1 25 package org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.interceptorxml; 26 27 import static org.objectweb.easybeans.tests.common.asserts.Assert.assertEquals; 28 29 import java.util.ArrayList ; 30 import java.util.List ; 31 32 import javax.ejb.EJB ; 33 import javax.ejb.Remote ; 34 import javax.ejb.Stateful ; 35 36 import org.objectweb.easybeans.tests.common.interceptors.business.base.PrintOrderWithoutAnnotationInterc; 37 import org.objectweb.easybeans.tests.common.interceptors.business.order.PrintOrder02Interceptor; 38 39 45 @Stateful 46 @Remote (ItfInterceptorTester01.class) 47 public class SFSBInterceptorTester01 implements ItfInterceptorTester01 { 48 49 52 @EJB (beanName = "SFSBInterceptorXMLRemote01") 53 private ItfInterceptorXML sfsbInterceptorXML; 54 55 59 private void verifyDefaultInterceptor(final List <Integer > lstResult){ 60 List <Integer > lstExpected = new ArrayList <Integer >(); 61 62 lstExpected.add(PrintOrderWithoutAnnotationInterc.ORDER); 64 65 assertEquals(lstResult, lstExpected, 66 "The interceptors defined in the xml descriptor does not run in the correct order."); 67 } 68 69 73 public void testInterceptorOrder01(){ 74 verifyDefaultInterceptor(sfsbInterceptorXML.insertOrder1(new ArrayList <Integer >())); 75 } 76 77 81 public void testInterceptorOrder02(){ 82 List <Integer > lstResult = sfsbInterceptorXML.insertOrder2(new ArrayList <Integer >()); 83 List <Integer > lstExpected = new ArrayList <Integer >(); 84 85 lstExpected.add(PrintOrderWithoutAnnotationInterc.ORDER); 87 lstExpected.add(PrintOrder02Interceptor.ORDER); 89 90 assertEquals(lstResult, lstExpected, 91 "The interceptors defined in the xml descriptor does not run in the correct order."); 92 93 verifyDefaultInterceptor(sfsbInterceptorXML.insertOrder2(new ArrayList <Integer >(), 1)); 94 } 95 96 100 public void testInterceptorOrder03(){ 101 List <Integer > lstResult = sfsbInterceptorXML.insertOrder3(new ArrayList <Integer >()); 102 List <Integer > lstExpected = new ArrayList <Integer >(); 103 104 assertEquals(lstResult, lstExpected, 105 "The interceptors defined in the xml descriptor does not run in the correct order."); 106 } 107 108 } 109 | Popular Tags |