@Test
  public void testInvocation() {

    List<String> expected = new ArrayList<String>();
    expected.add(0 + Interceptor1.class.getSimpleName());
    expected.add(0 + Interceptor2.class.getSimpleName());
    expected.add(1 + Interceptor1.class.getSimpleName());
    expected.add(1 + Interceptor2.class.getSimpleName());
    expected.add(2 + Interceptor1.class.getSimpleName());

    ActionSequence.reset();
    bean.ping();
    assertEquals(expected, ActionSequence.getSequenceData());
  }
Ejemplo n.º 2
0
 public String ping() {
   ActionSequence.addAction("pong");
   return "pong";
 }
Ejemplo n.º 3
0
 @AroundInvoke
 public Object intercept(InvocationContext ctx) throws Exception {
   ActionSequence.addAction("interceptor");
   return super.aroundInvoke(ctx);
 }
Ejemplo n.º 4
0
 @PreDestroy
 public void destroy() {
   ActionSequence.addAction("conversationDestroyed");
 }
Ejemplo n.º 5
0
 @PostConstruct
 public void init() {
   ActionSequence.addAction("conversationCreated");
 }
 @AroundInvoke
 public Object alwaysReturnThis(InvocationContext ctx) throws Exception {
   ActionSequence.addAction(HighPriorityGlobalInterceptor.class.getName());
   return ctx.proceed();
 }