1 22 package org.jboss.test.jmx.test; 23 24 import javax.management.ObjectName ; 25 import javax.naming.InitialContext ; 26 27 import org.jboss.test.JBossTestCase; 28 import org.jboss.test.jmx.eardeployment.a.interfaces.SessionAHome; 29 import org.jboss.test.jmx.eardeployment.a.interfaces.SessionA; 30 31 32 38 public class CPManifestUnitTestCase extends JBossTestCase 39 { 40 41 public CPManifestUnitTestCase(String name) 42 { 43 super(name); 44 } 45 46 53 public void testEarJarManifest() throws Exception 54 { 55 getLog().info("+++ testEarJarManifest"); 56 deploy("cpmanifest.ear"); 57 Object home = getInitialContext().lookup("Concrete"); 58 getLog().info("Found Concrete home="+home); 59 undeploy("cpmanifest.ear"); 60 } 61 62 69 public void testCircularManifest() throws Exception 70 { 71 getLog().info("+++ testCircularManifest"); 72 deploy("cpcircular-manifest.ear"); 73 Object home = getInitialContext().lookup("Concrete"); 74 getLog().info("Found Concrete home="+home); 75 undeploy("cpcircular-manifest.ear"); 76 } 77 78 85 public void testSARManifest() throws Exception 86 { 87 getLog().info("+++ testSARManifest"); 88 deploy("external.ear"); 89 ObjectName serviceName = new ObjectName ("test:name=ExternalClass"); 90 boolean isRegisterd = getServer().isRegistered(serviceName); 91 assertTrue("ExternalClass service is registered", isRegisterd); 92 undeploy("external.ear"); 93 } 94 95 101 public void testEJBJarManifest() throws Exception 102 { 103 getLog().info("+++ testEJBJarManifest"); 104 deploy("cpejbs-manifest.ear"); 105 ObjectName ejb1Name = new ObjectName ("jboss.j2ee:service=EJB,jndiName=eardeployment/SessionA"); 106 boolean isRegisterd = getServer().isRegistered(ejb1Name); 107 assertTrue("eardeployment/SessionA is registered", isRegisterd); 108 ObjectName ejb2Name = new ObjectName ("jboss.j2ee:service=EJB,jndiName=eardeployment/SessionB"); 109 isRegisterd = getServer().isRegistered(ejb2Name); 110 assertTrue("eardeployment/SessionB is registered", isRegisterd); 111 112 InitialContext ctx = new InitialContext (); 113 SessionAHome home = (SessionAHome) ctx.lookup("eardeployment/SessionA"); 114 SessionA bean = home.create(); 115 bean.callB(); 116 bean.remove(); 117 undeploy("cpejbs-manifest.ear"); 118 } 119 } 120 121 | Popular Tags |