@Test public void createTablesNoDrop() { try { validateTables(); StorageService.initialize(false); validateTables(); } catch (final SQLException | StorageServiceException e) { fail("StorageServiceTest: createTablesNoDrop: could not create all tables" + e.getMessage()); } }
@Before public void setUp() throws Exception { StorageService.initialize(true); final Properties props = new Properties(); try { props.loadFromXML(new FileInputStream(new File("config/db.properties"))); Class.forName("org.h2.Driver"); _con = DriverManager.getConnection( props.getProperty("DB_URL"), props.getProperty("DB_USER"), props.getProperty("DB_PWD")); } catch (final ClassNotFoundException e) { fail("StorageServiceTest: setUp: db drive class not found: " + e.getMessage()); } catch (final IOException e) { fail("StorageServiceTest: setUp: could not load database properties: " + e.getMessage()); } }
@After public void tearDown() throws Exception { _con.close(); StorageService.cleanup(); }