@Override public void tearDown() throws Exception { mongo.dropDatabase( dbName ); super.tearDown(); } }
@Override public void tearDown() throws Exception { riakFixture.deleteTestData(); super.tearDown(); }
@Override public void tearDown() throws Exception { try( Jedis jedis = jedisPool.getResource() ) { jedis.flushDB(); } super.tearDown(); } }
@After @Override public void tearDown() throws Exception { super.tearDown(); // TODO : delete test data } }
@Override public void tearDown() throws Exception { Module storageModule = application.findModule( "Infrastructure Layer", "Storage Module" ); UnitOfWorkFactory uowf = storageModule.unitOfWorkFactory(); ServiceFinder serviceFinder = storageModule.serviceFinder(); UnitOfWork uow = uowf.newUnitOfWork( UsecaseBuilder.newUsecase( "Delete " + getClass().getSimpleName() + " test data" ) ); try { SQLConfiguration config = uow.get( SQLConfiguration.class, DEFAULT_ENTITYSTORE_IDENTITY ); Connection connection = serviceFinder.findService( DataSource.class ).get().getConnection(); connection.setAutoCommit( false ); String schemaName = config.schemaName().get(); try( Statement stmt = connection.createStatement() ) { stmt.execute( String.format( "DROP SCHEMA \"%s\" CASCADE", schemaName ) ); connection.commit(); } } finally { uow.discard(); super.tearDown(); } } }
@Override public void tearDown() throws Exception { Module storageModule = application.findModule( "Infrastructure Layer","Storage Module" ); UnitOfWorkFactory uowf = storageModule.unitOfWorkFactory(); UnitOfWork uow = uowf.newUnitOfWork( UsecaseBuilder.newUsecase( "Delete " + getClass().getSimpleName() + " test data" ) ); try { SQLEntityStoreConfiguration config = uow.get( SQLEntityStoreConfiguration.class, DEFAULT_ENTITYSTORE_IDENTITY ); Connection connection = storageModule.serviceFinder().findService( DataSource.class ).get().getConnection(); connection.setAutoCommit( false ); try( Statement stmt = connection.createStatement() ) { stmt.execute( String.format( "DELETE FROM %s.%s", config.schemaName().get(), config.entityTableName().get() ) ); connection.commit(); } } finally { uow.discard(); super.tearDown(); } } }
@Override public void tearDown() throws Exception { Module module = application.findModule( "Infrastructure Layer", "Storage Module" ); ServiceReference<CanRemoveAll> cleaner = module.serviceFinder().findService( CanRemoveAll.class ); if( cleaner.isActive() && cleaner.isAvailable() ) { cleaner.get().removeAll(); } else { throw new IllegalStateException( "Clean up operation of Cassandra database was not availeble." ); } super.tearDown(); } }