Example #1
0
  @Before
  public void setUp() throws Exception {
    tempFolder =
        TestFileUtil.createTempFolder("tempCommandLineTestFolder-" + System.currentTimeMillis());
    toDelete.add(tempFolder);

    subFolder = new File(tempFolder, "subFolder");
    subFolder.mkdirs();
    File file = new File("./originalCommand");
    file.createNewFile();
    file.setExecutable(true);
    toDelete.add(file);
  }
Example #2
0
 private GoConfigFileHelper(String xml, GoConfigDao goConfigDao) {
   new SystemEnvironment().setProperty(SystemEnvironment.ENFORCE_SERVERID_MUTABILITY, "N");
   this.originalXml = xml;
   assignFileDao(goConfigDao);
   try {
     File dir = TestFileUtil.createTempFolder("server-config-dir");
     this.configFile = new File(dir, "cruise-config.xml");
     configFile.deleteOnExit();
     sysEnv = new SystemEnvironment();
     sysEnv.setProperty(SystemEnvironment.CONFIG_FILE_PROPERTY, configFile.getAbsolutePath());
     initializeConfigFile();
   } catch (IOException e) {
     throw bomb("Error creating config file", e);
   }
 }