1 24 25 package org.objectweb.cjdbc.scenario.raidb1.recovery; 26 27 import java.sql.Connection ; 28 29 import org.objectweb.cjdbc.scenario.templates.Raidb1RecoveryWithRequestSenderTemplate; 30 import org.objectweb.cjdbc.scenario.tools.ScenarioUtility; 31 32 38 public class HotRecoveryScenario 39 extends Raidb1RecoveryWithRequestSenderTemplate 40 { 41 private static final String BACKUP_LOGIN = "user"; 42 private static final String BACKUP_PASSWORD = ""; 43 private static final String BACKUPER = "Octopus"; 44 private static final String BACKUP_PATH = "../backup"; 45 46 52 public void testHotDisableEnableWithCheckpoint() throws Exception 53 { 54 String checkpoint = "check"; 56 String backend = "localhost2"; 57 mainVdb.disableBackendWithCheckpoint(backend); 58 59 mainVdb.enableBackendFromCheckpoint(backend); 61 62 if (sender.getExceptions().size() != 0) 63 fail("Got exceptions during run:" + sender.getExceptions()); 64 } 65 66 72 public void testHotRecovery() throws Exception 73 { 74 String dumpName = "check" + System.currentTimeMillis(); 76 String backend = "localhost"; 77 mainVdb.backupBackend(backend, BACKUP_LOGIN, BACKUP_PASSWORD, dumpName, 78 BACKUPER, BACKUP_PATH, null); 79 80 Connection recoveryC = getHypersonicConnection(9003); 81 ScenarioUtility.displayResultOnScreen(ScenarioUtility.getSingleQueryResult( 82 "select * from recovery", recoveryC)); 83 84 backend = "localhost2"; 86 String checkpoint2 = dumpName + "2"; 87 mainVdb.disableBackendWithCheckpoint(backend); 88 89 mainVdb.restoreDumpOnBackend(backend, BACKUP_LOGIN, BACKUP_PASSWORD, 91 dumpName, null); 92 93 mainVdb.enableBackendFromCheckpoint(backend, dumpName); 95 96 if (sender.getExceptions().size() != 0) 97 fail("Got exceptions during run:" + sender.getExceptions()); 98 } 99 } | Popular Tags |