| 1 31 32 package org.opencms.setup; 33 34 import org.opencms.scheduler.TestCmsSchedulerInSystem; 35 import org.opencms.test.OpenCmsTestCase; 36 37 import junit.framework.Test; 38 import junit.framework.TestSuite; 39 40 49 public class TestCmsSetupDb extends OpenCmsTestCase { 50 51 56 public TestCmsSetupDb(String arg0) { 57 58 super(arg0); 59 } 60 61 66 public static Test suite() { 67 68 TestSuite suite = new TestSuite(); 69 suite.setName(TestCmsSchedulerInSystem.class.getName()); 70 71 suite.addTest(new TestCmsSetupDb("testCreateDatabase")); 72 suite.addTest(new TestCmsSetupDb("testCreateTables")); 73 suite.addTest(new TestCmsSetupDb("testDropTables")); 74 suite.addTest(new TestCmsSetupDb("testDropDatabase")); 75 76 return suite; 77 } 78 79 82 public void testCreateDatabase() { 83 84 if (DB_ORACLE.equals(getDatabaseProduct())) { 85 System.out.println("testCreateDatabase not applicable for oracle."); 86 return; 87 } 88 89 CmsSetupDb setupDb = getSetupDb(m_setupConnection); 91 setupDb.createDatabase(m_dbProduct, getReplacer(m_defaultConnection), true); 92 93 checkErrors(setupDb); 95 96 setupDb.closeConnection(); 98 } 99 100 103 public void testCreateTables() { 104 105 if (DB_ORACLE.equals(getDatabaseProduct())) { 106 System.out.println("testDropDatabase not applicable for oracle."); 107 return; 108 } 109 110 CmsSetupDb setupDb = getSetupDb(m_defaultConnection); 112 setupDb.createTables(m_dbProduct, getReplacer(m_defaultConnection), true); 113 114 checkErrors(setupDb); 116 117 setupDb.closeConnection(); 119 } 120 121 124 public void testDropDatabase() { 125 126 if (DB_ORACLE.equals(getDatabaseProduct())) { 127 System.out.println("testDropDatabase not applicable for oracle."); 128 return; 129 } 130 131 CmsSetupDb setupDb = getSetupDb(m_setupConnection); 133 setupDb.dropDatabase(m_dbProduct, getReplacer(m_defaultConnection), true); 134 135 checkErrors(setupDb); 137 138 setupDb.closeConnection(); 140 } 141 142 145 public void testDropTables() { 146 147 if (DB_ORACLE.equals(getDatabaseProduct())) { 148 System.out.println("testDropDatabase not applicable for oracle."); 149 return; 150 } 151 152 CmsSetupDb setupDb = getSetupDb(m_defaultConnection); 154 setupDb.dropTables(m_dbProduct, getReplacer(m_defaultConnection), true); 155 156 checkErrors(setupDb); 158 159 setupDb.closeConnection(); 161 } 162 } | Popular Tags |