From d1f056a0126252f101d108ad2952ac0eebb78cb0 Mon Sep 17 00:00:00 2001 From: nash Date: Tue, 24 Aug 2010 11:26:41 +0000 Subject: Copy 1.6 release to new 1.6.1 branch git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@988487 13f79535-47bb-0310-9956-ffa450edef68 --- .../branches/sca-java-1.6.1/itest/atom/pom.xml | 193 +++++++++++++++++++++ .../java/test/abdera/impl/NewsServiceImpl.java | 81 +++++++++ .../test/java/test/abdera/NewsServiceTestCase.java | 61 +++++++ .../atom/src/test/resources/news/news.composite | 34 ++++ .../itest/atom/src/test/resources/news/news.wsdl | 167 ++++++++++++++++++ .../itest/atom/src/test/resources/news/news.xsd | 137 +++++++++++++++ 6 files changed, 673 insertions(+) create mode 100644 sca-java-1.x/branches/sca-java-1.6.1/itest/atom/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/main/java/test/abdera/impl/NewsServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/java/test/abdera/NewsServiceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.composite create mode 100644 sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.xsd (limited to 'sca-java-1.x/branches/sca-java-1.6.1/itest/atom') diff --git a/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/pom.xml new file mode 100644 index 0000000000..44e6d8dc30 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/pom.xml @@ -0,0 +1,193 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.6-SNAPSHOT + ../pom.xml + + itest-atom + Apache Tuscany SCA iTest Atom Binding + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.6-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-interface-wsdl-xml + 1.6-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.6-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + 1.6-SNAPSHOT + runtime + + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.6-SNAPSHOT + runtime + + + + org.apache.tuscany.sdo + tuscany-sdo-impl + 1.1.1 + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + + org.apache.maven.plugins + maven-surefire-plugin + + -Djava.endorsed.dirs=target/endorsed + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy + generate-sources + + copy + + + + + javax.xml.ws + jaxws-api + 2.1 + jar + + + javax.xml.bind + jaxb-api + 2.1 + jar + + + ${project.build.directory}/endorsed + false + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-test-source + generate-sources + + add-test-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + + javax.jws + jsr181-api + 1.0-MR1 + + + javax.annotation + jsr250-api + 1.0 + + + + + wsimport + generate-sources + + wsimport + + + test.abdera + ${basedir}/src/test/resources/news + + news.wsdl + + ${project.build.directory}/jaxws-source + false + true + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/main/java/test/abdera/impl/NewsServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/main/java/test/abdera/impl/NewsServiceImpl.java new file mode 100644 index 0000000000..c03183059e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/main/java/test/abdera/impl/NewsServiceImpl.java @@ -0,0 +1,81 @@ +/* + * 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 test.abdera.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.osoa.sca.annotations.Init; + +import test.abdera.Entry; +import test.abdera.Item; +import test.abdera.NewsService; +import test.abdera.NotFoundException_Exception; + +public class NewsServiceImpl implements NewsService { + private static Map collection = new HashMap(); + + @Init + public void init() { + Item item = new Item(); + item.setName("Item Name 01"); + item.setTitle("Item title 01"); + + Entry entry = new Entry(); + entry.setKey("1"); + entry.setData(item); + + collection.put((String)entry.getKey(), entry); + } + + public List getAll() { + List entries = new ArrayList(); + for(Entry entry : collection.values()) { + entries.add(entry); + } + return entries; + } + + public Item get(String arg0) throws NotFoundException_Exception { + return (Item) collection.get(arg0).getData(); + } + + public String post(String arg0, Item arg1) { + // TODO Auto-generated method stub + return null; + } + + public void put(String arg0, Item arg1) throws NotFoundException_Exception { + // TODO Auto-generated method stub + + } + + public void delete(String arg0) throws NotFoundException_Exception { + // TODO Auto-generated method stub + + } + + public List query(String arg0) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/java/test/abdera/NewsServiceTestCase.java b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/java/test/abdera/NewsServiceTestCase.java new file mode 100644 index 0000000000..b9f2b4e2fc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/java/test/abdera/NewsServiceTestCase.java @@ -0,0 +1,61 @@ +/* + * 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 test.abdera; + +import java.net.Socket; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class NewsServiceTestCase { + private static SCADomain domain; + private static NewsService newsService; + + @BeforeClass + public static void init() throws Exception { + domain = SCADomain.newInstance("news/news.composite"); + Assert.assertNotNull(domain); + newsService = domain.getService(NewsService.class, "NewsServiceComponent"); + Assert.assertNotNull(newsService); + } + + @AfterClass + public static void destroy() throws Exception { + if(domain != null) { + domain.close(); + } + } + + @Test + public void testPing() throws Exception { + new Socket("127.0.0.1", 8085); + //System.in.read(); + } + + @Test + public void testNewsServicesGet() throws Exception { + Item item = newsService.get("1"); + + Assert.assertNotNull(item); + System.out.println(">>> Entry - " + item.getTitle()); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.composite b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.composite new file mode 100644 index 0000000000..f3a3b165cc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.wsdl b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.wsdl new file mode 100644 index 0000000000..62d46e66c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.wsdl @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.xsd b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.xsd new file mode 100644 index 0000000000..0a59f9311e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/itest/atom/src/test/resources/news/news.xsd @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3