[infinispan-commits] Infinispan SVN: r1826 - trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Wed May 19 11:28:15 EDT 2010
Author: galder.zamarreno at jboss.com
Date: 2010-05-19 11:28:15 -0400 (Wed, 19 May 2010)
New Revision: 1826
Modified:
trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodDistributionTest.scala
trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodMultiNodeTest.scala
Log:
[ISPN-424] (Enhance ping request to take a cache name) Added a test to verify expected behaivour.
Modified: trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodDistributionTest.scala
===================================================================
--- trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodDistributionTest.scala 2010-05-19 14:20:08 UTC (rev 1825)
+++ trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodDistributionTest.scala 2010-05-19 15:28:15 UTC (rev 1826)
@@ -8,13 +8,14 @@
import test.HotRodClient
import test.HotRodTestingUtil._
import org.testng.Assert._
+import org.infinispan.test.TestingUtil
+import org.infinispan.distribution.UnionConsistentHash
import collection.mutable.ListBuffer
-import org.infinispan.distribution.UnionConsistentHash
-import org.infinispan.test.TestingUtil
-import org.infinispan.test.AbstractCacheTest._
/**
- * // TODO: Document this
+ * Tests Hot Rod logic when interacting with distributed caches, particularly logic to do with
+ * hash-distribution-aware headers and how it behaves when cluster formation changes.
+ *
* @author Galder Zamarreño
* @since 4.1
*/
@@ -26,8 +27,13 @@
override protected def createCacheConfig: Configuration = getDefaultClusteredConfig(CacheMode.DIST_SYNC)
def testDistributedPutWithTopologyChanges(m: Method) {
- var resp = clients.head.put(k(m) , 0, 0, v(m), 1, 0)
+ var resp = clients.head.ping(3, 0)
assertStatus(resp.status, Success)
+ var expectedHashIds = generateExpectedHashIds
+ assertHashTopologyReceived(resp.topologyResponse.get, servers, expectedHashIds)
+
+ resp = clients.head.put(k(m) , 0, 0, v(m), 1, 0)
+ assertStatus(resp.status, Success)
assertEquals(resp.topologyResponse, None)
assertSuccess(clients.tail.head.get(k(m), 0), v(m))
resp = clients.head.put(k(m) , 0, 0, v(m, "v1-"), 2, 0)
@@ -43,7 +49,7 @@
resp = clients.head.put(k(m) , 0, 0, v(m, "v4-"), 3, 0)
assertStatus(resp.status, Success)
- var expectedHashIds = generateExpectedHashIds
+ expectedHashIds = generateExpectedHashIds
assertHashTopologyReceived(resp.topologyResponse.get, servers, expectedHashIds)
assertSuccess(clients.tail.head.get(k(m), 0), v(m, "v4-"))
resp = clients.tail.head.put(k(m) , 0, 0, v(m, "v5-"), 3, 1)
Modified: trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodMultiNodeTest.scala
===================================================================
--- trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodMultiNodeTest.scala 2010-05-19 14:20:08 UTC (rev 1825)
+++ trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodMultiNodeTest.scala 2010-05-19 15:28:15 UTC (rev 1826)
@@ -5,15 +5,14 @@
import org.testng.annotations.{AfterMethod, AfterClass, Test}
import test.HotRodClient
import test.HotRodTestingUtil._
-import org.infinispan.config.Configuration.CacheMode
/**
- * // TODO: Document this
+ * Base test class for multi node or clustered Hot Rod tests.
+ *
* @author Galder Zamarreño
* @since 4.1
*/
abstract class HotRodMultiNodeTest extends MultipleCacheManagersTest {
- import HotRodServer._
private[this] var hotRodServers: List[HotRodServer] = List()
private[this] var hotRodClients: List[HotRodClient] = List()
More information about the infinispan-commits
mailing list