1 25 package org.objectweb.easybeans.tests.deploymentdesc; 26 27 import org.objectweb.easybeans.tests.common.ejbs.base.xmldescriptor.ItfBasicBeanRemote; 28 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.xmldescriptor.ItfXmlDescriptorTester; 29 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.xmldescriptor.SFSBXmlDescriptorTester00; 30 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.xmldescriptor.SFSBXmlDescriptorTester01; 31 import org.objectweb.easybeans.tests.common.helper.EJBHelper; 32 import org.testng.annotations.BeforeMethod; 33 import org.testng.annotations.Test; 34 35 47 public class TestBasicElements { 48 49 52 private ItfXmlDescriptorTester sfTester; 53 54 57 private ItfXmlDescriptorTester slTester; 58 59 63 @BeforeMethod 64 public void setup() throws Exception { 65 slTester = EJBHelper.getBeanRemoteInstance(SFSBXmlDescriptorTester00.class, ItfXmlDescriptorTester.class); 66 sfTester = EJBHelper.getBeanRemoteInstance(SFSBXmlDescriptorTester01.class, ItfXmlDescriptorTester.class); 67 } 68 69 76 @Test 77 public void verifySLMappedName() throws Exception { 78 ItfBasicBeanRemote bean = EJBHelper.getBeanByMappedName("SLSBBasicBeanByXMLMappedRemote"); 79 bean.toString(); 80 } 81 82 89 @Test 90 public void verifySFMappedName() throws Exception { 91 ItfBasicBeanRemote bean = EJBHelper.getBeanByMappedName("SFSBBasicBeanByXMLMappedRemote"); 92 bean.toString(); 93 } 94 95 103 @Test(dependsOnMethods = {"verifySLMappedName"}, expectedExceptions = javax.ejb.EJBException .class) 104 public void verifySLBeanTypeElement() throws Exception { 105 ItfBasicBeanRemote bean = EJBHelper.getBeanByMappedName("SLSBBasicBeanByXMLMappedRemote"); 106 bean.openTransaction(); 107 } 108 109 117 @Test(dependsOnMethods = {"verifySFMappedName"}) 118 public void verifySFBeanTypeElement() throws Exception { 119 ItfBasicBeanRemote bean = EJBHelper.getBeanByMappedName("SFSBBasicBeanByXMLMappedRemote"); 120 bean.openTransaction(); 121 } 122 123 130 @Test 131 public void verifySLMappedNameLocal() throws Exception { 132 slTester.verifyBeanMappedName(); 133 } 134 135 143 @Test 144 public void verifySFMappedNameLocal() throws Exception { 145 sfTester.verifyBeanMappedName(); 146 } 147 148 155 @Test(expectedExceptions = javax.ejb.EJBException .class) 156 public void verifySLInjectionByEjbName() throws Exception { 157 slTester.verifyBeanTypeElement(); 158 } 159 160 166 @Test(expectedExceptions = javax.ejb.EJBException .class) 167 public void verifySFInjectionByEjbName() throws Exception { 168 sfTester.verifyBeanTypeElement(); 169 } 170 171 } 172 | Popular Tags |