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

Modernize the TCK for future maintainability #309

Merged
merged 6 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
import ee.jakarta.tck.concurrent.framework.junit.anno.Web;
import jakarta.enterprise.concurrent.AbortedException;

@Web //TODO couldn't this be a unit test?
@Web // TODO couldn't this be a unit test?
public class AbortedExceptionTests {

// TODO deploy as EJB and JSP artifacts
@Deployment(name = "AbortedExceptionTests")
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class).addPackages(true, AbortedExceptionTests.class.getPackage());
Expand Down Expand Up @@ -112,41 +111,41 @@ public void AbortedExceptionThrowableTest() {
@Test
public void AbortedExceptionStringThrowableTest() {
AbortedException thrown;

String sExpected = "thisisthedetailmessage";
String sExpectedNull = null;
final Throwable tExpected = new Throwable("thisisthethrowable");
final Throwable tExpectedNull = null;

thrown = assertThrows(AbortedException.class, () -> {
throw new AbortedException(sExpected, tExpected);
});

assertNotNull(thrown.getMessage());
assertNotNull(thrown.getCause());
assertEquals(sExpected, thrown.getMessage());
assertEquals(tExpected, thrown.getCause());

thrown = assertThrows(AbortedException.class, () -> {
throw new AbortedException(sExpected, tExpectedNull);
});

assertNotNull(thrown.getMessage());
assertNull(thrown.getCause());
assertEquals(sExpected, thrown.getMessage());

thrown = assertThrows(AbortedException.class, () -> {
throw new AbortedException(sExpectedNull, tExpected);
});

assertNull(thrown.getMessage());
assertNotNull(thrown.getCause());
assertEquals(tExpected, thrown.getCause());

thrown = assertThrows(AbortedException.class, () -> {
throw new AbortedException(sExpectedNull, tExpectedNull);
});

assertNull(thrown.getMessage());
assertNull(thrown.getCause());
}
Expand Down
Loading