You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@esme.apache.org by rh...@apache.org on 2010/01/11 13:09:03 UTC
svn commit: r897846 -
/incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/ApiTest.scala
Author: rhirsch
Date: Mon Jan 11 12:09:02 2010
New Revision: 897846
URL: http://svn.apache.org/viewvc?rev=897846&view=rev
Log:
[ESME-153] Test Cases for Original API
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=897846&r1=897845&r2=897846&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 Mon Jan 11 12:09:02 2010
@@ -150,8 +150,14 @@
for{
login <- post("/api/login", "token" -> token) !@ "Failed to log in" if (testSuccess(login))
add_action <- login.post("/api/add_action", "name" -> "test", "test" -> "#moo", "action" -> "filter") !@ "Failed to add action" if (testSuccess(add_action))
+ add_action1 <- login.post("/api/add_action", "name" -> "1test", "test" -> "#moo", "action" -> "filter") !@ "Failed to add action with a name starting with a number" if (testSuccess(add_action1))
+ add_action2 <- login.post("/api/add_action", "name" -> "test1", "test" -> "#moo", "action" -> "filter") !@ "Failed to add action with a name including a number" if (testSuccess(add_action2))
+ add_action3 <- login.post("/api/add_action", "name" -> "test%", "test" -> "#moo", "action" -> "filter") !@ "Failed to add action with a name including a punctuation" if (testSuccess(add_action3))
+ add_action4 <- login.post("/api/add_action", "name" -> "t", "test" -> "#moo", "action" -> "filter") !@ "Failed to add action with a short name with one character" if (testSuccess(add_action4))
+ add_action5 <- login.post("/api/add_action", "name" -> "tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt", "test" -> "#moo", "action" -> "filter") !@ "Failed to add action with a long name" if (testSuccess(add_action5))
+
} {
- println(add_action.xml)
+ //println(add_action.xml)
}
}
@@ -162,7 +168,8 @@
add_action1 <- login.post("/api/add_action", "name" -> "test", "test" -> "#moo") !@ "add_action should have failed: no action" if shouldnt(testSuccess(add_action1))
add_action2 <- login.post("/api/add_action", "name" -> "test", "action" -> "filter") !@ "add_action should have failed: no test" if shouldnt(testSuccess(add_action2))
add_action3 <- login.post("/api/add_action", "action" -> "filter", "test" -> "#moo") !@ "add_action should have failed: no name" if shouldnt(testSuccess(add_action3))
- add_action4 <- login.post("/api/add_action", "name" -> "test", "test" -> "moo", "action" -> "filter") !@ "add_action should have failed: no name" if shouldnt(testSuccess(add_action3))
+ add_action4 <- login.post("/api/add_action", "name" -> "test", "test" -> "unkown", "action" -> "filter") !@ "add_action should have failed: unknown test" if shouldnt(testSuccess(add_action4))
+ add_action5 <- login.post("/api/add_action", "name" -> "test", "test" -> "moo", "action" -> "unknown") !@ "add_action should have failed: unknown action" if shouldnt(testSuccess(add_action5))
} {
println(add_action3.xml)