commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/modeler/src/test/org/apache/commons/modeler RegistryTestCase.java
Date Mon, 27 Jan 2003 19:31:49 GMT
craigmcc    2003/01/27 11:31:49

  Modified:    modeler/src/java/org/apache/commons/modeler
                        OperationInfo.java
               modeler/src/test/org/apache/commons/modeler
                        RegistryTestCase.java
  Log:
  Fix ModelMBeanOperationInfo as well.
  
  Revision  Changes    Path
  1.4       +5 -4      jakarta-commons/modeler/src/java/org/apache/commons/modeler/OperationInfo.java
  
  Index: OperationInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/OperationInfo.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- OperationInfo.java	7 Jan 2003 06:39:36 -0000	1.3
  +++ OperationInfo.java	27 Jan 2003 19:31:49 -0000	1.4
  @@ -265,6 +265,7 @@
           Descriptor descriptor = info.getDescriptor();
           descriptor.removeField("class");
           descriptor.setField("role", getRole());
  +        addFields(descriptor);
           info.setDescriptor(descriptor);
           return (info);
   
  
  
  
  1.5       +33 -4     jakarta-commons/modeler/src/test/org/apache/commons/modeler/RegistryTestCase.java
  
  Index: RegistryTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/test/org/apache/commons/modeler/RegistryTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegistryTestCase.java	27 Jan 2003 19:27:43 -0000	1.4
  +++ RegistryTestCase.java	27 Jan 2003 19:31:49 -0000	1.5
  @@ -72,6 +72,7 @@
   import javax.management.modelmbean.ModelMBeanAttributeInfo;
   import javax.management.modelmbean.ModelMBeanConstructorInfo;
   import javax.management.modelmbean.ModelMBeanInfo;
  +import javax.management.modelmbean.ModelMBeanOperationInfo;
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  @@ -332,6 +333,34 @@
           checkDescriptor(desc, "descriptortype", "MBean");
           checkDescriptor(desc, "field1", "HttpConnector/field1");
           checkDescriptor(desc, "field2", "HttpConnector/field2");
  +
  +    }
  +
  +
  +    /**
  +     * Test ModelMBeanOperationInfo information.
  +     */
  +    public void testModelMBeanOperationInfo() throws Exception {
  +
  +        // Retrieve a ManagedBean
  +        ManagedBean http = registry.findManagedBean("HttpConnector");
  +        assertNotNull("Found HttpConnector managed bean");
  +
  +        // Create the associated ModelMBeanInfo
  +        ModelMBeanInfo info = http.createMBeanInfo();
  +        assertNotNull("Found HttpConnector ModelMBeanInfo", info);
  +
  +        // Retrieve the specified ModelMBeanOperationInfo
  +        ModelMBeanOperationInfo mmoinfo = info.getOperation("initialize");
  +        assertNotNull("Found HttpConnector initialize info", mmoinfo);
  +
  +        // Get the Descriptor
  +        Descriptor desc = mmoinfo.getDescriptor();
  +        assertNotNull("Found HttpConnector initialize descriptor", desc);
  +
  +        // Check the configured fields
  +        checkDescriptor(desc, "field1", "HttpConnector.initialize/field1");
  +        checkDescriptor(desc, "field2", "HttpConnector.initialize/field2");
   
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message