Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fail/skip/error test #6

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<body>
<section id="appIntro">
<div id="titleSection">
<h1 id="appTitle">Open Liberty System Properties Sample</h1>
<h1 id="appTitle">Open Liberty System Properties Sample - Test4</h1>
<div class="line"></div>
<div class="headerImage"></div>
<h2>Congrats on your shiny, new Open Liberty sample app!</h2>
Expand Down
11 changes: 11 additions & 0 deletions src/test/java/basic/unittests/FirstSuiteTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package basic.unittests;

import org.junit.jupiter.api.Test;

public class FirstSuiteTest {
@Test
public void firstTest1() {
System.out.println("firstTest1 was successful");
}

}
15 changes: 15 additions & 0 deletions src/test/java/basic/unittests/SecondSuiteTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package basic.unittests;

import org.junit.jupiter.api.Test;

public class SecondSuiteTest {
@Test
public void secondTest1() {
System.out.println("secondTest1 successful!");
}

@Test
public void secondTest2() {
System.out.println("secondTest2 successful!");
}
}
24 changes: 24 additions & 0 deletions src/test/java/basic/unittests/ThirdSuiteTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package basic.unittests;

import static org.junit.jupiter.api.Assertions.fail;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class ThirdSuiteTest {
@Disabled
@Test
public void skippedTest1() {
System.out.println("thirdTest1 successful!");
}

@Test
public void failedTest2() throws Exception {
fail("Forcing a test failure");
}

@Test
public void errorTest3() throws Exception {
throw new Exception("Throwing an error");
}
}