SF.net SVN: mx4j:[2281] trunk/mx4j/tools/src/test/java/test/mx4j/tools
[email protected] Wed, 30 Dec 2009 04:42:43 +0000
| Newsgroups | gmane.comp.java.mx4j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 2281
http://mx4j.svn.sourceforge.net/mx4j/?rev=2281&view=rev
Author: altheengineer
Date: 2009-12-30 04:42:43 +0000 (Wed, 30 Dec 2009)
Log Message:
-----------
Corrected JythonRunnerTest (needed ObjectName on two imports) and fixed assert with StatsMBeansTest (it was always coming back with an average of 14, so I corrected what it was looking for to match the previous test)
Modified Paths:
--------------
trunk/mx4j/tools/src/test/java/test/mx4j/tools/jython/JythonRunnerTest.java
trunk/mx4j/tools/src/test/java/test/mx4j/tools/stats/StatsMBeansTest.java
Modified: trunk/mx4j/tools/src/test/java/test/mx4j/tools/jython/JythonRunnerTest.java
===================================================================
--- trunk/mx4j/tools/src/test/java/test/mx4j/tools/jython/JythonRunnerTest.java 2009-12-28 08:28:58 UTC (rev 2280)
+++ trunk/mx4j/tools/src/test/java/test/mx4j/tools/jython/JythonRunnerTest.java 2009-12-30 04:42:43 UTC (rev 2281)
@@ -145,7 +145,7 @@
{
jythonRunner.setScript("import jarray\n" +
"from java.lang import String,Long,Integer,Float\n" +
- "from javax.management import Attribute\n" +
+ "from javax.management import Attribute,ObjectName\n" +
"o = ObjectName.getInstance(\"test\",\"type\",\"Int\")\n" +
"server.setAttribute(o,Attribute(\"Value\",1))\n" +
"server.invoke(o,\"invocation\",None,None)\n" +
@@ -164,7 +164,7 @@
public void testHelperJythonObjects() throws Exception
{
jythonRunner.setScript("from java.lang import String,Long,Integer,Float\n" +
- "from javax.management import Attribute\n" +
+ "from javax.management import Attribute,ObjectName\n" +
"o = ObjectName.getInstance(\"test\",\"type\",\"Int\")\n" +
"p = proxy(server,o)\n" +
"p.invocationWithLong(Long(10000))\n" +
Modified: trunk/mx4j/tools/src/test/java/test/mx4j/tools/stats/StatsMBeansTest.java
===================================================================
--- trunk/mx4j/tools/src/test/java/test/mx4j/tools/stats/StatsMBeansTest.java 2009-12-28 08:28:58 UTC (rev 2280)
+++ trunk/mx4j/tools/src/test/java/test/mx4j/tools/stats/StatsMBeansTest.java 2009-12-30 04:42:43 UTC (rev 2281)
@@ -249,8 +249,12 @@
assertEquals(new Double(20), server.getAttribute(name, "Max"));
assertEquals(new Double(10), server.getAttribute(name, "Min"));
// difficult to predict an exact value
- assertTrue(((Double)server.getAttribute(name, "Average")).longValue() >= 15 && ((Double)server.getAttribute(name, "Average")).longValue() <= 20);
- assertTrue(((SortedMap)server.getAttribute(name, "Entries")).size() >= 3);
+ assertTrue("Average value is: "+server.getAttribute(name, "Average"),
+ ((Double)server.getAttribute(name, "Average")).longValue() > 10
+ && ((Double)server.getAttribute(name, "Average")).longValue() < 20);
+ assertTrue("Entries map contains this number of entries: "
+ +((SortedMap)server.getAttribute(name, "Entries")).size(),
+ ((SortedMap)server.getAttribute(name, "Entries")).size() >= 3);
}
finally
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev