From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001 From: dims Date: Tue, 17 Jun 2008 00:23:01 +0000 Subject: Move Tuscany from Incubator to top level. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/java2wsdl/generate/CustomerValue.java | 43 ++++ .../java2wsdl/generate/CustomerWithAccount.java | 49 +++++ .../generate/TuscanyJava2WSDLTestCase.java | 108 +++++++++ .../tools/java2wsdl/generate/account/Account.java | 53 +++++ .../java2wsdl/generate/customer/Customer.java | 30 +++ .../java2wsdl/generate/extra/GoldCustomer.java | 36 +++ .../java/org/soapinterop/CreditScoreDocLit.java | 25 +++ .../src/test/resources/AccountService.wsdl | 242 +++++++++++++++++++++ .../src/test/resources/CreditScoreDocLit.wsdl | 76 +++++++ .../java2wsdl/src/test/resources/helloworld.wsdl | 121 +++++++++++ .../java2wsdl/src/test/resources/interopdoc.wsdl | 180 +++++++++++++++ .../java2wsdl/src/test/resources/sequences.xsd | 100 +++++++++ 12 files changed, 1063 insertions(+) create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/resources/AccountService.wsdl create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/resources/helloworld.wsdl create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/resources/interopdoc.wsdl create mode 100644 branches/sca-java-0.91/modules/java2wsdl/src/test/resources/sequences.xsd (limited to 'branches/sca-java-0.91/modules/java2wsdl/src/test') diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java new file mode 100644 index 0000000000..e679496509 --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java @@ -0,0 +1,43 @@ +/* + * 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.tools.java2wsdl.generate; + +import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; + +public class CustomerValue { + + public int getValue(String custId, String stockSymbol) { + return 0; + } + + public Customer getCustomerDetails(String custId) { + return new Customer(); + } + + public String noArgsServiceMethod() + { + return new String(); + } + + private void privateServiceMethod() + { + + } + +} diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java new file mode 100644 index 0000000000..4b5a795f2c --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java @@ -0,0 +1,49 @@ +/* + * 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.tools.java2wsdl.generate; + +import org.apache.tuscany.tools.java2wsdl.generate.account.Account; +import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; + +public class CustomerWithAccount { + + private Customer customer = new Customer(); + + private Account[] accounts; + + public int getValue(String custId, String stockSymbol) { + return 123; + } + + public Customer getCustomerDetails(String custId) { + return customer; + } + + public Account getCustomerAccount(String custId, String accountId) { + return accounts[0]; + } + + public Account[] getAccounts() { + return accounts; + } + + public void setAccounts(Account[] accounts) { + this.accounts = accounts; + } +} diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java new file mode 100644 index 0000000000..a72321c9b1 --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java @@ -0,0 +1,108 @@ +/* + * 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.tools.java2wsdl.generate; + +import java.io.File; + +import junit.framework.TestCase; + +/** + * A JUnit test case to test the Tuscany Java 2 WSDL Generation + */ +public class TuscanyJava2WSDLTestCase extends TestCase { + + /** + * setup the pre-requisites for the test case to run + * + * @exception Exception + */ + protected void setUp() throws Exception { + // System.out.println("inside setup"); + super.setUp(); + } + + /** + * @exception Exception + */ + protected void tearDown() throws Exception { + // System.out.println("inside tearDown"); + super.tearDown(); + } + + + /** + * Simple WSDL generation test. + */ + public void testSimpleWSDLGeneration() { + String[] arguments = new String[] { "-cn","org.apache.tuscany.tools.java2wsdl.generate.CustomerValue", + "-o", "target/java2wsdl-source", + "-xc", "org.apache.tuscany.tools.java2wsdl.generate.extra.GoldCustomer"}; + + + Java2WSDL.main(arguments); + + File file = new File("target/java2wsdl-source/CustomerValue.wsdl"); + assertTrue(file.exists() && file.isFile()); + } + + /** + * Test WSDL generation where a parameter Object[] is involved. + */ + public void testWsdlGeneration2() { + + String[] arguments = new String[] + { + "-cn", + "org.apache.tuscany.tools.java2wsdl.generate.CustomerWithAccount", + "-o", "target/java2wsdl-source", }; + Java2WSDL.main(arguments); + + File file = new File("target/java2wsdl-source/CustomerWithAccount.wsdl"); + assertTrue(file.exists() && file.isFile()); + } + + public void testWsdlGeneration_SDO_Static() + { + //tests for SDOs where XSD exist. Hence no XSDs must be generated + String[] arguments = new String[] { + "-cn", + "org.soapinterop.CreditScoreDocLit", + "-o", "target/java2wsdl-source", + "-ixsd", "[http://www.example.org/creditscore/doclit/," + + "http://www.example.org/creditscore/doclit/xsd]"}; + Java2WSDL.main(arguments); + + File file = new File("target/java2wsdl-source/CreditScoreDocLit.wsdl"); + assertTrue(file.exists() && file.isFile()); + } + + + + /** + * Test WSDL generation from a java interface and then generate the java + * interface using the generated WSDL. + */ + public void _testRoundTrip() { + // TODO implement round trip + // this should re-generate java interfaces from the generated wsdl + // and compile (?) the generated java code. + // fail(); + + } +} diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java new file mode 100644 index 0000000000..84d59164ee --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.tools.java2wsdl.generate.account; + +import java.math.BigDecimal; + +public class Account { + int accountType; + + String accountNo; + + BigDecimal balance; + + public String getAccountNo() { + return accountNo; + } + + public void setAccountNo(String accountNo) { + this.accountNo = accountNo; + } + + public int getAccountType() { + return accountType; + } + + public void setAccountType(int accountType) { + this.accountType = accountType; + } + + public BigDecimal getBalance() { + return balance; + } + + public void setBalance(BigDecimal balance) { + this.balance = balance; + } +} diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java new file mode 100644 index 0000000000..a28399e7fe --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java @@ -0,0 +1,30 @@ +/* + * 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.tools.java2wsdl.generate.customer; + +public class Customer { + private String name = ""; + + public int custType = 0; + + public String getName() { + return name; + } +} + diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java new file mode 100644 index 0000000000..afc68a3217 --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java @@ -0,0 +1,36 @@ +/* + * 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.tools.java2wsdl.generate.extra; + +import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; + + + + +public class GoldCustomer extends Customer { + public String goldCustNumber = ""; + + public String getGoldCustNumber() { + return goldCustNumber; + } + + public void setGoldCustNumber(String goldCustNumber) { + this.goldCustNumber = goldCustNumber; + } +} diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java new file mode 100644 index 0000000000..e9e8aa882a --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java @@ -0,0 +1,25 @@ +/* + * 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.soapinterop; + +public interface CreditScoreDocLit { + public org.example.creditscore.doclit.CreditReport getCreditScore( + org.example.creditscore.doclit.Customer param0) throws java.rmi.RemoteException; + } + diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/AccountService.wsdl b/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/AccountService.wsdl new file mode 100644 index 0000000000..6f2fed1e2a --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/AccountService.wsdl @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl b/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl new file mode 100644 index 0000000000..09d1a58589 --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/helloworld.wsdl b/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/helloworld.wsdl new file mode 100644 index 0000000000..051f604bb2 --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/helloworld.wsdl @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/interopdoc.wsdl b/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/interopdoc.wsdl new file mode 100644 index 0000000000..820c26ca34 --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/interopdoc.wsdl @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/sequences.xsd b/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/sequences.xsd new file mode 100644 index 0000000000..a565f3fa65 --- /dev/null +++ b/branches/sca-java-0.91/modules/java2wsdl/src/test/resources/sequences.xsd @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3