Skip to content

Commit

Permalink
Merge pull request #309 from KyleAure/269-modernize-tck
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAure authored Jul 14, 2023
2 parents 498b832 + f803b8f commit a9bf4ac
Show file tree
Hide file tree
Showing 94 changed files with 1,804 additions and 3,457 deletions.
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

0 comments on commit a9bf4ac

Please sign in to comment.