Skip to content

Commit

Permalink
Adjust ITs for new multi-mod behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Kurz <[email protected]>
  • Loading branch information
scottkurz committed Aug 10, 2022
1 parent b85ff89 commit 4893028
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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) {}
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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());
}
Expand Down

0 comments on commit 4893028

Please sign in to comment.