Author: lresende
Date: Thu Oct 1 04:04:27 2009
New Revision: 820527
URL: http://svn.apache.org/viewvc?rev=820527&view=rev
Log:
Bringin up JSON-RPC binding test cases
Modified:
tuscany/java/sca/modules/binding-jsonrpc-runtime/META-INF/MANIFEST.MF
tuscany/java/sca/modules/binding-jsonrpc-runtime/pom.xml
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCExceptionTestCase.java
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCSmdTestCase.java
Modified: tuscany/java/sca/modules/binding-jsonrpc-runtime/META-INF/MANIFEST.MF
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jsonrpc-runtime/META-INF/MANIFEST.MF?rev=820527&r1=820526&r2=820527&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jsonrpc-runtime/META-INF/MANIFEST.MF
(original)
+++ tuscany/java/sca/modules/binding-jsonrpc-runtime/META-INF/MANIFEST.MF Thu
Oct 1 04:04:27 2009
@@ -26,6 +26,7 @@
org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
org.apache.tuscany.sca.invocation,
org.apache.tuscany.sca.monitor;version="2.0",
+ org.apache.tuscany.sca.node;version="2.0.0",
org.apache.tuscany.sca.provider,
org.apache.tuscany.sca.runtime,
org.json;version="1.0.0",
Modified: tuscany/java/sca/modules/binding-jsonrpc-runtime/pom.xml
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jsonrpc-runtime/pom.xml?rev=820527&r1=820526&r2=820527&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jsonrpc-runtime/pom.xml (original)
+++ tuscany/java/sca/modules/binding-jsonrpc-runtime/pom.xml Thu Oct 1
04:04:27 2009
@@ -106,6 +106,13 @@
<!-- Test Dependencies -->
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-java-runtime</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>test</scope>
Modified:
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java?rev=820527&r1=820526&r2=820527&view=diff
==============================================================================
---
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java
(original)
+++
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java
Thu Oct 1 04:04:27 2009
@@ -22,11 +22,13 @@
import junit.framework.Assert;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
import org.json.JSONObject;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import com.meterware.httpunit.PostMethodWebRequest;
@@ -41,16 +43,24 @@
private static final String SERVICE_PATH = "/EchoService";
private static final String SERVICE_URL =
"http://localhost:8085/SCADomain" + SERVICE_PATH;
- private SCADomain domain;
-
- @Before
- public void setUp() throws Exception {
- domain = SCADomain.newInstance("JSONRPCBinding.composite");
- }
+
+ private static Node node;
- @After
- public void tearDown() throws Exception {
- domain.close();
+ @BeforeClass
+ public static void setUp() throws Exception {
+ try {
+ String contribution =
ContributionLocationHelper.getContributionLocation(JSONRPCDataTypeTestCase.class);
+ node =
NodeFactory.newInstance().createNode("JSONRPCBinding.composite", new
Contribution("test", contribution));
+ node.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ node.destroy();
}
@Test
Modified:
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCExceptionTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCExceptionTestCase.java?rev=820527&r1=820526&r2=820527&view=diff
==============================================================================
---
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCExceptionTestCase.java
(original)
+++
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCExceptionTestCase.java
Thu Oct 1 04:04:27 2009
@@ -22,10 +22,13 @@
import junit.framework.Assert;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
import org.json.JSONObject;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import com.meterware.httpunit.PostMethodWebRequest;
@@ -42,17 +45,24 @@
private static final String SERVICE_URL =
"http://localhost:8085/SCADomain" + SERVICE_PATH;
- private SCADomain domain;
+ private static Node node;
- @Before
- public void setUp() throws Exception {
- domain = SCADomain.newInstance("JSONRPCBinding.composite");
- }
-
- @After
- public void tearDown() throws Exception {
- domain.close();
- }
+ @BeforeClass
+ public static void setUp() throws Exception {
+ try {
+ String contribution =
ContributionLocationHelper.getContributionLocation(JSONRPCExceptionTestCase.class);
+ node =
NodeFactory.newInstance().createNode("JSONRPCBinding.composite", new
Contribution("test", contribution));
+ node.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ node.destroy();
+ }
@Test
public void testRuntimeException() throws Exception{
Modified:
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java?rev=820527&r1=820526&r2=820527&view=diff
==============================================================================
---
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java
(original)
+++
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java
Thu Oct 1 04:04:27 2009
@@ -22,10 +22,13 @@
import junit.framework.Assert;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
import org.json.JSONObject;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import com.meterware.httpunit.PostMethodWebRequest;
@@ -42,17 +45,24 @@
private static final String SERVICE_URL =
"http://localhost:8085/SCADomain" + SERVICE_PATH;
- private SCADomain domain;
+ private static Node node;
- @Before
- public void setUp() throws Exception {
- domain = SCADomain.newInstance("JSONRPCBinding.composite");
- }
-
- @After
- public void tearDown() throws Exception {
- domain.close();
- }
+ @BeforeClass
+ public static void setUp() throws Exception {
+ try {
+ String contribution =
ContributionLocationHelper.getContributionLocation(JSONRPCServiceTestCase.class);
+ node =
NodeFactory.newInstance().createNode("JSONRPCBinding.composite", new
Contribution("test", contribution));
+ node.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ node.destroy();
+ }
@Test
public void testJSONRPCBinding() throws Exception {
Modified:
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCSmdTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCSmdTestCase.java?rev=820527&r1=820526&r2=820527&view=diff
==============================================================================
---
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCSmdTestCase.java
(original)
+++
tuscany/java/sca/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCSmdTestCase.java
Thu Oct 1 04:04:27 2009
@@ -21,10 +21,11 @@
import junit.framework.Assert;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.After;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
import org.junit.AfterClass;
-import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -44,17 +45,24 @@
private static final String SMD_URL = SERVICE_URL + "?smd";
- private static SCADomain domain;
+ private static Node node;
- @Before
- public void setUp() throws Exception {
- domain = SCADomain.newInstance("JSONRPCBinding.composite");
- }
-
- @After
- public void tearDown() throws Exception {
- domain.close();
- }
+ @BeforeClass
+ public static void setUp() throws Exception {
+ try {
+ String contribution =
ContributionLocationHelper.getContributionLocation(JSONRPCSmdTestCase.class);
+ node =
NodeFactory.newInstance().createNode("JSONRPCBinding.composite", new
Contribution("test", contribution));
+ node.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ node.destroy();
+ }
@Test
/**