[jboss-cvs] JBossAS SVN: r81444 - trunk/testsuite/src/main/org/jboss/test/profileservice/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Nov 21 11:41:46 EST 2008
Author: scott.stark at jboss.org
Date: 2008-11-21 11:41:45 -0500 (Fri, 21 Nov 2008)
New Revision: 81444
Modified:
trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
JBAS-6198, test the expected DS op return values are MetaValues
Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java 2008-11-21 16:26:49 UTC (rev 81443)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java 2008-11-21 16:41:45 UTC (rev 81444)
@@ -524,7 +524,9 @@
}
/**
- * Validate that the DefaultDS management ops work
+ * Validate that the DefaultDS management ops work and that they have the
+ * expected MetaValue return type.
+ *
* @throws Exception
*/
public void testDefaultDSOps()
@@ -538,19 +540,28 @@
assertNotNull("Set<ManagedOperation>", ops);
assertTrue("Set<ManagedOperation> > 0", ops.size() > 0);
ManagedOperation listFormattedSubPoolStatistics = null;
+ HashMap<String, ManagedOperation> opsByName = new HashMap<String, ManagedOperation>();
for (ManagedOperation op : ops)
{
- if (op.getName().equals("listFormattedSubPoolStatistics"))
- {
- listFormattedSubPoolStatistics = op;
- break;
- }
+ opsByName.put(op.getName(), op);
}
+ // Validate the listFormattedSubPoolStatistics op
+ listFormattedSubPoolStatistics = opsByName.get("listFormattedSubPoolStatistics");
assertNotNull("listFormattedSubPoolStatistics", listFormattedSubPoolStatistics);
MetaValue[] params = {};
Object result = listFormattedSubPoolStatistics.invoke(params);
assertNotNull("Expecting non null result", result);
log.info("listFormattedSubPoolStatistics.invoke: "+result);
+ // It needs to be a MetaValue as well
+ assertTrue("result is a MetaValue", result instanceof MetaValue);
+ // Validate the listStatistics op
+ ManagedOperation listStatistics = opsByName.get("listStatistics");
+ assertNotNull("listStatistics", listStatistics);
+ result = listStatistics.invoke(params);
+ assertNotNull("Expecting non null result", result);
+ log.info("listStatistics.invoke: "+result);
+ // It needs to be a MetaValue as well
+ assertTrue("result is a MetaValue", result instanceof MetaValue);
}
/**
More information about the jboss-cvs-commits
mailing list