1 24 25 package org.objectweb.cjdbc.scenario.raidb2; 26 27 import java.sql.Connection ; 28 29 import org.objectweb.cjdbc.scenario.templates.SimpleRaidb2Template; 30 import org.objectweb.cjdbc.scenario.tools.testlet.AbstractTestLet; 31 import org.objectweb.cjdbc.scenario.tools.testlet.FailoverOn2BackendsTestLet; 32 33 39 public class Raidb2BasicFailoverScenario extends SimpleRaidb2Template 40 { 41 45 public void testFailOverWithVariablePool() throws Exception 46 { 47 cm.loadVirtualDatabases(controller, "myDB", 49 "hsqldb-raidb2-variablepool.xml"); 50 mainVdb = controller.getVirtualDatabase("myDB"); 51 mainVdb.enableAllBackends(); 52 execute(); 53 } 54 55 59 public void testFailOverWithRandomWaitPool() throws Exception 60 { 61 cm.loadVirtualDatabases(controller, "myDB", 63 "hsqldb-raidb2-randomwaitpool.xml"); 64 mainVdb = controller.getVirtualDatabase("myDB"); 65 mainVdb.enableAllBackends(); 66 execute(); 67 } 68 69 73 public void testFailOverWithFailFastPool() throws Exception 74 { 75 cm.loadVirtualDatabases(controller, "myDB", 77 "hsqldb-raidb2-failfastpool.xml"); 78 mainVdb = controller.getVirtualDatabase("myDB"); 79 mainVdb.enableAllBackends(); 80 execute(); 81 } 82 83 87 public void testFailOverWithNoPool() throws Exception 88 { 89 cm.loadVirtualDatabases(controller, "myDB", "hsqldb-raidb2-nopool.xml"); 91 mainVdb = controller.getVirtualDatabase("myDB"); 92 mainVdb.enableAllBackends(); 93 execute(); 94 } 95 96 99 private void execute() throws Exception 100 { 101 Connection con = getCJDBCConnection(); 103 FailoverOn2BackendsTestLet let = new FailoverOn2BackendsTestLet(con); 104 let.set(AbstractTestLet.LIST_FAILOVER_BACKENDS,new Object []{hm1,hm2}); 105 let.execute(); 106 } 107 } 108 | Popular Tags |