1 package net.sourceforge.ejtools.management.test; 2 3 import javax.management.j2ee.Management ; 4 import javax.management.j2ee.ManagementHome ; 5 6 import net.sourceforge.ejtools.management.util.MEJB; 7 8 import org.apache.log4j.Category; 9 10 18 public class ConnectivityTestCase extends ReportTestCase 19 { 20 21 private static Category logger = Category.getInstance(ConnectivityTestCase.class); 22 23 26 public ConnectivityTestCase() 27 { 28 this("NONE"); 29 } 30 31 35 public ConnectivityTestCase(String name) 36 { 37 super(name); 38 super.setFatal(false); 39 } 40 41 42 public void testManagementEJB() 43 { 44 this.addInfo("mejb.binding", MEJB.getMEJBBinding()); 45 46 ManagementHome home = MEJB.lookupMEJB(); 47 48 this.vassert("Lookup of MEJB is OK", "Can't look up MEJB", (home != null)); 49 50 Management mejb = null; 51 try 52 { 53 mejb = home.create(); 54 } 55 catch (Exception e) 56 { 57 } 58 59 this.vassert("Creation of MEJB is OK", "Can't create up MEJB", (mejb != null)); 60 61 if(mejb != null) { 62 this.addInfo("mejb.class.name", mejb.getClass().getName()); 63 this.addInfo("mejb.default.domain", MEJB.getDefaultDomain()); 64 this.addInfo("mejb.mbean.count", ""+ MEJB.getMBeanCount()); 65 } 66 } 67 } 68 | Popular Tags |