@Test
public void testUsingTheMoneySerializer() throws IOException
{
File targetD = FileSupport.createTempDirectory();
File f = File.createTempFile("tmp", "tmp", targetD);
Directory targetDir = FileSystems.getEntityForDirectory(targetD, false);
try
{
compileClass("Currency", runReplaces(Files.readTextFile(new FileReadableFile(getDocFile("pg/ex/serializer/ex_Currency.javaa"))), null), targetDir);
compileClass("Money", runReplaces(Files.readTextFile(new FileReadableFile(getDocFile("pg/ex/serializer/ex_Money.javaa"))), null), targetDir);
compileClass("MoneySerializer", runReplaces(Files.readTextFile(new FileReadableFile(getDocFile("pg/ex/serializer/ex_MoneySerializer.javaa"))), null), targetDir);
List<TwoObjects<String, String>> replaces = new ArrayList<TwoObjects<String, String>>();
replaces.add(new TwoObjects<String, String>("MoneySerializer", "MoooneySerializer"));
replaces.add(new TwoObjects<String, String>("Money", "org.helidb.javabank.Money"));
replaces.add(new TwoObjects<String, String>("MoooneySerializer", "org.helidb.javabank.MoneySerializer"));
replaces.add(new TwoObjects<String, String>("Currency", "org.helidb.javabank.Currency"));
runExampleMethodTest("pg/ex/serializer/ex_using_the_money_serializer.javaa", "java.io.File f = (java.io.File) args[0];\r\n", "db.close(); return null;", null, new Object[] { f }, replaces, targetDir);
}
finally
{
new IteratorDeleter(targetDir).delete();
targetDir.getFileSystem().close();
assertTrue(targetD.delete());
}
}