@Test
public void testCreatePgeMetadata() throws Exception {

   final String PGE_NAME = "PGE_Test";
   final String PGE_REQUIRED_METADATA = "Filename, FileLocation ";
   final String PROP_ADDERS = "some.prop.adder.classpath,some.other.classpath";
   PGETaskInstance pgeTask = createTestInstance();
   Metadata dynMet = new Metadata();
   WorkflowTaskConfiguration config = new WorkflowTaskConfiguration();
   config.addConfigProperty(NAME.getName(), PGE_NAME);
   config.addConfigProperty(REQUIRED_METADATA.getName(),
         PGE_REQUIRED_METADATA);
   config.addConfigProperty(PROPERTY_ADDERS.getName(), PROP_ADDERS);
   PgeMetadata pgeMet = pgeTask.createPgeMetadata(dynMet, config);
   assertEquals(1, pgeMet.getAllMetadata(NAME).size());
   assertEquals(PGE_NAME, pgeMet.getAllMetadata(NAME).get(0));
   assertEquals(2, pgeMet.getAllMetadata(REQUIRED_METADATA).size());
   assertTrue(pgeMet.getAllMetadata(REQUIRED_METADATA).contains("Filename"));
   assertTrue(pgeMet.getAllMetadata(REQUIRED_METADATA).contains(
         "FileLocation"));
   assertEquals(2, pgeMet.getAllMetadata(PROPERTY_ADDERS).size());
   assertTrue(pgeMet.getAllMetadata(PROPERTY_ADDERS).contains(
         "some.prop.adder.classpath"));
   assertTrue(pgeMet.getAllMetadata(PROPERTY_ADDERS).contains(
         "some.other.classpath"));
   // Verify still works when only one property adder is specified.
   pgeTask = createTestInstance();
   config = new WorkflowTaskConfiguration();
   config.addConfigProperty(PgeTaskMetKeys.PROPERTY_ADDERS.getName(),
         "one.prop.adder.only");
   pgeMet = pgeTask.createPgeMetadata(dynMet, config);
   assertEquals(1, pgeMet.getAllMetadata(PROPERTY_ADDERS).size());
   assertEquals("one.prop.adder.only", pgeMet
         .getAllMetadata(PROPERTY_ADDERS).get(0));
}