Enable generate feature test and validate the message added to the new xml file.
@@ -210,12 +210,12 @@ public class DevTest extends BaseDevTest {
assertTrue(systemHealthTarget.exists());
}
- // TODO @Test
+ @Test
public void generateFeatureTest() throws Exception {
final String GENERATED_FEATURES_FILE_NAME = "generated-features.xml";
final String SERVER_XML_COMMENT = "Plugin has generated Liberty features"; // the explanation added to server.xml
- // TODO final String NEW_FILE_INFO_MESSAGE = "Some message"; // the explanation added to the generated features file
+ final String NEW_FILE_INFO_MESSAGE = "This file was generated by the Liberty Maven Plugin and will be overwritten"; // the explanation added to the generated features file
assertTrue(verifyLogMessageExists("Liberty is running in dev mode.", 10000));
assertFalse(verifyLogMessageExists("batch-1.0", 10000));
@@ -234,13 +234,13 @@ public class DevTest extends BaseDevTest {
// Dev mode should now compile the new Java file...
File helloBatchObj = new File(tempProj, "target/classes/com/demo/HelloBatch.class");
- verifyFileExists(newTargetFeatureFile, 15000);
+ verifyFileExists(helloBatchObj, 15000);
// ... and run the proper mojo.
assertTrue(verifyLogMessageExists("Running liberty:generate-features", 10000)); // mojo ran
assertTrue(verifyFileExists(newFeatureFile, 5000)); // mojo created file
- assertTrue(verifyFileExists(newTargetFeatureFile, 5000)); // mojo copied file
+ assertTrue(verifyFileExists(newTargetFeatureFile, 5000)); // dev mode copied file
assertTrue(verifyLogMessageExists("batch-1.0", 10000, newFeatureFile));
- // TODO assertTrue(verifyLogMessageExists(NEW_FILE_INFO_MESSAGE, 10000, newFeatureFile));
+ assertTrue(verifyLogMessageExists(NEW_FILE_INFO_MESSAGE, 10000, newFeatureFile));
assertTrue(verifyLogMessageExists(SERVER_XML_COMMENT, 10000, serverXmlFile));
assertTrue(verifyLogMessageExists("batch-1.0", 10000)); // should appear in the message "CWWKF0012I: The server installed the following features:"
}
