SF.net SVN: mx4j: [2257] trunk/mx4j
[email protected] Tue, 20 Mar 2007 14:07:53 -0700
| Newsgroups | gmane.comp.java.mx4j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 2257
http://svn.sourceforge.net/mx4j/?rev=2257&view=rev
Author: simonebordet
Date: 2007-03-20 14:07:51 -0700 (Tue, 20 Mar 2007)
Log Message:
-----------
Tests package reorganization.
Modified Paths:
--------------
trunk/mx4j/examples/pom.xml
trunk/mx4j/jsr003/pom.xml
trunk/mx4j/jsr160/pom.xml
trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorFactoryTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorInvocationTestCase.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorServerFactoryTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorServerTestCase.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorTestCase.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXNotificationsTestCase.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXServiceURLTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/RemoteSecurityManagerTestCase.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/compliance/OptionalRemoteJMXComplianceTestCase.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/compliance/RemoteJMXComplianceTestCase.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/compliance/serialization/OptionalRemoteJMXSerializationTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/compliance/serialization/RemoteJMXSerializationTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/compliance/serialization/support/OptionalRemoteComparator.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/compliance/serialization/support/OptionalRemoteInstantiator.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/compliance/serialization/support/RemoteComparator.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/compliance/serialization/support/RemoteInstantiator.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/compliance/signature/OptionalRemoteJMXSignatureTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/compliance/signature/RemoteJMXSignatureTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIConnectorServerTestCase.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIConnectorTestCase.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIIIOPConnectorInvocationTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIIIOPConnectorServerTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIIIOPConnectorTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIIIOPNotificationsTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIInteroperabilityTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIJRMPConnectorInvocationTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIJRMPConnectorServerTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIJRMPConnectorTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIJRMPMultiThreadMBeanServerConnectionTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIJRMPNotificationsTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIJRMPRemoteSecurityManagerTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMIMarshallingTest.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/rmi/RMITestCase.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/support/Marshalling.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/support/MarshallingMBean.java
trunk/mx4j/jsr160/src/test/java/javax/management/remote/support/Unknown.java
trunk/mx4j/jsr160/src/test/java/mx4j/remote/RemoteNotificationClientHandlerTest.java
trunk/mx4j/jsr160/src/test/java/mx4j/remote/RemoteNotificationServerHandlerTest.java
trunk/mx4j/pom.xml
trunk/mx4j/tests/pom.xml
trunk/mx4j/tools/pom.xml
Modified: trunk/mx4j/examples/pom.xml
===================================================================
--- trunk/mx4j/examples/pom.xml 2006-12-13 14:35:43 UTC (rev 2256)
+++ trunk/mx4j/examples/pom.xml 2007-03-20 21:07:51 UTC (rev 2257)
@@ -4,7 +4,7 @@
<parent>
<groupId>mx4j</groupId>
<artifactId>mx4j</artifactId>
- <version>3.1.0-SNAPSHOT</version>
+ <version>${mx4jVersion}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -47,17 +47,17 @@
<dependency>
<groupId>mx4j</groupId>
<artifactId>mx4j-jsr003</artifactId>
- <version>${project.version}</version>
+ <version>${mx4jVersion}</version>
</dependency>
<dependency>
<groupId>mx4j</groupId>
<artifactId>mx4j-jsr160</artifactId>
- <version>${project.version}</version>
+ <version>${mx4jVersion}</version>
</dependency>
<dependency>
<groupId>mx4j</groupId>
<artifactId>mx4j-tools</artifactId>
- <version>${project.version}</version>
+ <version>${mx4jVersion}</version>
</dependency>
</dependencies>
Modified: trunk/mx4j/jsr003/pom.xml
===================================================================
--- trunk/mx4j/jsr003/pom.xml 2006-12-13 14:35:43 UTC (rev 2256)
+++ trunk/mx4j/jsr003/pom.xml 2007-03-20 21:07:51 UTC (rev 2257)
@@ -4,29 +4,34 @@
<parent>
<groupId>mx4j</groupId>
<artifactId>mx4j</artifactId>
- <version>3.1.0-SNAPSHOT</version>
+ <version>${mx4jVersion}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>mx4j</groupId>
<artifactId>mx4j-jsr003</artifactId>
- <name>MX4J :: JSR003</name>
+ <name>MX4J :: JSR 003</name>
<packaging>jar</packaging>
-
+
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <childDelegation>true</childDelegation>
- <!--includes>
- <include>BinaryOpValueExpTest.java</include>
- </includes-->
+ <!--<childDelegation>true</childDelegation>-->
+ <forkMode>always</forkMode>
+ <excludes>
+ <exclude>**/*SecurityManager*</exclude>
+ </excludes>
+<!--
+ <includes>
+ <include>**/management/*Test.java</include>
+ </includes>
+-->
</configuration>
</plugin>
</plugins>
</build>
-
<!--
<profiles>
<profile>
@@ -53,22 +58,21 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- <version>1.2.8</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.bcel</groupId>
<artifactId>bcel</artifactId>
- <version>5.2</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>mx4j</groupId>
<artifactId>mx4j-tests</artifactId>
- <version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Modified: trunk/mx4j/jsr160/pom.xml
===================================================================
--- trunk/mx4j/jsr160/pom.xml 2006-12-13 14:35:43 UTC (rev 2256)
+++ trunk/mx4j/jsr160/pom.xml 2007-03-20 21:07:51 UTC (rev 2257)
@@ -4,21 +4,25 @@
<parent>
<groupId>mx4j</groupId>
<artifactId>mx4j</artifactId>
- <version>3.1.0-SNAPSHOT</version>
+ <version>${mx4jVersion}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>mx4j</groupId>
<artifactId>mx4j-jsr160</artifactId>
- <name>MX4J :: JSR160</name>
+ <name>MX4J :: JSR 160</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>mx4j</groupId>
<artifactId>mx4j-jsr003</artifactId>
- <version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>mx4j</groupId>
+ <artifactId>mx4j-tests</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified: trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorFactoryTest.java
===================================================================
--- trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorFactoryTest.java 2006-12-13 14:35:43 UTC (rev 2256)
+++ trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorFactoryTest.java 2007-03-20 21:07:51 UTC (rev 2257)
@@ -6,27 +6,18 @@
* See the terms of the MX4J License in the documentation provided with this software.
*/
-package test.javax.management.remote;
+package javax.management.remote;
import java.net.MalformedURLException;
import java.util.HashMap;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXProviderException;
-import javax.management.remote.JMXServiceURL;
-import test.MX4JTestCase;
+import mx4j.MX4JTestCase;
/**
* @version $Revision$
*/
public class JMXConnectorFactoryTest extends MX4JTestCase
{
- public JMXConnectorFactoryTest(String s)
- {
- super(s);
- }
-
public void testInvalidURLs() throws Exception
{
try
Modified: trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorInvocationTestCase.java
===================================================================
--- trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorInvocationTestCase.java 2006-12-13 14:35:43 UTC (rev 2256)
+++ trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorInvocationTestCase.java 2007-03-20 21:07:51 UTC (rev 2257)
@@ -6,7 +6,7 @@
* See the terms of the MX4J License in the documentation provided with this software.
*/
-package test.javax.management.remote;
+package javax.management.remote;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -15,6 +15,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+
import javax.management.Attribute;
import javax.management.AttributeList;
import javax.management.AttributeNotFoundException;
@@ -27,476 +28,469 @@
import javax.management.ObjectInstance;
import javax.management.ObjectName;
import javax.management.RuntimeMBeanException;
-import javax.management.remote.JMXAuthenticator;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXConnectorServerFactory;
-import javax.management.remote.JMXPrincipal;
-import javax.management.remote.JMXServiceURL;
import javax.security.auth.Subject;
-import test.MX4JTestCase;
+import mx4j.MX4JTestCase;
/**
* @version $Revision$
*/
public abstract class JMXConnectorInvocationTestCase extends MX4JTestCase
{
- private JMXConnectorServer connectorServer;
+ private JMXConnectorServer connectorServer;
- public JMXConnectorInvocationTestCase(String name)
- {
- super(name);
- }
+ public abstract JMXServiceURL createJMXConnectorServerAddress() throws MalformedURLException;
- public abstract JMXServiceURL createJMXConnectorServerAddress() throws MalformedURLException;
+ public abstract Map getEnvironment();
- public abstract Map getEnvironment();
+ private MBeanServer newMBeanServer()
+ {
+ return MBeanServerFactory.newMBeanServer();
+ }
- private MBeanServerConnection getMBeanServerConnection(MBeanServer server) throws IOException
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
- connectorServer.start();
- sleep(5000);
- JMXConnector connector = JMXConnectorFactory.connect(connectorServer.getAddress(), getEnvironment());
- return connector.getMBeanServerConnection();
- }
+ private MBeanServerConnection getMBeanServerConnection(MBeanServer server) throws IOException
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
+ connectorServer.start();
+ sleep(5000);
+ JMXConnector connector = JMXConnectorFactory.connect(connectorServer.getAddress(), getEnvironment());
+ return connector.getMBeanServerConnection();
+ }
- protected void tearDown() throws Exception
- {
- if (connectorServer != null) connectorServer.stop();
- sleep(5000);
- }
+ protected void tearDown() throws Exception
+ {
+ if (connectorServer != null) connectorServer.stop();
+ sleep(5000);
+ }
- public void testCallToMBeanServerWithAttributeNotFoundException() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- try
- {
- // The attribute does not exist
- mbsc.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "dummy");
- fail();
- }
- catch (AttributeNotFoundException e)
- {
- }
- }
+ public void testCallToMBeanServerWithAttributeNotFoundException() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ try
+ {
+ // The attribute does not exist
+ mbsc.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "dummy");
+ fail();
+ }
+ catch (AttributeNotFoundException e)
+ {
+ }
+ }
- public void testCallToMBeanServerWithInstanceNotFoundException() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- try
- {
- // The mbean does not exist
- mbsc.getAttribute(new ObjectName(":type=dummy"), "ImplementationVersion");
- fail();
- }
- catch (InstanceNotFoundException x)
- {
- }
- }
+ public void testCallToMBeanServerWithInstanceNotFoundException() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ try
+ {
+ // The mbean does not exist
+ mbsc.getAttribute(new ObjectName(":type=dummy"), "ImplementationVersion");
+ fail();
+ }
+ catch (InstanceNotFoundException x)
+ {
+ }
+ }
- public void testCreateMBeanWith3Params() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
- }
+ public void testCreateMBeanWith3Params() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
+ }
- public void testCreateMBeanWith5Params() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- String value = "mx4j";
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null, new Object[]{value}, new String[]{String.class.getName()});
- assertNotNull(instance);
+ public void testCreateMBeanWith5Params() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ String value = "mx4j";
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null, new Object[]{value}, new String[]{String.class.getName()});
+ assertNotNull(instance);
- // Be sure the argument arrived to the MBean
- String result = (String)mbsc.getAttribute(name, "Name");
- assertEquals(result, value);
- }
+ // Be sure the argument arrived to the MBean
+ String result = (String)mbsc.getAttribute(name, "Name");
+ assertEquals(result, value);
+ }
- public void testGetAttribute() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- String value = "mx4j";
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null, new Object[]{value}, new String[]{String.class.getName()});
- assertNotNull(instance);
+ public void testGetAttribute() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ String value = "mx4j";
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null, new Object[]{value}, new String[]{String.class.getName()});
+ assertNotNull(instance);
- // Be sure the argument arrived to the MBean
- String result = (String)mbsc.getAttribute(name, "Name");
- assertEquals(result, value);
- }
+ // Be sure the argument arrived to the MBean
+ String result = (String)mbsc.getAttribute(name, "Name");
+ assertEquals(result, value);
+ }
- public void testGetAttributes() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- String value = "mx4j";
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null, new Object[]{value}, new String[]{String.class.getName()});
- assertNotNull(instance);
+ public void testGetAttributes() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ String value = "mx4j";
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null, new Object[]{value}, new String[]{String.class.getName()});
+ assertNotNull(instance);
- // Be sure the argument arrived to the MBean
- String attribute = "Name";
- String[] attributes = new String[]{attribute};
- AttributeList result = mbsc.getAttributes(name, attributes);
- assertNotNull(result);
- assertEquals(result.size(), attributes.length);
- assertEquals(((Attribute)result.get(0)).getName(), attribute);
- assertEquals(((Attribute)result.get(0)).getValue(), value);
- }
+ // Be sure the argument arrived to the MBean
+ String attribute = "Name";
+ String[] attributes = new String[]{attribute};
+ AttributeList result = mbsc.getAttributes(name, attributes);
+ assertNotNull(result);
+ assertEquals(result.size(), attributes.length);
+ assertEquals(((Attribute)result.get(0)).getName(), attribute);
+ assertEquals(((Attribute)result.get(0)).getValue(), value);
+ }
- public void testGetDefaultDomain() throws Exception
- {
- String domain = "DOMAIN";
- MBeanServer server = MBeanServerFactory.newMBeanServer(domain);
- MBeanServerConnection mbsc = getMBeanServerConnection(server);
+ public void testGetDefaultDomain() throws Exception
+ {
+ String domain = "DOMAIN";
+ MBeanServer server = MBeanServerFactory.newMBeanServer(domain);
+ MBeanServerConnection mbsc = getMBeanServerConnection(server);
- String defaultDomain = mbsc.getDefaultDomain();
- assertEquals(defaultDomain, domain);
- }
+ String defaultDomain = mbsc.getDefaultDomain();
+ assertEquals(defaultDomain, domain);
+ }
- public void testGetDomains() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ public void testGetDomains() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- String[] domains = mbsc.getDomains();
- if (domains.length < 1) fail();
- }
+ String[] domains = mbsc.getDomains();
+ if (domains.length < 1) fail();
+ }
- public void testGetMBeanCount() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ public void testGetMBeanCount() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- Integer count = mbsc.getMBeanCount();
- if (count.intValue() < 1) fail();
- }
+ Integer count = mbsc.getMBeanCount();
+ if (count.intValue() < 1) fail();
+ }
- public void testGetMBeanInfo() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ public void testGetMBeanInfo() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("JMImplementation", "type", "MBeanServerDelegate");
- MBeanInfo info = mbsc.getMBeanInfo(name);
- assertNotNull(info);
- if (info.getAttributes().length < 1) fail();
- }
+ ObjectName name = ObjectName.getInstance("JMImplementation", "type", "MBeanServerDelegate");
+ MBeanInfo info = mbsc.getMBeanInfo(name);
+ assertNotNull(info);
+ if (info.getAttributes().length < 1) fail();
+ }
- public void testGetObjectInstance() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ public void testGetObjectInstance() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- ObjectInstance result = mbsc.getObjectInstance(name);
- assertNotNull(result);
- assertEquals(result, instance);
- }
+ ObjectInstance result = mbsc.getObjectInstance(name);
+ assertNotNull(result);
+ assertEquals(result, instance);
+ }
- public void testInvoke() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ public void testInvoke() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- String value = "value";
- String result = (String)mbsc.invoke(name, "echo", new Object[]{value}, new String[]{String.class.getName()});
- assertNotNull(result);
- assertEquals(result, value);
- }
+ String value = "value";
+ String result = (String)mbsc.invoke(name, "echo", new Object[]{value}, new String[]{String.class.getName()});
+ assertNotNull(result);
+ assertEquals(result, value);
+ }
- public void testInvokeThrowsCustomException() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ public void testInvokeThrowsCustomException() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- try
- {
- mbsc.invoke(name, "throwCustomException", null, null);
- }
- catch (MBeanException x)
- {
- Exception xx = x.getTargetException();
- if (xx != null && xx.getClass() != SupportException.class) fail();
- }
- }
+ try
+ {
+ mbsc.invoke(name, "throwCustomException", null, null);
+ }
+ catch (MBeanException x)
+ {
+ Exception xx = x.getTargetException();
+ if (xx != null && xx.getClass() != SupportException.class) fail();
+ }
+ }
- public void testInvokeThrowsRuntimeException() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ public void testInvokeThrowsRuntimeException() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- try
- {
- mbsc.invoke(name, "throwRuntimeException", null, null);
- }
- catch (RuntimeMBeanException x)
- {
- Exception xx = x.getTargetException();
- if (xx != null && xx.getClass() != IllegalArgumentException.class) fail();
- }
- }
+ try
+ {
+ mbsc.invoke(name, "throwRuntimeException", null, null);
+ }
+ catch (RuntimeMBeanException x)
+ {
+ Exception xx = x.getTargetException();
+ if (xx != null && xx.getClass() != IllegalArgumentException.class) fail();
+ }
+ }
- public void testIsInstanceOf() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ public void testIsInstanceOf() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- boolean isInstanceOf = mbsc.isInstanceOf(name, Support.class.getName());
- if (!isInstanceOf) fail("Class");
+ boolean isInstanceOf = mbsc.isInstanceOf(name, Support.class.getName());
+ if (!isInstanceOf) fail("Class");
- isInstanceOf = mbsc.isInstanceOf(name, SupportMBean.class.getName());
- if (!isInstanceOf) fail("Interface");
- }
+ isInstanceOf = mbsc.isInstanceOf(name, SupportMBean.class.getName());
+ if (!isInstanceOf) fail("Interface");
+ }
- public void testIsRegistered() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ public void testIsRegistered() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- boolean isRegistered = mbsc.isRegistered(name);
- if (!isRegistered) fail();
- }
+ boolean isRegistered = mbsc.isRegistered(name);
+ if (!isRegistered) fail();
+ }
- public void testQueryMBeansNullNull() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ public void testQueryMBeansNullNull() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- Set mbeans = mbsc.queryMBeans(null, null);
- assertNotNull(mbeans);
- if (mbeans.size() < 1) fail();
- }
+ Set mbeans = mbsc.queryMBeans(null, null);
+ assertNotNull(mbeans);
+ if (mbeans.size() < 1) fail();
+ }
- public void testQueryMBeansObjectNameNull() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ public void testQueryMBeansObjectNameNull() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- Set mbeans = mbsc.queryMBeans(ObjectName.getInstance("JMImplementation:*"), null);
- assertNotNull(mbeans);
- if (mbeans.size() < 1) fail();
- }
+ Set mbeans = mbsc.queryMBeans(ObjectName.getInstance("JMImplementation:*"), null);
+ assertNotNull(mbeans);
+ if (mbeans.size() < 1) fail();
+ }
- public void testQueryMBeansObjectNameQueryExp() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ public void testQueryMBeansObjectNameQueryExp() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- Set mbeans = mbsc.queryMBeans(ObjectName.getInstance("JMImplementation:*"), new ObjectName("*:type=MBeanServerDelegate"));
- assertNotNull(mbeans);
- if (mbeans.size() != 1) fail();
- }
+ Set mbeans = mbsc.queryMBeans(ObjectName.getInstance("JMImplementation:*"), new ObjectName("*:type=MBeanServerDelegate"));
+ assertNotNull(mbeans);
+ if (mbeans.size() != 1) fail();
+ }
- public void testSetAttribute() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ public void testSetAttribute() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- String attribute = "Name";
- String value = "mx4j";
- mbsc.setAttribute(name, new Attribute(attribute, value));
+ String attribute = "Name";
+ String value = "mx4j";
+ mbsc.setAttribute(name, new Attribute(attribute, value));
- String result = (String)mbsc.getAttribute(name, attribute);
- assertEquals(result, value);
- }
+ String result = (String)mbsc.getAttribute(name, attribute);
+ assertEquals(result, value);
+ }
- public void testSetAttributes() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ public void testSetAttributes() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- String attribute = "Name";
- String value = "mx4j";
- AttributeList attributes = new AttributeList();
- attributes.add(new Attribute(attribute, value));
- AttributeList result = mbsc.setAttributes(name, attributes);
- assertNotNull(result);
- assertEquals(result, attributes);
- }
+ String attribute = "Name";
+ String value = "mx4j";
+ AttributeList attributes = new AttributeList();
+ attributes.add(new Attribute(attribute, value));
+ AttributeList result = mbsc.setAttributes(name, attributes);
+ assertNotNull(result);
+ assertEquals(result, attributes);
+ }
- public void testUnregisterMBean() throws Exception
- {
- MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ public void testUnregisterMBean() throws Exception
+ {
+ MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- mbsc.unregisterMBean(name);
- if (mbsc.isRegistered(name)) fail();
- }
+ mbsc.unregisterMBean(name);
+ if (mbsc.isRegistered(name)) fail();
+ }
- public void testAuthenticatedInvoke() throws Exception
- {
- final String principalName = "authenticatedPrincipal";
+ public void testAuthenticatedInvoke() throws Exception
+ {
+ final String principalName = "authenticatedPrincipal";
- JMXServiceURL url = createJMXConnectorServerAddress();
- Map serverEnv = getEnvironment();
- serverEnv.put(JMXConnectorServer.AUTHENTICATOR, new JMXAuthenticator()
- {
- public Subject authenticate(Object credentials) throws SecurityException
- {
- Set principals = new HashSet();
- principals.add(new JMXPrincipal(principalName));
- return new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
- }
- });
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ Map serverEnv = getEnvironment();
+ serverEnv.put(JMXConnectorServer.AUTHENTICATOR, new JMXAuthenticator()
+ {
+ public Subject authenticate(Object credentials) throws SecurityException
+ {
+ Set principals = new HashSet();
+ principals.add(new JMXPrincipal(principalName));
+ return new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
+ }
+ });
- JMXConnectorServer cntorServer = null;
- try
- {
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, newMBeanServer());
- cntorServer.start();
+ JMXConnectorServer cntorServer = null;
+ try
+ {
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, newMBeanServer());
+ cntorServer.start();
- Map clientEnv = getEnvironment();
- clientEnv.put(JMXConnector.CREDENTIALS, new String[0]);
+ Map clientEnv = getEnvironment();
+ clientEnv.put(JMXConnector.CREDENTIALS, new String[0]);
- JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), clientEnv);
- MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
+ JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), clientEnv);
+ MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- Boolean result = (Boolean)mbsc.invoke(name, "authenticated", new Object[]{principalName}, new String[]{String.class.getName()});
- assertTrue(result.booleanValue());
- }
- finally
- {
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ Boolean result = (Boolean)mbsc.invoke(name, "authenticated", new Object[]{principalName}, new String[]{String.class.getName()});
+ assertTrue(result.booleanValue());
+ }
+ finally
+ {
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public void testDelegatedInvoke() throws Exception
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- Map serverEnv = getEnvironment();
- serverEnv.put(JMXConnectorServer.AUTHENTICATOR, new JMXAuthenticator()
- {
- public Subject authenticate(Object credentials) throws SecurityException
- {
- Set principals = new HashSet();
- principals.add(new JMXPrincipal("authenticatedPrincipal"));
- return new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
- }
- });
- JMXConnectorServer cntorServer = null;
- try
- {
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, newMBeanServer());
- cntorServer.start();
+ public void testDelegatedInvoke() throws Exception
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ Map serverEnv = getEnvironment();
+ serverEnv.put(JMXConnectorServer.AUTHENTICATOR, new JMXAuthenticator()
+ {
+ public Subject authenticate(Object credentials) throws SecurityException
+ {
+ Set principals = new HashSet();
+ principals.add(new JMXPrincipal("authenticatedPrincipal"));
+ return new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
+ }
+ });
+ JMXConnectorServer cntorServer = null;
+ try
+ {
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, newMBeanServer());
+ cntorServer.start();
- Map clientEnv = getEnvironment();
- clientEnv.put(JMXConnector.CREDENTIALS, new String[0]);
+ Map clientEnv = getEnvironment();
+ clientEnv.put(JMXConnector.CREDENTIALS, new String[0]);
- JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), clientEnv);
- Set principals = new HashSet();
- String delegatedName = "delegatedPrincipal";
- principals.add(new JMXPrincipal(delegatedName));
- Subject delegate = new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
- MBeanServerConnection mbsc = cntor.getMBeanServerConnection(delegate);
+ JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), clientEnv);
+ Set principals = new HashSet();
+ String delegatedName = "delegatedPrincipal";
+ principals.add(new JMXPrincipal(delegatedName));
+ Subject delegate = new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
+ MBeanServerConnection mbsc = cntor.getMBeanServerConnection(delegate);
- ObjectName name = ObjectName.getInstance("", "test", "invocation");
- ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
- assertNotNull(instance);
+ ObjectName name = ObjectName.getInstance("", "test", "invocation");
+ ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
+ assertNotNull(instance);
- Boolean result = (Boolean)mbsc.invoke(name, "delegated", new Object[]{delegatedName}, new String[]{String.class.getName()});
- assertTrue(result.booleanValue());
- }
- finally
- {
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ Boolean result = (Boolean)mbsc.invoke(name, "delegated", new Object[]{delegatedName}, new String[]{String.class.getName()});
+ assertTrue(result.booleanValue());
+ }
+ finally
+ {
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public static class SupportException extends Exception
- {
- }
+ public static class SupportException extends Exception
+ {
+ }
- public interface SupportMBean
- {
- public String getName();
+ public interface SupportMBean
+ {
+ public String getName();
- public void setName(String name);
+ public void setName(String name);
- public void throwCustomException() throws SupportException;
+ public void throwCustomException() throws SupportException;
- public void throwRuntimeException() throws IllegalArgumentException;
+ public void throwRuntimeException() throws IllegalArgumentException;
- public String echo(String argument);
+ public String echo(String argument);
- public boolean authenticated(String name);
+ public boolean authenticated(String name);
- public boolean delegated(String name);
- }
+ public boolean delegated(String name);
+ }
- public static class Support implements SupportMBean
- {
- private String name;
+ public static class Support implements SupportMBean
+ {
+ private String name;
- public Support()
- {
- }
+ public Support()
+ {
+ }
- public Support(String name)
- {
- this.name = name;
- }
+ public Support(String name)
+ {
+ this.name = name;
+ }
- public String getName()
- {
- return name;
- }
+ public String getName()
+ {
+ return name;
+ }
- public void setName(String name)
- {
- this.name = name;
- }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
- public void throwCustomException() throws SupportException
- {
- throw new SupportException();
- }
+ public void throwCustomException() throws SupportException
+ {
+ throw new SupportException();
+ }
- public void throwRuntimeException() throws IllegalArgumentException
- {
- throw new IllegalArgumentException();
- }
+ public void throwRuntimeException() throws IllegalArgumentException
+ {
+ throw new IllegalArgumentException();
+ }
- public String echo(String argument)
- {
- return argument;
- }
+ public String echo(String argument)
+ {
+ return argument;
+ }
- public boolean authenticated(String name)
- {
- Subject subject = Subject.getSubject(AccessController.getContext());
- if (subject == null) return false;
- Set principals = subject.getPrincipals();
- return principals.contains(new JMXPrincipal(name));
- }
+ public boolean authenticated(String name)
+ {
+ Subject subject = Subject.getSubject(AccessController.getContext());
+ if (subject == null) return false;
+ Set principals = subject.getPrincipals();
+ return principals.contains(new JMXPrincipal(name));
+ }
- public boolean delegated(String name)
- {
- Subject subject = Subject.getSubject(AccessController.getContext());
- if (subject == null) return false;
- Set principals = subject.getPrincipals();
- return principals.contains(new JMXPrincipal(name));
- }
- }
+ public boolean delegated(String name)
+ {
+ Subject subject = Subject.getSubject(AccessController.getContext());
+ if (subject == null) return false;
+ Set principals = subject.getPrincipals();
+ return principals.contains(new JMXPrincipal(name));
+ }
+ }
}
Modified: trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorServerFactoryTest.java
===================================================================
--- trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorServerFactoryTest.java 2006-12-13 14:35:43 UTC (rev 2256)
+++ trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorServerFactoryTest.java 2007-03-20 21:07:51 UTC (rev 2257)
@@ -6,27 +6,18 @@
* See the terms of the MX4J License in the documentation provided with this software.
*/
-package test.javax.management.remote;
+package javax.management.remote;
import java.net.MalformedURLException;
import java.util.HashMap;
-import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXConnectorServerFactory;
-import javax.management.remote.JMXProviderException;
-import javax.management.remote.JMXServiceURL;
-import test.MX4JTestCase;
+import mx4j.MX4JTestCase;
/**
* @version $Revision$
*/
public class JMXConnectorServerFactoryTest extends MX4JTestCase
{
- public JMXConnectorServerFactoryTest(String s)
- {
- super(s);
- }
-
public void testInvalidURLs() throws Exception
{
try
Modified: trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorServerTestCase.java
===================================================================
--- trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorServerTestCase.java 2006-12-13 14:35:43 UTC (rev 2256)
+++ trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorServerTestCase.java 2007-03-20 21:07:51 UTC (rev 2257)
@@ -6,7 +6,7 @@
* See the terms of the MX4J License in the documentation provided with this software.
*/
-package test.javax.management.remote;
+package javax.management.remote;
import java.io.IOException;
import java.lang.reflect.InvocationHandler;
@@ -14,30 +14,26 @@
import java.lang.reflect.Proxy;
import java.net.MalformedURLException;
import java.util.Map;
+
import javax.management.MBeanServer;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXConnectorServerFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.MBeanServerForwarder;
+import javax.management.MBeanServerFactory;
-import test.MX4JTestCase;
+import mx4j.MX4JTestCase;
/**
* @version $Revision$
*/
public abstract class JMXConnectorServerTestCase extends MX4JTestCase
{
- public JMXConnectorServerTestCase(String name)
- {
- super(name);
- }
-
public abstract JMXServiceURL createJMXConnectorServerAddress() throws MalformedURLException;
public abstract Map getEnvironment();
+ protected MBeanServer newMBeanServer()
+ {
+ return MBeanServerFactory.newMBeanServer();
+ }
+
public void testNewJMXConnectorServerWithNullURL() throws Exception
{
try
Modified: trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorTestCase.java
===================================================================
--- trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorTestCase.java 2006-12-13 14:35:43 UTC (rev 2256)
+++ trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXConnectorTestCase.java 2007-03-20 21:07:51 UTC (rev 2257)
@@ -6,7 +6,7 @@
* See the terms of the MX4J License in the documentation provided with this software.
*/
-package test.javax.management.remote;
+package javax.management.remote;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -18,393 +18,388 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import javax.management.ListenerNotFoundException;
import javax.management.MBeanNotificationInfo;
import javax.management.MBeanServer;
import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerFactory;
import javax.management.Notification;
import javax.management.NotificationEmitter;
import javax.management.NotificationFilter;
import javax.management.NotificationListener;
import javax.management.ObjectName;
-import javax.management.remote.JMXAuthenticator;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXConnectorServerFactory;
-import javax.management.remote.JMXPrincipal;
-import javax.management.remote.JMXServiceURL;
import javax.security.auth.Subject;
-import test.MX4JTestCase;
+import mx4j.MX4JTestCase;
/**
* @version $Revision$
*/
public abstract class JMXConnectorTestCase extends MX4JTestCase
{
- public JMXConnectorTestCase(String name)
- {
- super(name);
- }
+ protected void tearDown() throws Exception
+ {
+ sleep(5000);
+ }
- protected void tearDown() throws Exception
- {
- sleep(5000);
- }
+ public abstract JMXServiceURL createJMXConnectorServerAddress() throws MalformedURLException;
- public abstract JMXServiceURL createJMXConnectorServerAddress() throws MalformedURLException;
+ public abstract Map getEnvironment();
- public abstract Map getEnvironment();
+ protected MBeanServer newMBeanServer()
+ {
+ return MBeanServerFactory.newMBeanServer();
+ }
- public void testNewJMXConnectorWithNullURL() throws Exception
- {
- try
- {
- JMXConnectorFactory.connect(null);
- fail();
- }
- catch (NullPointerException x)
- {
- }
- }
+ public void testNewJMXConnectorWithNullURL() throws Exception
+ {
+ try
+ {
+ JMXConnectorFactory.connect(null);
+ fail();
+ }
+ catch (NullPointerException x)
+ {
+ }
+ }
- public void testConnectionId() throws Exception
- {
- // Format is:
- // protocol:[[host]:port] [clientId] [arbitrary]
- // Spaces are mandatory, brackets indicates optional parts
+ public void testConnectionId() throws Exception
+ {
+ // Format is:
+ // protocol:[[host]:port] [clientId] [arbitrary]
+ // Spaces are mandatory, brackets indicates optional parts
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
- cntorServer.start();
- sleep(5000);
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
+ cntorServer.start();
+ sleep(5000);
- cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- String connectionId = cntor.getConnectionId();
- String protocol = connectionId.substring(0, connectionId.indexOf(':'));
- assertEquals(protocol, url.getProtocol());
+ cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ String connectionId = cntor.getConnectionId();
+ String protocol = connectionId.substring(0, connectionId.indexOf(':'));
+ assertEquals(protocol, url.getProtocol());
- // Match first mandatory space
- int space = connectionId.indexOf(' ');
- String remaining = connectionId.substring(space + 1);
- // Match second mandatory space
- space = remaining.indexOf(' ');
- String arbitrary = remaining.substring(space + 1);
- if (arbitrary.length() < 1) fail("Missing MX4J arbitrary test");
- }
- finally
- {
- if (cntor != null) cntor.close();
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ // Match first mandatory space
+ int space = connectionId.indexOf(' ');
+ String remaining = connectionId.substring(space + 1);
+ // Match second mandatory space
+ space = remaining.indexOf(' ');
+ String arbitrary = remaining.substring(space + 1);
+ if (arbitrary.length() < 1) fail("Missing MX4J arbitrary test");
+ }
+ finally
+ {
+ if (cntor != null) cntor.close();
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public void testConnectionWithNoPath() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
- cntorServer.start();
- sleep(5000);
+ public void testConnectionWithNoPath() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
+ cntorServer.start();
+ sleep(5000);
- cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- }
- finally
- {
- if (cntor != null) cntor.close();
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ }
+ finally
+ {
+ if (cntor != null) cntor.close();
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public void testJMXAuthenticator() throws Exception
- {
- final String password = "mx4j";
- JMXAuthenticator authenticator = new JMXAuthenticator()
- {
- public Subject authenticate(Object credentials) throws SecurityException
- {
- if (password.equals(credentials))
+ public void testJMXAuthenticator() throws Exception
+ {
+ final String password = "mx4j";
+ JMXAuthenticator authenticator = new JMXAuthenticator()
+ {
+ public Subject authenticate(Object credentials) throws SecurityException
{
- JMXPrincipal principal = new JMXPrincipal("mx4j");
- Subject subject = new Subject();
- subject.getPrincipals().add(principal);
- subject.setReadOnly();
- return subject;
+ if (password.equals(credentials))
+ {
+ JMXPrincipal principal = new JMXPrincipal("mx4j");
+ Subject subject = new Subject();
+ subject.getPrincipals().add(principal);
+ subject.setReadOnly();
+ return subject;
+ }
+ throw new SecurityException("Authentication Failed");
}
- throw new SecurityException("Authentication Failed");
- }
- };
+ };
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- MBeanServer server = newMBeanServer();
- Map serverEnv = getEnvironment();
- serverEnv.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, server);
- cntorServer.start();
- sleep(5000);
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ MBeanServer server = newMBeanServer();
+ Map serverEnv = getEnvironment();
+ serverEnv.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, server);
+ cntorServer.start();
+ sleep(5000);
- // Try to provide wrong password
- Map clientEnv = getEnvironment();
- try
- {
+ // Try to provide wrong password
+ Map clientEnv = getEnvironment();
+ try
+ {
+ testJMXAuthenticatorConnect(cntorServer.getAddress(), clientEnv);
+ fail();
+ }
+ catch (SecurityException x)
+ {
+ }
+
+ // Try now with a correct password
+ clientEnv.put(JMXConnector.CREDENTIALS, password);
testJMXAuthenticatorConnect(cntorServer.getAddress(), clientEnv);
- fail();
- }
- catch (SecurityException x)
- {
- }
+ }
+ finally
+ {
+ if (cntor != null) cntor.close();
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- // Try now with a correct password
- clientEnv.put(JMXConnector.CREDENTIALS, password);
- testJMXAuthenticatorConnect(cntorServer.getAddress(), clientEnv);
- }
- finally
- {
- if (cntor != null) cntor.close();
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ protected void testJMXAuthenticatorConnect(JMXServiceURL url, Map environment) throws SecurityException, IOException
+ {
+ JMXConnectorFactory.connect(url, environment);
+ }
- protected void testJMXAuthenticatorConnect(JMXServiceURL url, Map environment) throws SecurityException, IOException
- {
- JMXConnectorFactory.connect(url, environment);
- }
+ public void testStopServerBeforeClosingClient() throws Exception
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
+ cntorServer.start();
+ sleep(5000);
- public void testStopServerBeforeClosingClient() throws Exception
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
- cntorServer.start();
- sleep(5000);
+ JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
- JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
+ cntorServer.stop();
- cntorServer.stop();
+ try
+ {
+ mbsc.getDefaultDomain();
+ fail();
+ }
+ catch (IOException x)
+ {
+ }
+ }
- try
- {
- mbsc.getDefaultDomain();
- fail();
- }
- catch (IOException x)
- {
- }
- }
+ public void testStopServerAndCloseClientThenInvoke() throws Exception
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
+ cntorServer.start();
+ sleep(5000);
- public void testStopServerAndCloseClientThenInvoke() throws Exception
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
- cntorServer.start();
- sleep(5000);
+ JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
- JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
+ cntor.close();
+ cntorServer.stop();
- cntor.close();
- cntorServer.stop();
+ try
+ {
+ mbsc.getDefaultDomain();
+ fail();
+ }
+ catch (IOException x)
+ {
+ }
+ }
- try
- {
- mbsc.getDefaultDomain();
- fail();
- }
- catch (IOException x)
- {
- }
- }
+ public void testSerializedConnectorCanConnect() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
+ cntorServer.start();
+ sleep(5000);
- public void testSerializedConnectorCanConnect() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
- cntorServer.start();
- sleep(5000);
+ cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
- cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
+ // Serialize it: we want to test serialization does no reset data members
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(cntor);
+ oos.close();
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ cntor = (JMXConnector)ois.readObject();
+ ois.close();
- // Serialize it: we want to test serialization does no reset data members
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(cntor);
- oos.close();
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectInputStream ois = new ObjectInputStream(bais);
- cntor = (JMXConnector)ois.readObject();
- ois.close();
+ cntor.connect();
+ MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
+ mbsc.getDefaultDomain();
- cntor.connect();
- MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
- mbsc.getDefaultDomain();
+ // Again
+ cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- // Again
- cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ // Serialize it: we want to test serialization does no reset data members
+ baos = new ByteArrayOutputStream();
+ oos = new ObjectOutputStream(baos);
+ oos.writeObject(cntor);
+ oos.close();
+ bais = new ByteArrayInputStream(baos.toByteArray());
+ ois = new ObjectInputStream(bais);
+ cntor = (JMXConnector)ois.readObject();
+ ois.close();
- // Serialize it: we want to test serialization does no reset data members
- baos = new ByteArrayOutputStream();
- oos = new ObjectOutputStream(baos);
- oos.writeObject(cntor);
- oos.close();
- bais = new ByteArrayInputStream(baos.toByteArray());
- ois = new ObjectInputStream(bais);
- cntor = (JMXConnector)ois.readObject();
- ois.close();
+ cntor.connect();
+ mbsc = cntor.getMBeanServerConnection();
+ mbsc.getDefaultDomain();
+ }
+ finally
+ {
+ if (cntor != null) cntor.close();
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- cntor.connect();
- mbsc = cntor.getMBeanServerConnection();
- mbsc.getDefaultDomain();
- }
- finally
- {
- if (cntor != null) cntor.close();
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ public void testDefaultClassLoader() throws Exception
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ Map environment = new HashMap(getEnvironment());
+ environment.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, new Object());
+ try
+ {
+ JMXConnectorFactory.newJMXConnector(url, environment);
+ fail();
+ }
+ catch (IllegalArgumentException x)
+ {
+ }
- public void testDefaultClassLoader() throws Exception
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- Map environment = new HashMap(getEnvironment());
- environment.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, new Object());
- try
- {
- JMXConnectorFactory.newJMXConnector(url, environment);
- fail();
- }
- catch (IllegalArgumentException x)
- {
- }
+ JMXConnector cntor = JMXConnectorFactory.newJMXConnector(url, getEnvironment());
+ try
+ {
+ cntor.connect(environment);
+ fail();
+ }
+ catch (IllegalArgumentException x)
+ {
+ }
+ }
- JMXConnector cntor = JMXConnectorFactory.newJMXConnector(url, getEnvironment());
- try
- {
- cntor.connect(environment);
- fail();
- }
- catch (IllegalArgumentException x)
- {
- }
- }
+ public void testListenersAreRemovedOnConnectorClose() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ MBeanServer server = newMBeanServer();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
+ cntorServer.start();
+ sleep(5000);
- public void testListenersAreRemovedOnConnectorClose() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- MBeanServer server = newMBeanServer();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
- cntorServer.start();
- sleep(5000);
+ Emitter emitter = new Emitter();
+ ObjectName emitterName = ObjectName.getInstance(":name=emitter");
+ server.registerMBean(emitter, emitterName);
- Emitter emitter = new Emitter();
- ObjectName emitterName = ObjectName.getInstance(":name=emitter");
- server.registerMBean(emitter, emitterName);
+ cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
- cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
-
- NotificationListener listener = new NotificationListener()
- {
- public void handleNotification(Notification notification, Object handback)
+ NotificationListener listener = new NotificationListener()
{
- }
- };
+ public void handleNotification(Notification notification, Object handback)
+ {
+ }
+ };
- // Add the listener and be sure the mechanism of removal works fine
- mbsc.addNotificationListener(emitterName, listener, null, null);
- assertEquals(emitter.getSize(), 1);
- mbsc.removeNotificationListener(emitterName, listener, null, null);
- assertEquals(emitter.getSize(), 0);
+ // Add the listener and be sure the mechanism of removal works fine
+ mbsc.addNotificationListener(emitterName, listener, null, null);
+ assertEquals(emitter.getSize(), 1);
+ mbsc.removeNotificationListener(emitterName, listener, null, null);
+ assertEquals(emitter.getSize(), 0);
- // Add the listener and close the connector
- mbsc.addNotificationListener(emitterName, listener, null, null);
- assertEquals(emitter.getSize(), 1);
- cntor.close();
- assertEquals(emitter.getSize(), 0);
- }
- finally
- {
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ // Add the listener and close the connector
+ mbsc.addNotificationListener(emitterName, listener, null, null);
+ assertEquals(emitter.getSize(), 1);
+ cntor.close();
+ assertEquals(emitter.getSize(), 0);
+ }
+ finally
+ {
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public void testConnectWithProviderClassLoader() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- MBeanServer server = newMBeanServer();
- Map serverEnv = getEnvironment();
- serverEnv.put(JMXConnectorServerFactory.PROTOCOL_PROVIDER_CLASS_LOADER, getClass().getClassLoader());
- ClassLoader old = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader().getParent());
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, server);
- cntorServer.start();
- Thread.currentThread().setContextClassLoader(old);
- sleep(5000);
+ public void testConnectWithProviderClassLoader() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ MBeanServer server = newMBeanServer();
+ Map serverEnv = getEnvironment();
+ serverEnv.put(JMXConnectorServerFactory.PROTOCOL_PROVIDER_CLASS_LOADER, getClass().getClassLoader());
+ ClassLoader old = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader().getParent());
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, server);
+ cntorServer.start();
+ Thread.currentThread().setContextClassLoader(old);
+ sleep(5000);
- cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
- assertNotNull(mbsc);
- }
- finally
- {
- if (cntor != null) cntor.close();
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
+ assertNotNull(mbsc);
+ }
+ finally
+ {
+ if (cntor != null) cntor.close();
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public interface EmitterMBean
- {
- }
+ public interface EmitterMBean
+ {
+ }
- private static class Emitter implements NotificationEmitter, EmitterMBean
- {
- private List listeners = new ArrayList();
+ private static class Emitter implements NotificationEmitter, EmitterMBean
+ {
+ private List listeners = new ArrayList();
- public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
- {
- listeners.add(listener);
- }
+ public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
+ {
+ listeners.add(listener);
+ }
- public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
- {
- listeners.remove(listener);
- }
+ public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
+ {
+ listeners.remove(listener);
+ }
- public MBeanNotificationInfo[] getNotificationInfo()
- {
- return new MBeanNotificationInfo[0];
- }
+ public MBeanNotificationInfo[] getNotificationInfo()
+ {
+ return new MBeanNotificationInfo[0];
+ }
- public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
- {
- }
+ public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
+ {
+ }
- public int getSize()
- {
- return listeners.size();
- }
- }
+ public int getSize()
+ {
+ return listeners.size();
+ }
+ }
}
Modified: trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXNotificationsTestCase.java
===================================================================
--- trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXNotificationsTestCase.java 2006-12-13 14:35:43 UTC (rev 2256)
+++ trunk/mx4j/jsr160/src/test/java/javax/management/remote/JMXNotificationsTestCase.java 2007-03-20 21:07:51 UTC (rev 2257)
@@ -6,7 +6,7 @@
* See the terms of the MX4J License in the documentation provided with this software.
*/
-package test.javax.management.remote;
+package javax.management.remote;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -14,6 +14,7 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerFactory;
import javax.management.MBeanServerNotification;
import javax.management.Notification;
import javax.management.NotificationBroadcasterSupport;
@@ -23,845 +24,866 @@
import javax.management.ObjectName;
import javax.management.loading.MLet;
import javax.management.relation.MBeanServerNotificationFilter;
-import javax.management.remote.JMXConnectionNotification;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXConnectorServerFactory;
-import javax.management.remote.JMXServiceURL;
+import mx4j.MX4JTestCase;
+import mx4j.MutableBoolean;
+import mx4j.MutableInteger;
+import mx4j.MutableObject;
import mx4j.remote.MX4JRemoteConstants;
-import test.MX4JTestCase;
-import test.MutableBoolean;
-import test.MutableInteger;
-import test.MutableObject;
/**
* @version $Revision$
*/
public abstract class JMXNotificationsTestCase extends MX4JTestCase
{
- public JMXNotificationsTestCase(String name)
- {
- super(name);
- }
+ protected void tearDown() throws Exception
+ {
+ sleep(5000);
+ }
- protected void tearDown() throws Exception
- {
- sleep(5000);
- }
+ public abstract JMXServiceURL createJMXConnectorServerAddress() throws MalformedURLException;
- public abstract JMXServiceURL createJMXConnectorServerAddress() throws MalformedURLException;
+ public abstract Map getEnvironment();
- public abstract Map getEnvironment();
+ private MBeanServer newMBeanServer()
+ {
+ return MBeanServerFactory.newMBeanServer();
+ }
- public void testConnectionNotificationOpenedOnServer() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- try
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
- cntorServer.start();
- sleep(5000);
+ public void testConnectionNotificationOpenedOnServer() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ try
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
+ cntorServer.start();
+ sleep(5000);
- final MutableObject holder = new MutableObject(null);
- cntorServer.addNotificationListener(new NotificationListener()
- {
- public void handleNotification(Notification notification, Object handback)
+ final MutableObject holder = new MutableObject(null);
+ cntorServer.addNotificationListener(new NotificationListener()
{
- holder.set(notification);
- }
- }, null, null);
+ public void handleNotification(Notification notification, Object handback)
+ {
+ holder.set(notification);
+ }
+ }, null, null);
- JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- Notification notification = (Notification) holder.get();
- if (!(notification instanceof JMXConnectionNotification)) fail();
- assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
- } catch (Exception x)
- {
- x.printStackTrace();
- throw x;
- } finally
- {
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ Notification notification = (Notification)holder.get();
+ if (!(notification instanceof JMXConnectionNotification)) fail();
+ assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
+ }
+ catch (Exception x)
+ {
+ x.printStackTrace();
+ throw x;
+ }
+ finally
+ {
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public void testConnectionNotificationClosedOnServer() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- try
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
- cntorServer.start();
- sleep(5000);
+ public void testConnectionNotificationClosedOnServer() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ try
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
+ cntorServer.start();
+ sleep(5000);
- final MutableObject holder = new MutableObject(null);
- cntorServer.addNotificationListener(new NotificationListener()
- {
- public void handleNotification(Notification notification, Object handback)
+ final MutableObject holder = new MutableObject(null);
+ cntorServer.addNotificationListener(new NotificationListener()
{
- holder.set(notification);
- }
- }, null, null);
+ public void handleNotification(Notification notification, Object handback)
+ {
+ holder.set(notification);
+ }
+ }, null, null);
- JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- cntor.close();
+ JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ cntor.close();
- Notification notification = (Notification) holder.get();
- if (!(notification instanceof JMXConnectionNotification)) fail();
- assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
- } catch (Exception x)
- {
- x.printStackTrace();
- throw x;
- } finally
- {
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ Notification notification = (Notification)holder.get();
+ if (!(notification instanceof JMXConnectionNotification)) fail();
+ assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
+ }
+ catch (Exception x)
+ {
+ x.printStackTrace();
+ throw x;
+ }
+ finally
+ {
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public void testConnectionNotificationOpenedOnClient() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- MBeanServer server = newMBeanServer();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
- cntorServer.start();
- sleep(5000);
+ public void testConnectionNotificationOpenedOnClient() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ MBeanServer server = newMBeanServer();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
+ cntorServer.start();
+ sleep(5000);
- final MutableObject holder = new MutableObject(null);
- cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
- cntor.addConnectionNotificationListener(new NotificationListener()
- {
- public void handleNotification(Notification notification, Object handback)
+ final MutableObject holder = new MutableObject(null);
+ cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
+ cntor.addConnectionNotificationListener(new NotificationListener()
{
- holder.set(notification);
- }
- }, null, null);
+ public void handleNotification(Notification notification, Object handback)
+ {
+ holder.set(notification);
+ }
+ }, null, null);
- cntor.connect(getEnvironment());
+ cntor.connect(getEnvironment());
- JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
- assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
- } catch (Exception x)
- {
- x.printStackTrace();
- throw x;
- } finally
- {
- if (cntor != null) cntor.close();
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
+ assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
+ }
+ catch (Exception x)
+ {
+ x.printStackTrace();
+ throw x;
+ }
+ finally
+ {
+ if (cntor != null) cntor.close();
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public void testConnectionNotificationClosedOnClient() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- MBeanServer server = newMBeanServer();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
- cntorServer.start();
- sleep(5000);
+ public void testConnectionNotificationClosedOnClient() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ MBeanServer server = newMBeanServer();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
+ cntorServer.start();
+ sleep(5000);
- final MutableObject holder = new MutableObject(null);
- cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
- cntor.addConnectionNotificationListener(new NotificationListener()
- {
- public void handleNotification(Notification notification, Object handback)
+ final MutableObject holder = new MutableObject(null);
+ cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
+ cntor.addConnectionNotificationListener(new NotificationListener()
{
- holder.set(notification);
- }
- }, null, null);
+ public void handleNotification(Notification notification, Object handback)
+ {
+ holder.set(notification);
+ }
+ }, null, null);
- cntor.connect(getEnvironment());
- cntor.close();
+ cntor.connect(getEnvironment());
+ cntor.close();
- JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
- assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
- } catch (Exception x)
- {
- x.printStackTrace();
- throw x;
- } finally
- {
- if (cntor != null) cntor.close();
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
+ assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
+ }
+ catch (Exception x)
+ {
+ x.printStackTrace();
+ throw x;
+ }
+ finally
+ {
+ if (cntor != null) cntor.close();
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public void testConnectionNotificationFailedOnClient() throws Exception
- {
- JMXServiceURL url = createJMXConnectorServerAddress();
- MBeanServer server = newMBeanServer();
- JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
+ public void testConnectionNotificationFailedOnClient() throws Exception
+ {
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ MBeanServer server = newMBeanServer();
+ JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
- cntorServer.start();
- sleep(5000);
+ cntorServer.start();
+ sleep(5000);
- final MutableObject holder = new MutableObject(null);
- long period = 1000;
- int retries = 3;
- try
- {
- JMXConnector cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
- cntor.addConnectionNotificationListener(new NotificationListener()
- {
- public void handleNotification(Notification notification, Object handback)
+ final MutableObject holder = new MutableObject(null);
+ long period = 1000;
+ int retries = 3;
+ try
+ {
+ JMXConnector cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
+ cntor.addConnectionNotificationListener(new NotificationListener()
{
- holder.set(notification);
- }
- }, null, null);
+ public void handleNotification(Notification notification, Object handback)
+ {
+ holder.set(notification);
+ }
+ }, null, null);
- Map clientEnv = getEnvironment();
- clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_PERIOD, new Long(period));
- clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_RETRIES, new Integer(retries));
- cntor.connect(clientEnv);
+ Map clientEnv = getEnvironment();
+ clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_PERIOD, new Long(period));
+ clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_RETRIES, new Integer(retries));
+ cntor.connect(clientEnv);
- JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
- assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
- holder.set(null);
- } catch (Exception x)
- {
- x.printStackTrace();
- throw x;
- } finally
- {
- cntorServer.stop();
- sleep(5000);
- }
+ JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
+ assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
+ holder.set(null);
+ }
+ catch (Exception x)
+ {
+ x.printStackTrace();
+ throw x;
+ }
+ finally
+ {
+ cntorServer.stop();
+ sleep(5000);
+ }
- // Wait for the heartbeat to send the failed notification
- sleep((retries * 3) * period);
+ // Wait for the heartbeat to send the failed notification
+ sleep((retries * 3) * period);
- JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
- assertNotNull(notification);
- assertEquals(notification.getType(), JMXConnectionNotification.FAILED);
- }
+ JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
+ assertNotNull(notification);
+ assertEquals(notification.getType(), JMXConnectionNotification.FAILED);
+ }
- public void testRemoteNotificationListener() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- MBeanServer server = newMBeanServer();
+ public void testRemoteNotificationListener() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ MBeanServer server = newMBeanServer();
- JMXServiceURL url = createJMXConnectorServerAddress();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
- cntorServer.start();
- sleep(5000);
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
+ cntorServer.start();
+ sleep(5000);
- cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
- ObjectName delegate = new ObjectName("JMImplementation:type=MBeanServerDelegate");
+ cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
+ ObjectName delegate = new ObjectName("JMImplementation:type=MBeanServerDelegate");
- final MutableObject holder = new MutableObject(null);
- mbsc.addNotificationListener(delegate, new NotificationListener()
- {
- public void handleNotification(Notification notification, Object handback)
+ final MutableObject holder = new MutableObject(null);
+ mbsc.addNotificationListener(delegate, new NotificationListener()
{
- holder.set(notification);
- }
- }, null, null);
+ public void handleNotification(Notification notification, Object handback)
+ {
+ holder.set(notification);
+ }
+ }, null, null);
- // Wait for notifications threads to start
- sleep(1000);
+ // Wait for notifications threads to start
+ sleep(1000);
- // Register a new MBean, it will generate a notification
- MLet mlet = new MLet();
- ObjectName name = new ObjectName(":mbean=mlet");
- server.registerMBean(mlet, name);
+ // Register a new MBean, it will generate a notification
+ MLet mlet = new MLet();
+ ObjectName name = new ObjectName(":mbean=mlet");
+ server.registerMBean(mlet, name);
- // Wait for notifications to arrive
- sleep(1000);
+ // Wait for notifications to arrive
+ sleep(1000);
- Notification notification = (Notification) holder.get();
- assertEquals(notification.getType(), MBeanServerNotification.REGISTRATION_NOTIFICATION);
- holder.set(null);
+ Notification notification = (Notification)holder.get();
+ assertEquals(notification.getType(), MBeanServerNotification.REGISTRATION_NOTIFICATION);
+ holder.set(null);
- // Unregister the MBean
- server.unregisterMBean(name);
+ // Unregister the MBean
+ server.unregisterMBean(name);
- // Wait for notifications to arrive
- sleep(1000);
+ // Wait for notifications to arrive
+ sleep(1000);
- notification = (Notification) holder.get();
- assertEquals(notification.getType(), MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
- holder.set(null);
- } catch (Exception x)
- {
- x.printStackTrace();
- throw x;
- } finally
- {
- if (cntor != null) cntor.close();
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ notification = (Notification)holder.get();
+ assertEquals(notification.getType(), MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
+ holder.set(null);
+ }
+ catch (Exception x)
+ {
+ x.printStackTrace();
+ throw x;
+ }
+ finally
+ {
+ if (cntor != null) cntor.close();
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public void testNonSerializableNotifications() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- MBeanServer server = newMBeanServer();
+ public void testNonSerializableNotifications() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ MBeanServer server = newMBeanServer();
- // Register an MBean Emitter
- ObjectName emitterName = ObjectName.getInstance(":mbean=emitter");
- MBeanEmitter emitter = new MBeanEmitter();
- server.registerMBean(emitter, emitterName);
+ // Register an MBean Emitter
+ ObjectName emitterName = ObjectName.getInstance(":mbean=emitter");
+ MBeanEmitter emitter = new MBeanEmitter();
+ server.registerMBean(emitter, emitterName);
- JMXServiceURL url = createJMXConnectorServerAddress();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), null);
- ObjectName cntorName = ObjectName.getInstance("connector:protocol=rmi");
- server.registerMBean(cntorServer, cntorName);
- cntorServer.start();
- sleep(5000);
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), null);
+ ObjectName cntorName = ObjectName.getInstance("connector:protocol=rmi");
+ server.registerMBean(cntorServer, cntorName);
+ cntorServer.start();
+ sleep(5000);
- cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
- final MutableObject plainNotification = new MutableObject(null);
- mbsc.addNotificationListener(emitterName, new NotificationListener()
- {
- public void handleNotification(Notification notification, Object handback)
+ cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
+ final MutableObject plainNotification = new MutableObject(null);
+ mbsc.addNotificationListener(emitterName, new NotificationListener()
{
- plainNotification.set(notification);
- }
- }, null, null);
+ public void handleNotification(Notification notification, Object handback)
+ {
+ plainNotification.set(notification);
+ }
+ }, null, null);
- final MutableObject connectionNotification = new MutableObject(null);
- cntor.addConnectionNotificationListener(new NotificationListener()
- {
- public void handleNotification(Notification notification, Object handback)
+ final MutableObject connectionNotification = new MutableObject(null);
+ cntor.addConnectionNotificationListener(new NotificationListener()
{
- connectionNotification.set(notification);
- }
- }, null, null);
+ public void handleNotification(Notification notification, Object handback)
+ {
+ connectionNotification.set(notification);
+ }
+ }, null, null);
- // Wait for notifications threads to start
- sleep(1000);
+ // Wait for notifications threads to start
+ sleep(1000);
- String type = "notification.type";
- Notification notification = new Notification(type, this, 0);
- // Make it non-serializable
- notification.setUserData(this);
- emitter.emit(notification);
+ String type = "notification.type";
+ Notification notification = new Notification(type, this, 0);
+ // Make it non-serializable
+ notification.setUserData(this);
+ emitter.emit(notification);
- // Wait for notifications to arrive
- sleep(1000);
+ // Wait for notifications to arrive
+ sleep(1000);
- assertNull(plainNotification.get());
- assertNotNull(connectionNotification.get());
- assertEquals(((Notification) connectionNotification.get()).getType(), JMXConnectionNotification.NOTIFS_LOST);
- } catch (Exception x)
- {
- x.printStackTrace();
- throw x;
- } finally
- {
- if (cntor != null) cntor.close();
- if (cntorServer != null) cntorServer.stop();
- }
- }
+ assertNull(plainNotification.get());
+ assertNotNull(connectionNotification.get());
+ assertEquals(((Notification)connectionNotification.get()).getType(), JMXConnectionNotification.NOTIFS_LOST);
+ }
+ catch (Exception x)
+ {
+ x.printStackTrace();
+ throw x;
+ }
+ finally
+ {
+ if (cntor != null) cntor.close();
+ if (cntorServer != null) cntorServer.stop();
+ }
+ }
- public void testAddRemoveMBeanListener() throws Exception
- {
- JMXConnectorServer cntorServer = null;
- JMXConnector cntor = null;
- try
- {
- MBeanServer server = newMBeanServer();
+ public void testAddRemoveMBeanListener() throws Exception
+ {
+ JMXConnectorServer cntorServer = null;
+ JMXConnector cntor = null;
+ try
+ {
+ MBeanServer server = newMBeanServer();
- // Register an MBean Emitter
- ObjectName emitterName = ObjectName.getInstance(":mbean=emitter");
- MBeanEmitter emitter = new MBeanEmitter();
- server.registerMBean(emitter, emitterName);
+ // Register an MBean Emitter
+ ObjectName emitterName = ObjectName.getInstance(":mbean=emitter");
+ MBeanEmitter emitter = new MBeanEmitter();
+ server.registerMBean(emitter, emitterName);
- // Register an MBean Listener
- MutableObject notificationHolder = new MutableObject(null);
- MutableObject handbackHolder = new MutableObject(null);
- ObjectName listenerName = ObjectName.getInstance(":mbean=listener");
- MBeanListener listener = new MBeanListener(notificationHolder, handbackHolder);
- server.registerMBean(listener, listenerName);
+ // Register an MBean Listener
+ MutableObject notificationHolder = new MutableObject(null);
+ MutableObject handbackHolder = new MutableObject(null);
+ ObjectName listenerName = ObjectName.getInstance(":mbean=listener");
+ MBeanListener listener = new MBeanListener(notificationHolder, handbackHolder);
+ server.registerMBean(listener, listenerName);
- JMXServiceURL url = createJMXConnectorServerAddress();
- cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
- cntorServer.start();
- sleep(5000);
+ JMXServiceURL url = createJMXConnectorServerAddress();
+ cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
+ cntorServer.start();
+ sleep(5000);
- cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
- MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
+ cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+ MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
- // Non-serializable filter
- try
- {
- mbsc.addNotificationListener(emitterName, listenerName, new NotificationFilter()
+ // Non-serializable filter
+ try
{
- public boolean isNotificationEnabled(Notification notification)
- {
- return false;
- }
- }, null);
- fail();
- } catch (IOException x)
- {
- }
+ mbsc.addNotificationListener(emitterName, listenerName, new NotificationFilter()
+ {
+ public boolean isNotificationEnabled(Notification notification)
+ {
+ return false;
+ }
+ }, null);
+ fail();
+ }
+ catch (IOException x)
+ {
+ }
- // Non-serializable handback
- try
- {
- mbsc.addNotificationListener(emitterName, listenerName, null, new Object());
- fail();
- } catch (IOException x)
- {
- }
+ // Non-serializable handback
+ try
+ {
+ mbsc.addNotificationListener(emitterName, listenerName, null, new Object());
+ fail();
+ }
+ catch (IOException x)
+ {
+ }
- // Non-serializable filter and non serializable handback
- try
- {
- mbsc.addNotificationListener(emitterName, listenerName, new NotificationFilter()
+ // Non-serializable filter and non serializable handback
+ try
{
- public boolean isNotificationEnabled(Notification notification)
- {
- return false;
- }
- }, new Object());
- fail();
- } catch (IOException x)
- {
- }
+ mbsc.addNotificationListener(emitterName, listenerName, new NotificationFilter()
+ {
+ public boolean isNotificationEnabled(Notification notification)
+ {
+ return false;
+ }
+ }, new Object());
+ fail();
+ }
+ catch (IOException x)
+ {
+ }
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV