From 01178cf6ceaa5ce588854a67f9228fc70644f46c Mon Sep 17 00:00:00 2001 From: lresende Date: Tue, 5 May 2009 07:29:08 +0000 Subject: TUSCANY-2968 - Enabling more tests that are currently passing git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@771606 13f79535-47bb-0310-9956-ffa450edef68 --- .../jsonrpc/JSONRPCDataTypeTestCase.java | 27 +++++++++++----------- .../jsonrpc/JSONRPCExceptionTestCase.java | 18 +++++++-------- .../wireformat/jsonrpc/JSONRPCServiceTestCase.java | 8 +++---- 3 files changed, 27 insertions(+), 26 deletions(-) (limited to 'branches/sca-java-1.x/itest/http-jsonrpc') diff --git a/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCDataTypeTestCase.java b/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCDataTypeTestCase.java index 6b59aae03e..0241e073c6 100644 --- a/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCDataTypeTestCase.java +++ b/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCDataTypeTestCase.java @@ -24,8 +24,8 @@ import junit.framework.Assert; import org.apache.tuscany.sca.host.embedded.SCADomain; import org.json.JSONObject; -import org.junit.After; -import org.junit.Before; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; @@ -40,21 +40,22 @@ import com.meterware.httpunit.WebResponse; public class JSONRPCDataTypeTestCase { private static final String SERVICE_PATH = "/EchoService"; - private static final String SERVICE_URL = "http://localhost:8085/SCADomain" + SERVICE_PATH; - private SCADomain domain; + private static final String SERVICE_URL = "http://localhost:8085/" + SERVICE_PATH; + + private static SCADomain domain; - //@Before - public void setUp() throws Exception { - domain = SCADomain.newInstance("JSONRPCBinding.composite"); + @BeforeClass + public static void setUp() throws Exception { + domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCBinding.composite"); } - //@After - public void tearDown() throws Exception { + @AfterClass + public static void tearDown() throws Exception { domain.close(); } - //@Test - @Ignore("Work in progress") + @Test + //@Ignore("Work in progress") public void testInt() throws Exception { JSONObject jsonRequest = new JSONObject( "{ \"method\": \"echoInt\", \"params\": [12345], \"id\": 4}"); @@ -71,8 +72,8 @@ public class JSONRPCDataTypeTestCase { Assert.assertEquals(12345, jsonResp.getInt("result")); } - //@Test - @Ignore("Work in progress") + @Test + //@Ignore("Work in progress") public void testBoolean() throws Exception { JSONObject jsonRequest = new JSONObject( "{ \"method\": \"echoBoolean\", \"params\": [true], \"id\": 5}"); diff --git a/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCExceptionTestCase.java b/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCExceptionTestCase.java index b652f742b0..94cf75d00b 100644 --- a/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCExceptionTestCase.java +++ b/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCExceptionTestCase.java @@ -24,8 +24,8 @@ import junit.framework.Assert; import org.apache.tuscany.sca.host.embedded.SCADomain; import org.json.JSONObject; -import org.junit.After; -import org.junit.Before; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; @@ -41,17 +41,17 @@ public class JSONRPCExceptionTestCase{ private static final String SERVICE_PATH = "/EchoService"; - private static final String SERVICE_URL = "http://localhost:8085/SCADomain" + SERVICE_PATH; + private static final String SERVICE_URL = "http://localhost:8085/" + SERVICE_PATH; - private SCADomain domain; + private static SCADomain domain; - //@Before - public void setUp() throws Exception { - domain = SCADomain.newInstance("JSONRPCBinding.composite"); + //@BeforeClass + public static void setUp() throws Exception { + domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCBinding.composite"); } - //@After - public void tearDown() throws Exception { + //@AfterClass + public static void tearDown() throws Exception { domain.close(); } diff --git a/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCServiceTestCase.java b/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCServiceTestCase.java index 5a1196cde4..ac03704db0 100644 --- a/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCServiceTestCase.java +++ b/branches/sca-java-1.x/itest/http-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/JSONRPCServiceTestCase.java @@ -52,7 +52,7 @@ public class JSONRPCServiceTestCase { @AfterClass public static void tearDown() throws Exception { - domain.close(); + domain.close(); } @Test @@ -65,13 +65,13 @@ public class JSONRPCServiceTestCase { WebResponse response = wc.getResource(request); Assert.assertEquals(200, response.getResponseCode()); - + JSONObject jsonResp = new JSONObject(response.getText()); Assert.assertEquals("echo: Hello JSON-RPC", jsonResp.getString("result")); } - + @Test public void testDummy() throws Exception { - + } } \ No newline at end of file -- cgit v1.2.3