Skip to content

Commit

Permalink
Fix MultiWarTest
Browse files Browse the repository at this point in the history
  • Loading branch information
jharting committed Jun 19, 2015
1 parent 617b736 commit f53bc37
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Expand Up @@ -29,7 +29,7 @@ public class Observer1 {

void observe(@Observes @Initialized(ApplicationScoped.class) ServletContext servletContext) {
if (observed) {
throw new IllegalStateException("ServletContextEvent invoked multiple times.");
throw new IllegalStateException("ServletContext invoked multiple times.");
}
observed = true;
}
Expand Down
Expand Up @@ -19,18 +19,18 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.Initialized;
import javax.enterprise.event.Observes;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContext;

public class Observer2 {

private static boolean observed;

void observe(@Observes @Initialized(ApplicationScoped.class) ServletContextEvent event) {
if (!event.getServletContext().getContextPath().equals("/test1")) {
throw new IllegalArgumentException("Excepted /test1 but received " + event.getServletContext().getContextPath());
void observe(@Observes @Initialized(ApplicationScoped.class) ServletContext event) {
if (!event.getContextPath().equals("/test1")) {
throw new IllegalArgumentException("Excepted /test1 but received " + event.getContextPath());
}
if (observed) {
throw new IllegalStateException("ServletContextEvent invoked multiple times.");
throw new IllegalStateException("ServletContext invoked multiple times.");
}
observed = true;
}
Expand Down
Expand Up @@ -19,18 +19,18 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.Initialized;
import javax.enterprise.event.Observes;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContext;

public class Observer3 {

private static boolean observed;

void observe(@Observes @Initialized(ApplicationScoped.class) ServletContextEvent event) {
if (!event.getServletContext().getContextPath().equals("/test2")) {
throw new IllegalArgumentException("Excepted /test2 but received " + event.getServletContext().getContextPath());
void observe(@Observes @Initialized(ApplicationScoped.class) ServletContext event) {
if (!event.getContextPath().equals("/test2")) {
throw new IllegalArgumentException("Excepted /test2 but received " + event.getContextPath());
}
if (observed) {
throw new IllegalStateException("ServletContextEvent invoked multiple times.");
throw new IllegalStateException("ServletContext invoked multiple times.");
}
observed = true;
}
Expand Down

0 comments on commit f53bc37

Please sign in to comment.