summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test')
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuffTestCase.java129
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HelloworldTestCase.java93
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ResourceServiceTestCase.java79
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/BeanA.java60
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ComplexStuff.java32
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ComplexStuffImpl.java53
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/Helloworld.java26
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/HelloworldImpl.java28
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ResourceService.java55
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/SomeException.java29
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/complex.composite45
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/helloworld.composite45
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/resource.composite33
13 files changed, 707 insertions, 0 deletions
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuffTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuffTestCase.java
new file mode 100644
index 0000000000..704a24554b
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuffTestCase.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.http;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * HTTP binding unit tests for Helloworld service.
+ */
+public class ComplexStuffTestCase {
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ node = NodeFactory.newInstance().createNode("complex.composite", new String[] {"target/test-classes"});
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testGet() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/multiParams?x=1&s=petra&b=true");
+ InputStream is = url.openStream();
+ Assert.assertEquals("\"1petratrue\"", read(is));
+ }
+
+ @Test
+ public void testNoArgs() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/noArgs");
+ InputStream is = url.openStream();
+ Assert.assertEquals("\"noArgs\"", read(is));
+ }
+
+ @Test
+ public void testEchoBean() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/echoBeanA?x={\"s\":\"petra\",\"b\":true,\"y\":42,\"x\":1}");
+ InputStream is = url.openStream();
+ String result = read(is);
+ Assert.assertTrue(result.startsWith("{"));
+ Assert.assertTrue(result.contains("\"s\":\"petra\""));
+ Assert.assertTrue(result.contains("\"b\":true"));
+ Assert.assertTrue(result.contains("\"y\":42"));
+ Assert.assertTrue(result.contains("\"x\":1"));
+ // Assert.assertEquals("{\"s\":\"petra\",\"b\":true,\"y\":42,\"x\":1}", read(is));
+ }
+
+ @Test
+ public void testVoidReturn() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/voidReturn");
+ InputStream is = url.openStream();
+ Assert.assertEquals("", read(is));
+ }
+
+ @Test
+ public void testCheckedException() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/checkedException");
+ try {
+ InputStream is = url.openStream();
+ Assert.fail();
+ } catch (IOException e) {
+ // expected
+ // TODO: what should happen with checked exceptions?
+ }
+ }
+
+ @Test
+ public void testRuntimeException() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/runtimeException");
+ try {
+ InputStream is = url.openStream();
+ Assert.fail();
+ } catch (IOException e) {
+ Assert.assertTrue(e.getMessage().contains("HTTP response code: 500"));
+ }
+ }
+
+ private static String read(InputStream is) throws IOException {
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(is));
+ StringBuffer sb = new StringBuffer();
+ String str;
+ while ((str = reader.readLine()) != null) {
+ sb.append(str);
+ }
+ return sb.toString();
+ } finally {
+ if (reader != null) {
+ reader.close();
+ }
+ }
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HelloworldTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HelloworldTestCase.java
new file mode 100644
index 0000000000..89598b91c7
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HelloworldTestCase.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.http;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * HTTP binding unit tests for Helloworld service.
+ */
+public class HelloworldTestCase {
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ node = NodeFactory.newInstance().createNode("helloworld.composite", new String[] {"target/test-classes"});
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testGet() throws Exception {
+ URL url = new URL("http://localhost:8080/HelloworldComponent/Helloworld/sayHello?name=Petra");
+ InputStream is = url.openStream();
+ Assert.assertEquals("\"Hello Petra\"", read(is));
+ }
+
+ @Test
+ public void testGetArg0() throws Exception {
+ URL url = new URL("http://localhost:8080/HelloworldComponent/Helloworld/sayHello?arg0=Petra");
+ InputStream is = url.openStream();
+ Assert.assertEquals("\"Hello Petra\"", read(is));
+ }
+
+ @Test
+ public void testXml() throws Exception {
+ URL url = new URL("http://localhost:8080/HelloworldXmlComponent/Helloworld/sayHello?arg0=Petra");
+ InputStream is = url.openStream();
+ Assert.assertTrue(read(is).endsWith(">Hello Petra</return>"));
+ }
+
+ private static String read(InputStream is) throws IOException {
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(is));
+ StringBuffer sb = new StringBuffer();
+ String str;
+ while ((str = reader.readLine()) != null) {
+ sb.append(str);
+ }
+ return sb.toString();
+ } finally {
+ if (reader != null) {
+ reader.close();
+ }
+ }
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ResourceServiceTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ResourceServiceTestCase.java
new file mode 100644
index 0000000000..edbb111198
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ResourceServiceTestCase.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.http;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * HTTP binding unit tests for Helloworld service.
+ */
+public class ResourceServiceTestCase {
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ node = NodeFactory.newInstance().createNode("resource.composite", new String[] {"target/test-classes"});
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testGet() throws Exception {
+ URL url = new URL("http://localhost:8080/resource");
+ InputStream is = url.openStream();
+ Assert.assertTrue(read(is).startsWith("Resource"));
+ }
+
+ private static String read(InputStream is) throws IOException {
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(is));
+ StringBuffer sb = new StringBuffer();
+ String str;
+ while ((str = reader.readLine()) != null) {
+ sb.append(str);
+ }
+ return sb.toString();
+ } finally {
+ if (reader != null) {
+ reader.close();
+ }
+ }
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/BeanA.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/BeanA.java
new file mode 100644
index 0000000000..73bd908db8
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/BeanA.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package services;
+
+public class BeanA {
+
+ protected Boolean b;
+ protected String s;
+ protected int x;
+ protected Integer y;
+
+ public Boolean getB() {
+ return b;
+ }
+
+ public void setB(Boolean b) {
+ this.b = b;
+ }
+
+ public String getS() {
+ return s;
+ }
+
+ public void setS(String s) {
+ this.s = s;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public Integer getY() {
+ return y;
+ }
+
+ public void setY(Integer y) {
+ this.y = y;
+ }
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ComplexStuff.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ComplexStuff.java
new file mode 100644
index 0000000000..5c3ef631d7
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ComplexStuff.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package services;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface ComplexStuff {
+ BeanA echoBeanA(BeanA bean);
+ String multiParams(int x, String s, Boolean b);
+ String noArgs();
+ void voidReturn();
+ String checkedException() throws SomeException;
+ String runtimeException();
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ComplexStuffImpl.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ComplexStuffImpl.java
new file mode 100644
index 0000000000..f41ca498c1
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ComplexStuffImpl.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package services;
+
+public class ComplexStuffImpl implements ComplexStuff {
+
+ @Override
+ public BeanA echoBeanA(BeanA bean) {
+ return bean;
+ }
+
+ @Override
+ public String multiParams(int x, String s, Boolean b) {
+ return x + s + b;
+ }
+
+ @Override
+ public String noArgs() {
+ return "noArgs";
+ }
+
+ @Override
+ public void voidReturn() {
+ }
+
+ @Override
+ public String checkedException() throws SomeException {
+ throw new SomeException("some msg");
+ }
+
+ @Override
+ public String runtimeException() {
+ throw new RuntimeException("bang");
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/Helloworld.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/Helloworld.java
new file mode 100644
index 0000000000..4ecda47d71
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/Helloworld.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package services;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Helloworld {
+ String sayHello(String name);
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/HelloworldImpl.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/HelloworldImpl.java
new file mode 100644
index 0000000000..f0a24a6d9a
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/HelloworldImpl.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package services;
+
+public class HelloworldImpl implements Helloworld {
+
+ @Override
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ResourceService.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ResourceService.java
new file mode 100644
index 0000000000..612a61247d
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/ResourceService.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package services;
+
+import java.io.IOException;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.oasisopen.sca.annotation.Service;
+
+@Service(Servlet.class)
+public class ResourceService extends HttpServlet implements Servlet {
+ private static final long serialVersionUID = 8240260033930060726L;
+
+ public void init(ServletConfig config) throws ServletException {
+ }
+
+ public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ response.addHeader("Content-Type","text/plain");
+ response.getOutputStream().print("Resource request sucessfuly handled : " + request.getRequestURI() +'\n');
+ }
+
+ public void destroy() {
+ }
+
+ public ServletConfig getServletConfig() {
+ return null;
+ }
+
+ public String getServletInfo() {
+ return null;
+ }
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/SomeException.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/SomeException.java
new file mode 100644
index 0000000000..f65c22dc05
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/java/services/SomeException.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package services;
+
+public class SomeException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ public SomeException(String msg) {
+ super(msg);
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/complex.composite b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/complex.composite
new file mode 100644
index 0000000000..9aa3e26c6c
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/complex.composite
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample/test"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="ComplexStuff">
+
+ <component name="ComplexComponent">
+ <implementation.java class="services.ComplexStuffImpl"/>
+ <service name="ComplexStuff">
+ <tuscany:binding.http>
+ <tuscany:wireFormat.json />
+ <tuscany:operationSelector.rpc />
+ </tuscany:binding.http>
+ </service>
+ </component>
+
+ <component name="ComplexXmlComponent">
+ <implementation.java class="services.ComplexStuffImpl"/>
+ <service name="ComplexStuff">
+ <tuscany:binding.http>
+ <tuscany:wireFormat.xml />
+ <tuscany:operationSelector.rpc />
+ </tuscany:binding.http>
+ </service>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/helloworld.composite b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/helloworld.composite
new file mode 100644
index 0000000000..8b8b2877cd
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/helloworld.composite
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample/test"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="helloworld">
+
+ <component name="HelloworldComponent">
+ <implementation.java class="services.HelloworldImpl"/>
+ <service name="Helloworld">
+ <tuscany:binding.http>
+ <tuscany:wireFormat.json />
+ <tuscany:operationSelector.rpc />
+ </tuscany:binding.http>
+ </service>
+ </component>
+
+ <component name="HelloworldXmlComponent">
+ <implementation.java class="services.HelloworldImpl"/>
+ <service name="Helloworld">
+ <tuscany:binding.http>
+ <tuscany:wireFormat.xml />
+ <tuscany:operationSelector.rpc />
+ </tuscany:binding.http>
+ </service>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/resource.composite b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/resource.composite
new file mode 100644
index 0000000000..27b229e483
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-http-runtime/src/test/resources/resource.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample/test"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="ResourceService">
+
+
+ <component name="ResourceComponent">
+ <implementation.java class="services.ResourceService" />
+ <service name="Servlet">
+ <tuscany:binding.http uri="/resource" />
+ </service>
+ </component>
+
+</composite> \ No newline at end of file