org.objectweb.easybeans.tests.interceptors.business
Class TestMethodInterceptor

java.lang.Object
  extended by org.objectweb.easybeans.tests.interceptors.business.TestMethodInterceptor

public class TestMethodInterceptor
extends java.lang.Object

Verifies if the order to execute the method interceptors is correct. The correct order is:

  • Default Interceptor in the order of theirs specification.
  • Interceptor Classes in the order of theirs specification.
  • Interceptor Methods in the order of theirs specification.
  • Interceptors annotated to a business method in the order of theirs specification.

  • The bean used to the test has one interceptor.

    Author:
    Gisele Pinheiro Souza, Eduardo Studzinski Estima de Castro
    Reference:
    JSR220-PROPOSED FINAL - Item:11.7
    Requirement:
    Application Server must be running; the bean org.objectweb.easybeans.tests.common.ejbs.stateless.SLSBMethodInterceptorTest.java must be deployed.
    Setup:
    gets the reference of SLSBMethodInterceptorTest

    Field Summary
    private  ItfMethodInterceptorTestRemote<java.lang.Integer> mtBean
              Bean used to implement the test.
     
    Constructor Summary
    TestMethodInterceptor()
               
     
    Method Summary
     void interceptorMethodTest00()
              Verifies if the interceptors are not executed.
     void interceptorMethodTest02()
              Verifies if the interceptor is executed.
     void interceptorMethodTest03()
              Verifies if two interceptors are executed in order.
     void interceptorMethodTest04()
              Verifies if many interceptors are executed in order.
     void interceptorMethodTest05()
              Verifies if many interceptors are executed in order.
     void interceptorMethodTest06()
              Verifies if interceptors are executed in order.
     void interceptorMethodTest07()
              Verifies if interceptors are executed in order.
     void interceptorMethodTest08()
              Verifies if interceptors are executed in order.
     void startUp()
              Creates a bean to be used in the tests.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    mtBean

    private ItfMethodInterceptorTestRemote<java.lang.Integer> mtBean
    Bean used to implement the test.

    Constructor Detail

    TestMethodInterceptor

    public TestMethodInterceptor()
    Method Detail

    startUp

    public void startUp()
                 throws java.lang.Exception
    Creates a bean to be used in the tests.

    Throws:
    java.lang.Exception - if there is a problem with the bean initialization.

    interceptorMethodTest00

    public void interceptorMethodTest00()
    Verifies if the interceptors are not executed.

    Input:
    List with no values inside
    Output:
    List with only one value, the value inserted by the method

    interceptorMethodTest02

    public void interceptorMethodTest02()
    Verifies if the interceptor is executed.

    Input:
    List with no values inside
    Output:
    List with two values, the value inserted by the method and the value inserted by the interceptor

    interceptorMethodTest03

    public void interceptorMethodTest03()
    Verifies if two interceptors are executed in order.

    Input:
    List with no values inside
    Output:
    List with three values, the value inserted by the method and the value inserted by the interceptors.

    interceptorMethodTest04

    public void interceptorMethodTest04()
    Verifies if many interceptors are executed in order.

    Input:
    List with no values inside
    Output:
    List with six values, the value inserted by the method and the value inserted by the interceptors.

    interceptorMethodTest05

    public void interceptorMethodTest05()
    Verifies if many interceptors are executed in order. This must repect the declaration order.

    Input:
    List with no values inside
    Output:
    List with six values, the value inserted by the method and the value inserted by the interceptors.

    interceptorMethodTest06

    public void interceptorMethodTest06()
    Verifies if interceptors are executed in order. All interceptors have a private method that intercepts.

    Input:
    List with no values inside
    Output:
    List with 4 values, the value inserted by the method and the value inserted by the interceptors.

    interceptorMethodTest07

    public void interceptorMethodTest07()
    Verifies if interceptors are executed in order. All interceptors have a protected method that intercepts.

    Input:
    List with no values inside
    Output:
    List with 3 values, the value inserted by the method and the value inserted by the interceptors.

    interceptorMethodTest08

    public void interceptorMethodTest08()
    Verifies if interceptors are executed in order. There is interceptors with private, protected, and public method, also there is inheritance in one interceptor(PrintOrder03Interceptor.class).

    Input:
    List with no values inside
    Output:
    List with 9 values, the value inserted by the method and the value inserted by the interceptors.