1 17 18 package org.apache.geronimo.j2ee.management; 19 20 import org.apache.geronimo.management.J2EEServer; 21 22 23 26 public class ServerTest extends Abstract77Test { 27 private J2EEServer server; 28 private String version; 29 30 public void testStandardInterface() throws Exception { 31 assertEquals(SERVER_DATA.getAbstractName().getObjectName().getCanonicalName(), server.getObjectName()); 32 assertEquals(0, server.getDeployedObjects().length); 33 assertEquals(0, server.getResources().length); 34 assertObjectNamesEqual(new String []{JVM_DATA.getAbstractName().getObjectName().getCanonicalName()}, server.getJavaVMs()); 35 assertEquals("The Apache Software Foundation", server.getServerVendor()); 36 assertEquals(version, server.getServerVersion()); 37 } 38 39 public void testStandardAttributes() throws Exception { 40 assertEquals(SERVER_DATA.getAbstractName().getObjectName().getCanonicalName(), kernel.getAttribute(SERVER_DATA.getAbstractName(), "objectName")); 41 assertEquals(0, ((String []) kernel.getAttribute(SERVER_DATA.getAbstractName(), "deployedObjects")).length); 42 assertEquals(0, ((String []) kernel.getAttribute(SERVER_DATA.getAbstractName(), "resources")).length); 43 assertObjectNamesEqual(new String []{JVM_DATA.getAbstractName().getObjectName().getCanonicalName()}, (String []) kernel.getAttribute(SERVER_DATA.getAbstractName(), "javaVMs")); 44 assertEquals("The Apache Software Foundation", kernel.getAttribute(SERVER_DATA.getAbstractName(), "serverVendor")); 45 assertEquals(version, kernel.getAttribute(SERVER_DATA.getAbstractName(), "serverVersion")); 46 } 47 48 protected void setUp() throws Exception { 49 super.setUp(); 50 server = (J2EEServer) kernel.getGBean(SERVER_DATA.getAbstractName()); 51 version = (String ) kernel.getAttribute(SERVER_INFO_DATA.getAbstractName(), "version"); 52 } 53 } 54 | Popular Tags |