Java Code Examples for org.junit.AfterClass

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project addis, under directory /application/src/integration-test/java/org/drugis/addis/util/JSMAAintegration/.

Source file: NetworkBenefitRiskIT.java

  29 
vote

@AfterClass public static void cleanUp(){
  d_domainManager=null;
  d_br=null;
  d_brpm=null;
  d_model=null;
}
 

Example 2

From project AdServing, under directory /modules/services/tracking/src/test/java/net/mad/ads/services/tracking/impl/local/h2/.

Source file: H2TrackingServiceTest.java

  29 
vote

@AfterClass public static void close(){
  if (ts != null) {
    try {
      ts.close();
    }
 catch (    ServiceException e) {
      e.printStackTrace();
    }
  }
}
 

Example 3

From project advanced, under directory /management/src/test/java/org/neo4j/management/.

Source file: ManagementBeansTest.java

  29 
vote

@AfterClass public static synchronized void stopGraphDb(){
  if (graphDb != null) {
    graphDb.shutdown();
    graphDb=null;
  }
}
 

Example 4

From project amber, under directory /oauth-2.0/integration-tests/src/test/java/org/apache/amber/oauth2/integration/.

Source file: ClientRegistrationOAuthTest.java

  29 
vote

@AfterClass public static void stopService() throws Exception {
  if (s3 != null) {
    s3.stop();
  }
  ClientServerOAuthTest.stopService();
}
 

Example 5

From project arquillian-container-osgi, under directory /container-embedded/src/test/java/org/jboss/test/arquillian/container/osgi/.

Source file: ARQ271BeforeClassTestCase.java

  29 
vote

@AfterClass public static void afterClass() throws Exception {
  assertNotNull("BundleContext injected",context);
  assertEquals("System Bundle ID",0,context.getBundle().getBundleId());
  assertNotNull("Bundle injected",bundle);
  assertEquals(Bundle.RESOLVED,bundle.getState());
}
 

Example 6

From project avro, under directory /lang/java/ipc/src/test/java/org/apache/avro/ipc/.

Source file: TestNettyServerWithCallbacks.java

  29 
vote

@AfterClass public static void tearDownConnections() throws Exception {
  if (transceiver != null) {
    transceiver.close();
  }
  if (server != null) {
    server.close();
  }
}
 

Example 7

From project aws-tasks, under directory /src/it/java/datameer/awstasks/aws/ec2/.

Source file: AbstractEc2IntegrationInteractionTest.java

  29 
vote

@AfterClass public static void shutdownInstanceGroup(){
  if (CLUSTER_ALREADY_RUNNING) {
    LOG.info("don't shutdown instance group");
  }
 else {
    _instanceGroup.terminate();
  }
}
 

Example 8

From project camel-zookeeper, under directory /src/test/java/org/apache/camel/component/zookeeper/.

Source file: ZooKeeperTestSupport.java

  29 
vote

@AfterClass public static void shutdownServer() throws Exception {
  LOG.info("Stopping Zookeeper Test Infrastructure");
  client.shutdown();
  server.shutdown();
  waitForServerDown("localhost:" + getServerPort(),1000);
  LOG.info("Stopped Zookeeper Test Infrastructure");
}
 

Example 9

From project camelpe, under directory /impl/src/test/java/net/camelpe/extension/cdi/spi/.

Source file: CamelInjectionTargetWrapperInContainerTest.java

  29 
vote

@AfterClass public static void reenableCamelPE(){
  final URL cdiServiceFileDisabledUrl=CamelInjectionTargetWrapperInContainerTest.class.getClassLoader().getResource(CDIPE_SERVICE_FILE_PATH + CDIPE_SERVICE_FILE_PATH_DISABLED_SUFFIX);
  if (cdiServiceFileDisabledUrl == null) {
    return;
  }
  final File cdiServiceFileDisabled=new File(cdiServiceFileDisabledUrl.getFile());
  final File cdiServiceFile=new File(cdiServiceFileDisabledUrl.getFile().replace(CDIPE_SERVICE_FILE_PATH_DISABLED_SUFFIX,""));
  cdiServiceFileDisabled.renameTo(cdiServiceFile);
}
 

Example 10

From project chililog-server, under directory /src/test/java/org/chililog/server/.

Source file: AppTest.java

  29 
vote

@AfterClass public static void classTeardown() throws Exception {
  DBCollection coll=_db.getCollection(UserController.MONGODB_COLLECTION_NAME);
  Pattern pattern=Pattern.compile("^AppTestUser[\\w]*$");
  DBObject query=new BasicDBObject();
  query.put("username",pattern);
  coll.remove(query);
  coll=_db.getCollection(RepositoryConfigController.MONGODB_COLLECTION_NAME);
  query.put("name",REPOSITORY_NAME);
  coll.remove(query);
  coll=_db.getCollection(MONGODB_COLLECTION_NAME);
  coll.drop();
}
 

Example 11

From project common_1, under directory /src/test/java/org/powertac/common/.

Source file: OrderbookTests.java

  29 
vote

@AfterClass public static void saveLogs() throws Exception {
  File state=new File("log/test.state");
  state.renameTo(new File("log/OrderbookTests.state"));
  File trace=new File("log/test.trace");
  trace.renameTo(new File("log/OrderbookTests.trace"));
}
 

Example 12

From project Core_2, under directory /test-harness/src/main/java/org/jboss/forge/test/.

Source file: SingletonAbstractShellTest.java

  29 
vote

@AfterClass public static void afterClass() throws IOException {
  for (  FileResource<?> file : tempFolders) {
    if (file.exists()) {
      assertTrue(file.delete(true));
    }
  }
}
 

Example 13

From project Couch-RQS, under directory /test/com/couchrqs/.

Source file: QueueServiceTest.java

  29 
vote

@AfterClass public static void tearDownClass(){
  try {
    nonQueue.delete();
    new Database(instance.couchDB,queueName).delete();
  }
 catch (  Exception e) {
    System.err.println("Caught " + e + " during QueueServiceTest.tearDownClass");
    e.printStackTrace(System.err);
  }
}
 

Example 14

From project datasalt-utils, under directory /src/test/java/com/datasalt/utils/mapred/joiner/.

Source file: TestJoinOneToMany.java

  29 
vote

@AfterClass public static void cleanUp() throws IOException {
  Configuration conf=new Configuration();
  HadoopUtils.deleteIfExists(FileSystem.get(conf),new Path(OUTPUT));
  HadoopUtils.deleteIfExists(FileSystem.get(conf),new Path(INPUT1));
  HadoopUtils.deleteIfExists(FileSystem.get(conf),new Path(INPUT2));
}
 

Example 15

From project DirectMemory, under directory /DirectMemory-Cache/src/test/java/org/apache/directmemory/cache/.

Source file: CacheConcurrentTest.java

  29 
vote

@AfterClass public static void dump(){
  Cache.dump();
  Monitor.dump("cache");
  logger.info("************************************************");
  logger.info("entries: " + entries);
  logger.info("inserted: " + Cache.entries());
  logger.info("reads: " + read);
  logger.info("count: " + count);
  logger.info("got: " + got);
  logger.info("missed: " + missed);
  logger.info("good: " + good);
  logger.info("bad: " + bad);
  logger.info("disposals: " + disposals);
  logger.info("************************************************");
}
 

Example 16

From project EasySOA, under directory /samples/easysoa-samples-smarttravel/easysoa-samples-smarttravel-trip/src/test/java/org/easysoa/galaxydemotest/.

Source file: GalaxyDemoTestStarter.java

  29 
vote

/** 
 * Stop FraSCAti components and cleans jett (?)
 * @throws FrascatiException
 */
@AfterClass public static void tearDown() throws Exception {
  logger.info("Stopping FraSCAti...");
  stopFraSCAti();
  cleanJetty(9000);
  cleanJetty(9080);
}
 

Example 17

From project empire-db, under directory /empire-db-examples/empire-db-example-codegen/src/test/java/org/apache/empire/db/examples/codegen/.

Source file: ValidatePluginRunTest.java

  29 
vote

@AfterClass public static void closeConnection() throws Exception {
  if (conn != null) {
    try {
      Statement st=conn.createStatement();
      st.execute("SHUTDOWN");
    }
 catch (    SQLException ex) {
      ex.printStackTrace();
    }
    conn.close();
  }
}
 

Example 18

From project enterprise, under directory /ha/src/test/java/org/neo4j/kernel/impl/cache/.

Source file: TestGcrCacheRemoveSizeDiverge.java

  29 
vote

@AfterClass public static void shutdownDb(){
  try {
    if (graphdb != null)     graphdb.shutdown();
  }
  finally {
    graphdb=null;
  }
}
 

Example 19

From project fast-http, under directory /src/test/java/org/neo4j/smack/test/util/.

Source file: SharedSmackServerTestBase.java

  29 
vote

@AfterClass public static final void releaseServer(){
  try {
    ServerHolder.release(server);
  }
  finally {
    server=null;
  }
}
 

Example 20

From project fedora-client, under directory /fedora-client-core/src/test/java/com/yourmediashelf/fedora/client/request/.

Source file: BatchIT.java

  29 
vote

@AfterClass public static void purgeFixtures() throws FedoraClientException {
  System.out.print("Purging fixtures, this may take some time ");
  for (  String pid : pids) {
    purgeObject(pid).execute(fedora);
    System.out.print(".");
  }
  System.out.println();
}
 

Example 21

From project flume, under directory /flume-ng-sinks/flume-hdfs-sink/src/test/java/org/apache/flume/sink/hdfs/.

Source file: TestHDFSEventSinkOnMiniCluster.java

  29 
vote

@AfterClass public static void teardown(){
  cluster.shutdown();
  cluster=null;
  if (oldTestBuildDataProp != null) {
    System.setProperty(TEST_BUILD_DATA_KEY,oldTestBuildDataProp);
  }
  if (!KEEP_DATA) {
    FileUtils.deleteQuietly(new File(DFS_DIR));
  }
}
 

Example 22

From project gitblit, under directory /tests/com/gitblit/tests/.

Source file: GitServletTest.java

  29 
vote

@AfterClass public static void stopGitblit() throws Exception {
  if (started.get()) {
    GitBlitSuite.stopGitblit();
    deleteWorkingFolders();
  }
}
 

Example 23

From project gora, under directory /gora-core/src/test/java/org/apache/gora/store/.

Source file: DataStoreTestBase.java

  29 
vote

@AfterClass public static void tearDownClass() throws Exception {
  if (testDriver != null) {
    log.info("tearing down class");
    testDriver.tearDownClass();
  }
}
 

Example 24

From project grails-data-mapping, under directory /grails-datastore-appengine/src/test/groovy/org/grails/datastore/mapping/appengine/testsupport/.

Source file: AppEngineDatastoreTestCase.java

  29 
vote

@AfterClass public static void tearDown() throws Exception {
  ApiProxyLocal proxy=(ApiProxyLocal)ApiProxy.getDelegate();
  LocalDatastoreService datastoreService=(LocalDatastoreService)proxy.getService(LocalDatastoreService.PACKAGE);
  datastoreService.clearProfiles();
  ApiProxy.setDelegate(null);
  ApiProxy.setEnvironmentForCurrentThread(null);
}
 

Example 25

From project hackergarten-moreunit, under directory /org.moreunit.test.dependencies/src/org/moreunit/test/.

Source file: SimpleProjectTestCase.java

  29 
vote

@AfterClass public static void tearDownProject() throws JavaModelException {
  sourcesPackage.delete(true,null);
  sourcesFolder.delete(IResource.FORCE,IPackageFragmentRoot.ORIGINATING_PROJECT_CLASSPATH,null);
  testPackage.delete(true,null);
  testFolder.delete(IResource.FORCE,IPackageFragmentRoot.ORIGINATING_PROJECT_CLASSPATH,null);
}
 

Example 26

From project harmony, under directory /harmony.idb/src/test/java/org/opennaas/extensions/idb/database/test/.

Source file: TestConnectionsRelation.java

  29 
vote

@AfterClass public static void tearDownAfterClass() throws DatabaseException {
  TestConnectionsRelation.reservation.delete();
  Assert.assertNull("reference reservation should be deleted",Reservation.load(TestConnectionsRelation.reservation.getReservationId()));
  Assert.assertNull("reference service should be deleted",Service.load(TestConnectionsRelation.service.getPK_service()));
  TestConnectionsRelation.domain.delete();
  Assert.assertNull("reference domain should be deleted",Domain.load(TestConnectionsRelation.domain.getName()));
  Assert.assertNull("reference endpoint should be deleted",Endpoint.load(TestConnectionsRelation.endpoint.getTNA()));
}
 

Example 27

From project HBase-Lattice, under directory /hbl/src/test/java/com/inadco/hbl/test/.

Source file: CompositeFilterTest.java

  29 
vote

@AfterClass public void close() throws IOException {
  try {
    dropTable();
  }
  finally {
    IOUtil.closeAll(closeables);
  }
}
 

Example 28

From project HBasePS, under directory /src/test/java/com/sentric/hbase/coprocessor/.

Source file: TestProspectiveSearchRegionObserver.java

  29 
vote

@AfterClass public static void tearDownAfterClass() throws Exception {
  long stopInNsec=System.nanoTime();
  TEST_UTIL.shutdownMiniCluster();
  long downInNsec=System.nanoTime();
  float delta=(float)(downInNsec - stopInNsec) / 1000000000;
  System.out.printf("Cluster down in %f seconds\n",delta);
}
 

Example 29

From project hcatalog, under directory /src/test/org/apache/hcatalog/mapreduce/.

Source file: TestHCatMultiOutputFormat.java

  29 
vote

@AfterClass public static void tearDown() throws IOException {
  FileUtil.fullyDelete(workDir);
  FileSystem fs=FileSystem.get(mrConf);
  if (fs.exists(warehousedir)) {
    fs.delete(warehousedir,true);
  }
  if (mrCluster != null) {
    mrCluster.shutdown();
  }
}
 

Example 30

From project hiho, under directory /test/co/nubetech/hiho/job/.

Source file: TestDBQueryInputJobWithCluster.java

  29 
vote

@AfterClass public static void shutdown(){
  try {
    connection.commit();
    connection.close();
  }
 catch (  Throwable ex) {
    logger.warn("Exception occurred while closing connection :" + ex);
  }
 finally {
    try {
      if (server != null) {
        server.shutdown();
      }
    }
 catch (    Throwable ex) {
      logger.warn("Exception occurred while shutting down HSQLDB :" + ex);
    }
  }
}
 

Example 31

From project james-mailbox, under directory /jcr/src/test/java/org/apache/james/mailbox/jcr/.

Source file: JCRSubscriptionManagerTest.java

  29 
vote

@AfterClass public static void after(){
  if (repository != null) {
    repository.shutdown();
  }
  new File(JACKRABBIT_HOME).delete();
}
 

Example 32

From project jboss-ejb-client, under directory /src/test/java/org/jboss/ejb/client/.

Source file: ClasspathConfigBasedSelectorTestCase.java

  29 
vote

@AfterClass public static void afterClass() throws Exception {
  if (server != null) {
    server.stop();
  }
  final ClassLoader tccl=Thread.currentThread().getContextClassLoader();
  if (tccl != null && tccl.getClass().getName().equals(ResourceSwitchingClassLoader.class.getName())) {
    Thread.currentThread().setContextClassLoader(originalTCCL);
  }
  if (skipClassLoaderScanSysPropPreviousValue != null) {
    System.setProperty("jboss.ejb.client.properties.skip.classloader.scan",skipClassLoaderScanSysPropPreviousValue);
  }
}
 

Example 33

From project jboss-jpa, under directory /deployers/src/test/java/org/jboss/jpa/remote/test/remote/.

Source file: RemoteTestCase.java

  29 
vote

@AfterClass public static void afterClass() throws Exception {
  if (derbyService != null) {
    derbyService.stop();
    derbyService.destroy();
    derbyService=null;
  }
  if (namingServer != null) {
    namingServer.destroy();
    namingServer=null;
  }
}
 

Example 34

From project jboss-sasl, under directory /src/test/java/org/jboss/sasl/test/.

Source file: BaseTestCase.java

  29 
vote

@AfterClass public static void removeProvider(){
  AccessController.doPrivileged(new PrivilegedAction<Void>(){
    public Void run(){
      Security.removeProvider(jbossSaslProvider.getName());
      return null;
    }
  }
);
}
 

Example 35

From project jDTO-Binder, under directory /jdto/src/test/java/org/jdto/.

Source file: TestConfigurationErrors.java

  29 
vote

@AfterClass public static void globalTearDown(){
  Logger logger=Logger.getLogger("org.jdto.impl.BeanClassUtils");
  logger.setLevel(Level.INFO);
  logger=Logger.getLogger("org.jdto.impl.AbstractBeanInspector");
  logger.setLevel(Level.INFO);
}
 

Example 36

From project jetty-project, under directory /test-jetty-distribution/src/test/java/org/mortbay/jetty/tests/distribution/jmx/.

Source file: JmxIntegrationTest.java

  29 
vote

@AfterClass public static void shutdownJetty() throws Exception {
  if (jmxConnect != null) {
    jmxConnect.disconnect();
  }
  if (jetty != null) {
    jetty.stop();
  }
}
 

Example 37

From project jSCSI, under directory /bundles/targetExtensions/scsi/test/unit/org/jscsi/scsi/tasks/buffered/.

Source file: BufferTestTask.java

  29 
vote

@AfterClass public static void tearDownAfterClass() throws Exception {
  _logger.debug("flushing file buffer to backing store");
  ((MappedByteBuffer)fileBuf).force();
  _logger.debug("closing file buffer backing store");
  file.close();
}
 

Example 38

From project junit-rules, under directory /src/main/java/junit/rules/jpa/hibernate/.

Source file: DerbyHibernateTestCase.java

  29 
vote

/** 
 */
@AfterClass public static void closeHibernateDerby(){
  ENTITY_MANAGER_FACTORY.get().close();
  try {
    DriverManager.getConnection(JDBC_DERBY_URL + ";shutdown=true");
  }
 catch (  final SQLException e) {
    if (e.getErrorCode() == 45000 && "08006".equals(e.getSQLState())) {
      logger.info("Derby shut down normally");
    }
 else {
      throw new RuntimeException(e.getMessage(),e);
    }
  }
}
 

Example 39

From project kevoree-library, under directory /javase/org.kevoree.library.javase.kinect/src/test/java/org/openkinect/freenect/.

Source file: FreenectTest.java

  29 
vote

@AfterClass public static void shutdownKinect(){
  if (ctx != null) {
    if (dev != null) {
      dev.close();
    }
    ctx.shutdown();
  }
}
 

Example 40

From project kitten, under directory /java/client/src/test/java/com/cloudera/kitten/.

Source file: TestKittenDistributedShell.java

  29 
vote

@AfterClass public static void tearDown() throws IOException {
  if (yarnCluster != null) {
    yarnCluster.stop();
    yarnCluster=null;
  }
}
 

Example 41

From project Lily, under directory /cr/indexer/engine/src/test/java/org/lilyproject/indexer/engine/test/.

Source file: IndexerTest.java

  29 
vote

@AfterClass public static void tearDownAfterClass() throws Exception {
  Closer.close(typeManager);
  Closer.close(repository);
  Closer.close(rowLogConfMgr);
  Closer.close(zk);
  HBASE_PROXY.stop();
  if (SOLR_TEST_UTIL != null)   SOLR_TEST_UTIL.stop();
}
 

Example 42

From project magrit, under directory /server/core/src/test/java/org/kercoin/magrit/core/build/.

Source file: StatusesServiceImplTest.java

  29 
vote

@AfterClass public static void tearDownClass(){
  if (test != null) {
    test.close();
    tests.FilesUtils.recursiveDelete(test.getDirectory().getParentFile());
    test=null;
  }
}
 

Example 43

From project maven-dependency-analyzer, under directory /src/test/it/nl/pieni/maven/dependency_analyzer/neo4j/database/.

Source file: DependencyDatabaseSearcherImplNonBreakingTest.java

  29 
vote

/** 
 * Cleanup of database after test
 */
@AfterClass public static void afterClass(){
  try {
    database.shutdownDatabase();
    searcher.shutdownSearcher();
  }
 catch (  Exception e) {
  }
}
 

Example 44

From project maven-shared, under directory /maven-artifact-resolver/src/test/java/org/apache/maven/shared/artifact/resolver/.

Source file: DefaultProjectDependenciesResolverIT.java

  29 
vote

@AfterClass public static void shutdown(){
  try {
    container.release(resolver);
    container.release(artifactResolver);
    container.release(metadataSource);
    container.release(artifactFactory);
    container.release(projectBuilder);
    container.dispose();
  }
 catch (  ComponentLifecycleException e) {
  }
  try {
    FileUtils.forceDelete(localRepoDir);
    FileUtils.forceDelete(pomsDir);
  }
 catch (  IOException e) {
  }
}
 

Example 45

From project maven-wagon, under directory /wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/.

Source file: HttpWagonTests.java

  29 
vote

@AfterClass public static void afterAll(){
  for (  File f : tmpFiles) {
    if (f.exists()) {
      try {
        FileUtils.forceDelete(f);
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  if (container != null) {
    try {
      container.release(configurator);
    }
 catch (    ComponentLifecycleException e) {
      e.printStackTrace();
    }
    container.dispose();
  }
}
 

Example 46

From project meaningfulweb, under directory /meaningfulweb-core/src/test/java/org/meaningfulweb/core/test/.

Source file: MWCoreTest.java

  29 
vote

@AfterClass public static void shutdown(){
  try {
    server.stop();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
 

Example 47

From project mkgmap, under directory /test/func/.

Source file: StructureTest.java

  29 
vote

/** 
 * Close everything down.
 */
@AfterClass public static void cleanup(){
  TestUtils.deleteOutputFiles();
  if (fs != null) {
    fs.close();
    treFile.close();
    lblFile.close();
    rgnFile.close();
  }
}
 

Example 48

From project montysolr, under directory /contrib/examples/src/test/examples/.

Source file: MontySolrJettyBase.java

  29 
vote

@AfterClass public static void afterSolrJettyTestBase() throws Exception {
  if (jetty != null) {
    jetty.stop();
    jetty=null;
  }
  server=null;
}
 

Example 49

From project neoclipse, under directory /org.neo4j.neoclipse/src/test/java/examples/.

Source file: NeoclipseExample.java

  29 
vote

@AfterClass public static void stopNeo(){
  try {
    neo.shutdown();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
 

Example 50

From project nuxeo-distribution, under directory /nuxeo-functional-tests/src/main/java/org/nuxeo/functionaltests/.

Source file: AbstractTest.java

  29 
vote

@AfterClass public static void quitDriver() throws InterruptedException {
  if (driver != null) {
    driver.close();
    driver=null;
  }
  removeFireBug();
  try {
    stopProxy();
  }
 catch (  Exception e) {
    System.err.println("Could not stop proxy: " + e.getMessage());
  }
}
 

Example 51

From project ODE-X, under directory /cli/src/test/java/org/apache/ode/cli/.

Source file: CLITest.java

  29 
vote

@AfterClass public static void tearDownAfterClass() throws Exception {
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  mbs.unregisterMBean(ObjectName.getInstance(Repository.OBJECTNAME));
  cntorServer.stop();
  log.info("JMXServer stopped");
}
 

Example 52

From project omid, under directory /src/test/java/com/yahoo/omid/.

Source file: OmidTestBase.java

  29 
vote

@AfterClass public static void teardownOmid() throws Exception {
  if (hbasecluster != null) {
    hbasecluster.shutdown();
    hbasecluster.join();
  }
  if (tsothread != null) {
    tsothread.interrupt();
    tsothread.join();
  }
  if (bkthread != null) {
    bkthread.interrupt();
    bkthread.join();
  }
  waitForSocketNotListening("localhost",1234);
}
 

Example 53

From project oreilly-ejb-6thedition-book-examples, under directory /ch06-filetransfer/src/test/java/org/jboss/ejb3/examples/ch06/filetransfer/.

Source file: FileTransferUnitTestCase.java

  29 
vote

/** 
 * Stops and resets the FTP Service.  Called once after all tests are done.
 * @throws Exception
 */
@AfterClass public static void destroyFtpService() throws Exception {
  if (ftpService == null) {
    return;
  }
  ftpService.stopServer();
  ftpService=null;
  log.info("Brought down test FTP Service");
}
 

Example 54

From project passfault, under directory /core/test/com/passfault/.

Source file: PropertiesFindersBuilderTest.java

  29 
vote

@AfterClass public static void tearDownClass() throws Exception {
  File dir=new File(TEST_WORD_LIST_DIRECTORY);
  if (dir.exists()) {
    for (    File file : dir.listFiles()) {
      file.delete();
    }
    dir.delete();
  }
}
 

Example 55

From project pg-inet-maven, under directory /org.ancoron.postgresql.jpa/src/test/java/org/ancoron/postgresql/jpa/test/.

Source file: DriverIntegrationTest.java

  29 
vote

@AfterClass public static void tearDown() throws Exception {
  log.info("Shuting down JPA layer.");
  if (emFactory != null) {
    emFactory.close();
  }
}
 

Example 56

From project qi4j-core, under directory /testsupport/src/main/java/org/qi4j/test/.

Source file: AbstractQi4jScenarioTest.java

  29 
vote

@AfterClass public void tearDown() throws Exception {
  if (module != null && module.isUnitOfWorkActive()) {
    while (module.isUnitOfWorkActive()) {
      UnitOfWork uow=module.currentUnitOfWork();
      if (uow.isOpen()) {
        uow.discard();
      }
 else {
        throw new InternalError("I have seen a case where a UoW is on the stack, but not opened.");
      }
    }
    new Exception("UnitOfWork not properly cleaned up").printStackTrace();
  }
  if (application != null) {
    application.passivate();
  }
}
 

Example 57

From project qi4j-extensions, under directory /reindexer/src/test/java/org/qi4j/index/reindexer/.

Source file: ReindexerTest.java

  29 
vote

@AfterClass @SuppressWarnings("AssignmentReplaceableWithOperatorAssignment") public static void afterClass() throws Exception {
  boolean success=true;
  success=deleteEntitiesData();
  success=success & deleteIndexData();
  if (!success) {
    throw new Exception("Could not delete test data");
  }
}
 

Example 58

From project querydsl, under directory /querydsl-jdo/src/test/java/com/mysema/query/jdo/.

Source file: AbstractJDOTest.java

  29 
vote

@AfterClass public static void doCleanUp(){
  PersistenceManager pm=pmf.getPersistenceManager();
  Transaction tx=pm.currentTransaction();
  try {
    tx.begin();
    pm.newQuery(Store.class).deletePersistentAll();
    pm.newQuery(Book.class).deletePersistentAll();
    pm.newQuery(Product.class).deletePersistentAll();
    tx.commit();
  }
  finally {
    if (tx.isActive()) {
      tx.rollback();
    }
    pm.close();
  }
}
 

Example 59

From project reef-example-apps, under directory /services/basic-proto-service/test/src/test/java/org/totalgrid/reef/examples/service/basic/.

Source file: IntegrationTest.java

  29 
vote

@AfterClass public static void teardownConnection(){
  if (connection != null) {
    connection.disconnect();
  }
  if (connectionFactory != null) {
    connectionFactory.terminate();
  }
}
 

Example 60

From project ReGalAndroid, under directory /g3-java-client/src/test/java/net/dahanne/gallery3/client/business/.

Source file: G3ClientTest.java

  29 
vote

@AfterClass public static void tearDown() throws G3GalleryException {
  G3Client itemClient=new G3Client(galleryUrl,"Unit Test");
  itemClient.setUsername(username);
  itemClient.setPassword(password);
  Item g2AndroidSecretAlbumItem=itemClient.getItem(G2ANDROID_SECRET_ALBUM);
  for (  String member : g2AndroidSecretAlbumItem.getMembers()) {
    int itemId=ItemUtils.getItemIdFromUrl(member);
    itemClient.deleteItem(itemId);
  }
}
 

Example 61

From project remoting-jmx, under directory /src/test/java/org/jboss/remotingjmx/.

Source file: AbstractTestBase.java

  29 
vote

@AfterClass public static void tearDownServer() throws IOException {
  try {
    remotingServer.stop();
  }
  finally {
    remotingServer=null;
  }
}
 

Example 62

From project restfuse, under directory /com.eclipsesource.restfuse.test/src/com/eclipsesource/restfuse/internal/.

Source file: HttpTestStatementOrder_Test.java

  29 
vote

@AfterClass public static void tearDown() throws Exception {
  server.stop();
  int timer=0;
  while (!server.isStopped() && timer < TIMEOUT) {
    Thread.sleep(1000);
    timer++;
  }
}
 

Example 63

From project riak-java-client, under directory /src/test/java/com/basho/riak/client/http/itest/.

Source file: ITestMapReduce.java

  29 
vote

@AfterClass public static void teardown(){
  RiakClient c=new RiakClient(RIAK_URL);
  for (int i=0; i < TEST_ITEMS; i++) {
    c.delete(BUCKET_NAME,"java_" + Integer.toString(i));
  }
}
 

Example 64

From project riftsaw, under directory /engine/src/test/java/org/riftsaw/engine/.

Source file: BPELEngineTest.java

  29 
vote

@AfterClass public static void runAfterClass(){
  try {
    m_engine.close();
  }
 catch (  Exception e) {
    fail("Failed to close down the engine: " + e);
  }
}
 

Example 65

From project scisoft-core, under directory /uk.ac.diamond.scisoft.analysis/test/uk/ac/diamond/scisoft/analysis/rpc/flattening/.

Source file: FlatteningViaAnalysisRpcToPythonTestAbstract.java

  29 
vote

@AfterClass public static void stop(){
  if (pythonRunInfo != null) {
    pythonRunInfo.terminate();
    pythonRunInfo.getStdout(true);
  }
  pythonRunInfo=null;
  client=null;
}
 

Example 66

From project scisoft-ui, under directory /uk.ac.diamond.scisoft.analysis.rcp.test/src/uk/ac/diamond/scisoft/analysis/rcp/plotting/rpc/sdaplotter/.

Source file: AllPyPlotMethodsPluginTest.java

  29 
vote

@AfterClass public static void tearDownAfterClass(){
  if (pythonRunInfo != null) {
    pythonRunInfo.terminate();
    pythonRunInfo.getStdout(true);
  }
  pythonRunInfo=null;
}
 

Example 67

From project scooter, under directory /source/src/com/scooterframework/test/.

Source file: FunctionalTestHelper.java

  29 
vote

@AfterClass public static void tearDownAfterClass(){
  if (ac != null) {
    DatabaseConfig.getInstance().restoreDefaultDatabaseConnectionName();
    ApplicationConfig.getInstance().endApplication();
  }
}
 

Example 68

From project sensei, under directory /sensei-gateways/src/test/java/com/senseidb/gateway/test/.

Source file: TestJDBCGateway.java

  29 
vote

@AfterClass public static void shutdown(){
  gateway.stop();
  pluginRegistry.stop();
  if (conn != null) {
    try {
      try {
        PreparedStatement createDBStmt=conn.prepareStatement(dropTableSql);
        createDBStmt.execute();
        conn.commit();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      conn.close();
      System.out.println("Database connection terminated");
    }
 catch (    Exception e) {
    }
  }
}
 

Example 69

From project shiro, under directory /core/src/test/java/org/apache/shiro/test/.

Source file: AbstractShiroTest.java

  29 
vote

@AfterClass public static void tearDownShiro(){
  doClearSubject();
  try {
    SecurityManager securityManager=getSecurityManager();
    LifecycleUtils.destroy(securityManager);
  }
 catch (  UnavailableSecurityManagerException e) {
  }
  setSecurityManager(null);
}
 

Example 70

From project SIREn, under directory /siren-core/src/test/java/org/sindice/siren/search/.

Source file: TestSirenNumericRangeQuery32.java

  29 
vote

@AfterClass public static void afterClass() throws Exception {
  searcher.close();
  searcher=null;
  reader.close();
  reader=null;
  directory.close();
  directory=null;
}
 

Example 71

From project skalli, under directory /org.eclipse.skalli.gerrit.test/src/main/java/org/eclipse/skalli/gerrit/client/internal/.

Source file: GerritClientTest.java

  29 
vote

@AfterClass public static void tearDownOnce() throws Exception {
  String privateKey=FileUtils.readFileToString(new File(TEST_PRIVATEKEY_FILE));
  EvilGerritClient evilClient=new EvilGerritClient(TEST_HOST,TEST_PORT,TEST_ADMIN_ACCOUNT,privateKey,TEST_PASSPHRASE,TEST_ONBEHALFOF);
  evilClient.connect();
  final StringBuffer deleteGroupsQueries=new StringBuffer();
  deleteGroupsQueries.append("DELETE FROM ").append(GSQL.Tables.ACCOUNT_GROUPS);
  deleteGroupsQueries.append(" WHERE description = '").append(DESCRIPTION).append("'");
  deleteGroupsQueries.append(" AND group_id NOT IN (SELECT admin_group_id FROM ").append(GSQL.Tables.SYSTEM_CONFIG).append(")");
  deleteGroupsQueries.append(" AND group_id NOT IN (SELECT anonymous_group_id FROM ").append(GSQL.Tables.SYSTEM_CONFIG).append(")");
  deleteGroupsQueries.append(" AND group_id NOT IN (SELECT registered_group_id FROM ").append(GSQL.Tables.SYSTEM_CONFIG).append(")");
  deleteGroupsQueries.append(" AND group_id NOT IN (SELECT batch_users_group_id FROM ").append(GSQL.Tables.SYSTEM_CONFIG).append(");");
  deleteGroupsQueries.append("DELETE FROM ").append(GSQL.Tables.ACCOUNT_GROUP_NAMES).append(" WHERE group_id NOT IN (SELECT group_id FROM ").append(GSQL.Tables.ACCOUNT_GROUPS).append(");");
  deleteGroupsQueries.append("DELETE FROM ").append(GSQL.Tables.ACCOUNT_GROUP_MEMBERS).append(" WHERE group_id NOT IN (SELECT group_id FROM ").append(GSQL.Tables.ACCOUNT_GROUPS).append(");");
  deleteGroupsQueries.append("DELETE FROM ").append(GSQL.Tables.ACCOUNT_GROUP_MEMBERS_AUDIT).append(" WHERE group_id NOT IN (SELECT group_id FROM ").append(GSQL.Tables.ACCOUNT_GROUPS).append(");");
  evilClient.gsql(deleteGroupsQueries.toString(),GSQL.ResultFormat.PRETTY);
  final StringBuffer deleteProjectsQueries=new StringBuffer();
  deleteProjectsQueries.append("DELETE FROM ").append(GSQL.Tables.PROJECTS).append(" WHERE description = '").append(DESCRIPTION).append("';");
  deleteProjectsQueries.append("DELETE FROM ").append(GSQL.Tables.REF_RIGHTS).append(" WHERE project_name NOT IN (SELECT name FROM ").append(GSQL.Tables.PROJECTS).append(");");
  evilClient.gsql(deleteProjectsQueries.toString(),ResultFormat.PRETTY);
  evilClient.disconnect();
}
 

Example 72

From project smart-cms, under directory /spi-modules/api-spi-guice-binder/src/test/java/com/smartitengineering/cms/binder/guice/.

Source file: InjectionTest.java

  29 
vote

@AfterClass public static void tearDownTests() throws Exception {
  standaloneServerFactory.shutdown();
  if (!AppTest.waitForServerDown(CLIENT_PORT,CONNECTION_TIMEOUT)) {
    throw new IllegalStateException("Waiting for shutdown of standalone server");
  }
}
 

Example 73

From project sparqled, under directory /sparql-editor-client/src/test/java/org/sindice/servlet/sparqlqueryservlet/.

Source file: SparqlQueryServletTest.java

  29 
vote

@AfterClass public static void clean(){
  File path=new File("/tmp/test-unit-memory/");
  deleteDirectory(path);
  path=new File("/tmp/test-unit-native/");
  deleteDirectory(path);
}
 

Example 74

From project spicy-stonehenge, under directory /common-library/src-test/nl/tudelft/stocktrader/dal/test/.

Source file: ConfigServiceDAOImplTest.java

  29 
vote

@AfterClass public static void tearDownDatabase() throws Exception {
  System.out.println("Test");
  conn.close();
  server.shutdown();
  try {
    while (true) {
      server.ping();
      Thread.currentThread().sleep(1000);
    }
  }
 catch (  Exception e) {
  }
  FileUtils.forceDelete(new File("testdb"));
  FileUtils.forceDelete(new File("derby.log"));
}
 

Example 75

From project spring-gemfire, under directory /src/test/java/org/springframework/data/gemfire/config/.

Source file: ClientRegionNamespaceTest.java

  29 
vote

@AfterClass public static void tearDown(){
  for (  String name : new File(".").list(new FilenameFilter(){
    @Override public boolean accept(    File dir,    String name){
      return name.startsWith("BACKUP");
    }
  }
)) {
    new File(name).delete();
  }
}
 

Example 76

From project spring-hadoop, under directory /src/test/java/org/springframework/data/hadoop/mapreduce/.

Source file: JarTests.java

  29 
vote

@AfterClass public static void cleanProps(){
  Properties properties=System.getProperties();
  Enumeration<?> props=properties.propertyNames();
  while (props.hasMoreElements()) {
    Object key=props.nextElement();
    Object value=properties.get(key);
    if (!value.getClass().equals(String.class)) {
      System.out.println("Removing incorrect key [" + key + "] w/ value "+ value);
      properties.remove(key);
    }
  }
}
 

Example 77

From project spring-insight-plugins, under directory /collection-plugins/httpclient3/src/test/java/com/springsource/insight/plugin/apache/http/hc3/.

Source file: HttpClientExecutionCollectionAspectTest.java

  29 
vote

@AfterClass public static void stopEmbeddedServer() throws Exception {
  if (SERVER != null) {
    System.out.println("Stopping embedded server");
    SERVER.stop();
    System.out.println("Server stopped");
  }
}
 

Example 78

From project tourenplaner-server, under directory /junit-tests/de/tourenplaner/database/.

Source file: DatabaseManagerTest.java

  29 
vote

/** 
 * Cleaning up after test run.
 */
@AfterClass public static void cleanUpAfterTestRun(){
  if (!doTest)   return;
  if (dbm != null) {
    try {
      UserDataset user=dbm.getUser("1337testuser@tourenplaner");
      if (user != null) {
        dbm.deleteUser(user.userid);
      }
      dbm.deleteUser(testUserID);
    }
 catch (    SQLException e) {
      fail(e.getMessage());
    }
  }
}
 

Example 79

From project turmeric-releng, under directory /support/turmeric-junit/src/test/java/org/ebayopensource/turmeric/junit/rules/.

Source file: TestTracerTest.java

  29 
vote

@AfterClass public static void validatePrintStream(){
  String captured=StringUtils.join(capturing.messages.iterator(),SystemUtils.LINE_SEPARATOR);
  System.out.println(captured);
  StringBuilder expected=new StringBuilder();
  String className=TestTracerTest.class.getName();
  String ln=SystemUtils.LINE_SEPARATOR;
  String id=String.format("### %s / testSomething ::: ",className);
  expected.append(id).append("Starting").append(ln);
  expected.append("Testing something").append(ln);
  expected.append("Tracked requests for the following resources:").append(ln);
  expected.append(id).append("Completed").append(ln);
  id=String.format("### %s / testSomethingElse ::: ",className);
  expected.append(id).append("Starting").append(ln);
  expected.append("Testing something else").append(ln);
  expected.append("Tracked requests for the following resources:").append(ln);
  expected.append(id).append("Completed");
  Assert.assertEquals(expected.toString(),captured);
}
 

Example 80

From project turmeric-security, under directory /integration-tests/PolicyTests/src/test/java/org/ebayopensource/turmeric/policyservice/createpolicyapi/.

Source file: EnableDisablePolicyTests.java

  29 
vote

@AfterClass public static void tearDown() throws Exception {
  cleanUpPolicy();
  cleanUpResources();
  cleanUpSubjectGroups();
  cleanUpSubjects();
}
 

Example 81

From project uaa, under directory /common/src/test/java/org/cloudfoundry/identity/uaa/scim/.

Source file: ScimUserEndpointsTests.java

  29 
vote

@AfterClass public static void tearDown() throws Exception {
  TestUtils.deleteFrom(database,"users","groups","group_membership");
  if (database != null) {
    database.shutdown();
  }
}
 

Example 82

From project UML-Java-Generation, under directory /tests/org.obeonetwork.pim.uml2.gen.java.ui.tests/src/org/obeonetwork/pim/uml2/gen/java/ui/tests/.

Source file: AbstractSWTBotTests.java

  29 
vote

@AfterClass public static void tearDown() throws CoreException {
  IProject[] projects=ResourcesPlugin.getWorkspace().getRoot().getProjects();
  for (  IProject iProject : projects) {
    iProject.delete(true,new NullProgressMonitor());
  }
}
 

Example 83

From project usergrid-stack, under directory /core/src/test/java/org/usergrid/locking/zookeeper/.

Source file: AbstractZooKeeperTest.java

  29 
vote

@AfterClass public static void after() throws Exception {
  zkServer.shutdown();
  boolean deletedData=recurseDelete(tmpDir);
  if (!deletedData) {
    logger.warn("Zk testing data was not removed properly. You need to" + "manually remove:" + tmpDir.getAbsolutePath());
  }
}
 

Example 84

From project Utah-Tools-Decision-Support, under directory /applicationVasoactive/edu.utah.cdmcc.decisionsupport.application.vasoactive/tests/database/tests/.

Source file: AllDatabaseTests.java

  29 
vote

@AfterClass public static void tearDown() throws Exception {
  Class.forName("org.hsqldb.jdbcDriver");
  String url="jdbc:hsqldb:hsql://localhost:9001";
  Connection con=DriverManager.getConnection(url,"sa","");
  String sql="SHUTDOWN";
  Statement stmt=con.createStatement();
  stmt.executeUpdate(sql);
  stmt.close();
}
 

Example 85

From project virgo.web, under directory /org.eclipse.virgo.web.test/src/test/java/org/eclipse/virgo/web/test/.

Source file: AbstractWebIntegrationTests.java

  29 
vote

@AfterClass public static void cleanup() throws Exception {
  MBeanServer mBeanServer=ManagementFactory.getPlatformMBeanServer();
  ObjectName objectName=new ObjectName("org.eclipse.virgo.kernel:type=ArtifactModel,artifact-type=plan,name=org.eclipse.virgo.web.tomcat,version=" + CURRENT_VERSION + ",region=global");
  try {
    mBeanServer.invoke(objectName,"stop",null,null);
    mBeanServer.invoke(objectName,"uninstall",null,null);
  }
 catch (  JMException _) {
  }
}
 

Example 86

From project whirr, under directory /services/cdh/src/test/java/org/apache/whirr/service/cdh/integration/.

Source file: CdhHadoopServiceTest.java

  29 
vote

@AfterClass public static void tearDown() throws IOException, InterruptedException {
  if (proxy != null) {
    proxy.stop();
  }
  controller.destroyCluster(clusterSpec);
}
 

Example 87

From project xnio_1, under directory /nio-impl/src/test/java/org/xnio/nio/test/.

Source file: XnioWorkerTestCase.java

  29 
vote

@AfterClass public static void destroyWorker() throws InterruptedException {
  if (worker != null && !worker.isShutdown()) {
    worker.shutdown();
    worker.awaitTermination(1L,TimeUnit.MINUTES);
  }
}
 

Example 88

From project xwiki-eclipse, under directory /plugins/org.xwiki.eclipse.test/src/main/java/org/xwiki/eclipse/storage/.

Source file: RestRemoteXWikiDataStorageAdapterTest.java

  29 
vote

@AfterClass public static void tearDown(){
  IWorkspaceRoot workspaceRoot=ResourcesPlugin.getWorkspace().getRoot();
  IProject project=workspaceRoot.getProject("testProject");
  try {
    project.delete(true,null);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  Assert.assertTrue(!project.exists());
}