Skip to content

Commit b59866b

Browse files
committed
Adjust ITs for new multi-mod behavior
Signed-off-by: Scott Kurz <skurz@us.ibm.com>
1 parent e462bc5 commit b59866b

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/BaseDevTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848
import org.junit.AfterClass;
4949
import org.junit.Before;
5050
import org.junit.BeforeClass;
51+
import org.junit.Rule;
5152
import org.junit.Test;
53+
import org.junit.rules.TestWatcher;
54+
import org.junit.runner.Description;
5255

5356
public class BaseDevTest {
5457

@@ -501,4 +504,14 @@ protected static void tagLog(String line) throws Exception {
501504
writer.write(line + "\n");
502505
writer.flush();
503506
}
507+
508+
@Rule
509+
public TestWatcher watchman = new TestWatcher() {
510+
@Override
511+
protected void failed(Throwable thr, Description description) {
512+
try {
513+
System.out.println("Failure log in " + logFile + ", tail of contents = " + getLogTail(logFile));
514+
} catch (IOException e) {}
515+
}
516+
};
504517
}

liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleM2InstalledTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static void setUpBeforeClass() throws Exception {
3737
}
3838

3939
@Test
40-
public void purgeLocallyInstalledModule_DevMode_Test() throws Exception {
40+
public void purgeUpstreamSourcePart_DevMode_Test() throws Exception {
4141

4242
// install everything to m2
4343
runCommand("mvn install");
@@ -58,7 +58,7 @@ public void purgeLocallyInstalledModule_DevMode_Test() throws Exception {
5858
startProcess(null, true, "mvn io.openliberty.tools:liberty-maven-plugin:"+System.getProperty("mavenPluginVersion")+":", false);
5959

6060
// TODO when https://github.com/OpenLiberty/ci.maven/issues/1203 is fixed, check for compilation error instead
61-
assertTrue(getLogTail(logFile), verifyLogMessageExists("Could not resolve dependencies for project", 5000));
61+
assertTrue(getLogTail(logFile), verifyLogMessageExists("package io.openliberty.guides.multimodules.lib does not exist", 25000));
6262

6363
assertFalse(getLogTail(logFile), targetClass.exists());
6464
}

liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleRunM2InstalledTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static void setUpBeforeClass() throws Exception {
3737
}
3838

3939
@Test
40-
public void purgeLocallyInstalledModule_LibertyRun_Test() throws Exception {
40+
public void purgeUpstreamSourcePart_LibertyRun_Test() throws Exception {
4141

4242
// install everything to m2
4343
runCommand("mvn install");
@@ -58,7 +58,7 @@ public void purgeLocallyInstalledModule_LibertyRun_Test() throws Exception {
5858
startProcess(null, false, "mvn io.openliberty.tools:liberty-maven-plugin:"+System.getProperty("mavenPluginVersion")+":", false);
5959

6060
// TODO when https://github.com/OpenLiberty/ci.maven/issues/1203 is fixed, check for compilation error instead
61-
assertTrue(getLogTail(logFile), verifyLogMessageExists("Could not resolve dependencies for project", 5000));
61+
assertTrue(getLogTail(logFile), verifyLogMessageExists("package io.openliberty.guides.multimodules.lib does not exist", 25000));
6262

6363
assertFalse(getLogTail(logFile), targetClass.exists());
6464
}

0 commit comments

Comments
 (0)