@After
 public void teardown() throws Exception {
   TestRepo.internalTearDown();
   dbHelper.onTearDown();
   FileUtil.deleteFolder(goConfigService.artifactsDir());
   FileUtil.deleteFolder(workingFolder);
   TestRepo.internalTearDown();
   pipelineScheduleQueue.clear();
 }
  @Before
  public void setup() throws Exception {
    configHelper = new GoConfigFileHelper();
    configHelper.usingCruiseConfigDao(goConfigDao);
    configHelper.onSetUp();
    testRepo = new SvnTestRepo("testSvnRepo");
    dbHelper.onSetUp();
    repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
    mingleConfig = configHelper.addPipeline("mingle", STAGE_NAME, repository, "unit", "functional");

    goConfig = configHelper.addPipeline("go", STAGE_NAME, repository, "unit");
    StageConfig ftStageConfig = StageConfigMother.custom("ft", "twist");
    ftStageConfig
        .jobConfigByConfigName(new CaseInsensitiveString("twist"))
        .addVariable("JOB_LVL", "job value");
    ftStageConfig.setVariables(env("STAGE_LVL", "stage value"));
    configHelper.addStageToPipeline("go", ftStageConfig);
    configHelper.addEnvironmentVariableToPipeline("go", env("PIPELINE_LVL", "pipeline value"));
    configHelper.addEnvironments("uat");
    EnvironmentConfig uatEnv =
        configHelper.currentConfig().getEnvironments().named(new CaseInsensitiveString("uat"));
    uatEnv.addPipeline(new CaseInsensitiveString("go"));
    uatEnv.addEnvironmentVariable("ENV_LVL", "env value");

    evolveConfig = configHelper.addPipeline("evolve", STAGE_NAME, repository, "unit");
    goCache.clear();
  }
 @After
 public void tearDown() throws Exception {
   configHelper.onTearDown();
   dbHelper.onTearDown();
   TestRepo.internalTearDown();
   cleanupTempFolders();
 }
 @After
 public void teardown() throws Exception {
   diskSpaceSimulator.onTearDown();
   TestRepo.internalTearDown();
   dbHelper.onTearDown();
   pipelineScheduleQueue.clear();
   configHelper.onTearDown();
 }
 @After
 public void teardown() throws Exception {
   if (pipelineWithTwoStages != null) {
     pipelineWithTwoStages.onTearDown();
   }
   dbHelper.onTearDown();
   pipelineScheduleQueue.clear();
   testRepo.tearDown();
   FileUtil.deleteFolder(new File("pipelines"));
   configHelper.onTearDown();
 }
  @Before
  public void setUp() throws Exception {
    configHelper = new GoConfigFileHelper().usingCruiseConfigDao(goConfigDao);
    configHelper.onSetUp();

    dbHelper.onSetUp();
    fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate);
    fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();

    repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
    evolveConfig = configHelper.addPipeline("evolve", STAGE_NAME, repository, "unit");
    configHelper.addPipeline("anotherPipeline", STAGE_NAME, repository, "anotherTest");
    configHelper.addPipeline("thirdPipeline", STAGE_NAME, repository, "yetAnotherTest");
    goConfigService.forceNotifyListeners();
    goCache.clear();
    u = new ScheduleTestUtil(transactionTemplate, materialRepository, dbHelper, configHelper);

    agent = new AgentStub();
  }
  @Before
  public void setup() throws Exception {
    CONFIG_HELPER = new GoConfigFileHelper();
    dbHelper.onSetUp();
    CONFIG_HELPER.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
    CONFIG_HELPER.onSetUp();

    repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
    goConfigService.forceNotifyListeners();
    agentAssignment.clear();
    goCache.clear();

    CONFIG_HELPER.addPipeline(
        "blahPipeline",
        "blahStage",
        MaterialConfigsMother.hgMaterialConfig(
            "file:///home/cruise/projects/cruisen/manual-testing/ant_hg/dummy"),
        "job1",
        "job2");
    CONFIG_HELPER.makeJobRunOnAllAgents("blahPipeline", "blahStage", "job2");
  }
 @AfterClass
 public static void tearDownConfigFileLocation() throws IOException {
   TestRepo.internalTearDown();
 }
 @AfterClass
 public static void tearDownConfigFileLocation() {
   TestRepo.internalTearDown();
 }