Skip to content

Commit

Permalink
TCK Challenge: ObserverExceptionRethrownTest modify event type (#488)
Browse files Browse the repository at this point in the history
Specify event that triggers exception

Signed-off-by: Jorge Bescos Gascon <[email protected]>
  • Loading branch information
jbescos authored Oct 11, 2023
1 parent 0d847c1 commit 03bf6e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.cdi.tck.AbstractTest;
import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder;
import org.jboss.cdi.tck.tests.event.observer.runtimeException.TeaCupPomeranian.Trigger;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
Expand All @@ -44,7 +45,7 @@ public static WebArchive createTestArchive() {
@Test(expectedExceptions = { TeaCupPomeranian.OversizedException.class })
@SpecAssertion(section = OBSERVER_NOTIFICATION, id = "cd")
public void testNonTransactionalObserverThrowsNonCheckedExceptionIsRethrown() {
getCurrentManager().getEvent().select(String.class).fire("string event");
getCurrentManager().getEvent().select(Trigger.class).fire(new Trigger());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public static class OversizedException extends RuntimeException {
private static final long serialVersionUID = 1L;
}

public void observeSimpleEvent(@Observes String someEvent) {
static class Trigger {};

public void observeSimpleEvent(@Observes Trigger someEvent) {
throw new OversizedException();
}

Expand Down

0 comments on commit 03bf6e8

Please sign in to comment.