@Test
public void testCreatePgeConfig() throws Exception {

   final String KEY = "TestKey";
   final String VALUE = "TestValue";
   File pgeConfigFile = new File(createTmpDir(), "pgeConfig.xml");
   FileUtils.writeLines(pgeConfigFile, "UTF-8",
         Lists.newArrayList(
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
            "<pgeConfig>",
            "   <customMetadata>",
            "      <metadata key=\"" + KEY + "\" val=\"" + VALUE
            		+ "\"/>",
            "   </customMetadata>",
            "</pgeConfig>"));
   PGETaskInstance pgeTask = createTestInstance();
   pgeTask.pgeMetadata.replaceMetadata(CONFIG_FILE_PATH,
         pgeConfigFile.getAbsolutePath());
   PgeConfig pgeConfig = pgeTask.createPgeConfig();
   assertNotNull(pgeConfig);
   assertEquals(VALUE, pgeTask.pgeMetadata.getMetadata(KEY));
   pgeTask = createTestInstance();
   pgeTask.pgeMetadata.replaceMetadata(PGE_CONFIG_BUILDER,
         MockPgeConfigBuilder.class.getCanonicalName());
   pgeConfig = pgeTask.createPgeConfig();
   assertEquals(MockPgeConfigBuilder.MOCK_EXE_DIR, pgeConfig.getExeDir());
}