You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2008/06/07 09:15:40 UTC
svn commit: r664294 [9/10] - in
/incubator/tuscany/sandbox/sebastien/java/sca-test2: ./ demos/
demos/bigbank/ demos/bigbank/src/main/java/bigbank/account/feed/
demos/secure-bigbank/ demos/secure-bigbank/secure-bigbank-account/
demos/secure-bigbank/secu...
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/pom.xml?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/pom.xml Sat Jun 7 00:15:29 2008
@@ -56,6 +56,12 @@
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.xml.soap</groupId>
+ <artifactId>saaj-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -164,9 +170,6 @@
<packageName>com.example.stock</packageName>
<wsdlDirectory>${basedir}/src/test/resources/wsdl</wsdlDirectory>
<wsdlFiles>
- <!--
- <wsdlFile>StockQuotes.wsdl</wsdlFile>
- -->
<wsdlFile>StockExceptionTest.wsdl</wsdlFile>
</wsdlFiles>
<sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
@@ -174,6 +177,7 @@
<xnocompile>true</xnocompile>
</configuration>
</execution>
+
<!--
<execution>
<id>wsgen</id>
@@ -191,7 +195,7 @@
</execution>
-->
</executions>
-
+
<dependencies>
<dependency>
<groupId>com.sun</groupId>
@@ -201,9 +205,44 @@
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
-
+
</plugin>
+ <!--
+ wsimport cannot handle WSDL files without a service/binding element.
+ CXF wsdl2java plugin does support that. I had to override the default
+ value of wsdlRoot/testWsdlRoot to a non-existent file to avoid NPE -->
+ <!--
+ <plugin>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-codegen-plugin</artifactId>
+ <version>2.1</version>
+ <executions>
+ <execution>
+ <id>generate-sources</id>
+ <phase>generate-sources</phase>
+
+ <configuration>
+ <sourceRoot>${basedir}/target/jaxws-source</sourceRoot>
+ <wsdlRoot>NONE</wsdlRoot>
+ <testWsdlRoot>NONE</testWsdlRoot>
+ <wsdlOptions>
+ <wsdlOption>
+ <wsdl>${basedir}/src/test/resources/wsdl/Stock.wsdl</wsdl>
+ <outputDir>${basedir}/target/jaxws-source</outputDir>
+ <packagenames>
+ <packagename>com.example.stock.cxf</packagename>
+ </packagenames>
+ </wsdlOption>
+ </wsdlOptions>
+ </configuration>
+ <goals>
+ <goal>wsdl2java</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ -->
<plugin>
<groupId>org.apache.felix</groupId>
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java Sat Jun 7 00:15:29 2008
@@ -95,7 +95,7 @@
protected void declareField(ClassWriter cw, String propName, String propClassSignature, String propTypeSignature) {
FieldVisitor fv;
AnnotationVisitor av0;
- fv = cw.visitField(ACC_PRIVATE, getFieldName(propName), propClassSignature, propTypeSignature, null);
+ fv = cw.visitField(ACC_PROTECTED, getFieldName(propName), propClassSignature, propTypeSignature, null);
av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
av0.visit("name", propName);
@@ -111,6 +111,9 @@
String propName,
String propClassSignature,
String propTypeSignature) {
+ if ("Ljava/util/List;".equals(propClassSignature)) {
+ return;
+ }
MethodVisitor mv =
cw.visitMethod(ACC_PUBLIC,
"set" + capitalize(propName),
@@ -143,6 +146,11 @@
String propName,
String propClassSignature,
String propTypeSignature) {
+ if ("Ljava/util/List;".equals(propClassSignature)) {
+ decalreListGetter(cw, classDescriptor, classSignature, propName, propClassSignature, propTypeSignature);
+ return;
+ }
+
String getterName = ("Z".equals(propClassSignature) ? "is" : "get") + capitalize(propName);
MethodVisitor mv =
cw.visitMethod(ACC_PUBLIC, getterName, "()" + propClassSignature, propTypeSignature == null ? null
@@ -161,6 +169,45 @@
mv.visitEnd();
}
+ protected void decalreListGetter(ClassWriter cw,
+ String classDescriptor,
+ String classSignature,
+ String propName,
+ String propClassSignature,
+ String propTypeSignature) {
+ String getterName = "get" + capitalize(propName);
+ String fieldName = getFieldName(propName);
+ MethodVisitor mv =
+ cw.visitMethod(ACC_PUBLIC, getterName, "()" + propClassSignature, propTypeSignature == null ? null
+ : "()" + propTypeSignature, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(63, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, classDescriptor, fieldName, propClassSignature);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(64, l2);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitTypeInsn(NEW, "java/util/ArrayList");
+ mv.visitInsn(DUP);
+ mv.visitMethodInsn(INVOKESPECIAL, "java/util/ArrayList", "<init>", "()V");
+ mv.visitFieldInsn(PUTFIELD, classDescriptor, fieldName, propClassSignature);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(66, l1);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, classDescriptor, fieldName, propClassSignature);
+ mv.visitInsn(ARETURN);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLocalVariable("this", classSignature, null, l0, l3, 0);
+ mv.visitMaxs(3, 1);
+ mv.visitEnd();
+ }
+
protected static String capitalize(String name) {
if (name == null || name.length() == 0) {
return name;
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java Sat Jun 7 00:15:29 2008
@@ -33,6 +33,7 @@
import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
import org.apache.tuscany.sca.interfacedef.DataType;
import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper;
+import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
import org.apache.tuscany.sca.interfacedef.util.FaultException;
import org.apache.tuscany.sca.interfacedef.util.XMLType;
@@ -73,7 +74,7 @@
* </ul>
*/
@SuppressWarnings("unchecked")
- public Throwable wrapFaultInfo(DataType<DataType> exceptionType, String message, Object faultInfo, Throwable cause) {
+ public Throwable wrapFaultInfo(DataType<DataType> exceptionType, String message, Object faultInfo, Throwable cause, Operation operation) {
Class<?> exceptionClass = exceptionType.getPhysical();
if (exceptionClass.isInstance(faultInfo)) {
return (Throwable)faultInfo;
@@ -171,7 +172,7 @@
}
}
- public Object getFaultInfo(Throwable exception, Class<?> faultBeanClass) {
+ public Object getFaultInfo(Throwable exception, Class<?> faultBeanClass, Operation operation) {
if (exception == null) {
return null;
}
@@ -245,7 +246,7 @@
}
@SuppressWarnings("unchecked")
- public boolean introspectFaultDataType(DataType<DataType> exceptionType, final boolean generatingFaultBean) {
+ public boolean introspectFaultDataType(DataType<DataType> exceptionType, Operation operation, final boolean generatingFaultBean) {
QName faultName = null;
boolean result = false;
@@ -317,7 +318,7 @@
if (faultType.getDataBinding() == null && dataBindingExtensionPoint != null) {
faultBean = faultType.getPhysical();
result =
- dataBindingExtensionPoint.introspectType(faultType, null, Throwable.class.isAssignableFrom(faultBean));
+ dataBindingExtensionPoint.introspectType(faultType, operation);
}
((DataType) exceptionType).setLogical(faultType);
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java Sat Jun 7 00:15:29 2008
@@ -106,7 +106,7 @@
SOAPBinding soapBinding = clazz.getAnnotation(SOAPBinding.class);
for (Iterator<Operation> it = contract.getOperations().iterator(); it.hasNext();) {
- JavaOperation operation = (JavaOperation)it.next();
+ final JavaOperation operation = (JavaOperation)it.next();
final Method method = operation.getJavaMethod();
introspectFaultTypes(operation);
@@ -197,7 +197,7 @@
Class<?> wrapperClass = Class.forName(inputWrapperClassName, false, clazz.getClassLoader());
QName qname = new QName(inputNS, inputName);
DataType dt = new DataTypeImpl<XMLType>(wrapperClass, new XMLType(qname, qname));
- dataBindingExtensionPoint.introspectType(dt, null);
+ dataBindingExtensionPoint.introspectType(dt, operation);
return dt;
} catch (ClassNotFoundException e) {
GeneratedClassLoader cl = new GeneratedClassLoader(clazz.getClassLoader());
@@ -232,7 +232,7 @@
Class.forName(outputWrapperClassName, false, clazz.getClassLoader());
QName qname = new QName(inputNS, inputName);
DataType dt = new DataTypeImpl<XMLType>(wrapperClass, new XMLType(qname, qname));
- dataBindingExtensionPoint.introspectType(dt, null);
+ dataBindingExtensionPoint.introspectType(dt, operation);
return dt;
} catch (ClassNotFoundException e) {
GeneratedClassLoader cl = new GeneratedClassLoader(clazz.getClassLoader());
@@ -293,7 +293,7 @@
private void introspectFaultTypes(Operation operation) {
if (operation != null && operation.getFaultTypes() != null) {
for (DataType exceptionType : operation.getFaultTypes()) {
- faultExceptionMapper.introspectFaultDataType(exceptionType, true);
+ faultExceptionMapper.introspectFaultDataType(exceptionType, operation, true);
DataType faultType = (DataType)exceptionType.getLogical();
if (faultType.getDataBinding() == JavaExceptionDataBinding.NAME) {
// The exception class doesn't have an associated bean class, so
@@ -322,7 +322,7 @@
if (dt != null) {
propDT.setDataBinding(dt.value());
}
- dataBindingExtensionPoint.introspectType(propDT, aMethod.getAnnotations());
+ dataBindingExtensionPoint.introspectType(propDT, operation);
// sort the list lexicographically as specified in JAX-WS spec section 3.7
int i = 0;
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java Sat Jun 7 00:15:29 2008
@@ -19,6 +19,7 @@
package org.apache.tuscany.sca.interfacedef.java.jaxws;
+import java.io.StringReader;
import java.io.StringWriter;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
@@ -27,6 +28,7 @@
import java.util.Map;
import javax.xml.bind.JAXBContext;
+import javax.xml.transform.stream.StreamSource;
import org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper;
import org.apache.tuscany.sca.databinding.jaxb.JAXBTypeHelper;
@@ -39,6 +41,7 @@
@Test
public void testGenerate() throws Exception {
List<Class<?>> classes = new WrapperBeanGenerator().generateWrapperBeans(TestInterface.class);
+ JAXBContext context = JAXBContextHelper.createJAXBContext(classes.toArray(new Class<?>[classes.size()]));
for (Class<?> cls : classes) {
for (Field f : cls.getDeclaredFields()) {
// System.out.println(f.getName());
@@ -53,17 +56,18 @@
}
}
Object obj = cls.newInstance();
- JAXBContext context = JAXBContextHelper.createJAXBContext(cls);
StringWriter sw = new StringWriter();
context.createMarshaller().marshal(obj, sw);
- System.out.println(sw.toString());
+ // System.out.println(sw.toString());
+ StringReader sr = new StringReader(sw.toString());
+ context.createUnmarshaller().unmarshal(new StreamSource(sr), cls);
}
}
@Test
public void testGenerateSchema() throws Exception {
List<Class<?>> classes = new WrapperBeanGenerator().generateWrapperBeans(TestInterface.class);
- JAXBContext context = JAXBContext.newInstance(classes.toArray(new Class[0]));
+ JAXBContext context = JAXBContextHelper.createJAXBContext(classes.toArray(new Class<?>[classes.size()]));
Map<String, String> results = JAXBTypeHelper.generateSchema(context);
for (String xsd : results.values()) {
System.out.println(xsd);
Added: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl?rev=664294&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl Sat Jun 7 00:15:29 2008
@@ -0,0 +1,142 @@
+<?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.
+-->
+<wsdl:definitions targetNamespace="http://www.example.com/stock" xmlns:impl="http://www.example.com/stock"
+ xmlns:tns="http://www.example.com/stock" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StockExceptionTest">
+ <wsdl:types>
+ <schema targetNamespace="http://www.example.com/stock" xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <complexType name="StockOffer">
+ <sequence>
+ <element name="symbol" minOccurs="1" type="xsd:string" />
+ <element name="price" minOccurs="1" type="xsd:float" nillable="true" /><!-- max price reqested, actual response -->
+ <element name="name" minOccurs="0" type="xsd:string" />
+ <element name="list" minOccurs="0" maxOccurs="unbounded" type="xsd:string" />
+ </sequence>
+ </complexType>
+
+ <element name="stockQuoteOffer">
+ <complexType>
+ <sequence>
+ <element name="input" minOccurs="0" maxOccurs="unbounded" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="stockQuoteOfferResponse">
+ <complexType>
+ <sequence>
+ <element name="stockQuoteOfferReturn" minOccurs="0" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Faults -->
+ <element name="InvalidSymbolFault">
+ <complexType>
+ <sequence>
+ <element name="message" minOccurs="1" type="xsd:string" />
+ <element name="offer" minOccurs="1" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="MarketClosedFault" type="xsd:int" />
+
+ <element name="TestNotDeclaredAtSourceFault" type="xsd:string" />
+
+ </schema>
+ </wsdl:types>
+
+
+ <wsdl:message name="stockQuoteOfferRequest">
+ <wsdl:part element="tns:stockQuoteOffer" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="stockQuoteOfferResponse">
+ <wsdl:part element="tns:stockQuoteOfferResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="InvalidSymbolFault">
+ <wsdl:part element="tns:InvalidSymbolFault" name="fault" />
+ </wsdl:message>
+
+ <wsdl:message name="MarketClosedFault">
+ <wsdl:part element="tns:MarketClosedFault" name="fault" />
+ </wsdl:message>
+
+ <wsdl:message name="TestNotDeclaredAtSourceFault">
+ <wsdl:part element="tns:TestNotDeclaredAtSourceFault" name="fault" />
+ </wsdl:message>
+
+
+ <wsdl:portType name="StockExceptionTest">
+ <wsdl:operation name="stockQuoteOffer">
+ <wsdl:input message="tns:stockQuoteOfferRequest" name="stockQuoteOfferRequest" />
+
+ <wsdl:output message="tns:stockQuoteOfferResponse" name="stockQuoteOfferResponse" />
+
+ <wsdl:fault message="tns:InvalidSymbolFault" name="InvalidSymbolException" />
+
+ <wsdl:fault message="tns:MarketClosedFault" name="MarketClosedException" />
+
+ <wsdl:fault message="tns:TestNotDeclaredAtSourceFault" name="TestNotDeclaredAtSourceException" />
+ </wsdl:operation>
+
+
+ </wsdl:portType>
+
+ <wsdl:binding name="StockExceptionTestServiceSoapBinding" type="tns:StockExceptionTest">
+ <!-- <wsaw:UsingAddressing wsdl:required="false" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/> -->
+
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+
+ <wsdl:operation name="stockQuoteOffer">
+ <wsdlsoap:operation soapAction="" />
+
+ <wsdl:input name="stockQuoteOfferRequest">
+ <wsdlsoap:body use="literal" />
+ </wsdl:input>
+
+ <wsdl:output name="stockQuoteOfferResponse">
+ <wsdlsoap:body use="literal" />
+ </wsdl:output>
+
+ <wsdl:fault name="InvalidSymbolException">
+ <wsdlsoap:fault name="InvalidSymbolException" use="literal" />
+ </wsdl:fault>
+
+ <wsdl:fault name="MarketClosedException">
+ <wsdlsoap:fault name="MarketClosedException" use="literal" />
+ </wsdl:fault>
+
+ <wsdl:fault name="TestNotDeclaredAtSourceException">
+ <wsdlsoap:fault name="TestNotDeclaredAtSourceException" use="literal" />
+ </wsdl:fault>
+
+
+
+ </wsdl:operation>
+
+
+ </wsdl:binding>
+
+
+</wsdl:definitions>
\ No newline at end of file
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java Sat Jun 7 00:15:29 2008
@@ -48,7 +48,7 @@
import org.apache.tuscany.sca.databinding.DataBinding;
import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
import org.apache.tuscany.sca.databinding.XMLTypeHelper;
-import org.apache.tuscany.sca.databinding.jaxb.JAXBTypeHelper;
+import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding;
import org.apache.tuscany.sca.interfacedef.DataType;
import org.apache.tuscany.sca.interfacedef.Interface;
import org.apache.tuscany.sca.interfacedef.Operation;
@@ -78,6 +78,10 @@
private static final String SCHEMA_NAME = "schema";
private static final QName SCHEMA_QNAME = new QName(SCHEMA_NS, SCHEMA_NAME);
private static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/";
+
+ private static final String ANYTYPE_NAME = "anyType";
+ private static final QName ANYTYPE_QNAME = new QName(SCHEMA_NS, ANYTYPE_NAME);
+
private WSDLFactory factory;
private DataBindingExtensionPoint dataBindings;
@@ -106,6 +110,51 @@
this.xsdFactory = xsdFactory;
this.factory = factory;
}
+
+ private void addDataType(Map<String, List<DataType>> map, DataType type) {
+ if (type == null) {
+ return;
+ }
+ String db = type.getDataBinding();
+ if (db == null) {
+ return;
+ }
+ if ("java:array".equals(db)) {
+ DataType dt = (DataType)type.getLogical();
+ db = dt.getDataBinding();
+ }
+ List<DataType> types = map.get(db);
+ if (types == null) {
+ types = new ArrayList<DataType>();
+ map.put(db, types);
+ }
+ types.add(type);
+ }
+
+ private Map<String, List<DataType>> getDataTypes(Interface intf, boolean useWrapper) {
+ Map<String, List<DataType>> dataTypes = new HashMap<String, List<DataType>>();
+ for (Operation op : intf.getOperations()) {
+ WrapperInfo wrapper = op.getWrapper();
+ if (useWrapper && wrapper != null) {
+ DataType dt1 = wrapper.getInputWrapperType();
+ addDataType(dataTypes, dt1);
+ DataType dt2 = wrapper.getOutputWrapperType();
+ addDataType(dataTypes, dt2);
+ } else {
+ for (DataType dt1 : op.getInputType().getLogical()) {
+ addDataType(dataTypes, dt1);
+ }
+ DataType dt2 = op.getOutputType();
+ addDataType(dataTypes, dt2);
+ }
+ for (DataType<DataType> dt3 : op.getFaultTypes()) {
+ DataType dt4 = dt3.getLogical();
+ addDataType(dataTypes, dt4);
+ }
+ }
+ return dataTypes;
+ }
+
public Definition generate(Interface interfaze, WSDLDefinition wsdlDefinition) throws WSDLException {
if (interfaze == null) {
@@ -153,36 +202,15 @@
// call each helper in turn to populate the wsdl.types element
XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
- int index = 0;
- for (XMLTypeHelper helper: new HashSet<XMLTypeHelper>(helpers.values())) {
- List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver);
+
+ for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
+ XMLTypeHelper helper = helpers.get(en.getKey());
+ if (helper == null) {
+ continue;
+ }
+ List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
for (XSDefinition xsDef: xsDefinitions) {
- String nsURI = xsDef.getNamespace();
- Document document = xsDef.getDocument();
- XmlSchema schemaDef = xsDef.getSchema();
- if (document == null) {
- try {
- NamespaceMap prefixMap = new NamespaceMap();
- prefixMap.add("xs", SCHEMA_NS);
- prefixMap.add("tns", nsURI);
- schemaDef.setNamespaceContext(prefixMap);
- Document[] docs = schemaDef.getAllSchemas();
- document = docs[0];
- xsDef.setDocument(document);
- for (int i = 1; i < docs.length; i++) {
- Element schema = docs[i].getDocumentElement();
- Schema schemaExt = createSchemaExt(definition);
- schemaExt.setElement(schema);
- }
- } catch (XmlSchemaException e) {
- throw new RuntimeException(e);
- }
- }
- loadXSD(schemaCollection, xsDef);
- wsdlDefinition.getXmlSchemas().add(xsDef);
- Element schema = document.getDocumentElement();
- Schema schemaExt = createSchemaExt(definition);
- schemaExt.setElement(schema);
+ addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
}
}
@@ -279,6 +307,41 @@
return definition;
}
+ private void addSchemaExtension(XSDefinition xsDef,
+ XmlSchemaCollection schemaCollection,
+ WSDLDefinition wsdlDefinition,
+ Definition definition) throws WSDLException {
+ if (xsDef.getAggregatedDefinitions() != null) {
+ for (XSDefinition xsd: xsDef.getAggregatedDefinitions()) {
+ addSchemaExtension(xsd, schemaCollection, wsdlDefinition, definition);
+ }
+ } else {
+ String nsURI = xsDef.getNamespace();
+ Document document = xsDef.getDocument();
+ if (document == null) {
+ try {
+ NamespaceMap prefixMap = new NamespaceMap();
+ prefixMap.add("xs", SCHEMA_NS);
+ prefixMap.add("tns", nsURI);
+ XmlSchema schemaDef = xsDef.getSchema();
+ schemaDef.setNamespaceContext(prefixMap);
+ Document[] docs = schemaDef.getAllSchemas();
+ document = docs[docs.length-1];
+ document.setDocumentURI(xsDef.getLocation().toString());
+ xsDef.setDocument(document);
+ } catch (XmlSchemaException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ loadXSD(schemaCollection, xsDef);
+ wsdlDefinition.getXmlSchemas().add(xsDef);
+ Element schema = document.getDocumentElement();
+ Schema schemaExt = createSchemaExt(definition);
+ schemaExt.setDocumentBaseURI(document.getDocumentURI());
+ schemaExt.setElement(schema);
+ }
+ }
+
private static void loadXSD(XmlSchemaCollection schemaCollection, XSDefinition definition) {
if (definition.getSchema() != null) {
return;
@@ -504,19 +567,32 @@
if (helper == null) {
DataBinding dataBinding = dataBindings.getDataBinding(db);
if (dataBinding == null) {
- throw new RuntimeException("no data binding for " + db);
+ QName element = name;
+ if (element == null || dataType.getLogical() instanceof XMLType) {
+ XMLType xmlType = (XMLType)dataType.getLogical();
+ if (xmlType.getElementName() != null) {
+ element = xmlType.getElementName();
+ }
+ }
+ return new ElementInfo(element, new TypeInfo(ANYTYPE_QNAME, false, null));
+ // throw new ServiceRuntimeException("No data binding for " + db);
}
helper = dataBinding.getXMLTypeHelper();
if (helper == null) {
- helper = new JAXBTypeHelper();
+ // Default to JAXB
+ helper = helpers.get(JAXBDataBinding.NAME);
+ if (helper == null) {
+ helper = dataBindings.getDataBinding(JAXBDataBinding.NAME).getXMLTypeHelper();
+ helpers.put(JAXBDataBinding.NAME, helper);
+ }
}
helpers.put(db, helper);
}
TypeInfo typeInfo = helper.getTypeInfo(javaType.isArray() ? javaType.getComponentType() : javaType,
dataType.getLogical());
ElementInfo element = new ElementInfo(name, typeInfo);
- element.setMany(javaType.isArray());
+ element.setMany(byte[].class != javaType && javaType.isArray());
element.setNillable(!javaType.isPrimitive());
return element;
}
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java Sat Jun 7 00:15:29 2008
@@ -32,10 +32,11 @@
* type
*
* @param exceptionDataType The data type representing a java exception class
+ * @param operation TODO
* @param generatingFaultBean If JAXWS Section 3.7 Fault Bean will be generated
* @return true if the introspection can recognize the exception data type
*/
- boolean introspectFaultDataType(DataType<DataType> exceptionDataType, boolean generatingFaultBean);
+ boolean introspectFaultDataType(DataType<DataType> exceptionDataType, Operation operation, boolean generatingFaultBean);
/**
* Create a java exception to wrap the fault data
@@ -44,17 +45,18 @@
* @param message message for the exception
* @param faultInfo The fault data
* @param cause of the exception
+ * @param operation TODO
* @return An instance of java exception to represent the fault
*/
- Throwable wrapFaultInfo(DataType<DataType> exceptionType, String message, Object faultInfo, Throwable cause);
+ Throwable wrapFaultInfo(DataType<DataType> exceptionType, String message, Object faultInfo, Throwable cause, Operation operation);
/**
* Retrieve the fault info from a java exception
*
* @param exception The java exception that represents the fault data
* @param faultBeanClass
- *
+ * @param operation TODO
* @return The fault data
*/
- Object getFaultInfo(Throwable exception, Class<?> faultBeanClass);
+ Object getFaultInfo(Throwable exception, Class<?> faultBeanClass, Operation operation);
}
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/pom.xml?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/pom.xml Sat Jun 7 00:15:29 2008
@@ -81,6 +81,7 @@
<module>core-databinding</module>
<module>core-spi</module>
<module>core-spring</module>
+ <module>data-api</module>
<module>databinding</module>
<module>databinding-axiom</module>
<module>databinding-jaxb</module>
@@ -121,7 +122,6 @@
<module>implementation-bpel</module>
<module>implementation-bpel-ode</module>
<module>implementation-das</module>
- <module>implementation-data-api</module>
<module>implementation-data-xml</module>
<module>implementation-ejb</module>
<module>implementation-ejb-xml</module>
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java Sat Jun 7 00:15:29 2008
@@ -28,6 +28,7 @@
import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.DefaultImport;
import org.apache.tuscany.sca.contribution.Export;
import org.apache.tuscany.sca.contribution.Import;
import org.apache.tuscany.sca.contribution.resolver.DefaultImportModelResolver;
@@ -120,7 +121,9 @@
} else {
// Record import resolution issue
- warning("UnresolvedImport", import_, import_);
+ if (!(import_ instanceof DefaultImport)) {
+ warning("UnresolvedImport", import_, import_);
+ }
}
}
}
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java Sat Jun 7 00:15:29 2008
@@ -38,6 +38,7 @@
import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
import org.apache.tuscany.sca.contribution.resolver.ClassReference;
+import org.apache.tuscany.sca.contribution.resolver.DefaultModelResolver;
import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
@@ -157,6 +158,7 @@
// Add default contribution import and export
DefaultImport defaultImport = contributionFactory.createDefaultImport();
+ defaultImport.setModelResolver(new DefaultModelResolver());
contribution.getImports().add(defaultImport);
DefaultExport defaultExport = contributionFactory.createDefaultExport();
contribution.getExports().add(defaultExport);
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java Sat Jun 7 00:15:29 2008
@@ -40,6 +40,7 @@
import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
import org.apache.tuscany.sca.contribution.resolver.ClassReference;
+import org.apache.tuscany.sca.contribution.resolver.DefaultModelResolver;
import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
@@ -173,6 +174,7 @@
// Add default contribution import and export
DefaultImport defaultImport = contributionFactory.createDefaultImport();
+ defaultImport.setModelResolver(new DefaultModelResolver());
contribution.getImports().add(defaultImport);
DefaultExport defaultExport = contributionFactory.createDefaultExport();
contribution.getExports().add(defaultExport);
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java Sat Jun 7 00:15:29 2008
@@ -198,6 +198,7 @@
aggregated.setUnresolved(true);
aggregated.setSchema(facade);
aggregated.setNamespace(ns);
+ aggregated.setAggregatedDefinitions(definitions);
aggregated.setUnresolved(false);
// FIXME: [rfeng] This is hacky
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java Sat Jun 7 00:15:29 2008
@@ -20,6 +20,7 @@
package org.apache.tuscany.sca.xsd;
import java.net.URI;
+import java.util.List;
import javax.xml.namespace.QName;
@@ -89,15 +90,28 @@
void setDocument(Document document);
/**
- * Get the XSD element by QName
- * @param name
+ * Get an XSD element by QName
+ * @param name The element name
* @return The XSD element
*/
XmlSchemaElement getXmlSchemaElement(QName name);
/**
- * @param name Get the XSD type by QName
+ * Get an XSD type by QName
+ * @param name The type name
* @return The XSD type
*/
XmlSchemaType getXmlSchemaType(QName name);
+
+ /**
+ * Get the aggregated definitions for a facade XSDefinition
+ * @return The aggregated definitions, or null if not a facade
+ */
+ List<XSDefinition> getAggregatedDefinitions();
+
+ /**
+ * Set the aggregated definitions for a facade XSDefinition
+ * @param name The aggregated definitions
+ */
+ void setAggregatedDefinitions(List<XSDefinition> definitions);
}
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java Sat Jun 7 00:15:29 2008
@@ -21,6 +21,7 @@
import java.net.URI;
import java.util.Iterator;
+import java.util.List;
import javax.xml.namespace.QName;
@@ -46,6 +47,7 @@
private URI location;
private Document document;
private boolean unresolved;
+ private List<XSDefinition> definitions;
public XSDefinitionImpl() {
}
@@ -218,5 +220,13 @@
}
return null;
}
+
+ public List<XSDefinition> getAggregatedDefinitions() {
+ return definitions;
+ }
+
+ public void setAggregatedDefinitions(List<XSDefinition> definitions) {
+ this.definitions = definitions;
+ }
}
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/pom.xml?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/pom.xml Sat Jun 7 00:15:29 2008
@@ -134,6 +134,42 @@
</plugins>
</build>
</profile>
+
+ <profile>
+ <id>security</id>
+ <modules>
+ <!-- <module>demos</module> -->
+ <module>itest</module>
+ <module>vtest</module>
+ </modules>
+ <activation>
+ <property>
+ <name>tuscany.policy.file</name>
+ </property>
+ </activation>
+ <properties>
+ <tuscany.policy.file>file:///${java.home}/lib/security/tuscany.policy</tuscany.policy.file>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ <reportFormat>brief</reportFormat>
+ <useFile>false</useFile>
+ <forkMode>once</forkMode>
+ <!-- Place tuscany.policy in your Java home security directory. Alternatively, hardcode the file location here. -->
+ <argLine>-Djava.security.manager -Djava.security.policy=${tuscany.policy.file} -Dpolicy.allowSystemProperty=true -Djava.security.debug=policy</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/pom.xml?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/pom.xml Sat Jun 7 00:15:29 2008
@@ -171,7 +171,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-data-api</artifactId>
+ <artifactId>tuscany-data-api</artifactId>
<version>2.0-incubating-SNAPSHOT</version>
<scope>test</scope>
</dependency>
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/Cart.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/Cart.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/Cart.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/Cart.java Sat Jun 7 00:15:29 2008
@@ -19,7 +19,7 @@
package services;
-import org.apache.tuscany.sca.implementation.data.collection.Collection;
+import org.apache.tuscany.sca.data.collection.Collection;
import org.osoa.sca.annotations.Remotable;
@Remotable
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/ShoppingCartClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/ShoppingCartClientImpl.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/ShoppingCartClientImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/ShoppingCartClientImpl.java Sat Jun 7 00:15:29 2008
@@ -19,8 +19,8 @@
package services;
-import org.apache.tuscany.sca.implementation.data.collection.Entry;
-import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
+import org.apache.tuscany.sca.data.collection.Entry;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Scope;
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/ShoppingCartImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/ShoppingCartImpl.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/ShoppingCartImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/domain-management/src/test/java/services/ShoppingCartImpl.java Sat Jun 7 00:15:29 2008
@@ -25,8 +25,8 @@
import java.util.Map;
import java.util.UUID;
-import org.apache.tuscany.sca.implementation.data.collection.Entry;
-import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
+import org.apache.tuscany.sca.data.collection.Entry;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
import org.osoa.sca.annotations.Init;
import org.osoa.sca.annotations.Scope;
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/pom.xml?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/pom.xml Sat Jun 7 00:15:29 2008
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-data-api</artifactId>
+ <artifactId>tuscany-data-api</artifactId>
<version>2.0-incubating-SNAPSHOT</version>
</dependency>
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/src/main/java/services/Cart.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/src/main/java/services/Cart.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/src/main/java/services/Cart.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/src/main/java/services/Cart.java Sat Jun 7 00:15:29 2008
@@ -19,7 +19,7 @@
package services;
-import org.apache.tuscany.sca.implementation.data.collection.Collection;
+import org.apache.tuscany.sca.data.collection.Collection;
import org.osoa.sca.annotations.Remotable;
@Remotable
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/src/main/java/services/ShoppingCartImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/src/main/java/services/ShoppingCartImpl.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/src/main/java/services/ShoppingCartImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/samples/store/src/main/java/services/ShoppingCartImpl.java Sat Jun 7 00:15:29 2008
@@ -25,8 +25,8 @@
import java.util.Map;
import java.util.UUID;
-import org.apache.tuscany.sca.implementation.data.collection.Entry;
-import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
+import org.apache.tuscany.sca.data.collection.Entry;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
import org.osoa.sca.annotations.Init;
import org.osoa.sca.annotations.Scope;
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java Sat Jun 7 00:15:29 2008
@@ -115,6 +115,25 @@
list.add(JavaCore.newLibraryEntry(path, sourcePath, null));
}
}
+
+ File libDirectory = runtimePath.append("lib").toFile();
+ if (libDirectory != null && libDirectory.exists()) {
+ for (File file : libDirectory.listFiles()) {
+ IPath path = new Path(file.getPath());
+ String name = path.lastSegment();
+ String extension = path.getFileExtension();
+
+ // Only include jaxb, jaxws and jsr API JARs
+ if (!"jar".equals(extension)) {
+ continue;
+ }
+ if (name.indexOf("-api-") != -1) {
+ if (name.startsWith("jaxb") || name.startsWith("jaxws") || name.startsWith("jsr")) {
+ list.add(JavaCore.newLibraryEntry(path, sourcePath, null));
+ }
+ }
+ }
+ }
}
return (IClasspathEntry[])list.toArray(new IClasspathEntry[list.size()]);
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/pom.xml?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/pom.xml Sat Jun 7 00:15:29 2008
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-data-api</artifactId>
+ <artifactId>tuscany-data-api</artifactId>
<version>2.0-incubating-SNAPSHOT</version>
</dependency>
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/Cart.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/Cart.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/Cart.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/Cart.java Sat Jun 7 00:15:29 2008
@@ -19,7 +19,7 @@
package services;
-import org.apache.tuscany.sca.implementation.data.collection.Collection;
+import org.apache.tuscany.sca.data.collection.Collection;
import org.osoa.sca.annotations.Remotable;
@Remotable
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/ShoppingCartImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/ShoppingCartImpl.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/ShoppingCartImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/ShoppingCartImpl.java Sat Jun 7 00:15:29 2008
@@ -25,8 +25,8 @@
import java.util.Map;
import java.util.UUID;
-import org.apache.tuscany.sca.implementation.data.collection.Entry;
-import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
+import org.apache.tuscany.sca.data.collection.Entry;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
import org.osoa.sca.annotations.Init;
import org.osoa.sca.annotations.Scope;
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/db/ShoppingCartTableImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/db/ShoppingCartTableImpl.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/db/ShoppingCartTableImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/assets/services/db/ShoppingCartTableImpl.java Sat Jun 7 00:15:29 2008
@@ -28,8 +28,8 @@
import java.util.List;
import java.util.UUID;
-import org.apache.tuscany.sca.implementation.data.collection.Entry;
-import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
+import org.apache.tuscany.sca.data.collection.Entry;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
import org.osoa.sca.ServiceRuntimeException;
import org.osoa.sca.annotations.Destroy;
import org.osoa.sca.annotations.Init;
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/client/ShopperImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/client/ShopperImpl.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/client/ShopperImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/client/ShopperImpl.java Sat Jun 7 00:15:29 2008
@@ -19,7 +19,7 @@
package client;
-import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
import org.osoa.sca.annotations.Reference;
import services.Cart;
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/pom.xml?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/pom.xml Sat Jun 7 00:15:29 2008
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-data-api</artifactId>
+ <artifactId>tuscany-data-api</artifactId>
<version>2.0-incubating-SNAPSHOT</version>
</dependency>
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/services/Cart.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/services/Cart.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/services/Cart.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-client/services/Cart.java Sat Jun 7 00:15:29 2008
@@ -19,7 +19,7 @@
package services;
-import org.apache.tuscany.sca.implementation.data.collection.Collection;
+import org.apache.tuscany.sca.data.collection.Collection;
import org.osoa.sca.annotations.Remotable;
@Remotable
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-test/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-test/pom.xml?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-test/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/tutorial/store-test/pom.xml Sat Jun 7 00:15:29 2008
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-data-api</artifactId>
+ <artifactId>tuscany-data-api</artifactId>
<version>2.0-incubating-SNAPSHOT</version>
</dependency>
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java Sat Jun 7 00:15:29 2008
@@ -21,17 +21,17 @@
import org.apache.tuscany.sca.vtest.assembly.ctypefile.AService;
import org.apache.tuscany.sca.vtest.assembly.ctypefile.BService;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Service;
-@Service(AService.class)
public class AServiceImpl implements AService {
- @Reference
- protected BService b;
+ private BService bService;
+
+ public void setBService(BService b) {
+ this.bService = b;
+ }
public String getState() {
- return b.getState();
+ return bService.getState();
}
}
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java Sat Jun 7 00:15:29 2008
@@ -20,13 +20,11 @@
package org.apache.tuscany.sca.vtest.assembly.ctypefile.impl;
import org.apache.tuscany.sca.vtest.assembly.ctypefile.BService;
-import org.osoa.sca.annotations.Service;
-//@Service(BService.class)
public class BServiceImpl implements BService {
public String getState() {
return "SomeStateFromB";
}
-}
+}
Added: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.componentType?rev=664294&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.componentType (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.componentType Sat Jun 7 00:15:29 2008
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
+
+ <service name="AService">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.ctypefile.AService"/>
+ </service>
+
+ <reference name="bService">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.ctypefile.BService"/>
+ </reference>
+
+</componentType>
\ No newline at end of file
Added: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType?rev=664294&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType Sat Jun 7 00:15:29 2008
@@ -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.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
+
+ <service name="BService">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.ctypefile.BService"/>
+ </service>
+
+</componentType>
+
\ No newline at end of file
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/typefile.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/typefile.composite?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/typefile.composite (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/main/resources/typefile.composite Sat Jun 7 00:15:29 2008
@@ -19,12 +19,12 @@
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java-api-tests"
+ targetNamespace="http://assembly-tests"
name="Assemby-component-typefile-Composite">
<component name="AComponent">
<implementation.java class="org.apache.tuscany.sca.vtest.assembly.ctypefile.impl.AServiceImpl"/>
- <reference name="b" target="BComponent"/>
+ <reference name="bService" target="BComponent/BService"/>
</component>
<component name="BComponent">
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java Sat Jun 7 00:15:29 2008
@@ -40,10 +40,10 @@
try {
System.out.println("Setting up");
ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
+ aService = ServiceFinder.getService(AService.class, "AComponent/AService");
} catch (Exception ex) {
ex.printStackTrace();
- }
+ }
}
@AfterClass
@@ -56,7 +56,6 @@
@Test
public void typeFile1() throws Exception {
- String thisState = "This State";
Assert.assertSame("SomeStateFromB", aService.getState());
}
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite Sat Jun 7 00:15:29 2008
@@ -95,5 +95,41 @@
<binding.ws requires="soap.1_1"/>
</reference>
</component>
+
+ <service name="BServicePromoted" promote="BComponentPromoted">
+ <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
+ <binding.ws name="BServicePromotedSOAP11" requires="soap.1_1" uri="http://localhost:8080/BServicePromoted/soap11"/>
+ <binding.ws requires="soap.1_2" uri="http://localhost:8080/BServicePromoted/soap12"/>
+ </service>
+
+ <service name="CServicePromoted" promote="CComponentPromoted">
+ <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/>
+ <binding.ws name="CServicePromotedSOAP12" requires="soap.1_2" uri="http://localhost:8080/CServicePromoted/soap12"/>
+ <binding.ws requires="soap.1_1" uri="http://localhost:8080/CServicePromoted/soap11"/>
+ </service>
+
+ <component name="BComponentPromoted">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.BServiceImpl"/>
+ </component>
+
+ <component name="CComponentPromoted">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.CServiceImpl"/>
+ </component>
+
+ <reference name="DComponent3B1" promote="DComponent3/b1">
+ <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
+ <binding.ws requires="soap.1_2" uri="http://localhost:8080/BServicePromoted/soap12"/>
+ </reference>
+
+ <reference name="DComponent3C1" promote="DComponent3/c1">
+ <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/>
+ <binding.ws requires="soap.1_1" uri="http://localhost:8080/CServicePromoted/soap11"/>
+ </reference>
+
+ <component name="DComponent3">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.DServiceImpl"/>
+ <reference name="b1"/>
+ <reference name="c1"/>
+ </component>
</composite>
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java Sat Jun 7 00:15:29 2008
@@ -28,7 +28,8 @@
/**
* Tests the simplest form of the binding element without WSDL document
- * described in section section 2.2.2 of SCA Web Services Binding V1.00
+ * described in section section 2.2.2 and 2.3.2 of SCA Web Services
+ * Binding V1.00
*/
public class NoWsdlMultiSoapBindingsTestCase {
@@ -40,6 +41,7 @@
protected static AService a4;
protected static DService d1;
protected static DService d2;
+ protected static DService d3;
@BeforeClass
public static void init() throws Exception {
@@ -52,6 +54,7 @@
a4 = ServiceFinder.getService(AService.class, "AComponent4");
d1 = ServiceFinder.getService(DService.class, "DComponent1");
d2 = ServiceFinder.getService(DService.class, "DComponent2");
+ d3 = ServiceFinder.getService(DService.class, "DComponent3");
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -125,7 +128,12 @@
}
/**
- * Lines 201-225:<br>
+ * Lines 201-225, 262-264:<br>
+ * The WSDL service has one or more ports for each web service binding on
+ * the SCA service that has a SOAP requirement, or that refers to an
+ * existing WSDL binding, depending on the requirements of the web service
+ * binding. Each of those ports has a single binding.<br>
+ * <p>
* Test multiple SOAP bindings with two references which use different versions.<br>
*/
@Test
@@ -170,6 +178,33 @@
Assert.assertEquals(new Integer(9002), c1Integer);
}
+ /**
+ * Lines 201-225, 262-264:<br>
+ * Test multiple SOAP bindings with promoted services and references.<br>
+ */
+ @Test
+ public void testMultiSoapBindings3() throws Exception {
+
+ String dName = d3.getName();
+ String b1Str1 = d3.getB1String("string1");
+ String b1Str2 = d3.getB1String2("string2", "string3");
+ String c1Str1 = d3.getC1String("string5");
+ String c1Str2 = d3.getC1String2("string6", "string7");
+ int b1Int = d3.getB1Int(4000);
+ float c1Float = d3.getC1Float((float) 8.8);
+ Integer c1Integer = d3.getC1Integer(new Integer(9003));
+
+ System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer);
+ Assert.assertEquals("DService", dName);
+ Assert.assertEquals("string1", b1Str1);
+ Assert.assertEquals("string2string3", b1Str2);
+ Assert.assertEquals(4000, b1Int);
+ Assert.assertEquals("string5", c1Str1);
+ Assert.assertEquals("string6string7", c1Str2);
+ Assert.assertEquals((float) 8.8, c1Float);
+ Assert.assertEquals(new Integer(9003), c1Integer);
+
+ }
@AfterClass
public static void destroy() throws Exception {
System.out.println("Cleaning up");
Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/pom.xml?rev=664294&r1=664293&r2=664294&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/pom.xml Sat Jun 7 00:15:29 2008
@@ -62,6 +62,7 @@
<module>defaultbinding</module>
<module>soapversion</module>
<module>multisoapbindings</module>
+ <module>promoted</module>
</modules>
</profile>
</profiles>
Added: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/promoted/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/promoted/pom.xml?rev=664294&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/promoted/pom.xml (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/promoted/pom.xml Sat Jun 7 00:15:29 2008
@@ -0,0 +1,58 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>vtest-wsbinding-nowsdl</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>vtest-wsbinding-nowsdl-promoted</artifactId>
+ <name>Apache Tuscany SCA Web Service Binding Verification Tests - No WSDL Promoted Service and Reference</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+</project>
Added: incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java?rev=664294&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java Sat Jun 7 00:15:29 2008
@@ -0,0 +1,37 @@
+/*
+ * 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.vtest.wsbinding.nowsdl.promoted;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The interface for AService.
+ */
+@Remotable
+public interface AService {
+
+ public String getName();
+
+ public String getB1String(String aString);
+
+ public String getB1String2(String aString, String bString);
+
+ public int getB1Int(int i);
+
+}