SF.net SVN: mx4j:[2288] trunk/mx4j
[email protected] Sun, 03 Jan 2010 00:31:04 +0000
| Newsgroups | gmane.comp.java.mx4j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 2288
http://mx4j.svn.sourceforge.net/mx4j/?rev=2288&view=rev
Author: altheengineer
Date: 2010-01-03 00:31:01 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
Fixing compilance serialization and signature tests - also adding JMX reference implementation classes so that this implementation can be compared against it.
Modified Paths:
--------------
trunk/mx4j/jsr003/pom.xml
trunk/mx4j/jsr003/src/test/java/test/javax/management/compliance/JMXComplianceTestCase.java
trunk/mx4j/jsr003/src/test/java/test/mx4j/MX4JClassLoadingTestCase.java
trunk/mx4j/jsr003/src/test/java/test/mx4j/MX4JTestCase.java
trunk/mx4j/jsr160/pom.xml
trunk/mx4j/jsr160/src/test/java/test/javax/management/remote/compliance/OptionalRemoteJMXComplianceTestCase.java
trunk/mx4j/jsr160/src/test/java/test/javax/management/remote/compliance/RemoteJMXComplianceTestCase.java
Added Paths:
-----------
trunk/mx4j/jmxri/
Modified: trunk/mx4j/jsr003/pom.xml
===================================================================
--- trunk/mx4j/jsr003/pom.xml 2010-01-02 09:14:46 UTC (rev 2287)
+++ trunk/mx4j/jsr003/pom.xml 2010-01-03 00:31:01 UTC (rev 2288)
@@ -19,8 +19,6 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<testExcludes>
- <exclude>**/JMXSerializationTest.java</exclude>
- <exclude>**/JMXSignatureTest.java</exclude>
<exclude>**/SecurityManagerTestCase.java</exclude>
<exclude>**/LocalSecurityManagerTest.java</exclude>
</testExcludes>
Modified: trunk/mx4j/jsr003/src/test/java/test/javax/management/compliance/JMXComplianceTestCase.java
===================================================================
--- trunk/mx4j/jsr003/src/test/java/test/javax/management/compliance/JMXComplianceTestCase.java 2010-01-02 09:14:46 UTC (rev 2287)
+++ trunk/mx4j/jsr003/src/test/java/test/javax/management/compliance/JMXComplianceTestCase.java 2010-01-03 00:31:01 UTC (rev 2288)
@@ -27,7 +27,7 @@
protected JarFile loadJar() throws IOException
{
- File jmxri = new File("dist/test/jmxri.jar");
+ File jmxri = new File(getJMXRIJarPath());
if (!jmxri.exists()) fail("JMXRI jar is not available");
JarFile jmxriJar = new JarFile(jmxri);
return jmxriJar;
Modified: trunk/mx4j/jsr003/src/test/java/test/mx4j/MX4JClassLoadingTestCase.java
===================================================================
--- trunk/mx4j/jsr003/src/test/java/test/mx4j/MX4JClassLoadingTestCase.java 2010-01-02 09:14:46 UTC (rev 2287)
+++ trunk/mx4j/jsr003/src/test/java/test/mx4j/MX4JClassLoadingTestCase.java 2010-01-03 00:31:01 UTC (rev 2288)
@@ -12,73 +12,65 @@
{
protected ClassLoader createMX4JClassLoader() throws MalformedURLException
{
- File jmx = new File("dist/test/mx4j-jmx.jar");
- File impl = new File("dist/test/mx4j-impl.jar");
- return new URLClassLoader(new URL[]{jmx.toURL(), impl.toURL()}, getClass().getClassLoader().getParent());
+ return getClass().getClassLoader();
}
protected ClassLoader createJMXRIClassLoader() throws MalformedURLException
{
- File jmxri = new File("dist/test/jmxri.jar");
+ File jmxri = new File(getJMXRIJarPath());
if (!jmxri.exists()) fail("JMXRI jar is not available");
return new URLClassLoader(new URL[]{jmxri.toURL()}, getClass().getClassLoader().getParent());
}
protected ClassLoader createJMXRIWithMX4JImplClassLoader() throws MalformedURLException
{
- File jmxri = new File("dist/test/jmxri.jar");
+ File jmxri = new File(getJMXRIJarPath());
if (!jmxri.exists()) fail("JMXRI jar is not available");
- File mx4j = new File("dist/test/mx4j-impl.jar");
- return new URLClassLoader(new URL[]{jmxri.toURL(), mx4j.toURL()}, getClass().getClassLoader().getParent());
+ return new URLClassLoader(new URL[]{jmxri.toURL()}, getClass().getClassLoader());
}
protected ClassLoader createMX4JWithTestsClassLoader() throws MalformedURLException
{
- File jmx = new File("dist/test/mx4j-jmx.jar");
- File impl = new File("dist/test/mx4j-impl.jar");
- File tests = new File("dist/test/mx4j-tests.jar");
- return new URLClassLoader(new URL[]{jmx.toURL(), impl.toURL(), tests.toURL()}, getClass().getClassLoader().getParent());
+ return getClass().getClassLoader();
}
protected ClassLoader createRemoteMX4JWithTestsClassLoader() throws MalformedURLException
{
- File jmx = new File("dist/test/mx4j-jmx.jar");
- File impl = new File("dist/test/mx4j-impl.jar");
- File rjmx = new File("dist/test/mx4j-rjmx.jar");
- File rimpl = new File("dist/test/mx4j-rimpl.jar");
- File tests = new File("dist/test/mx4j-tests.jar");
- File jaas = new File("dist/test/jaas.jar");
- return new URLClassLoader(new URL[]{jaas.toURL(), jmx.toURL(), impl.toURL(), rjmx.toURL(), rimpl.toURL(), tests.toURL()}, getClass().getClassLoader().getParent());
+ File jaas = new File(getJAASJarPath());
+ return new URLClassLoader(new URL[]{jaas.toURL()}, getClass().getClassLoader());
}
protected ClassLoader createJMXRIWithTestsClassLoader() throws MalformedURLException
{
- File jmxri = new File("dist/test/jmxri.jar");
+ File jmxri = new File(getJMXRIJarPath());
if (!jmxri.exists()) fail("JMXRI jar is not available");
- File tests = new File("dist/test/mx4j-tests.jar");
- return new URLClassLoader(new URL[]{jmxri.toURL(), tests.toURL()}, getClass().getClassLoader().getParent());
+ File tests003 = new File(getJSR003TestDir());
+ File tests160 = new File(getJSR160TestDir());
+ return new URLClassLoader(new URL[]{jmxri.toURL(), tests003.toURL(), tests160.toURL()}, getClass().getClassLoader().getParent());
}
protected ClassLoader createRemoteJMXRIWithTestsClassLoader() throws MalformedURLException
{
- File jmx = new File("dist/test/jmxri.jar");
+ File jmx = new File(getJMXRIJarPath());
if (!jmx.exists()) fail("JMXRI jar is not available");
- File rjmx = new File("dist/test/jmxremote.jar");
+ File rjmx = new File(getJMXRIRemoteJarPath());
if (!rjmx.exists()) fail("JMX Remote jar is not available");
- File tests = new File("dist/test/mx4j-tests.jar");
- File jaas = new File("dist/test/jaas.jar");
- return new URLClassLoader(new URL[]{jaas.toURL(), jmx.toURL(), rjmx.toURL(), tests.toURL()}, getClass().getClassLoader().getParent());
+ File jaas = new File(getJAASJarPath());
+ File tests003 = new File(getJSR003TestDir());
+ File tests160 = new File(getJSR160TestDir());
+ return new URLClassLoader(new URL[]{jaas.toURL(), jmx.toURL(), rjmx.toURL(), tests003.toURL(), tests160.toURL()}, getClass().getClassLoader().getParent());
}
protected ClassLoader createOptionalRemoteJMXRIWithTestsClassLoader() throws MalformedURLException
{
- File jmx = new File("dist/test/jmxri.jar");
+ File jmx = new File(getJMXRIJarPath());
if (!jmx.exists()) fail("JMXRI jar is not available");
- File rjmx = new File("dist/test/jmxremote.jar");
+ File rjmx = new File(getJMXRIRemoteJarPath());
if (!rjmx.exists()) fail("JMX Remote jar is not available");
- File orjmx = new File("dist/test/jmxremote_optional.jar");
+ File orjmx = new File(getJMXRIRemoteOptionalJarPath());
if (!orjmx.exists()) fail("JMX Optional Remote jar is not available");
- File tests = new File("dist/test/mx4j-tests.jar");
- return new URLClassLoader(new URL[]{jmx.toURL(), rjmx.toURL(), orjmx.toURL(), tests.toURL()}, getClass().getClassLoader().getParent());
+ File tests003 = new File(getJSR003TestDir());
+ File tests160 = new File(getJSR160TestDir());
+ return new URLClassLoader(new URL[]{jmx.toURL(), rjmx.toURL(), orjmx.toURL(), tests003.toURL(), tests160.toURL()}, getClass().getClassLoader().getParent());
}
}
Modified: trunk/mx4j/jsr003/src/test/java/test/mx4j/MX4JTestCase.java
===================================================================
--- trunk/mx4j/jsr003/src/test/java/test/mx4j/MX4JTestCase.java 2010-01-02 09:14:46 UTC (rev 2287)
+++ trunk/mx4j/jsr003/src/test/java/test/mx4j/MX4JTestCase.java 2010-01-03 00:31:01 UTC (rev 2288)
@@ -28,4 +28,55 @@
Thread.currentThread().interrupt();
}
}
+
+ protected String getCurrentProjectBaseDir()
+ {
+ return System.getProperty("basedir");
+ }
+
+ protected String getFileSeparator()
+ {
+ return System.getProperty("file.separator");
+ }
+
+ protected String getCurrentTestDir()
+ {
+ return getCurrentProjectBaseDir()+getFileSeparator()+"target"+getFileSeparator()+"test-classes/";
+ }
+
+ protected String getJSR003TestDir()
+ {
+ return getCurrentProjectBaseDir()+getFileSeparator()+".."+getFileSeparator()+"jsr003"+getFileSeparator()+"target"+getFileSeparator()+"test-classes/";
+ }
+
+ protected String getJSR160TestDir()
+ {
+ return getCurrentProjectBaseDir()+getFileSeparator()+".."+getFileSeparator()+"jsr160"+getFileSeparator()+"target"+getFileSeparator()+"test-classes/";
+ }
+
+ protected String getJMXRIBasePath()
+ {
+ return getCurrentProjectBaseDir()+getFileSeparator()+".."+getFileSeparator()+"jmxri"
+ +getFileSeparator()+"lib"+getFileSeparator();
+ }
+
+ protected String getJMXRIJarPath()
+ {
+ return getJMXRIBasePath()+"jmxri.jar";
+ }
+
+ protected String getJMXRIRemoteJarPath()
+ {
+ return getJMXRIBasePath()+"jmxremote.jar";
+ }
+
+ protected String getJMXRIRemoteOptionalJarPath()
+ {
+ return getJMXRIBasePath()+"jmxremote_optional.jar";
+ }
+
+ protected String getJAASJarPath()
+ {
+ return getJMXRIBasePath()+"jaas-1.0.01.jar";
+ }
}
Modified: trunk/mx4j/jsr160/pom.xml
===================================================================
--- trunk/mx4j/jsr160/pom.xml 2010-01-02 09:14:46 UTC (rev 2287)
+++ trunk/mx4j/jsr160/pom.xml 2010-01-03 00:31:01 UTC (rev 2288)
@@ -19,8 +19,6 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<testExcludes>
- <exclude>**/RemoteJMXSerializationTest.java</exclude>
- <exclude>**/RemoteJMXSignatureTest.java</exclude>
<exclude>**/RemoteSecurityManagerTestCase.java</exclude>
<exclude>**/RMIJRMPRemoteSecurityManagerTest.java</exclude>
</testExcludes>
Modified: trunk/mx4j/jsr160/src/test/java/test/javax/management/remote/compliance/OptionalRemoteJMXComplianceTestCase.java
===================================================================
--- trunk/mx4j/jsr160/src/test/java/test/javax/management/remote/compliance/OptionalRemoteJMXComplianceTestCase.java 2010-01-02 09:14:46 UTC (rev 2287)
+++ trunk/mx4j/jsr160/src/test/java/test/javax/management/remote/compliance/OptionalRemoteJMXComplianceTestCase.java 2010-01-03 00:31:01 UTC (rev 2288)
@@ -27,7 +27,7 @@
protected JarFile loadJar() throws IOException
{
- File rjmx = new File("dist/test/jmxremote_optional.jar");
+ File rjmx = new File(getJMXRIRemoteOptionalJarPath());
if (!rjmx.exists()) fail("JMX Optional Remote jar is not available");
JarFile jar = new JarFile(rjmx);
return jar;
Modified: trunk/mx4j/jsr160/src/test/java/test/javax/management/remote/compliance/RemoteJMXComplianceTestCase.java
===================================================================
--- trunk/mx4j/jsr160/src/test/java/test/javax/management/remote/compliance/RemoteJMXComplianceTestCase.java 2010-01-02 09:14:46 UTC (rev 2287)
+++ trunk/mx4j/jsr160/src/test/java/test/javax/management/remote/compliance/RemoteJMXComplianceTestCase.java 2010-01-03 00:31:01 UTC (rev 2288)
@@ -27,7 +27,7 @@
protected JarFile loadJar() throws IOException
{
- File rjmx = new File("dist/test/jmxremote.jar");
+ File rjmx = new File(getJMXRIRemoteJarPath());
if (!rjmx.exists()) fail("JMX Remote jar is not available");
JarFile jar = new JarFile(rjmx);
return jar;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev