diff --git a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/BaseDevTest.java b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/BaseDevTest.java index 4d4040c2b..bb9ee1af7 100644 --- a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/BaseDevTest.java +++ b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/BaseDevTest.java @@ -48,7 +48,10 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; public class BaseDevTest { @@ -501,4 +504,14 @@ protected static void tagLog(String line) throws Exception { writer.write(line + "\n"); writer.flush(); } + + @Rule + public TestWatcher watchman = new TestWatcher() { + @Override + protected void failed(Throwable thr, Description description) { + try { + System.out.println("Failure log in " + logFile + ", tail of contents = " + getLogTail(logFile)); + } catch (IOException e) {} + } + }; } diff --git a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleM2InstalledTest.java b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleM2InstalledTest.java index 846acc825..a5a1d2892 100644 --- a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleM2InstalledTest.java +++ b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleM2InstalledTest.java @@ -37,7 +37,7 @@ public static void setUpBeforeClass() throws Exception { } @Test - public void purgeLocallyInstalledModule_DevMode_Test() throws Exception { + public void purgeUpstreamSourcePart_DevMode_Test() throws Exception { // install everything to m2 runCommand("mvn install"); @@ -58,7 +58,7 @@ public void purgeLocallyInstalledModule_DevMode_Test() throws Exception { startProcess(null, true, "mvn io.openliberty.tools:liberty-maven-plugin:"+System.getProperty("mavenPluginVersion")+":", false); // TODO when https://github.com/OpenLiberty/ci.maven/issues/1203 is fixed, check for compilation error instead - assertTrue(getLogTail(logFile), verifyLogMessageExists("Could not resolve dependencies for project", 5000)); + assertTrue(getLogTail(logFile), verifyLogMessageExists("package io.openliberty.guides.multimodules.lib does not exist", 25000)); assertFalse(getLogTail(logFile), targetClass.exists()); } diff --git a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleRunM2InstalledTest.java b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleRunM2InstalledTest.java index 5038ba8d0..dfdb8a1d6 100644 --- a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleRunM2InstalledTest.java +++ b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleRunM2InstalledTest.java @@ -37,7 +37,7 @@ public static void setUpBeforeClass() throws Exception { } @Test - public void purgeLocallyInstalledModule_LibertyRun_Test() throws Exception { + public void purgeUpstreamSourcePart_LibertyRun_Test() throws Exception { // install everything to m2 runCommand("mvn install"); @@ -58,7 +58,7 @@ public void purgeLocallyInstalledModule_LibertyRun_Test() throws Exception { startProcess(null, false, "mvn io.openliberty.tools:liberty-maven-plugin:"+System.getProperty("mavenPluginVersion")+":", false); // TODO when https://github.com/OpenLiberty/ci.maven/issues/1203 is fixed, check for compilation error instead - assertTrue(getLogTail(logFile), verifyLogMessageExists("Could not resolve dependencies for project", 5000)); + assertTrue(getLogTail(logFile), verifyLogMessageExists("package io.openliberty.guides.multimodules.lib does not exist", 25000)); assertFalse(getLogTail(logFile), targetClass.exists()); }