summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-09-21 04:00:09 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-09-21 04:00:09 +0000
commit355a3f50b76fbecb852673e34816d1376ee29444 (patch)
tree367e5008ae4234f46e17f82ba512ce7f612c8047 /java/sca
parent1dbead7a00b068a57e22e9bda2084c16b86e1bf7 (diff)
Bringing up HTTP Binding test cases
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@817146 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/modules/binding-http-runtime/pom.xml7
-rw-r--r--java/sca/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingProviderFactory.java1
-rw-r--r--java/sca/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java6
-rw-r--r--java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingCacheTestCase.java18
-rw-r--r--java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java18
-rw-r--r--java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceCacheImpl.java3
-rw-r--r--java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java3
-rw-r--r--java/sca/modules/binding-http-runtime/src/test/resources/test.composite4
-rw-r--r--java/sca/modules/binding-http-runtime/src/test/resources/testCache.composite4
9 files changed, 45 insertions, 19 deletions
diff --git a/java/sca/modules/binding-http-runtime/pom.xml b/java/sca/modules/binding-http-runtime/pom.xml
index e24e8b96c5..86ea68a260 100644
--- a/java/sca/modules/binding-http-runtime/pom.xml
+++ b/java/sca/modules/binding-http-runtime/pom.xml
@@ -74,6 +74,13 @@
<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-host-jetty</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>test</scope>
diff --git a/java/sca/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingProviderFactory.java b/java/sca/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingProviderFactory.java
index 32596fde33..53383af35e 100644
--- a/java/sca/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingProviderFactory.java
+++ b/java/sca/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingProviderFactory.java
@@ -51,6 +51,7 @@ public class HTTPBindingProviderFactory implements BindingProviderFactory<HTTPBi
}
public ReferenceBindingProvider createReferenceBindingProvider(EndpointReference endpointReference) {
+ // Binding HTTP is currently NOT supporting References
return null;
}
diff --git a/java/sca/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java b/java/sca/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java
index 0cfec663c3..8342dd64c8 100644
--- a/java/sca/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java
+++ b/java/sca/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java
@@ -69,10 +69,10 @@ public class HTTPServiceBindingProvider implements ServiceBindingProviderRRB {
ServletHost servletHost) {
this.endpoint = endpoint;
- this.component = component;
- this.service = service;
+ this.component = (RuntimeComponent)endpoint.getComponent();
+ this.service = (RuntimeComponentService)endpoint.getService();
+ this.binding = (HTTPBinding)endpoint.getBinding();
- this.binding = binding;
this.extensionPoints = extensionPoints;
this.messageFactory = messageFactory;
this.servletHost = servletHost;
diff --git a/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingCacheTestCase.java b/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingCacheTestCase.java
index bb5f6d5a8b..cc78509f4f 100644
--- a/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingCacheTestCase.java
+++ b/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingCacheTestCase.java
@@ -29,7 +29,10 @@ import java.util.Date;
import junit.framework.TestCase;
-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;
/**
* HTTP binding unit tests.
@@ -53,16 +56,23 @@ public class HTTPBindingCacheTestCase extends TestCase {
private static final int HTTP_PORT = 8085;
- private SCADomain scaDomain;
+ private static Node node;
@Override
protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("testCache.composite");
+ try {
+ String contribution = ContributionLocationHelper.getContributionLocation(HTTPBindingCacheTestCase.class);
+ node = NodeFactory.newInstance().createNode("testCache.composite", new Contribution("test", contribution));
+ node.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
@Override
protected void tearDown() throws Exception {
- scaDomain.close();
+ node.stop();
+ node.destroy();
}
/**
diff --git a/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java b/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java
index e5cad080a6..e5542884f3 100644
--- a/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java
+++ b/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java
@@ -27,7 +27,10 @@ import java.text.MessageFormat;
import junit.framework.TestCase;
-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;
/**
* HTTP binding unit tests.
@@ -65,16 +68,23 @@ public class HTTPBindingTestCase extends TestCase {
private static final int HTTP_PORT = 8085;
- private SCADomain scaDomain;
+ private static Node node;
@Override
protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("test.composite");
+ try {
+ String contribution = ContributionLocationHelper.getContributionLocation(HTTPBindingCacheTestCase.class);
+ node = NodeFactory.newInstance().createNode("test.composite", new Contribution("test", contribution));
+ node.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
@Override
protected void tearDown() throws Exception {
- scaDomain.close();
+ node.stop();
+ node.destroy();
}
/**
diff --git a/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceCacheImpl.java b/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceCacheImpl.java
index ed846c1127..fec68138a0 100644
--- a/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceCacheImpl.java
+++ b/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceCacheImpl.java
@@ -23,12 +23,11 @@ import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
-import org.osoa.sca.annotations.Service;
+import org.oasisopen.sca.annotation.Service;
/**
* Test service implementation.
diff --git a/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java b/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java
index 11945c8cd1..b8c1223894 100644
--- a/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java
+++ b/java/sca/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java
@@ -23,12 +23,11 @@ import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
-import org.osoa.sca.annotations.Service;
+import org.oasisopen.sca.annotation.Service;
/**
* Test service implementation.
diff --git a/java/sca/modules/binding-http-runtime/src/test/resources/test.composite b/java/sca/modules/binding-http-runtime/src/test/resources/test.composite
index 62c4af4e22..f8d5baebcf 100644
--- a/java/sca/modules/binding-http-runtime/src/test/resources/test.composite
+++ b/java/sca/modules/binding-http-runtime/src/test/resources/test.composite
@@ -17,9 +17,9 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
targetNamespace="http://sample/test"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:sr="http://sample/test"
name="test">
diff --git a/java/sca/modules/binding-http-runtime/src/test/resources/testCache.composite b/java/sca/modules/binding-http-runtime/src/test/resources/testCache.composite
index 39e651bb6e..3b3cb56a12 100644
--- a/java/sca/modules/binding-http-runtime/src/test/resources/testCache.composite
+++ b/java/sca/modules/binding-http-runtime/src/test/resources/testCache.composite
@@ -17,9 +17,9 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
targetNamespace="http://sample/test"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:sr="http://sample/test"
name="test">