Bringing up HTTP Binding test cases

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@817146 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
lresende 2009-09-21 04:00:09 +00:00
parent 1dbead7a00
commit 355a3f50b7
9 changed files with 45 additions and 19 deletions

View file

@ -72,6 +72,13 @@
</dependency>
-->
<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>

View file

@ -51,6 +51,7 @@ public class HTTPBindingProviderFactory implements BindingProviderFactory<HTTPBi
}
public ReferenceBindingProvider createReferenceBindingProvider(EndpointReference endpointReference) {
// Binding HTTP is currently NOT supporting References
return null;
}

View file

@ -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;

View file

@ -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();
}
/**

View file

@ -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();
}
/**

View file

@ -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.

View file

@ -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.

View file

@ -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">

View file

@ -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">