[jboss-cvs] JBossAS SVN: r69755 - trunk/testsuite/src/main/org/jboss/test/profileservice/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Feb 9 15:53:27 EST 2008


Author: scott.stark at jboss.org
Date: 2008-02-09 15:53:27 -0500 (Sat, 09 Feb 2008)
New Revision: 69755

Modified:
   trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
Add testDefaultDSPropertiesAreMetaValues

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2008-02-09 20:39:33 UTC (rev 69754)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2008-02-09 20:53:27 UTC (rev 69755)
@@ -330,7 +330,7 @@
       log.info("+++ testUpdateDefaultDS");
       ManagementView mgtView = getManagementView();
       ComponentType type = new ComponentType("DataSource", "LocalTx");
-      ManagedComponent hsqldb = getManagedComponent(mgtView, type, "DefaultDS");
+      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
       Map<String,ManagedProperty> props = hsqldb.getProperties();
       log.info("hsqldb.props: "+props);
       // Update properties
@@ -346,14 +346,40 @@
       // TODO: Query the profile service repository for the overriden data
    }
 
+   /**
+    * Validate that all ManagedPropertys are values are of type MetaValue
+    * @throws Exception
+    */
+   public void testDefaultDSPropertiesAreMetaValues()
+      throws Exception
+   {
+      ManagementView mgtView = getManagementView();
+      ComponentType type = new ComponentType("DataSource", "LocalTx");
+      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
+      Map<String,ManagedProperty> props = hsqldb.getProperties();
+      HashMap<String, Object> invalidValues = new HashMap<String, Object>();
+      HashMap<String, Object> nullValues = new HashMap<String, Object>();
+      for(ManagedProperty prop : props.values())
+      {
+         Object value = prop.getValue();
+         if((value instanceof MetaValue) == false)
+         {
+            if(value == null)
+               nullValues.put(prop.getName(), value);
+            else
+               invalidValues.put(prop.getName(), value);
+         }
+      }
+      log.info("Propertys with null values: "+nullValues);
+      assertEquals("InvalidPropertys: "+invalidValues, 0, invalidValues.size());
+   }
+
    public void testDefaultDSStats()
       throws Exception
    {
       ManagementView mgtView = getManagementView();
       ComponentType type = new ComponentType("DataSource", "LocalTx");
-      ManagedComponent hsqldb = getManagedComponent(mgtView, type, "DefaultDS");
-      Set<ManagedOperation> ops = hsqldb.getOperations();
-      assertNotNull(ops);
+      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
       Map<String,ManagedProperty> props = hsqldb.getProperties();
       boolean sawStats = false;
       for(ManagedProperty prop : props.values())
@@ -382,10 +408,9 @@
    public void testDefaultDSOps()
       throws Exception
    {
-      log.info("+++ testDefaultDSOps");
       ManagementView mgtView = getManagementView();
       ComponentType type = new ComponentType("DataSource", "LocalTx");
-      ManagedComponent hsqldb = getManagedComponent(mgtView, type, "DefaultDS");
+      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
       Set<ManagedOperation> ops = hsqldb.getOperations();
       log.info("DefaultDS ops: "+ops);
       assertNotNull("Set<ManagedOperation>", ops);




More information about the jboss-cvs-commits mailing list