1 24 25 package org.objectweb.cjdbc.scenario.raidb1.driver; 26 27 import org.objectweb.cjdbc.scenario.templates.Raidb1Template; 28 import org.objectweb.cjdbc.scenario.tools.testlet.AbstractTestLet; 29 import org.objectweb.cjdbc.scenario.tools.testlet.MacroStatementTestLet; 30 31 37 public class MacroInStatementsScenario extends Raidb1Template 38 { 39 40 static final String [] BATCH = new String []{"rand()", "now()", "current_date", 41 "current_time", "timeOfDay()", "current_timestamp"}; 42 43 48 public void testMacrosInStatementNotDriverProcessed() throws Exception 49 { 50 MacroStatementTestLet let = new MacroStatementTestLet(mainVdb); 51 let.set(AbstractTestLet.USE_OPTIMIZED_STATEMENT, "true"); 52 let.set(AbstractTestLet.USE_PREPARED_STATEMENT, "false"); 53 let.executeBatch(AbstractTestLet.MACRO_NAME, BATCH); 54 } 55 56 61 public void testMacrosInStatementDriverProcessed() throws Exception 62 { 63 MacroStatementTestLet let = new MacroStatementTestLet(mainVdb); 64 let.set(AbstractTestLet.USE_OPTIMIZED_STATEMENT, "false"); 65 let.set(AbstractTestLet.USE_PREPARED_STATEMENT, "false"); 66 let.executeBatch(AbstractTestLet.MACRO_NAME, BATCH); 67 } 68 69 74 75 public void testMacrosInPreparedStatementNotDriverProcessed() 76 throws Exception 77 { 78 MacroStatementTestLet let = new MacroStatementTestLet(mainVdb); 79 let.set(AbstractTestLet.USE_OPTIMIZED_STATEMENT, "true"); 80 let.set(AbstractTestLet.USE_PREPARED_STATEMENT, "true"); 81 let.executeBatch(AbstractTestLet.MACRO_NAME, BATCH); 82 } 83 84 89 public void testMacrosInPreparedStatementDriverProcessed() throws Exception 90 { 91 MacroStatementTestLet let = new MacroStatementTestLet(mainVdb); 92 let.set(AbstractTestLet.USE_OPTIMIZED_STATEMENT, "false"); 93 let.set(AbstractTestLet.USE_PREPARED_STATEMENT, "true"); 94 let.executeBatch(AbstractTestLet.MACRO_NAME, BATCH); 95 } 96 } | Popular Tags |