[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/marshall ...
Manik Surtani
msurtani at jboss.com
Mon Jan 15 11:19:09 EST 2007
User: msurtani
Date: 07/01/15 11:19:09
Modified: tests/functional/org/jboss/cache/marshall
RemoteCallerReturnValuesTest.java
ReturnValueMarshallingTest.java
Log:
* JBCACHE-752
* Refactored GravitationResult
* Updated CacheMarshaller200 to marshall GravitateResults and NodeData
* Moved NodeData (and related objects) to o.j.c.marshall pkg
Revision Changes Path
1.2 +1 -1 JBossCache/tests/functional/org/jboss/cache/marshall/RemoteCallerReturnValuesTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RemoteCallerReturnValuesTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/RemoteCallerReturnValuesTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- RemoteCallerReturnValuesTest.java 15 Jan 2007 11:22:39 -0000 1.1
+++ RemoteCallerReturnValuesTest.java 15 Jan 2007 16:19:09 -0000 1.2
@@ -38,7 +38,7 @@
Object retval = cache._replicate(MethodCallFactory.create(MethodDeclarations.clusteredGetMethod, MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal, fqn), false));
assertNotNull(retval);
- assertNotNull(cache._replicate(MethodCallFactory.create(MethodDeclarations.dataGravitationMethod, fqn, false, false)));
+ assertNotNull(cache._replicate(MethodCallFactory.create(MethodDeclarations.dataGravitationMethod, fqn, false)));
}
1.2 +12 -15 JBossCache/tests/functional/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ReturnValueMarshallingTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/ReturnValueMarshallingTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ReturnValueMarshallingTest.java 15 Jan 2007 11:22:39 -0000 1.1
+++ ReturnValueMarshallingTest.java 15 Jan 2007 16:19:09 -0000 1.2
@@ -5,6 +5,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Region;
+import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.config.Configuration;
import java.util.List;
@@ -29,11 +30,13 @@
cache1 = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
cache1.getConfiguration().setUseRegionBasedMarshalling(true);
cache1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
+ cache1.getConfiguration().setSyncReplTimeout(60000);// to aid with debugging
cache1.start();
cache2 = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
cache2.getConfiguration().setUseRegionBasedMarshalling(true);
cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
+ cache2.getConfiguration().setSyncReplTimeout(60000);// to aid with debugging
cache2.start();
classLoader = getClassLoader();
@@ -112,26 +115,20 @@
// now test if this is the same when obtained using a data gravitate call
MethodCall call = MethodCallFactory.create(MethodDeclarations.replicateMethod,
MethodCallFactory.create(MethodDeclarations.dataGravitationMethod,
- fqn, false, false
+ fqn, false
)
);
List responses = cache1.getRPCManager().callRemoteMethods(null, call, true, true, 15000);
- List response1 = (List) responses.get(0);// response from the first (and only) node
-
- Boolean found = (Boolean) response1.get(0);
- assertTrue("Should have found remote data", found);
-
- Object data = response1.get(1);
+ GravitateResult data = (GravitateResult) responses.get(0);// response from the first (and only) node
- // now test that the data returned has been marshalled using the appropriate class loader.
-
- // what is this data object returned? :S
- System.out.println(data);
-
- assertNotNull(data);
- assertNotSame(MyList.class, data.getClass());
- assertSame(listClass, data.getClass());
+ assertTrue("Should have found remote data", data.isDataFound());
+ assertNotNull(data.getNodeData());
+ Object value = data.getNodeData().get(0).getAttributes().get(key);
+
+ assertNotNull(value);
+ assertNotSame(MyList.class, value.getClass());
+ assertSame(listClass, value.getClass());
}
}
More information about the jboss-cvs-commits
mailing list