public void testOverwriteWithTokens() throws Exception {
  File configHome=new File(configuration.getHome());
  assertTrue("Could not find a proper configuration home.",configHome.exists() && configHome.isDirectory());
  File existingFile=createFile(configHome,"existingfile2","helloworld");
  assertEquals("helloworld",readFile(existingFile));
  String fileName="simpleCopyWithOverwrite";
  String fileContents="goodbye@token1@.";
  File file1=createFile(configFileDirectory,fileName,fileContents);
  FileConfig configFile=new FileConfig();
  configFile.setFile(getAbsolutePath(file1));
  configFile.setToFile("existingfile2");
  configFile.setOverwrite("true");
  configFile.setConfigfile("true");
  configuration.setProperty("token1"," everyone");
  testCopy(configFile,"existingfile2","goodbye everyone.");
  assertEquals("goodbye everyone.",readFile(existingFile));
}

public void testOverwriteWithTokens ( ) throws Exception { File configHome = new File ( configuration . getHome ( ) ) ; assertTrue ( "Could not find a proper configuration home." , configHome . exists ( ) && configHome . isDirectory ( ) ) ; File existingFile = createFile ( configHome , "existingfile2" , "helloworld" ) ; assertEquals ( "helloworld" , readFile ( existingFile ) ) ; String fileName = "simpleCopyWithOverwrite" ; String fileContents = "goodbye@token1@." ; File file1 = createFile ( configFileDirectory , fileName , fileContents ) ; FileConfig configFile = new FileConfig ( ) ; configFile . setFile ( getAbsolutePath ( file1 ) ) ; configFile . setToFile ( "existingfile2" ) ; configFile . setOverwrite ( "true" ) ; configFile . setConfigfile ( "true" ) ; configuration . setProperty ( "token1" , " everyone" ) ; testCopy ( configFile , "existingfile2" , "goodbye everyone." ) ; assertEquals ( "goodbye everyone." , readFile ( existingFile ) ) ; }
test file copy with overwrite and replacement tokens .
