esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r836071 - /incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/ApiTest.scala
Date Sat, 14 Nov 2009 00:09:22 GMT
Author: dpp
Date: Sat Nov 14 00:09:21 2009
New Revision: 836071

URL: http://svn.apache.org/viewvc?rev=836071&view=rev
Log:
More tests

Modified:
    incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/ApiTest.scala

Modified: incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/ApiTest.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/ApiTest.scala?rev=836071&r1=836070&r2=836071&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/ApiTest.scala (original)
+++ incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/ApiTest.scala Sat Nov 14
00:09:21 2009
@@ -65,17 +65,26 @@
     (resp.xml \ "@success").text must_== "true"
   }
 
+  def shouldnt(f: => Unit): Unit =
+  try {
+    val x = f
+    fail("Shouldn't succeed")
+  } catch {
+    case _ => ()
+  }
+
   "API" should {
 
     "Login" in {
       for {
         login <- post("/api/login", "token" -> token) !@ "Failed to log in" if (testSuccess(login))
         status <- login.get("/api/status") !@ "Failed to get status" if (testSuccess(status))
+        otherStatus <- get("/api/status") if shouldnt(testSuccess(status))
       } {
         (status.xml \ "user" \ "@id").text must_== theUser.id.toString
       }
     }
 
-    
+
   }
 }



Mime
View raw message