1 25 package org.objectweb.easybeans.tests.environment.reference.simpleentry; 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 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance; 30 31 import java.io.File ; 32 import java.util.ArrayList ; 33 import java.util.List ; 34 35 import org.objectweb.easybeans.tests.common.ejbs.base.ItfOneMethod01; 36 import org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry; 37 import org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntryByDescriptor; 38 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.simpleentry.SLSBSimpleEnvEntryByDescriptor; 39 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.simpleentry.SLSBSimpleEnvEntryFieldInjection00; 40 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.simpleentry.wrongspecification.SLSBFinalFieldEntry; 41 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.simpleentry.wrongspecification.SLSBStaticEntry; 42 import org.objectweb.easybeans.tests.common.enhancer.ClassesEnhancer.TYPE; 43 import org.testng.annotations.BeforeMethod; 44 import org.testng.annotations.Test; 45 46 57 public class TestSimpleEnvironmentEntryFieldInjection { 58 59 62 private ItfSimpleEnvEntry bean; 63 64 67 private ItfSimpleEnvEntryByDescriptor beanInjectionByDescriptor; 68 69 73 @BeforeMethod 74 public void startUp() throws Exception { 75 bean = getBeanRemoteInstance(SLSBSimpleEnvEntryFieldInjection00.class, ItfSimpleEnvEntry.class); 76 beanInjectionByDescriptor = getBeanRemoteInstance(SLSBSimpleEnvEntryByDescriptor.class, 77 ItfSimpleEnvEntryByDescriptor.class); 78 } 79 80 85 @Test 86 public void testString00() { 87 bean.checkString00(); 88 } 89 90 95 @Test 96 public void testCharacter00() { 97 bean.checkCharacter00(); 98 } 99 100 105 @Test 106 public void testInteger00() { 107 bean.checkInteger00(); 108 } 109 110 115 @Test 116 public void testBoolean00() { 117 bean.checkBoolean00(); 118 } 119 120 125 @Test 126 public void testDouble00() { 127 bean.checkDouble00(); 128 } 129 130 135 @Test 136 public void testByte00() { 137 bean.checkByte00(); 138 } 139 140 145 @Test 146 public void testShort00() { 147 bean.checkByte00(); 148 } 149 150 155 @Test 156 public void testLong00() { 157 bean.checkLong00(); 158 } 159 160 165 @Test 166 public void testFloat00() { 167 bean.checkFloat00(); 168 } 169 170 176 @Test 177 public void testNotOverride00() { 178 beanInjectionByDescriptor.checkNotOverride00(); 179 } 180 181 186 @Test 187 public void testInjectionByDeploymentDescriptor00() { 188 beanInjectionByDescriptor.checkStringInjection00(); 189 } 190 191 198 @Test(groups = {"withWrongSpecification"}, expectedExceptions = IllegalStateException .class) 199 public void testWrongSpec00() throws Exception { 200 List <String > lstFiles = new ArrayList <String >(); 201 202 lstFiles.add(ItfOneMethod01.class.getName().replace(".", File.separator) + EXT_CLASS); 203 lstFiles.add(SLSBStaticEntry.class.getName().replace(".", File.separator) + EXT_CLASS); 204 enhanceNewClassLoader(lstFiles, TYPE.ALL); 205 } 206 207 214 @Test(groups = {"withWrongSpecification"}, expectedExceptions = IllegalStateException .class) 215 public void testWrongSpec01() throws Exception { 216 List <String > lstFiles = new ArrayList <String >(); 217 218 lstFiles.add(ItfOneMethod01.class.getName().replace(".", File.separator) + EXT_CLASS); 219 lstFiles.add(SLSBFinalFieldEntry.class.getName().replace(".", File.separator) + EXT_CLASS); 220 enhanceNewClassLoader(lstFiles, TYPE.ALL); 221 } 222 223 } 224 | Popular Tags |