1 25 package org.objectweb.easybeans.tests.interceptors.business.stateless.containermanaged; 26 27 import static org.objectweb.easybeans.tests.common.enhancer.ClassesEnhancer.EXT_CLASS; 28 import static org.objectweb.easybeans.tests.common.enhancer.ClassesEnhancer.enhanceNewClassLoader; 29 30 import java.io.File ; 31 import java.util.ArrayList ; 32 import java.util.List ; 33 34 import org.objectweb.easybeans.deployment.annotations.exceptions.InterceptorsValidationException; 35 import org.objectweb.easybeans.tests.common.ejbs.base.ItfOneMethod00; 36 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.wrongspecification.ItfWithInterceptor; 37 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.wrongspecification.SLSBFinalExternalInterceptor; 38 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.wrongspecification.SLSBFinalInternalInterceptor; 39 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.wrongspecification.SLSBItfWithInterceptor; 40 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.wrongspecification.SLSBStaticExternalInterceptor; 41 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.wrongspecification.SLSBStaticInternalInterceptor; 42 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.wrongspecification.SLSBTwoArInvokeExternalInterceptor; 43 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.wrongspecification.SLSBTwoAroundInvokeError; 44 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.wrongspecification.SLSBVoidExternalInterceptor; 45 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.wrongspecification.SLSBWithArgsInterceptor; 46 import org.objectweb.easybeans.tests.common.enhancer.ClassesEnhancer.TYPE; 47 import org.objectweb.easybeans.tests.common.interceptors.business.wrongspecification.ArgsConstructorInterceptor; 48 import org.objectweb.easybeans.tests.common.interceptors.business.wrongspecification.FinalMethodInterceptor; 49 import org.objectweb.easybeans.tests.common.interceptors.business.wrongspecification.StaticMethodInterceptor; 50 import org.objectweb.easybeans.tests.common.interceptors.business.wrongspecification.TwoAroundInvokeInterceptor; 51 import org.objectweb.easybeans.tests.common.interceptors.business.wrongspecification.VoidInterceptor; 52 import org.testng.annotations.Test; 53 54 55 62 public class TestWrongSpecification { 63 64 71 @Test(groups = {"withWrongSpecification"}, expectedExceptions = InterceptorsValidationException.class) 72 public void testWrongSpec00() throws Exception { 73 List <String > lstFiles = new ArrayList <String >(); 74 75 lstFiles.add(ItfOneMethod00.class.getName().replace(".", File.separator) + EXT_CLASS); 76 lstFiles.add(SLSBTwoArInvokeExternalInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 77 lstFiles.add(TwoAroundInvokeInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 78 enhanceNewClassLoader(lstFiles, TYPE.INTERCEPTOR); 79 } 80 81 87 @Test(groups = {"withWrongSpecification"}, expectedExceptions = InterceptorsValidationException.class) 88 public void testWrongSpec01() throws Exception { 89 List <String > lstFiles = new ArrayList <String >(); 90 91 lstFiles.add(SLSBWithArgsInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 92 lstFiles.add(ItfOneMethod00.class.getName().replace(".", File.separator) + EXT_CLASS); 93 lstFiles.add(ArgsConstructorInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 94 enhanceNewClassLoader(lstFiles, TYPE.INTERCEPTOR); 95 } 96 97 104 @Test(groups = {"withWrongSpecification"}, expectedExceptions = InterceptorsValidationException.class) 105 public void testWrongSpec02() throws Exception { 106 List <String > lstFiles = new ArrayList <String >(); 107 108 lstFiles.add(SLSBTwoAroundInvokeError.class.getName().replace(".", File.separator) + EXT_CLASS); 109 lstFiles.add(ItfOneMethod00.class.getName().replace(".", File.separator) + EXT_CLASS); 110 enhanceNewClassLoader(lstFiles, TYPE.INTERCEPTOR); 111 } 112 113 120 @Test(groups = {"withWrongSpecification"}, expectedExceptions = InterceptorsValidationException.class) 121 public void testWrongSpec03() throws Exception { 122 List <String > lstFiles = new ArrayList <String >(); 123 124 lstFiles.add(SLSBVoidExternalInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 125 lstFiles.add(ItfOneMethod00.class.getName().replace(".", File.separator) + EXT_CLASS); 126 lstFiles.add(VoidInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 127 128 enhanceNewClassLoader(lstFiles, TYPE.INTERCEPTOR); 129 130 131 } 132 133 139 @Test(groups = {"withWrongSpecification"}, expectedExceptions = InterceptorsValidationException.class) 140 public void testWrongSpec04() throws Exception { 141 List <String > lstFiles = new ArrayList <String >(); 142 143 lstFiles.add(SLSBStaticExternalInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 144 lstFiles.add(ItfOneMethod00.class.getName().replace(".", File.separator) + EXT_CLASS); 145 lstFiles.add(StaticMethodInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 146 enhanceNewClassLoader(lstFiles, TYPE.INTERCEPTOR); 147 } 148 149 155 @Test(groups = {"withWrongSpecification"}, expectedExceptions = InterceptorsValidationException.class) 156 public void testWrongSpec05() throws Exception { 157 List <String > lstFiles = new ArrayList <String >(); 158 159 lstFiles.add(SLSBFinalExternalInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 160 lstFiles.add(ItfOneMethod00.class.getName().replace(".", File.separator) + EXT_CLASS); 161 lstFiles.add(FinalMethodInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 162 163 enhanceNewClassLoader(lstFiles, TYPE.INTERCEPTOR); 164 } 165 166 173 @Test(groups = {"withWrongSpecification"}, expectedExceptions = InterceptorsValidationException.class) 174 public void testWrongSpec06() throws Exception { 175 List <String > lstFiles = new ArrayList <String >(); 176 177 lstFiles.add(ItfWithInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 178 lstFiles.add(SLSBItfWithInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 179 enhanceNewClassLoader(lstFiles, TYPE.INTERCEPTOR); 180 } 181 182 188 @Test(groups = {"withWrongSpecification"}, expectedExceptions = InterceptorsValidationException.class) 189 public void testWrongSpec07() throws Exception { 190 List <String > lstFiles = new ArrayList <String >(); 191 192 lstFiles.add(SLSBStaticInternalInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 193 lstFiles.add(ItfOneMethod00.class.getName().replace(".", File.separator) + EXT_CLASS); 194 enhanceNewClassLoader(lstFiles, TYPE.INTERCEPTOR); 195 } 196 197 203 @Test(groups = {"withWrongSpecification"}, expectedExceptions = InterceptorsValidationException.class) 204 public void testWrongSpec08() throws Exception { 205 List <String > lstFiles = new ArrayList <String >(); 206 207 lstFiles.add(SLSBFinalInternalInterceptor.class.getName().replace(".", File.separator) + EXT_CLASS); 208 lstFiles.add(ItfOneMethod00.class.getName().replace(".", File.separator) + EXT_CLASS); 209 enhanceNewClassLoader(lstFiles, TYPE.INTERCEPTOR); 210 } 211 } 212 | Popular Tags |