Author: ozizka(a)redhat.com
Date: 2009-04-23 13:46:05 -0400 (Thu, 23 Apr 2009)
New Revision: 323
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java
Log:
JBossASNodeTest updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java 2009-04-23
16:35:49 UTC (rev 322)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java 2009-04-23
17:46:05 UTC (rev 323)
@@ -12,6 +12,7 @@
import java.util.Properties;
import javax.management.JMException;
import org.apache.commons.lang.math.NumberUtils;
+import org.jboss.jopr.jsfunit.DebugUtils;
import org.jboss.jopr.jsfunit.EmbjoprTestCase;
import org.jboss.jopr.jsfunit.JMXUtils;
import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
@@ -26,11 +27,17 @@
public void testASNodeMetricsTab() throws EmbJoprTestException, IOException, JMException
{
+ String jbossConfig = ejtt.getJBossConfig();
+
+ // Go to the AS node.
+ String nodeText = "JBoss AS 5 ("+jbossConfig+")";
+ ejtt.getNavTree().getNodeByLabel(nodeText, true).click();
+
+
// JBoss App Server:${config} node
String pageText = client.getPageAsText();
// Whole page contains
- String jbossConfig = ejtt.getJBossConfig();
String pageHeaderText = "JBoss AS 5 ("+jbossConfig+")";
//assertTrue("Page doesn't contain the header: "+headerText,
pageText.contains(headerText));
assertTrue("Content doesn't contain the header: "+pageHeaderText,
@@ -85,7 +92,8 @@
properties.getProperty("Server Name"));
assertEquals("Resource Traits / Server Home Dir",
- String.format("%s/server/%s", ejtt.getJBossHomeDir(),
ejtt.getJBossConfig()),
+ //String.format("%s/server/%s", ejtt.getJBossHomeDir(),
ejtt.getJBossConfig()),
+ ejtt.getJBossHomeDir(),
properties.getProperty("Server Home Dir"));
@@ -106,9 +114,9 @@
log.info( headerText +" 1st: "+ metricsProps.toString() );
// Active Thread Count
- int threads1 = NumberUtils.toInt(metricsProps.getProperty("Active Thread
Count"));
- double memFree1 = NumberUtils.toDouble(metricsProps.getProperty("JVM Free
Memory"));
- double memTotal1 = NumberUtils.toDouble(metricsProps.getProperty("JVM Total
Memory"));
+ int threads1 = NumberUtils.toInt(metricsProps.getProperty("Active Thread
Count").replace(',', '.'));
+ double memFree1 = NumberUtils.toDouble(metricsProps.getProperty("JVM Free
Memory").replace(',', '.'));
+ double memTotal1 = NumberUtils.toDouble(metricsProps.getProperty("JVM Total
Memory").replace(',', '.'));
// Do some requests to add threads.
@@ -139,9 +147,9 @@
log.info( headerText +" 2nd: "+ metricsProps.toString() );
// Active Thread Count
- int threads2 = NumberUtils.toInt(metricsProps.getProperty("Active Thread
Count"));
- double memFree2 = NumberUtils.toDouble(metricsProps.getProperty("JVM Free
Memory"));
- double memTotal2 = NumberUtils.toDouble(metricsProps.getProperty("JVM Total
Memory"));
+ int threads2 = NumberUtils.toInt( metricsProps.getProperty("Active Thread
Count").replace(',', '.') );
+ double memFree2 = NumberUtils.toDouble(metricsProps.getProperty("JVM Free
Memory").replace(',', '.') );
+ double memTotal2 = NumberUtils.toDouble(metricsProps.getProperty("JVM Total
Memory").replace(',', '.') );
log.info( "Value | old | new ");
log.info( String.format("Threads: %d, %d", threads1, threads2) );
Show replies by date