Author: nickboldt
Date: 2008-12-19 11:35:21 -0500 (Fri, 19 Dec 2008)
New Revision: 12728
Added:
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/JMXCoreAllTests.java
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.ui.test/src/org/jboss/tools/jmx/ui/JMXUIAllTests.java
Removed:
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/AllTests.java
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultMBeanServerConnectionFactoryTest.java
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.ui.test/src/org/jboss/tools/jmx/ui/AllTests.java
Modified:
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java
Log:
[JBIDE-3401] backport from trunk
Deleted:
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/AllTests.java
===================================================================
---
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/AllTests.java 2008-12-19
16:26:55 UTC (rev 12727)
+++
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/AllTests.java 2008-12-19
16:35:21 UTC (rev 12728)
@@ -1,18 +0,0 @@
-package org.jboss.tools.jmx.core;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.jboss.tools.jmx.core.tests.DefaultMBeanServerConnectionFactoryTest;
-import org.jboss.tools.jmx.core.tests.DefaultProviderTest;
-import org.jboss.tools.jmx.core.tests.NodeBuilderTestCase;
-
-
-public class AllTests {
- public static Test suite() {
- TestSuite suite = new TestSuite();
- suite.addTestSuite(DefaultMBeanServerConnectionFactoryTest.class);
- suite.addTestSuite(DefaultProviderTest.class);
- suite.addTestSuite(NodeBuilderTestCase.class);
- return suite;
- }
-}
Added:
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/JMXCoreAllTests.java
===================================================================
---
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/JMXCoreAllTests.java
(rev 0)
+++
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/JMXCoreAllTests.java 2008-12-19
16:35:21 UTC (rev 12728)
@@ -0,0 +1,16 @@
+package org.jboss.tools.jmx.core;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.tools.jmx.core.tests.DefaultProviderTest;
+import org.jboss.tools.jmx.core.tests.NodeBuilderTestCase;
+
+
+public class JMXCoreAllTests {
+ public static Test suite() {
+ TestSuite suite = new TestSuite();
+ suite.addTestSuite(DefaultProviderTest.class);
+ suite.addTestSuite(NodeBuilderTestCase.class);
+ return suite;
+ }
+}
Deleted:
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultMBeanServerConnectionFactoryTest.java
===================================================================
---
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultMBeanServerConnectionFactoryTest.java 2008-12-19
16:26:55 UTC (rev 12727)
+++
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultMBeanServerConnectionFactoryTest.java 2008-12-19
16:35:21 UTC (rev 12728)
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Jeff Mesnil
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- *
http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-
-package org.jboss.tools.jmx.core.tests;
-
-import junit.framework.TestCase;
-
-public class DefaultMBeanServerConnectionFactoryTest extends TestCase {
-//
-// private String correctURL;
-//
-// private JMXConnectorServer cs;
-//
-// protected void setUp() throws Exception {
-// super.setUp();
-// MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
-// JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://");
//$NON-NLS-1$
-// cs = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mbs);
-// cs.start();
-// correctURL = cs.getAddress().toString();
-// System.out.println(correctURL);
-// }
-//
-// protected void tearDown() throws Exception {
-// cs.stop();
-// correctURL = null;
-// super.tearDown();
-// }
-//
-// public void testConnectToNullURL() throws Exception {
-// DefaultMBeanServerConnectionFactory factory = new
DefaultMBeanServerConnectionFactory();
-// try {
-// factory.createMBeanServerConnection(null);
-// fail("should not connect to null descriptor"); //$NON-NLS-1$
-// } catch (Exception e) {
-// }
-// }
-//
-// public void testConnectToBadURL() throws Exception {
-// DefaultMBeanServerConnectionFactory factory = new
DefaultMBeanServerConnectionFactory();
-// MBeanServerConnectionDescriptor descriptor = new
MBeanServerConnectionDescriptor(UUID.randomUUID().toString(),
"service:whatever", null, null);
-// try {
-// factory.createMBeanServerConnection(descriptor);
-// fail("should not connect to bad URL"); //$NON-NLS-1$
-// } catch (Exception e) {
-// }
-// }
-//
-// public void testConnectToURL() throws Exception {
-// DefaultMBeanServerConnectionFactory factory = new
DefaultMBeanServerConnectionFactory();
-// MBeanServerConnectionDescriptor descriptor = new
MBeanServerConnectionDescriptor(correctURL, correctURL, null, null);
-// MBeanServerConnection mbsc = factory.createMBeanServerConnection(descriptor);
-// assertNotNull(mbsc);
-// }
-}
Modified:
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java
===================================================================
---
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java 2008-12-19
16:26:55 UTC (rev 12727)
+++
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java 2008-12-19
16:35:21 UTC (rev 12728)
@@ -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();
Deleted:
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.ui.test/src/org/jboss/tools/jmx/ui/AllTests.java
===================================================================
---
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.ui.test/src/org/jboss/tools/jmx/ui/AllTests.java 2008-12-19
16:26:55 UTC (rev 12727)
+++
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.ui.test/src/org/jboss/tools/jmx/ui/AllTests.java 2008-12-19
16:35:21 UTC (rev 12728)
@@ -1,14 +0,0 @@
-package org.jboss.tools.jmx.ui;
-import org.jboss.tools.jmx.ui.internal.MBeanUtilsTestCase;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-public class AllTests {
- public static Test suite() {
- TestSuite suite = new TestSuite();
- suite.addTestSuite(MBeanUtilsTestCase.class);
- return suite;
- }
-}
Added:
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.ui.test/src/org/jboss/tools/jmx/ui/JMXUIAllTests.java
===================================================================
---
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.ui.test/src/org/jboss/tools/jmx/ui/JMXUIAllTests.java
(rev 0)
+++
branches/jbosstools-3.0.0.CR1/jmx/tests/org.jboss.tools.jmx.ui.test/src/org/jboss/tools/jmx/ui/JMXUIAllTests.java 2008-12-19
16:35:21 UTC (rev 12728)
@@ -0,0 +1,14 @@
+package org.jboss.tools.jmx.ui;
+import org.jboss.tools.jmx.ui.internal.MBeanUtilsTestCase;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+public class JMXUIAllTests {
+ public static Test suite() {
+ TestSuite suite = new TestSuite();
+ suite.addTestSuite(MBeanUtilsTestCase.class);
+ return suite;
+ }
+}