Author: rob.stryker(a)jboss.com
Date: 2008-12-15 18:24:53 -0500 (Mon, 15 Dec 2008)
New Revision: 12609
Added:
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSamplerMBean.java
Removed:
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSamplerMXBean.java
Modified:
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSampler.java
trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java
Log:
unit test fixes
Modified:
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSampler.java
===================================================================
---
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSampler.java 2008-12-15
23:02:18 UTC (rev 12608)
+++
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSampler.java 2008-12-15
23:24:53 UTC (rev 12609)
@@ -9,7 +9,7 @@
import java.util.Date;
import java.util.Queue;
-public class QueueSampler implements QueueSamplerMXBean {
+public class QueueSampler implements QueueSamplerMBean {
private Queue<String> queue;
Copied:
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSamplerMBean.java
(from rev 12599,
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSamplerMXBean.java)
===================================================================
---
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSamplerMBean.java
(rev 0)
+++
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSamplerMBean.java 2008-12-15
23:24:53 UTC (rev 12609)
@@ -0,0 +1,12 @@
+/*
+ * QueueSamplerMXBean.java - MXBean interface describing the management
+ * operations and attributes for the QueueSampler MXBean. In this case
+ * there is a read-only attribute "QueueSample" and an operation
"clearQueue".
+ */
+
+package com.example;
+
+public interface QueueSamplerMBean {
+ public QueueSample getQueueSample();
+ public void clearQueue();
+}
Property changes on:
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSamplerMBean.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted:
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSamplerMXBean.java
===================================================================
---
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSamplerMXBean.java 2008-12-15
23:02:18 UTC (rev 12608)
+++
trunk/jmx/tests/org.jboss.tools.jmx.core.test/projects/JMX_EXAMPLE/src/com/example/QueueSamplerMXBean.java 2008-12-15
23:24:53 UTC (rev 12609)
@@ -1,12 +0,0 @@
-/*
- * QueueSamplerMXBean.java - MXBean interface describing the management
- * operations and attributes for the QueueSampler MXBean. In this case
- * there is a read-only attribute "QueueSample" and an operation
"clearQueue".
- */
-
-package com.example;
-
-public interface QueueSamplerMXBean {
- public QueueSample getQueueSample();
- public void clearQueue();
-}
Modified:
trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java
===================================================================
---
trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java 2008-12-15
23:02:18 UTC (rev 12608)
+++
trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java 2008-12-15
23:24:53 UTC (rev 12609)
@@ -20,12 +20,16 @@
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.IStreamListener;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.jboss.tools.jmx.core.ExtensionManager;
import org.jboss.tools.jmx.core.IConnectionProvider;
import org.jboss.tools.jmx.core.IConnectionWrapper;
import org.jboss.tools.jmx.core.providers.DefaultConnectionProvider;
import org.jboss.tools.jmx.core.tests.util.TestProjectProvider;
+import org.jboss.tools.jmx.core.tree.DomainNode;
import org.jboss.tools.jmx.core.tree.Node;
import org.jboss.tools.jmx.core.tree.Root;
@@ -81,6 +85,20 @@
ILaunchConfigurationWorkingCopy wc = createLaunch();
ILaunch launch = wc.launch("run", new NullProgressMonitor());
+ /* */
+ IProcess p = launch.getProcesses()[0];
+ p.getStreamsProxy().getErrorStreamMonitor().addListener(new IStreamListener() {
+ public void streamAppended(String text, IStreamMonitor monitor) {
+ System.out.println("[error] " + text);
+ }
+ });
+ p.getStreamsProxy().getOutputStreamMonitor().addListener(new IStreamListener() {
+ public void streamAppended(String text, IStreamMonitor monitor) {
+ System.out.println("[out] " + text);
+ }
+ });
+
+ /* */
Thread.sleep(10000);
try {
@@ -105,7 +123,14 @@
Node[] children = root.getChildren();
assertTrue("children were null", children != null);
- assertEquals("Example had the wrong number of domains", 5,
children.length);
+ assertTrue("children length was less than 1", children.length >= 0);
+
+ boolean found = false;
+ for( int i = 0; i < children.length; i++ )
+ if( children[i] instanceof DomainNode &&
((DomainNode)children[i]).getDomain().equals("com.example"))
+ found = true;
+
+ assertTrue("Domain \"com.example\" not found", found);
} finally {
projectProvider.dispose();
launch.terminate();
Show replies by date