Java Code Examples for org.junit.After

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 cdk, under directory /maven-cdk-plugin/src/it/renderer-template-test/src/test/java/org/richfaces/cdk/.

Source file: BaseRendererTest.java

  31 
vote

@After public void tearDown() throws Exception {
  environment.verify();
  environment.release();
  environment=null;
  responseWriter=null;
  facesContext=null;
  component=null;
  componentAttributes=null;
}
 

Example 2

From project aether-core, under directory /aether-connector-asynchttpclient/src/test/java/org/eclipse/aether/connector/async/.

Source file: ResumeGetTest.java

  30 
vote

@After public void after() throws Exception {
  if (server != null) {
    server.stop();
  }
  factory=null;
  session=null;
  server=null;
  TestFileUtils.deleteTempFiles();
}
 

Example 3

From project agraph-java-client, under directory /src/test/.

Source file: AGAbstractTest.java

  30 
vote

@After public void tearDown() throws Exception {
  vf=null;
  super.close();
  conn=null;
  repo=null;
}
 

Example 4

From project aim3-tu-berlin, under directory /seminar/exercises/datamining/core/src/test/java/de/tuberlin/dima/aim/exercises/.

Source file: HadoopAndPactTestcase.java

  30 
vote

@After public void tearDown() throws Exception {
  if (testTempDirPath != null) {
    try {
      fs.delete(testTempDirPath,true);
    }
 catch (    IOException e) {
      throw new IllegalStateException("Test file not found");
    }
    testTempDirPath=null;
    fs=null;
  }
  if (testTempDir != null) {
    new DeletingVisitor().accept(testTempDir);
  }
}
 

Example 5

From project ant4eclipse, under directory /org.ant4eclipse.ant.pydt.test/src-framework/org/ant4eclipse/ant/pydt/test/.

Source file: AbstractWorkspaceBasedTest.java

  30 
vote

/** 
 * Disposes all previously aquired resources.
 */
@After public void teardown(){
  if (this._disposeonexit) {
    dispose();
  }
  ServiceRegistryAccess.reset();
  this._dltk=false;
  this._projectsuite=null;
}
 

Example 6

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

Source file: ExtractionResultImplTest.java

  30 
vote

@After public void tearDown() throws TripleHandlerException {
  extractionResult.close();
  mockTripleHandler.close();
  extractor=null;
  mockTripleHandler=null;
  extractionResult=null;
}
 

Example 7

From project Flume-Hive, under directory /src/javatest/com/cloudera/flume/agent/diskfailover/.

Source file: TestDiskFailoverAgent.java

  30 
vote

@After public void shutdownMaster(){
  if (master != null) {
    master.shutdown();
    master=null;
  }
}
 

Example 8

From project flume_1, under directory /flume-core/src/test/java/com/cloudera/flume/agent/diskfailover/.

Source file: TestDiskFailoverAgent.java

  30 
vote

@After public void shutdownMaster() throws IOException {
  if (master != null) {
    master.shutdown();
    master=null;
  }
  FileUtil.rmr(tmpDir);
}
 

Example 9

From project Activiti-KickStart, under directory /activiti-kickstart-java/src/test/java/org/activiti/kickstart/.

Source file: KickstartTest.java

  29 
vote

@Override @After public void tearDown() throws Exception {
  super.tearDown();
  List<org.activiti.engine.repository.Deployment> deployments=processEngine.getRepositoryService().createDeploymentQuery().list();
  for (  org.activiti.engine.repository.Deployment deployment : deployments) {
    repositoryService.deleteDeployment(deployment.getId(),true);
  }
}
 

Example 10

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

Source file: AtcParserTest.java

  29 
vote

@After public void tearDown(){
  try {
    d_codeStream.close();
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  try {
    d_drugStream.close();
  }
 catch (  IOException e2) {
    e2.printStackTrace();
  }
}
 

Example 11

From project alphaportal_dev, under directory /sys-src/alphaportal/web/src/test/java/alpha/portal/webapp/controller/.

Source file: ContributorRoleControllerTest.java

  29 
vote

/** 
 * - delete test user - delete test contributor role.
 */
@After public void afterCleanup(){
  this.userManager.remove(this.u.getId());
  if (this.contribRole != null) {
    this.contributorRoleManager.remove(this.contribRole.getContributorRoleId());
  }
}
 

Example 12

From project apollo, under directory /injector/src/test/java/com/bskyb/cg/environments/cassandra/.

Source file: TestCassandraDao.java

  29 
vote

@After public void tearDown() throws Exception {
  CassandraConfigurationBuilder cassandraConfigurationBuilder=new CassandraConfigurationBuilder();
  cassandraConfigurationBuilder.setClusterName(clusterName);
  cassandraConfigurationBuilder.setExhaustPolicy(exhaustPolicy);
  cassandraConfigurationBuilder.setHosts(hosts);
  cassandraConfigurationBuilder.setKeySpaceName(keySpaceName);
  cassandraConfigurationBuilder.setLifo(true);
  cassandraConfigurationBuilder.setMaxActive(10);
  cassandraConfigurationBuilder.setMaxIdle(10);
  cassandraConfigurationBuilder.setMaxWaitTimeWhenExhausted(10);
  cassandraConfigurationBuilder.setReadConsistencyLevel(readConsistencyLevel);
  cassandraConfigurationBuilder.setRowCount(10);
  cassandraConfigurationBuilder.setThriftSocketTimeout(10);
  cassandraConfigurationBuilder.setTimeToGoStaleInMinutes(2);
  cassandraConfigurationBuilder.setTimeToLiveInMinutes(2);
  cassandraConfigurationBuilder.setWriteConsistencyLevel(writeConsistencyLevel);
  cassandraConfigurationBuilder.setMsgType(msgType);
}
 

Example 13

From project arastreju, under directory /arastreju.rdb/src/test/java/org/arastreju/rdb/test/.

Source file: RdbTest.java

  29 
vote

@After public void tearDown(){
  String driver=profile.getProperty("org.arastreju.bindings.rdb.jdbcDriver");
  String user=profile.getProperty("org.arastreju.bindings.rdb.dbUser");
  String pass=profile.getProperty("org.arastreju.bindings.rdb.dbPass");
  String url=profile.getProperty("org.arastreju.bindings.rdb.protocol") + profile.getProperty("org.arastreju.bindings.rdb.db");
  Connection con;
  try {
    Class.forName(driver);
    con=DriverManager.getConnection(url,user,pass);
    con.setAutoCommit(true);
  }
 catch (  ClassNotFoundException e) {
    System.out.println("cant load driver " + driver);
    logger.debug("Cann't load Driver " + driver);
  }
catch (  SQLException e) {
    e.printStackTrace();
  }
}
 

Example 14

From project Archimedes, under directory /br.org.archimedes.core.tests/test/br/org/archimedes/controller/.

Source file: ActiveStateTest.java

  29 
vote

@After public void tearDown() throws Exception {
  drawing=null;
  state=null;
  factory=null;
  activeSate=null;
}
 

Example 15

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

Source file: ARQ271BeforeTestCase.java

  29 
vote

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

Example 16

From project arquillian-core, under directory /junit/core/src/test/java/org/jboss/arquillian/junit/.

Source file: JUnitTestBaseClass.java

  29 
vote

@After public void clearCallbacks(){
  callbackCount.clear();
  for (  Cycle tmp : Cycle.values()) {
    callbackCount.put(tmp,0);
  }
  callbackException.clear();
}
 

Example 17

From project arquillian-showcase, under directory /spring/spring-jpa/src/test/java/com/acme/spring/jpa/repository/impl/.

Source file: JpaStockRepositoryTestCase.java

  29 
vote

/** 
 * <p>Tears down the test environment.</p>
 * @throws Exception if any error occurs
 */
@After public void tearDown() throws Exception {
  EntityManager entityManager=getEntityManager();
  entityManager.getTransaction().begin();
  entityManager.createQuery("delete from Stock").executeUpdate();
  entityManager.getTransaction().commit();
}
 

Example 18

From project arquillian_deprecated, under directory /extensions/drone/src/test/java/org/jboss/arquillian/drone/factory/.

Source file: PrecedenceTestCase.java

  29 
vote

@After public void destroy(){
  manager.getContext(ClassContext.class).deactivate();
  manager.getContext(ClassContext.class).destroy(this.getClass());
  manager.getContext(SuiteContext.class).deactivate();
  manager.getContext(SuiteContext.class).destroy();
  manager.shutdown();
}
 

Example 19

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

Source file: TestNettyServerConcurrentExecution.java

  29 
vote

@After public void cleanUpAfter() throws Exception {
  try {
    if (transceiver != null) {
      transceiver.close();
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  try {
    if (server != null) {
      server.close();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
 

Example 20

From project bitcask-java, under directory /src/test/java/com/trifork/bitcask/.

Source file: BitCaskFileTest.java

  29 
vote

@After public void cleanup() throws Exception {
  if (data_file != null) {
    data_file.close();
  }
  removeDataDir();
}
 

Example 21

From project blueprint-namespaces, under directory /blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/.

Source file: AbstractIntegrationTest.java

  29 
vote

@After public void tearDown() throws Exception {
  for (  ServiceTracker st : srs) {
    if (st != null) {
      st.close();
    }
  }
}
 

Example 22

From project bpelunit, under directory /net.bpelunit.framework.control.deploy.activevos9/src/test/java/net/bpelunit/framework/control/deploy/activevos9/.

Source file: ActiveVOS9DeploymentTest.java

  29 
vote

@After public void tearDown(){
  if (deployment != null) {
    try {
      deployment.cleanUp();
    }
 catch (    DeploymentException e) {
    }
  }
  if (tempDeploymentDir != null) {
    try {
      FileUtils.deleteDirectory(tempDeploymentDir);
    }
 catch (    IOException e) {
    }
  }
  if (tempDeploymentFile != null) {
    tempDeploymentDir.delete();
  }
}
 

Example 23

From project brix-cms, under directory /brix-wrapper/src/test/java/org/brixcms/.

Source file: WrapperTest.java

  29 
vote

@After public void cleanup(){
  for (  JcrSession session : sessions) {
    if (session.isLive()) {
      session.logout();
    }
  }
  ((JackrabbitRepository)repo).shutdown();
  delete(home);
}
 

Example 24

From project bulk-builder-plugin, under directory /src/test/java/org/jenkinsci/plugins/bulkbuilder/model/.

Source file: BuilderTest.java

  29 
vote

@After @Override public void tearDown() throws Exception {
  super.tearDown();
  builder=null;
  project1=project2=project3=project4=project5=null;
  project1NextBuildNumber=project2NextBuildNumber=project3NextBuildNumber=project4NextBuildNumber=project5NextBuildNumber=-1;
}
 

Example 25

From project bundlemaker, under directory /unittests/org.bundlemaker.core.itest/src/org/bundlemaker/core/itest/complex/exporter/.

Source file: AbstractExportOsgiBundleTest.java

  29 
vote

/** 
 * {@inheritDoc}
 */
@After public void after() throws CoreException {
  super.after();
  _resultDir=null;
  _jeditmodule=null;
  _exporterContext=null;
}
 

Example 26

From project candlepin, under directory /src/test/java/org/candlepin/sync/.

Source file: ImporterTest.java

  29 
vote

@After public void tearDown() throws Exception {
  PrintStream ps=new PrintStream(new File(this.getClass().getClassLoader().getResource("candlepin_info.properties").toURI()));
  ps.println("version=${version}");
  ps.println("release=${release}");
  ps.close();
  File mockJs=new File(MOCK_JS_PATH);
  mockJs.delete();
}
 

Example 27

From project capedwarf-blue, under directory /datastore/src/test/java/org/jboss/test/capedwarf/datastore/test/.

Source file: AbstractTest.java

  29 
vote

@After public void tearDown(){
  List<Entity> entities=service.prepare(new Query().setKeysOnly()).asList(withDefaults());
  for (  Entity entity : entities) {
    service.delete(entity.getKey());
  }
}
 

Example 28

From project Carolina-Digital-Repository, under directory /services/src/test/java/edu/unc/lib/dl/cdr/services/imaging/.

Source file: ImageEnhancementServiceITCase.java

  29 
vote

/** 
 * @throws java.lang.Exception
 */
@After public void tearDown() throws Exception {
  try {
    for (    PID p : samples) {
      this.getManagementClient().purgeObject(p,"removing test object",false);
    }
    samples.clear();
  }
 catch (  FedoraException e) {
    e.printStackTrace();
    throw new Error("Cannot purge test object",e);
  }
}
 

Example 29

From project cas, under directory /cas-server-integration-ehcache/src/test/java/org/jasig/cas/ticket/registry/.

Source file: EhCacheTicketRegistryTests.java

  29 
vote

@After public void shutDown(){
  final CacheManager mgr=this.applicationContext.getBean("cacheManager",CacheManager.class);
  if (mgr.getStatus().equals(Status.STATUS_ALIVE)) {
    log.debug("Shutting down cache manager {}...",mgr.getName());
    mgr.removalAll();
    mgr.shutdown();
  }
}
 

Example 30

From project cascading, under directory /src/test/cascading/.

Source file: PlatformTestCase.java

  29 
vote

@After public void tearDown() throws IOException {
  try {
    for (    String path : currentPaths) {
      LOG.info("copying to local {}",path);
      if (getPlatform().isUseCluster() && getPlatform().remoteExists(path))       getPlatform().copyToLocal(path);
    }
    currentPaths.clear();
  }
  finally {
    getPlatform().tearDown();
  }
}
 

Example 31

From project ceres, under directory /ceres-site/src/test/java/com/bc/ceres/site/util/.

Source file: ModuleUtilsTest.java

  29 
vote

@After public void tearDown(){
  final File exclusionList=new File(ExclusionListBuilder.EXCLUSION_LIST_FILENAME);
  if (exclusionList.exists()) {
    exclusionList.delete();
  }
}
 

Example 32

From project cloudify, under directory /USM/src/test/java/org/openspaces/usm/.

Source file: USMRollingFileAppenderTailerTest.java

  29 
vote

@After public void after(){
  if (rfp != null) {
    rfp.close();
  }
  FileSystemUtils.deleteRecursively(new File(logsDirectory));
}
 

Example 33

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

Source file: ClientServerTest.java

  29 
vote

@After public void stopServer() throws Exception {
  if (httpClient != null)   httpClient.stop();
  if (server != null) {
    server.stop();
    server.join();
  }
}
 

Example 34

From project commons-io, under directory /src/test/java/org/apache/commons/io/input/.

Source file: ReversedLinesFileReaderTestParamBlockSize.java

  29 
vote

@After public void closeReader(){
  try {
    reversedLinesFileReader.close();
  }
 catch (  Exception e) {
  }
}
 

Example 35

From project components-ness-config, under directory /src/test/java/com/nesscomputing/config/.

Source file: AbstractTestConfig.java

  29 
vote

@After public void tearDownConfig(){
  Assert.assertNotNull(cfg);
  Assert.assertNotNull(cfg2);
  cfg=null;
  cfg2=null;
}
 

Example 36

From project components-ness-hbase, under directory /src/test/java/com/nesscomputing/hbase/.

Source file: TestHBaseSpill.java

  29 
vote

@After public void tearDown(){
  if (spillDir != null && spillDir.exists()) {
    File[] children=spillDir.listFiles();
    for (    File child : children) {
      child.delete();
    }
  }
  spillDir.delete();
  EasyMock.verify(conf);
}
 

Example 37

From project components-ness-httpclient, under directory /client/src/test/java/com/nesscomputing/httpclient/.

Source file: AbstractTestHttpClient.java

  29 
vote

@After public void teardown(){
  Assert.assertNotNull(localHttpService);
  Assert.assertNotNull(testHandler);
  Assert.assertNotNull(httpClient);
  localHttpService.stop();
  localHttpService=null;
  testHandler=null;
  httpClient.close();
  httpClient=null;
}
 

Example 38

From project components-ness-httpserver_1, under directory /src/test/java/com/nesscomputing/httpserver/jetty/.

Source file: TestClasspathResourceHandler.java

  29 
vote

@After public void teardown(){
  Assert.assertNotNull(localHttpService);
  Assert.assertNotNull(testHandler);
  localHttpService.stop();
  localHttpService=null;
  testHandler=null;
  Assert.assertNotNull(httpClient);
  httpClient.close();
  httpClient=null;
  baseUri=null;
}
 

Example 39

From project components-ness-tracking, under directory /src/test/java/com/nesscomputing/tracking/.

Source file: AbstractTrackingTestCase.java

  29 
vote

@After public void tearDownTracking(){
  Assert.assertNotNull(guiceFilter);
  guiceFilter.destroy();
  Assert.assertNotNull(injector);
  injector=null;
  mockSupport.verifyAll();
}
 

Example 40

From project core_1, under directory /tools/forge/plugin/src/test/java/org/switchyard/tools/forge/plugin/.

Source file: SwitchYardFacetTest.java

  29 
vote

@After public void after() throws Exception {
  File backupConfigFile=new File(BACKUP_CONFIG_PATH);
  if (backupConfigFile.exists()) {
    backupConfigFile.delete();
  }
}
 

Example 41

From project Core_2, under directory /project-model-maven-tests/src/test/java/org/jboss/forge/maven/facets/.

Source file: JavaExectionFacetTest.java

  29 
vote

@After public void removeTestFile(){
  File f=new File(tempFolder + "/test.txt");
  if (f.exists()) {
    f.delete();
  }
}
 

Example 42

From project core_4, under directory /api/src/test/java/org/richfaces/l10n/.

Source file: BundleLoaderTest.java

  29 
vote

@After public void tearDown() throws Exception {
  bundleLoader=null;
  facesEnvironment.verify();
  facesEnvironment.release();
  facesEnvironment=null;
}
 

Example 43

From project curator, under directory /curator-x-zkclient-bridge/src/test/java/org/I0Itec/zkclient/.

Source file: ContentWatcherTest.java

  29 
vote

@After public void tearDown() throws Exception {
  if (_zkClient != null) {
    _zkClient.close();
  }
  if (_zkServer != null) {
    _zkServer.close();
  }
  LOG.info("------------ AFTER -------------");
}
 

Example 44

From project D2-Java-Persistence, under directory /src/test/java/org/d2/test/basic/.

Source file: TestD2Basic.java

  29 
vote

@After public void cleanup(){
  try {
    d2.close();
  }
 catch (  Throwable t) {
    t.printStackTrace();
  }
  try {
    Util.deleteDirectory(new File("testdb"));
  }
 catch (  Throwable t) {
    t.printStackTrace();
  }
}
 

Example 45

From project dawn-isenciaui, under directory /com.teaminabox.eclipse.wiki/test/com/teaminabox/eclipse/wiki/.

Source file: WikiTest.java

  29 
vote

@After public void tearDown() throws Exception {
  closeAllEditors();
  try {
    project.delete(true,true,null);
  }
 catch (  CoreException e) {
  }
  waitForJobs();
}
 

Example 46

From project dci-examples, under directory /frontloading/java-qi4j/marc-grue/src/main/test/v1/.

Source file: FrontloadTest.java

  29 
vote

@After public void printResult() throws Exception {
  UnitOfWork uow=assembler.unitOfWorkFactory().newUnitOfWork(newUsecase("Print Gantt chart"));
  try {
    List<ActivityData> activities=uow.get(ProjectData.class,PROJECT).allActivities();
    StringBuilder sb=new StringBuilder();
    sb.append("\n\n### Gantt chart showing planned activities:\n");
    Collections.sort(activities,new Comparator<ActivityData>(){
      public int compare(      ActivityData a1,      ActivityData a2){
        if (a1.earlyStart().get().equals(a2.earlyStart().get()))         return getEntityReference(a1).identity().compareTo(getEntityReference(a2).identity());
 else         return a1.earlyStart().get() - a2.earlyStart().get();
      }
    }
);
    for (    ActivityData activity : activities) {
      String id=EntityReference.getEntityReference(activity).identity();
      Integer start=activity.earlyStart().get();
      Integer duration=activity.duration().get();
      for (int i=1; i < start; i++) {
        sb.append("  ");
      }
      sb.append(id);
      for (int i=0; i < duration - 1; i++) {
        sb.append(" =");
      }
      sb.append("\n");
    }
    sb.append("1 2 3 4 5 6 7 8 9");
    System.out.println(sb.toString());
  }
  finally {
    uow.discard();
  }
}
 

Example 47

From project Dempsy, under directory /lib-dempsyimpl/src/test/java/com/nokia/dempsy/container/.

Source file: TestInstanceManager.java

  29 
vote

@After public void tearDown(){
  StatsCollector stats=manager.getStatsCollector();
  if (stats != null) {
    ((StatsCollectorCoda)stats).stop();
  }
}
 

Example 48

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

Source file: MallocTest.java

  29 
vote

@After public void dump(){
  logger.info("off-heap allocated: " + Ram.inMb(mem.capacity()));
  logger.info("off-heap used:      " + Ram.inMb(mem.used()));
  logger.info("heap - max: " + Ram.inMb(Runtime.getRuntime().maxMemory()));
  logger.info("heap - allocated: " + Ram.inMb(Runtime.getRuntime().totalMemory()));
  logger.info("heap - free : " + Ram.inMb(Runtime.getRuntime().freeMemory()));
  logger.info("************************************************");
}
 

Example 49

From project disruptor, under directory /src/test/java/com/lmax/disruptor/dsl/.

Source file: DisruptorTest.java

  29 
vote

@After public void tearDown() throws Exception {
  for (  DelayedEventHandler delayedEventHandler : delayedEventHandlers) {
    delayedEventHandler.stopWaiting();
  }
  disruptor.halt();
  executor.joinAllThreads();
}
 

Example 50

From project dozer, under directory /core/src/test/java/org/dozer/jmx/.

Source file: JMXPlatformImplTest.java

  29 
vote

@After public void tearDown() throws Exception {
  try {
    mbs.unregisterMBean(new ObjectName(DOZER_ADMIN_CONTROLLER));
  }
 catch (  Exception e) {
  }
}
 

Example 51

From project droolsjbpm-integration, under directory /drools-grid/drools-grid-impl/src/test/java/org/drools/grid/remote/commands/.

Source file: BaseRemoteTest.java

  29 
vote

@After public void tearDown(){
  remoteN1.dispose();
  grid1.removeGridNode(gsdN1.getId());
  grid1.get(SocketService.class).close();
  server.stop();
}
 

Example 52

From project EARQ, under directory /src/test/java/org/openjena/earq/.

Source file: TestEARQ_Script_ElasticSearch.java

  29 
vote

@After public void tearDown(){
  client.prepareDeleteByQuery(location).setQuery("").setTypes(ElasticSearchConstants.INDEX_TYPE).execute().actionGet();
  client.admin().indices().prepareDelete(location).execute().actionGet();
  client.admin().cluster().prepareHealth().setWaitForYellowStatus().setTimeout("10s").execute().actionGet();
  client=null;
}
 

Example 53

From project EasySOA, under directory /easysoa-proxy/easysoa-proxy-core/easysoa-proxy-core-httpdiscoveryproxy-test/src/test/java/org/easysoa/proxy/handler/event/.

Source file: EventExchangeHandlerTest.java

  29 
vote

/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@After public void cleanUp() throws Exception {
  logger.info("Stopping FraSCAti...");
  stopFraSCAti();
  cleanJetty(EasySOAConstants.HTTP_DISCOVERY_PROXY_PORT);
  cleanJetty(8080);
  cleanJetty(8081);
}
 

Example 54

From project efflux, under directory /src/functionaltest/java/com/biasedbit/efflux/session/.

Source file: ControlPacketFunctionalTest.java

  29 
vote

@After public void tearDown(){
  if (this.session1 != null) {
    this.session1.terminate();
  }
  if (this.session2 != null) {
    this.session2.terminate();
  }
}
 

Example 55

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

Source file: FileUtilsTest.java

  29 
vote

@After public void cleanup(){
  if (testParent.exists()) {
    boolean success=testParent.delete();
    assertTrue(success);
  }
}
 

Example 56

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

Source file: BackupHaIT.java

  29 
vote

@After public void after() throws Exception {
  if (instances != null) {
    for (    GraphDatabaseService instance : instances) {
      instance.shutdown();
    }
  }
}
 

Example 57

From project event-bus, under directory /src/test/java/com/northconcepts/eventbus/.

Source file: AbstractEventBusTest.java

  29 
vote

@After public void teardown(){
  publisher=null;
  bus=null;
  if (!busShutdown) {
    fail("Bus not shutdown, potential race condition in test case.");
  }
}
 

Example 58

From project flume, under directory /flume-ng-channels/flume-file-channel/src/test/java/org/apache/flume/channel/file/.

Source file: TestFileChannelBase.java

  29 
vote

@After public void teardown(){
  if (channel != null && channel.isOpen()) {
    channel.stop();
  }
  FileUtils.deleteQuietly(baseDir);
}
 

Example 59

From project framework, under directory /impl/extension/jpa/src/test/java/br/gov/frameworkdemoiselle/transaction/.

Source file: JPATransactionTest.java

  29 
vote

@After public void tearDown(){
  tx=null;
  em=null;
  et=null;
  cache=null;
  producer=null;
}
 

Example 60

From project gecko, under directory /src/test/java/com/taobao/gecko/core/core/impl/.

Source file: AbstractControllerUnitTest.java

  29 
vote

@After public void tearDown() throws Exception {
  if (this.controller != null) {
    this.controller.stop();
    Thread.sleep(1000);
  }
}
 

Example 61

From project gemini.web.gemini-web-container, under directory /org.eclipse.gemini.web.test/src/test/java/org/eclipse/gemini/web/test/extender/.

Source file: ClassPathDependencyTests.java

  29 
vote

@After public void after() throws BundleException {
  if (this.war != null) {
    uninstallWar();
  }
  if (this.extender != null) {
    this.extender.uninstall();
    this.extender=null;
  }
}
 

Example 62

From project gerrit-trigger-plugin, under directory /gerrit-events/src/test/java/com/sonyericsson/hudson/plugins/gerrit/gerritevents/.

Source file: GerritHandlerTest.java

  29 
vote

/** 
 * Shuts down the GerritHandler and the mocked connection.
 */
@After public void shutDown(){
  if (handler != null) {
    handler.shutdown(false);
    try {
      Thread.sleep(2000);
    }
 catch (    InterruptedException e) {
      System.out.println("Interrupted while sleeping.");
    }
    if (!handler.isShutdownInProgress()) {
      fail("Failed to set shutdown flag!");
    }
    try {
      pipedWriter.append("hello");
      pipedWriter.newLine();
      pipedWriter.close();
      handler.join();
    }
 catch (    InterruptedException e) {
      System.err.println("interupted while waiting for handler to shut down.");
    }
catch (    IOException e) {
      System.err.println("Could not close the pipe.");
    }
  }
  handler=null;
  sshConnectionMock=null;
  pipedReader=null;
  pipedWriter=null;
}
 

Example 63

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

Source file: TestZooKeeperExt.java

  29 
vote

@After public void tearDown(){
  if (zooKeeperExt == null) {
    return;
  }
  try {
    zooKeeperExt.close();
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
}
 

Example 64

From project git-starteam, under directory /fake-starteam/test/fakestarteam/util/test/.

Source file: TestMD5.java

  29 
vote

@After public void tearDown() throws Exception {
  md5sum=null;
  md5ipsum=null;
  md5data=null;
  FileUtility.close(md5IpsumStream);
  md5IpsumStream=null;
}
 

Example 65

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

Source file: RepositoryModelTest.java

  29 
vote

@After public void teardownConfiguration() throws Exception {
  Repository r=GitBlitSuite.getHelloworldRepository();
  StoredConfig config=r.getConfig();
  config.unsetSection(Constants.CONFIG_GITBLIT,Constants.CONFIG_CUSTOM_FIELDS);
  config.save();
}
 

Example 66

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

Source file: TestAvroStore.java

  29 
vote

@After public void tearDown() throws Exception {
  deletePath(employeeStore.getOutputPath());
  deletePath(webPageStore.getOutputPath());
  employeeStore.close();
  webPageStore.close();
}
 

Example 67

From project gxa, under directory /atlas-web/src/test/java/uk/ac/ebi/gxa/requesthandlers/dump/.

Source file: GoogleSitemapXmlRequestHandlerTest.java

  29 
vote

@After public void tearDown(){
  String[] filesToDelete=getTempDirectory().list(new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.startsWith("geneSitemap");
    }
  }
);
  for (  String f : filesToDelete) {
    if (!(new File(f).delete()))     log.error("Couldn't delete temporary file " + f + " in "+ getTempDirectory());
  }
}
 

Example 68

From project hackergarten-moreunit, under directory /org.moreunit.core.test/test/org/moreunit/core/commands/.

Source file: JumpActionHandlerTest.java

  29 
vote

@After public void cleanPreferences() throws Exception {
  for (  Language l : preferences.getLanguages()) {
    preferences.get(project).activatePreferencesForLanguage(l.getExtension(),false);
    preferences.remove(l);
  }
  preferences.get(project).activatePreferencesForLanguage(LanguagePreferencesWriter.ANY_LANGUAGE,false);
  preferences.get(project).save();
}
 

Example 69

From project hank, under directory /test/java/com/rapleaf/hank/monitor/notifier/db/.

Source file: SQLEnvironmentsNotifierFactoryTest.java

  29 
vote

@After public void tearDown() throws Exception {
  super.tearDown();
  databaseFile.delete();
  environmentFile.delete();
  configDirectory.delete();
}
 

Example 70

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

Source file: AbstractReservationTest.java

  29 
vote

@After public final void cleanUp() throws Exception {
  for (  String reservationId : this.reservationIds) {
    System.out.println("cancelling resv " + reservationId + " ...");
    final CancelReservationType cancelRequest=new CancelReservationType();
    cancelRequest.setReservationID(reservationId);
    try {
      CancelReservationResponseType r=this.reservationClient.cancelReservation(cancelRequest);
      System.out.println("   success=" + r.isSuccess());
    }
 catch (    Exception e) {
      System.out.println("   an exception occured: " + e.getMessage());
      throw e;
    }
  }
}
 

Example 71

From project HBaseHUT, under directory /src/test/java/com/sematext/hbase/hut/.

Source file: TestHBaseHut.java

  29 
vote

@After public void after() throws IOException {
  hTable=null;
  testingUtility.shutdownMiniCluster();
  testingUtility.shutdownMiniZKCluster();
  testingUtility=null;
}