geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/service LifeCycleTest.java
Date Tue, 11 Nov 2003 16:01:26 GMT
dain        2003/11/11 08:01:26

  Modified:    modules/kernel/src/test/org/apache/geronimo/kernel/service
                        LifeCycleTest.java
  Log:
  Stwitched test to use an initial value
  
  Revision  Changes    Path
  1.3       +12 -10    incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/service/LifeCycleTest.java
  
  Index: LifeCycleTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/service/LifeCycleTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LifeCycleTest.java	9 Nov 2003 20:18:58 -0000	1.2
  +++ LifeCycleTest.java	11 Nov 2003 16:01:26 -0000	1.3
  @@ -56,7 +56,6 @@
   package org.apache.geronimo.kernel.service;
   
   import java.util.Set;
  -import javax.management.Attribute;
   import javax.management.MBeanServer;
   import javax.management.ObjectName;
   
  @@ -86,6 +85,12 @@
           super(s);
       }
   
  +    public void testNamesSet() throws Exception {
  +        assertEquals("Grandparent", server.getAttribute(grandparentName, "name"));
  +        assertEquals("Parent", server.getAttribute(parentName, "name"));
  +        assertEquals("Child", server.getAttribute(childName, "name"));
  +    }
  +
       public void testDependencies() throws Exception {
           DependencyService2MBean dependencyService = (DependencyService2MBean) MBeanProxyFactory.getProxy(
                   DependencyService2MBean.class,
  @@ -387,28 +392,25 @@
   
           GeronimoMBean mbean;
   
  -        mbean = new GeronimoMBean(createPersonMBeanInfo(null));
  +        mbean = new GeronimoMBean(createPersonMBeanInfo("Grandparent", null));
           server.registerMBean(mbean, grandparentName);
  -        server.setAttribute(grandparentName, new Attribute("name", "Grandparent"));
   
  -        mbean = new GeronimoMBean(createPersonMBeanInfo(grandparentName));
  +        mbean = new GeronimoMBean(createPersonMBeanInfo("Parent", grandparentName));
           server.registerMBean(mbean, parentName);
  -        server.setAttribute(parentName, new Attribute("name", "Parent"));
   
  -        mbean = new GeronimoMBean(createPersonMBeanInfo(parentName));
  +        mbean = new GeronimoMBean(createPersonMBeanInfo("Child", parentName));
           server.registerMBean(mbean, childName);
  -        server.setAttribute(childName, new Attribute("name", "Child"));
   
           server.invoke(grandparentName, "start", null, null);
           server.invoke(parentName, "start", null, null);
           server.invoke(childName, "start", null, null);
       }
   
  -    private GeronimoMBeanInfo createPersonMBeanInfo(ObjectName parent) {
  +    private GeronimoMBeanInfo createPersonMBeanInfo(String name, ObjectName parent) {
           GeronimoMBeanInfo mbeanInfo = new GeronimoMBeanInfo();
           mbeanInfo.setTargetClass("org.apache.geronimo.kernel.service.Person");
           mbeanInfo.setName("Person");
  -        mbeanInfo.addAttributeInfo(new GeronimoAttributeInfo("name"));
  +        mbeanInfo.addAttributeInfo(new GeronimoAttributeInfo("name", name));
           mbeanInfo.addAttributeInfo(new GeronimoAttributeInfo("doStartCalled", true, false));
           mbeanInfo.addAttributeInfo(new GeronimoAttributeInfo("doStopCalled", true, false));
           mbeanInfo.addAttributeInfo(new GeronimoAttributeInfo("doFailCalled", true, false));
  
  
  

Mime
View raw message