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

Specify event that triggers exception #486

Merged
merged 2 commits into from
Oct 11, 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 @@ -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
Loading