incubator-esme-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=836072&view=rev
Log:
Misc test enhancement

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=836072&r1=836071&r2=836072&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:27 2009
@@ -40,6 +40,7 @@
 import net.sourceforge.jwebunit.junit.WebTester
 import _root_.junit.framework.AssertionFailedError
 import testing.{ReportFailure, TestKit, HttpResponse, TestFramework}
+
 class ApiSpecsAsTest extends JUnit3(ApiSpecs)
 object ApiSpecsRunner extends ConsoleRunner(ApiSpecs)
 
@@ -48,9 +49,9 @@
 
   val baseUrl = JettyTestServer.urlFor("")
 
-implicit val reportError = new ReportFailure {
-  def fail(msg: String): Nothing = ApiSpecs.this.fail(msg)
-}
+  implicit val reportError = new ReportFailure {
+    def fail(msg: String): Nothing = ApiSpecs.this.fail(msg)
+  }
 
   val theUser = User.createAndPopulate.nickname("api_test").saveMe
   val token = {
@@ -66,17 +67,17 @@
   }
 
   def shouldnt(f: => Unit): Unit =
-  try {
-    val x = f
-    fail("Shouldn't succeed")
-  } catch {
-    case _ => ()
-  }
+    try {
+      val x = f
+      fail("Shouldn't succeed")
+    } catch {
+      case _ => ()
+    }
 
   "API" should {
 
     "Login" in {
-      for {
+      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))



Mime
View raw message