[jboss-cvs] JBossAS SVN: r90106 - branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 11 16:43:35 EDT 2009


Author: ispringer
Date: 2009-06-11 16:43:35 -0400 (Thu, 11 Jun 2009)
New Revision: 90106

Modified:
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/Ejb3MetricsUnitTestCase.java
Log:
change expected format of SLSB/SFSB MOs


Modified: branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/Ejb3MetricsUnitTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/Ejb3MetricsUnitTestCase.java	2009-06-11 20:38:12 UTC (rev 90105)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/Ejb3MetricsUnitTestCase.java	2009-06-11 20:43:35 UTC (rev 90106)
@@ -42,7 +42,7 @@
  * 
  * Asserts that ManagementObjects and corresponding 
  * properties/operations are exposed in expected form for
- * SLSB, SFSB, MDB.  
+ * EJB3 SLSBs, SFSBs, and MDBs.  
  * 
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
@@ -76,47 +76,31 @@
    private static final String COMPONENT_SUBTYPE_MDB = "MDB";
 
    /**
-    * Suffix of @ManagementObject.name for metrics
+    * Properties which should be exposed by SLSB MOs.
     */
-   private static final String MANAGEMENT_OBJECT_NAME_SUFFIX_METRICS = "-metrics";
+   private static final String[] PROPERTY_NAMES_SLSB = new String[]
+   {"currentSize", "createCount", "removeCount", "availableCount", "maxSize", "invocationStats", 
+         "invocationStatsLastResetTime"};
 
    /**
-    * Suffix of @ManagementObject.name for instance metrics
+    * Properties which should be exposed by SFSB MOs.
     */
-   private static final String MANAGEMENT_OBJECT_NAME_SUFFIX_INSTANCE = MANAGEMENT_OBJECT_NAME_SUFFIX_METRICS
-         + "-instance";
-
-   /**
-    * Suffix of @ManagementObject.name for invocation metrics
-    */
-   private static final String MANAGEMENT_OBJECT_NAME_SUFFIX_INVOCATION = MANAGEMENT_OBJECT_NAME_SUFFIX_METRICS
-         + "-invocation";
-
-   /**
-    * Properties which should be exposed by the SLSB instance metrics
-    */
-   private static final String[] PROPERTY_NAMES_SLSB_INSTANCE_METRICS = new String[]
-   {"currentSize", "createCount", "removeCount", "availableCount", "maxSize"};
-
-   /**
-    * Properties which should be exposed by the SFSB instance metrics
-    */
-   private static final String[] PROPERTY_NAMES_SFSB_INSTANCE_METRICS = new String[]
+   private static final String[] PROPERTY_NAMES_SFSB = new String[]
    {"currentSize", "createCount", "removeCount", "availableCount", "maxSize", "cacheSize", "totalSize",
-         "passivatedCount"};
+         "passivatedCount", "invocationStats", "invocationStatsLastResetTime"};
 
    /**
-    * Properties which should be exposed by the invocation metrics
+    * Operations which should be exposed by SLSB MOs
     */
-   private static final String[] PROPERTY_NAMES_INVOCATION_METRICS = new String[]
-   {"stats", "lastResetTime"};
+   private static final String[] OPERATION_NAMES_SLSB = new String[]
+   {"resetInvocationStats"};
 
    /**
-    * Properties which should be exposed by the invocation metrics
+    * Operations which should be exposed by SFSB MOs
     */
-   private static final String[] OPERATION_NAMES_INVOCATION_METRICS = new String[]
-   {"resetStats"};
-
+   private static final String[] OPERATION_NAMES_SFSB = new String[]
+   {"resetInvocationStats"};
+   
    /**
     * The name of the test JAR to deploy
     */
@@ -212,25 +196,24 @@
    // ---------------------------------------------------------------------------------------||
 
    /**
-    * Ensures that instance metrics are exposed for SLSBs
-    * (backed by the bean pool) in expected form 
+    * Ensures that MOs with the correct metrics and operations are exposed for SLSBs.
     * 
     * @throws Exception
     */
-   public void testSlsbInstanceMetrics() throws Exception
+   public void testSlsb() throws Exception
    {
       // Log
-      this.getLog().info("testSlsbInstanceMetrics");
+      this.getLog().info("testSlsb");
 
-      // Get Component and ensure exists
-      final String ejbName = TestStatelessBean.class.getSimpleName();
-      final String suffix = MANAGEMENT_OBJECT_NAME_SUFFIX_INSTANCE;
-      final String componentName = ejbName + suffix;
+      // Ensure component exists.
+      final String ejbName = TestStatelessBean.class.getSimpleName();      
+      final String componentName = ejbName;
       final ManagedComponent component = this.getManagedComponent(COMPONENT_SUBTYPE_SLSB, componentName);
-
-      // Test
-      this.ensureManagementPropertiesExposed(component, PROPERTY_NAMES_SLSB_INSTANCE_METRICS);
-
+      
+      // Check component has expected props and ops.
+      this.ensureManagementPropertiesExposed(component, PROPERTY_NAMES_SLSB);
+      this.ensureManagementOperationsExposed(component, OPERATION_NAMES_SLSB);
+      
       //      ManagedProperty slsbStats = slsb.getProperty("stats");
       //      assertNotNull(slsbStats);
       //      TableValue table = (TableValue) slsbStats.getValue();
@@ -247,78 +230,41 @@
       //     SimpleValue simple = (SimpleValue ) currentSize.getValue();
       //     assertNotNull(simple);
       //     getLog().debug(simple);
-
    }
 
    /**
-    * Ensures that invocation metrics are exposed for SLSBs
-    * are in expected form 
+    * Ensures that MOs with the correct metrics and operations are exposed for SFSBs.
     * 
     * @throws Exception
     */
-   public void testSlsbInvocationMetrics() throws Exception
+   public void testSfsb() throws Exception
    {
       // Log
-      this.getLog().info("testSlsbInvocationMetrics");
+      this.getLog().info("testSfsb");
 
-      // Get Component and ensure exists
-      final String ejbName = TestStatelessBean.class.getSimpleName();
-      final String suffix = MANAGEMENT_OBJECT_NAME_SUFFIX_INVOCATION;
-      final String componentName = ejbName + suffix;
-      final ManagedComponent component = this.getManagedComponent(COMPONENT_SUBTYPE_SLSB, componentName);
-
-      // Test
-      this.ensureManagementPropertiesExposed(component, PROPERTY_NAMES_INVOCATION_METRICS);
-
-      // Test all operations exposed
-      this.ensureManagementOperationsExposed(component, OPERATION_NAMES_INVOCATION_METRICS);
-   }
-
-   /**
-    * Ensures that instance metrics are exposed for SFSBs
-    * (backed by the bean cache) in expected form 
-    * 
-    * @throws Exception
-    */
-   public void testSfsbInstanceMetrics() throws Exception
-   {
-      // Log
-      this.getLog().info("testSfsbInstanceMetrics");
-
-      // Get Component and ensure exists
+      // Ensure component exists.
       final String ejbName = TestStatefulBean.class.getSimpleName();
-      final String suffix = MANAGEMENT_OBJECT_NAME_SUFFIX_INSTANCE;
-      final String componentName = ejbName + suffix;
+      final String componentName = ejbName;
       final ManagedComponent component = this.getManagedComponent(COMPONENT_SUBTYPE_SFSB, componentName);
-
-      // Test
-      this.ensureManagementPropertiesExposed(component, PROPERTY_NAMES_SFSB_INSTANCE_METRICS);
+      
+      // Check component has expected props and ops.
+      this.ensureManagementPropertiesExposed(component, PROPERTY_NAMES_SFSB);      
+      this.ensureManagementOperationsExposed(component, OPERATION_NAMES_SFSB);
    }
 
    /**
-    * Ensures that invocation metrics are exposed for SFSBs
-    * are in expected form 
+    * Ensures that MOs with the correct metrics and operations are exposed for MDBs.
     * 
     * @throws Exception
     */
-   public void testSfsbInvocationMetrics() throws Exception
+   public void testMdb() throws Exception
    {
       // Log
-      this.getLog().info("testSfsbInvocationMetrics");
+      this.getLog().info("testMdb");
 
-      // Get Component and ensure exists
-      final String ejbName = TestStatefulBean.class.getSimpleName();
-      final String suffix = MANAGEMENT_OBJECT_NAME_SUFFIX_INVOCATION;
-      final String componentName = ejbName + suffix;
-      final ManagedComponent component = this.getManagedComponent(COMPONENT_SUBTYPE_SFSB, componentName);
-
-      // Test all properties exposed
-      this.ensureManagementPropertiesExposed(component, PROPERTY_NAMES_INVOCATION_METRICS);
-
-      // Test all operations exposed
-      this.ensureManagementOperationsExposed(component, OPERATION_NAMES_INVOCATION_METRICS);
+      // TODO
    }
-
+   
    // ---------------------------------------------------------------------------------------||
    // Internal Helper Methods ---------------------------------------------------------------||
    // ---------------------------------------------------------------------------------------||




More information about the jboss-cvs-commits mailing list