[infinispan-commits] Infinispan SVN: r1789 - in trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod: test and 1 other directory.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Thu May 13 09:37:18 EDT 2010


Author: galder.zamarreno at jboss.com
Date: 2010-05-13 09:37:17 -0400 (Thu, 13 May 2010)
New Revision: 1789

Modified:
   trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodFunctionalTest.scala
   trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala
Log:
[ISPN-432] (Add test to verify that a Hot Rod request to an undefined cache fails) Test added.

Modified: trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodFunctionalTest.scala
===================================================================
--- trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodFunctionalTest.scala	2010-05-12 07:39:51 UTC (rev 1788)
+++ trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodFunctionalTest.scala	2010-05-13 13:37:17 UTC (rev 1789)
@@ -33,7 +33,7 @@
 
    def testUnknownMagic(m: Method) {
       client.assertPut(m) // Do a put to make sure decoder gets back to reading properly
-      val status = client.executeWithBadMagic(0x66, 0x01, cacheName, k(m) , 0, 0, v(m), 0).status
+      val status = client.executeExpectBadMagic(0x66, 0x01, cacheName, k(m) , 0, 0, v(m), 0).status
       assertEquals(status, InvalidMagicOrMsgId,
          "Status should have been 'InvalidMagicOrMsgId' but instead was: " + status)
    }
@@ -52,10 +52,12 @@
       assertTrue(Arrays.equals(value.data, v(m)));
    }
 
-//   def testPutOnUndefinedCache(m: Method) {
-//      val status = client.execute(0xA0, 0x01, "boomooo", k(m), 0, 0, v(m), 0, 1, 0).status
-//      assertEquals(status, ServerError, "Status should have been 'ServerError' but instead was: " + status)
-//   }
+   def testPutOnUndefinedCache(m: Method) {
+      var status = client.execute(0xA0, 0x01, "boomooo", k(m), 0, 0, v(m), 0, 1, 0).status
+      assertEquals(status, ServerError, "Status should have been 'ServerError' but instead was: " + status)
+      status = client.executeExpectBadMagic(0xA0, 0x01, cacheName, k(m) , 0, 0, v(m), 0).status
+      client.assertPut(m)
+   }
 
    def testPutWithLifespan(m: Method) {
       client.assertPut(m, 1, 0)

Modified: trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala
===================================================================
--- trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala	2010-05-12 07:39:51 UTC (rev 1788)
+++ trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala	2010-05-13 13:37:17 UTC (rev 1789)
@@ -121,7 +121,7 @@
       execute(op, op.id)
    }
 
-   def executeWithBadMagic(magic: Int, code: Byte, name: String, k: Array[Byte], lifespan: Int, maxIdle: Int,
+   def executeExpectBadMagic(magic: Int, code: Byte, name: String, k: Array[Byte], lifespan: Int, maxIdle: Int,
                            v: Array[Byte], version: Long): ErrorResponse = {
       val op = new Op(magic, code, name, k, lifespan, maxIdle, v, 0, version, 1, 0)
       execute(op, 0).asInstanceOf[ErrorResponse]



More information about the infinispan-commits mailing list