[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/marshall ...
Manik Surtani
msurtani at jboss.com
Wed Dec 20 08:16:27 EST 2006
User: msurtani
Date: 06/12/20 08:16:27
Modified: tests/functional/org/jboss/cache/marshall
RedeploymentEmulationTest.java
Log:
Should help with CC runs now...
Revision Changes Path
1.3 +20 -16 JBossCache/tests/functional/org/jboss/cache/marshall/RedeploymentEmulationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RedeploymentEmulationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/RedeploymentEmulationTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- RedeploymentEmulationTest.java 1 Dec 2006 15:29:54 -0000 1.2
+++ RedeploymentEmulationTest.java 20 Dec 2006 13:16:27 -0000 1.3
@@ -7,17 +7,16 @@
package org.jboss.cache.marshall;
import junit.framework.TestCase;
-import org.jboss.cache.TreeCache;
import org.jboss.cache.Cache;
import org.jboss.cache.Fqn;
import org.jboss.cache.Region;
-import org.jboss.cache.CacheSPI;
+import org.jboss.cache.TreeCache;
import org.jboss.cache.config.Configuration;
import org.jgroups.Global;
-import java.net.URLClassLoader;
-import java.net.URL;
import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
/**
* Unit test demonstrating usability of marshalling for application redeployment in application server.
@@ -30,8 +29,8 @@
private static final String INSTANCE_LIBRARY = "jgroups.jar";
private static final String INSTANCE_CLASS_NAME = "org.jgroups.Global";
- private static final String USER_DIR = System.getProperty("user.dir");
- private static final String FILE_SEPARATOR = System.getProperty("file.separator");
+ private static final String USER_DIR = ".";//System.getProperty("user.dir");
+ private static final String FILE_SEPARATOR = File.separator;//System.getProperty("file.separator");
private static final String LIB_DIR = "lib";
protected void setUp() throws Exception
@@ -44,13 +43,18 @@
cache.getConfiguration().setUseRegionBasedMarshalling(true);
}
+ protected void tearDown()
+ {
+ cache.stop();
+ }
+
public void testClassCastException() throws Exception
{
cache.start();
File f = new File(USER_DIR + FILE_SEPARATOR + LIB_DIR + FILE_SEPARATOR);
URL context = f.toURL();
- URL jar= new URL(context, INSTANCE_LIBRARY);
+ URL jar = new URL(context, INSTANCE_LIBRARY);
URLClassLoader ucl1 = new URLClassLoader(new URL[]{jar}, null);
Thread.currentThread().setContextClassLoader(ucl1);
@@ -60,10 +64,10 @@
Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
try
{
- Global object = (Global)cache.get(fqn("/a"), "key");
+ Global object = (Global) cache.get(fqn("/a"), "key");
fail("Should have produced a ClassCastException");
}
- catch(ClassCastException cce)
+ catch (ClassCastException cce)
{
assertTrue(cce.getMessage().equals(INSTANCE_CLASS_NAME));
}
@@ -75,7 +79,7 @@
File f = new File(USER_DIR + FILE_SEPARATOR + LIB_DIR + FILE_SEPARATOR);
URL context = f.toURL();
- URL jar= new URL(context, INSTANCE_LIBRARY);
+ URL jar = new URL(context, INSTANCE_LIBRARY);
URLClassLoader ucl1 = new URLClassLoader(new URL[]{jar}, null);
Thread.currentThread().setContextClassLoader(ucl1);
@@ -95,10 +99,10 @@
try
{
- Global object = (Global)cache.get(fqn("/a"), "key");
+ Global object = (Global) cache.get(fqn("/a"), "key");
assertNull(object);
}
- catch(ClassCastException cce)
+ catch (ClassCastException cce)
{
fail("Should not have produced a ClassCastException");
}
More information about the jboss-cvs-commits
mailing list