diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 23:07:07 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 23:07:07 +0000 |
commit | 5559ef5edbf8d3616f7a4b497b2a459b0ee4082b (patch) | |
tree | 424dfa28917e6204d4fd24e4328d274f8d2d14d0 /sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src | |
parent | 3dd7e2c4da9c80b8182a2d04dc129a67aa7910df (diff) |
Moving 1.x branches
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835122 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src')
3 files changed, 452 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src/main/resources/generate/generate.xml b/sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src/main/resources/generate/generate.xml new file mode 100644 index 0000000000..5487b113e8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src/main/resources/generate/generate.xml @@ -0,0 +1,173 @@ +<?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. +--> +<tns:Generate xmlns:tns="http://www.apache.org/tuscany/generate" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.example.org/generate generate.xsd "> + <Template> + <TemplateName>pom.xml.vm</TemplateName> + <TemplateTargetDir>..</TemplateTargetDir> + </Template> + <Template> + <TemplateName>greeter.composite.vm</TemplateName> + <TemplateTargetDir>classes</TemplateTargetDir> + </Template> + <Template> + <TemplateName>GreeterService.java.vm</TemplateName> + <TemplateTargetDir>../src/main/java/org/apache/tuscany/sca/itest/sdodatabinding</TemplateTargetDir> + <JavaPackage>org.apache.tuscany.sca.itest.sdodatabinding</JavaPackage> + </Template> + <Template> + <TemplateName>GreeterServiceImpl.java.vm</TemplateName> + <TemplateTargetDir>../src/main/java/org/apache/tuscany/sca/itest/sdodatabinding</TemplateTargetDir> + <JavaPackage>org.apache.tuscany.sca.itest.sdodatabinding</JavaPackage> + </Template> + <Template> + <TemplateName>GreeterServiceClientImpl.java.vm</TemplateName> + <TemplateTargetDir>../src/main/java/org/apache/tuscany/sca/itest/sdodatabinding</TemplateTargetDir> + <JavaPackage>org.apache.tuscany.sca.itest.sdodatabinding</JavaPackage> + </Template> + <Template> + <TemplateName>DatabindingTestCase.java.vm</TemplateName> + <TemplateTargetDir>../src/test/java/org/apache/tuscany/sca/itest/sdodatabinding</TemplateTargetDir> + <JavaPackage>org.apache.tuscany.sca.itest.sdodatabinding</JavaPackage> + </Template> + <Template> + <TemplateName>Greeter.wsdl.vm</TemplateName> + <TemplateTargetDir>classes/wsdl</TemplateTargetDir> + </Template> + <InputFile> + <FileName>Person.xsd</FileName> + <FilePath>xsd</FilePath> + <JavaPackage>org.apache.tuscany.sca.itest.databinding.types</JavaPackage> + <Factory>TypesFactory</Factory> + <Namespace>http://apache.org/tuscany/sca/itest/databinding/types</Namespace> + <Prefix>p</Prefix> + <Type> + <TypeName>PersonType</TypeName> + <CreateTypeCode> + TypesFactory factory = TypesFactory.INSTANCE; + param = factory.createPersonType(); + param.setFirstName("George"); + param.setLastName("Doors"); + </CreateTypeCode> + <ModifyTypeCode> + param.setGreeting("Hello"); + </ModifyTypeCode> + <ResultComparison> + assertNotSame("greetedPerson.getGreeting() not set", "", result.getGreeting()); + </ResultComparison> + </Type> + </InputFile> + <InputFile> + <FileName>Interop.xsd</FileName> + <FilePath>xsd</FilePath> + <JavaPackage>org.apache.tuscany.interop</JavaPackage> + <Factory>InteropFactory</Factory> + <Namespace>http://www.apache.org/tuscany/interop</Namespace> + <Prefix>i</Prefix> + <!-- Type> + <TypeName>AnnotationComplexType</TypeName> + <CreateTypeCode> + InteropFactory factory = InteropFactory.INSTANCE; + param = factory.createAnnotationComplexType(); + param.setSimpleTypeWithNameElement("SomeText"); + </CreateTypeCode> + <ModifyTypeCode> + param.setSimpleTypeWithNameElement("SomeChangedText");; + </ModifyTypeCode> + <ResultComparison> + assertEquals("data not changed corretly", "SomeChangedText", result.getSimpleTypeWithNameElement()); + </ResultComparison> + </Type--> + <Type> + <TypeName>AttributeComplexType</TypeName> + <CreateTypeCode> + InteropFactory factory = InteropFactory.INSTANCE; + org.apache.tuscany.interop.AttributeType attrib = factory.createAttributeType(); + attrib.setAttribute("SomeText"); + param = factory.createAttributeComplexType(); + param.setAttributeElement(attrib); + </CreateTypeCode> + <ModifyTypeCode> + param.getAttributeElement().setAttribute("SomeChangedText");; + </ModifyTypeCode> + <ResultComparison> + assertEquals("data not changed corretly", "SomeChangedText", result.getAttributeElement().getAttribute()); + </ResultComparison> + </Type> + <Type> + <TypeName>AttributeReferenceComplexType</TypeName> + <CreateTypeCode> + InteropFactory factory = InteropFactory.INSTANCE; + param = factory.createAttributeReferenceComplexType(); + + param.setReferencedAttribute("SomeText"); + </CreateTypeCode> + <ModifyTypeCode> + param.setReferencedAttribute("SomeChangedText");; + </ModifyTypeCode> + <ResultComparison> + assertEquals("data not changed corretly", "SomeChangedText", result.getReferencedAttribute()); + </ResultComparison> + </Type> + <Type> + <TypeName>SimpleTypeWithAbstractComplexType</TypeName> + <CreateTypeCode> + InteropFactory factory = InteropFactory.INSTANCE; + param = factory.createSimpleTypeWithAbstractComplexType(); + param.setSimpleTypeWithAbstractExtensionElement("SomeText"); + </CreateTypeCode> + <ModifyTypeCode> + param.setSimpleTypeWithAbstractExtensionElement("SomeChangedText");; + </ModifyTypeCode> + <ResultComparison> + assertEquals("data not changed corretly", "SomeChangedText", result.getSimpleTypeWithAbstractExtensionElement()); + </ResultComparison> + </Type> + <Type> + <TypeName>SimpleTypeWithNameComplexType</TypeName> + <CreateTypeCode> + InteropFactory factory = InteropFactory.INSTANCE; + param = factory.createSimpleTypeWithNameComplexType(); + param.setSimpleTypeWithNameElement("SomeText"); + </CreateTypeCode> + <ModifyTypeCode> + param.setSimpleTypeWithNameElement("SomeChangedText");; + </ModifyTypeCode> + <ResultComparison> + assertEquals("data not changed corretly", "SomeChangedText", result.getSimpleTypeWithNameElement()); + </ResultComparison> + </Type> + <Type> + <TypeName>ComplexTypeWithContentType</TypeName> + <CreateTypeCode> + InteropFactory factory = InteropFactory.INSTANCE; + param = factory.createComplexTypeWithContentType(); + param.setSimpleTypeWithName("SomeText"); + </CreateTypeCode> + <ModifyTypeCode> + param.setSimpleTypeWithName("SomeChangedText");; + </ModifyTypeCode> + <ResultComparison> + assertEquals("data not changed corretly", "SomeChangedText", result.getSimpleTypeWithName()); + </ResultComparison> + </Type> + </InputFile> +</tns:Generate> diff --git a/sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src/main/resources/generate/greeter.composite.vm b/sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src/main/resources/generate/greeter.composite.vm new file mode 100644 index 0000000000..9494d70f96 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src/main/resources/generate/greeter.composite.vm @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--> +<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" + xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance" + xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0" + name="SDOGreeterService"> + + <!-- SDO factory classes --> + <dbsdo:import.sdo factory="org.apache.tuscany.sca.itest.databinding.services.ServicesFactory"/> + #foreach( $file in $fileList ) + <dbsdo:import.sdo factory="$file.getJavaPackage().$file.getFactory()"/> + #end + + <!-- Clients to test the services --> + <component name="DefaultGreeterServiceClient"> + <implementation.java class="org.apache.tuscany.sca.itest.sdodatabinding.GreeterServiceClientImpl" /> + <reference name="greeterService" target="SDOGreeterServiceComponent"/> + </component> + + <component name="WSGreeterServiceClient"> + <implementation.java class="org.apache.tuscany.sca.itest.sdodatabinding.GreeterServiceClientImpl" /> + </component> + + <reference name="SDOGreeterServiceWSReference" promote="WSGreeterServiceClient/greeterService"> + <interface.wsdl interface="http://apache.org/tuscany/sca/itest/databinding/services#wsdl.interface(GreeterPortType)"/> + <binding.ws wsdlElement="http://apache.org/tuscany/sca/itest/databinding/services#wsdl.port(GreeterService/GreeterPort)"/> + </reference> + + <!-- The greeter service --> + <service name="SDOGreeterService" promote="SDOGreeterServiceComponent"> + <interface.wsdl interface="http://apache.org/tuscany/sca/itest/databinding/services#wsdl.interface(GreeterPortType)"/> + <binding.ws wsdlElement="http://apache.org/tuscany/sca/itest/databinding/services#wsdl.port(GreeterService/GreeterPort)"/> + </service> + + <component name="SDOGreeterServiceComponent"> + <implementation.java class="org.apache.tuscany.sca.itest.sdodatabinding.GreeterServiceImpl" /> + </component> + +</composite> diff --git a/sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src/main/resources/generate/pom.xml.vm b/sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src/main/resources/generate/pom.xml.vm new file mode 100644 index 0000000000..91d8aead7e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.0/itest/databindings/sdogen/src/main/resources/generate/pom.xml.vm @@ -0,0 +1,223 @@ +<?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> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-databindings</artifactId> + <version>1.0-incubating-SNAPSHOT</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + + <artifactId>itest-databindings-sdo</artifactId> + <version>1.0-incubating-SNAPSHOT</version> + <packaging>jar</packaging> + <name>Apache Tuscany SCA SDO Databinding Integration Tests</name> + + <repositories> + <repository> + <snapshots> + <enabled>true</enabled> + </snapshots> + <id>java.net</id> + <name>java.net Maven 1.x Repository</name> + <url>https://maven-repository.dev.java.net/nonav/repository</url> + <layout>legacy</layout> + </repository> + </repositories> + + <pluginRepositories> + <pluginRepository> + <snapshots> + <enabled>true</enabled> + </snapshots> + <id>java.net</id> + <name>java.net Maven 1.x Repository</name> + <url>https://maven-repository.dev.java.net/repository</url> + <layout>legacy</layout> + </pluginRepository> + </pluginRepositories> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${pom.version}</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-core-databinding</artifactId> + <version>${pom.version}</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-databinding-jaxb</artifactId> + <version>${pom.version}</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-databinding-sdo</artifactId> + <version>${pom.version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-databinding-axiom</artifactId> + <version>${pom.version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>${pom.version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${pom.version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-interface-java-xml</artifactId> + <version>${pom.version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-databindings-common</artifactId> + <version>${pom.version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>1.0-incubating-SNAPSHOT</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.5</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>itest-databindings-common</artifactId> + <version>${project.version}</version> + <overWrite>true</overWrite> + <outputDirectory>${project.build.directory}/classes</outputDirectory> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <id>add-test-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-test-source</goal> + </goals> + <configuration> + <sources> + <source>target/sdo-source</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <executions> + <execution> + <id>generate-test-source</id> + <phase>process-resources</phase> + <goals> + <goal>java</goal> + </goals> + </execution> + </executions> + <configuration> + <mainClass>org.apache.tuscany.sca.itest.generate.Generate</mainClass> + <arguments> + <argument>${project.build.directory}</argument> + </arguments> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.tuscany.sdo</groupId> + <artifactId>tuscany-sdo-plugin</artifactId> + <version>1.0-incubating</version> + <executions> + <execution> + <id>generate-sdo</id> + <phase>process-resources</phase> + <configuration> + <schemaFiles> + <configuration> + <fileName>${project.build.directory}/classes/wsdl/Greeter.wsdl</fileName> + <javaPackage>org.apache.tuscany.sca.itest.databinding.services</javaPackage> + </configuration> + #foreach( $file in $fileList ) + <configuration> + <fileName>${project.build.directory}/classes/$file.getFilePath()/$file.getFileName()</fileName> + <javaPackage>$file.getJavaPackage()</javaPackage> + </configuration> + #end + </schemaFiles> + <noNotification>true</noNotification> + <noContainment>true</noContainment> + <noUnsettable>true</noUnsettable> + </configuration> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> |