Author: manik.surtani(a)jboss.com
Date: 2008-02-06 08:11:22 -0500 (Wed, 06 Feb 2008)
New Revision: 5313
Modified:
core/trunk/src/test/java/org/jboss/cache/factories/CustomInterceptorChainTest.java
core/trunk/src/test/java/org/jboss/cache/loader/FileCacheLoaderTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java
Log:
Fixed broken tests
Modified:
core/trunk/src/test/java/org/jboss/cache/factories/CustomInterceptorChainTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/factories/CustomInterceptorChainTest.java 2008-02-06
03:25:50 UTC (rev 5312)
+++
core/trunk/src/test/java/org/jboss/cache/factories/CustomInterceptorChainTest.java 2008-02-06
13:11:22 UTC (rev 5313)
@@ -54,14 +54,14 @@
public void testInjectionAtHead()
{
List<Interceptor> interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 8 interceptors", 8, interceptors.size());
+ assertEquals("Expecting 6 interceptors", 6, interceptors.size());
assertInterceptorLinkage(interceptors);
Interceptor x = new TestInterceptor();
cache.addInterceptor(x, 0);
interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 9 interceptors", 9, interceptors.size());
+ assertEquals("Expecting 7 interceptors", 7, interceptors.size());
assertInterceptorLinkage(interceptors);
assertEquals(x, interceptors.get(0));
@@ -70,30 +70,30 @@
public void testInjectionAtTail()
{
List<Interceptor> interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 8 interceptors", 8, interceptors.size());
+ assertEquals("Expecting 6 interceptors", 6, interceptors.size());
assertInterceptorLinkage(interceptors);
Interceptor x = new TestInterceptor();
- cache.addInterceptor(x, 8);
+ cache.addInterceptor(x, 6);
interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 9 interceptors", 9, interceptors.size());
+ assertEquals("Expecting 7 interceptors", 7, interceptors.size());
assertInterceptorLinkage(interceptors);
- assertEquals(x, interceptors.get(8));
+ assertEquals(x, interceptors.get(6));
}
public void testInjectionInMiddle()
{
List<Interceptor> interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 8 interceptors", 8, interceptors.size());
+ assertEquals("Expecting 6 interceptors", 6, interceptors.size());
assertInterceptorLinkage(interceptors);
Interceptor x = new TestInterceptor();
cache.addInterceptor(x, 3);
interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 9 interceptors", 9, interceptors.size());
+ assertEquals("Expecting 7 interceptors", 7, interceptors.size());
assertInterceptorLinkage(interceptors);
assertEquals(x, interceptors.get(3));
@@ -102,7 +102,7 @@
public void testInjectionBeyondTail()
{
List<Interceptor> interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 8 interceptors", 8, interceptors.size());
+ assertEquals("Expecting 6 interceptors", 6, interceptors.size());
assertInterceptorLinkage(interceptors);
Interceptor x = new TestInterceptor();
@@ -121,13 +121,13 @@
{
List<Interceptor> interceptors = cache.getInterceptorChain();
Interceptor afterHead = interceptors.get(1);
- assertEquals("Expecting 8 interceptors", 8, interceptors.size());
+ assertEquals("Expecting 6 interceptors", 6, interceptors.size());
assertInterceptorLinkage(interceptors);
cache.removeInterceptor(0);
interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 7 interceptors", 7, interceptors.size());
+ assertEquals("Expecting 5 interceptors", 5, interceptors.size());
assertInterceptorLinkage(interceptors);
assertEquals(afterHead, interceptors.get(0));
@@ -137,7 +137,7 @@
{
List<Interceptor> interceptors = cache.getInterceptorChain();
Interceptor beforeTail = interceptors.get(4);
- assertEquals("Expecting 8 interceptors", 8, interceptors.size());
+ assertEquals("Expecting 6 interceptors", 6, interceptors.size());
assertInterceptorLinkage(interceptors);
cache.removeInterceptor(5);
@@ -146,7 +146,7 @@
System.out.println(interceptors);
- assertEquals("Expecting 7 interceptors", 7, interceptors.size());
+ assertEquals("Expecting 5 interceptors", 5, interceptors.size());
assertInterceptorLinkage(interceptors);
assertEquals(beforeTail, interceptors.get(4));
@@ -155,20 +155,20 @@
public void testRemoveAtMiddle()
{
List<Interceptor> interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 8 interceptors", 8, interceptors.size());
+ assertEquals("Expecting 6 interceptors", 6, interceptors.size());
assertInterceptorLinkage(interceptors);
cache.removeInterceptor(3);
interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 7 interceptors", 7, interceptors.size());
+ assertEquals("Expecting 5 interceptors", 5, interceptors.size());
assertInterceptorLinkage(interceptors);
}
public void testRemoveBeyondTail()
{
List<Interceptor> interceptors = cache.getInterceptorChain();
- assertEquals("Expecting 8 interceptors", 8, interceptors.size());
+ assertEquals("Expecting 6 interceptors", 6, interceptors.size());
assertInterceptorLinkage(interceptors);
try
Modified: core/trunk/src/test/java/org/jboss/cache/loader/FileCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/FileCacheLoaderTest.java 2008-02-06
03:25:50 UTC (rev 5312)
+++ core/trunk/src/test/java/org/jboss/cache/loader/FileCacheLoaderTest.java 2008-02-06
13:11:22 UTC (rev 5313)
@@ -1,11 +1,10 @@
package org.jboss.cache.loader;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.misc.TestingUtil;
import static org.testng.AssertJUnit.assertEquals;
import org.testng.annotations.Test;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.misc.TestingUtil;
-
@Test(groups = {"functional"})
public class FileCacheLoaderTest extends CacheLoaderTestsBase
{
@@ -22,13 +21,13 @@
FileCacheLoader fcl = new FileCacheLoader();
Object[][] data = new Object[][]{
- {"C:\\here\\there.txt", true},
- {"/home/here/there", true},
- {"/home/*/jboss", false},
- {"C:\\>/jgroups/jboss", false},
- {"/cache/jboss<", false},
- {"/pojocache|/galder", false},
- {"/pojocache/gal\"der", false}};
+ {"C:\\here\\there.txt", true},
+ {"/home/here/there", true},
+ {"/home/*/jboss", false},
+ {"C:\\>/jgroups/jboss", false},
+ {"/cache/jboss<", false},
+ {"/pojocache|/galder", false},
+ {"/pojocache/gal\"der", false}};
for (Object[] aData : data)
{
@@ -43,16 +42,16 @@
FileCacheLoader fcl = new FileCacheLoader();
Object[][] data = new Object[][]{
- {Fqn.fromString("/a/b/c/d/e"), true},
- {Fqn.fromString("/a/*/c/d/e"), false},
- {Fqn.fromString("/a/b/>/d/e"), false},
- {Fqn.fromString("/a/</c/d/e"), false},
- {Fqn.fromString("/|/b/c/d/e"), false},
- {Fqn.fromString("/|/b/c/d/e"), false},
- {Fqn.fromString("/a/b/c/d/\""), false},
- {Fqn.fromString("/a/b/c/d/\\"), false},
- {Fqn.fromString("/a/b/c/d///"), true},
- {Fqn.fromString("/a/b/c/:/e"), false},};
+ {Fqn.fromString("/a/b/c/d/e"), true},
+ {Fqn.fromString("/a/*/c/d/e"), false},
+ {Fqn.fromString("/a/b/>/d/e"), false},
+ {Fqn.fromString("/a/</c/d/e"), false},
+ {Fqn.fromString("/|/b/c/d/e"), false},
+ {Fqn.fromString("/|/b/c/d/e"), false},
+ {Fqn.fromString("/a/b/c/d/\""), false},
+ {Fqn.fromString("/a/b/c/d/\\"), false},
+ {Fqn.fromString("/a/b/c/d///"), true},
+ {Fqn.fromString("/a/b/c/:/e"), false},};
for (Object[] aData : data)
{
@@ -64,12 +63,15 @@
public void testIsLengthPortablePath()
{
+
+ // This now always returns true unless we are using a Windows OS older than version
4.0 (Windows 2000/NT)
+
FileCacheLoader fcl = new FileCacheLoader();
Object[][] data = new Object[][]{
-
{"C:\\here\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\web_services\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\webservices\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\data.dat",
true},
-
{"C:\\there\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\web_services\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\webservices\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\data.dat",
true},
-
{"C:\\deerme\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\web_services\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\webservices\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\data.dat",
false}};
+
{"C:\\here\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\web_services\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\webservices\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\data.dat",
true},
+
{"C:\\there\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\web_services\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\webservices\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\data.dat",
true},
+
{"C:\\deerme\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\web_services\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\webservices\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\data.dat",
true}};
for (Object[] aData : data)
{
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java 2008-02-06
03:25:50 UTC (rev 5312)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java 2008-02-06
13:11:22 UTC (rev 5313)
@@ -46,8 +46,10 @@
@BeforeMethod
public void setUp()
{
- cache1 = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object,
Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.REPL_SYNC));
- cache2 = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object,
Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.REPL_SYNC));
+ cache1 = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object,
Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.REPL_SYNC,
false));
+ cache2 = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object,
Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.REPL_SYNC,
false));
+ cache1.getConfiguration().setUseLazyDeserialization(true);
+ cache2.getConfiguration().setUseLazyDeserialization(true);
assert TestingUtil.findInterceptor(cache1, MarshalledValueInterceptor.class) !=
null : "Marshalled value interceptor not in chain!";
assert TestingUtil.findInterceptor(cache2, MarshalledValueInterceptor.class) !=
null : "Marshalled value interceptor not in chain!";