@Test
public void testRunPropertyAdders() throws Exception {

   PGETaskInstance pgeTask = createTestInstance();
   pgeTask.pgeMetadata.replaceMetadata(PROPERTY_ADDERS,
         MockConfigFilePropertyAdder.class.getCanonicalName());
   pgeTask.pgeConfig.setPropertyAdderCustomArgs(new Object[] { "key",
         "value" });
   pgeTask.runPropertyAdders();
   assertEquals("value", pgeTask.pgeMetadata.getMetadata("key"));
   pgeTask.pgeMetadata.replaceMetadata(
         MockConfigFilePropertyAdder.RUN_COUNTER, "0");
   pgeTask.pgeMetadata.replaceMetadata(PROPERTY_ADDERS, Lists.newArrayList(
         MockConfigFilePropertyAdder.class.getCanonicalName(),
         MockConfigFilePropertyAdder.class.getCanonicalName()));
   pgeTask.runPropertyAdders();
   assertEquals("value", pgeTask.pgeMetadata.getMetadata("key"));
   assertEquals("2",
         pgeTask.pgeMetadata
               .getMetadata(MockConfigFilePropertyAdder.RUN_COUNTER));
   pgeTask.pgeMetadata.replaceMetadata(
         MockConfigFilePropertyAdder.RUN_COUNTER, "0");
   System.setProperty(PgeTaskMetKeys.USE_LEGACY_PROPERTY, "true");
   pgeTask.pgeMetadata.replaceMetadata(PROPERTY_ADDERS.getName(),
         MockConfigFilePropertyAdder.class.getCanonicalName());
   pgeTask.runPropertyAdders();
   assertEquals("value", pgeTask.pgeMetadata.getMetadata("key"));
   assertEquals("1",
         pgeTask.pgeMetadata
               .getMetadata(MockConfigFilePropertyAdder.RUN_COUNTER));
   System.getProperties().remove(PgeTaskMetKeys.USE_LEGACY_PROPERTY);
}