From 25ecf5fd25c607f964959e562a8ebb4c211fe5b2 Mon Sep 17 00:00:00 2001 From: antelder Date: Mon, 23 Mar 2009 07:58:24 +0000 Subject: Remove old testing sandbox sca trunk git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@757342 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/interfacedef/java/jaxws/Bean.java | 27 ----- .../tuscany/sca/interfacedef/java/jaxws/Bean1.java | 40 ------- .../tuscany/sca/interfacedef/java/jaxws/Bean2.java | 40 ------- .../sca/interfacedef/java/jaxws/BeanInterface.java | 28 ----- .../interfacedef/java/jaxws/BeanInterfaceImpl.java | 35 ------ .../java/jaxws/FaultBeanGeneratorTestCase.java | 64 ----------- .../jaxws/JAXWSJavaInterfaceProcessorTestCase.java | 121 --------------------- .../java/jaxws/JavaReflectionHelperTestCase.java | 47 -------- .../sca/interfacedef/java/jaxws/MyException.java | 62 ----------- .../sca/interfacedef/java/jaxws/MyServiceImpl.java | 52 --------- .../sca/interfacedef/java/jaxws/TestAdapter.java | 39 ------- .../interfacedef/java/jaxws/TestGenericClass.java | 40 ------- .../sca/interfacedef/java/jaxws/TestInterface.java | 70 ------------ .../java/jaxws/WrapperBeanGeneratorTestCase.java | 79 -------------- 14 files changed, 744 deletions(-) delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java delete mode 100644 sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java (limited to 'sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org') diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java deleted file mode 100644 index 1b07e25bad..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -/** - * - * @version $Rev$ $Date$ - */ -public interface Bean { - T getP1(); -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java deleted file mode 100644 index d38a21ba52..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -/** - * - * @version $Rev$ $Date$ - */ -public class Bean1 { - private String p1; - private int p2; - public String getP1() { - return p1; - } - public void setP1(String p1) { - this.p1 = p1; - } - public int getP2() { - return p2; - } - public void setP2(int p2) { - this.p2 = p2; - } -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java deleted file mode 100644 index 7b9375063d..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -/** - * - * @version $Rev$ $Date$ - */ -public class Bean2 implements Bean{ - private String p1; - private int p2; - public String getP1() { - return p1; - } - public void setP1(String p1) { - this.p1 = p1; - } - public int getP2() { - return p2; - } - public void setP2(int p2) { - this.p2 = p2; - } -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java deleted file mode 100644 index 67b9c84399..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -/** - * Bean Interface - */ -public interface BeanInterface { - String getAttr(); - void setAttr(String attr); -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java deleted file mode 100644 index f964ea374b..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -/** - * Impl of BeanInterface - */ -public class BeanInterfaceImpl implements BeanInterface { - private String attr; - - public String getAttr() { - return attr; - } - - public void setAttr(String attr) { - this.attr = attr; - } -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java deleted file mode 100644 index 4caeb79fca..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.annotation.Annotation; - -import javax.xml.bind.JAXBContext; - -import org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper; -import org.junit.Assert; -import org.junit.Test; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.util.CheckClassAdapter; - -/** - * @version $Rev$ $Date$ - */ -public class FaultBeanGeneratorTestCase { - - @Test - public void testGenerate() throws IOException { - byte[] content = new FaultBeanGenerator().generate(MyException.class); - ClassReader cr = new ClassReader(content); - PrintWriter pw = new PrintWriter(System.out); - CheckClassAdapter.verify(cr, false, pw); - } - - @Test - public void testGenerateClass() throws Exception { - Class cls = FaultBeanGenerator.generateFaultBeanClass(MyException.class); - Assert.assertEquals("org.apache.tuscany.sca.interfacedef.java.jaxws.jaxws.MyExceptionBean", cls.getName()); - for (Annotation a : cls.getAnnotations()) { - System.out.println(a); - } - // XmlType xmlType = cls.getAnnotation(XmlType.class); - // System.out.println(xmlType); - Object bean = cls.newInstance(); - JAXBContext context = JAXBContextHelper.createJAXBContext(cls); - StringWriter sw = new StringWriter(); - context.createMarshaller().marshal(bean, sw); - System.out.println(sw.toString()); - - } -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java deleted file mode 100644 index f82342fe28..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import javax.jws.WebMethod; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.jaxb.DefaultXMLAdapterExtensionPoint; -import org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import com.example.stock.StockExceptionTest; - -/** - * - * @version $Rev$ $Date$ - */ -public class JAXWSJavaInterfaceProcessorTestCase { - private JAXWSJavaInterfaceProcessor interfaceProcessor; - - @Before - public void setUp() throws Exception { - DataBindingExtensionPoint db = new DefaultDataBindingExtensionPoint(); - XMLAdapterExtensionPoint xa = new DefaultXMLAdapterExtensionPoint(); - interfaceProcessor = new JAXWSJavaInterfaceProcessor(db, new JAXWSFaultExceptionMapper(db, xa), xa); - } - - @Test - public void testWrapper() throws Exception { - DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory(); - JavaInterface contract = iFactory.createJavaInterface(StockExceptionTest.class); - - interfaceProcessor.visitInterface(contract); - Operation op = contract.getOperations().get(0); - Assert.assertTrue(!op.isWrapperStyle()); - Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOffer"), op.getWrapper().getInputWrapperElement().getQName()); - Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOfferResponse"), op.getWrapper().getOutputWrapperElement().getQName()); - } - - /** - * Test method for - * {@link org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor#visitInterface(JavaInterface)}. - */ - @Test - public final void testProcessor() throws Exception { - DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory(); - JavaInterface contract = iFactory.createJavaInterface(WebServiceInterfaceWithoutAnnotation.class); - - interfaceProcessor.visitInterface(contract); - assertFalse(contract.isRemotable()); - - contract = iFactory.createJavaInterface(WebServiceInterfaceWithAnnotation.class); - interfaceProcessor.visitInterface(contract); - assertTrue(contract.isRemotable()); - - Operation op1 = contract.getOperations().get(0); - Operation op2 = contract.getOperations().get(1); - - Operation op = null; - if ("m1".equals(op1.getName())) { - op = op1; - } else { - op = op2; - } - - assertTrue(!op.isWrapperStyle() && op.getWrapper() == null); - - if ("M2".equals(op2.getName())) { - op = op2; - } else { - op = op1; - } - assertTrue(!op.isWrapperStyle() && op.getWrapper() != null); - - } - - @WebService - private static interface WebServiceInterfaceWithAnnotation { - - @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) - @WebMethod(operationName = "m1") - String m1(String str); - - @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) - @WebMethod(operationName = "M2") - String m2(String str, int i); - } - - private static interface WebServiceInterfaceWithoutAnnotation { - - } -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java deleted file mode 100644 index 6315e12ff8..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -import java.lang.reflect.Field; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class JavaReflectionHelperTestCase { - @Test - public void testErasure() throws Exception { - for (Field f : TestGenericClass.class.getDeclaredFields()) { - Class cls = CodeGenerationHelper.getErasure(f.getGenericType()); - System.out.println(cls.getName()); - Assert.assertSame(f.getType(), cls); - } - } - - @Test - public void testSignature() throws Exception { - for (Field f : TestGenericClass.class.getDeclaredFields()) { - String sig = CodeGenerationHelper.getSignature(f.getGenericType()); - System.out.println(sig); - } - } -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java deleted file mode 100644 index 4df0517de6..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -/** - * - * @version $Rev$ $Date$ - */ -public class MyException extends Exception { - private String error; - private int code; - - public MyException() { - super(); - } - - public MyException(String message, Throwable cause) { - super(message, cause); - } - - public MyException(String message) { - super(message); - } - - public MyException(Throwable cause) { - super(cause); - } - - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java deleted file mode 100644 index 78527193d5..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -import java.util.List; - -import javax.jws.WebMethod; -import javax.jws.WebService; - -/** - * @version $Rev$ $Date$ - */ -@WebService -public class MyServiceImpl { - - public MyServiceImpl() { - super(); - } - - @WebMethod - public T getBean(T b, Bean2 b2) { - return null; - } - - @WebMethod - public List getBeans() { - return null; - } - - @WebMethod - public String convert(String str, int i) throws MyException { - return "ME"; - } - -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java deleted file mode 100644 index fb319a3b0f..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -import javax.xml.bind.annotation.adapters.XmlAdapter; - -/** - * Test XML Adapter - */ -public class TestAdapter extends XmlAdapter { - - @Override - public BeanInterfaceImpl marshal(BeanInterface v) throws Exception { - return (BeanInterfaceImpl)v; - } - - @Override - public BeanInterface unmarshal(BeanInterfaceImpl v) throws Exception { - return v; - } - -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java deleted file mode 100644 index 2ecf822904..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; - -/** - * @version $Rev$ $Date$ - */ -public class TestGenericClass , S> { - public TestGenericClass i; - public T f1; - public T[] f2; - public S f3; - public List list1; - public List list2; - public List list3; - public int f4; - public int[] f5; - public Map map; -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java deleted file mode 100644 index 1f8e6cb445..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebResult; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.ws.Holder; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * @version $Rev$ $Date$ - */ -@Remotable -public interface TestInterface { - int convert(String currency1, String currency2); - - List getRates(String currency); - - void check(boolean flag); - - String[] list(int[] list); - - int[][] map(String[][] strs); - - String getGreetings(String name); - - String[] getGreetingsArray(String[] names); - - List getGreetingsList(List names); - - ArrayList getGreetingsArrayList(ArrayList names); - - Map getGreetingsMap(Map namesMap); - - HashMap getGreetingsHashMap(HashMap namesMap); - - @WebMethod - @WebResult(name = "output") - String webMethod(@WebParam(name = "input", mode = WebParam.Mode.IN) String in, - @WebParam(name = "holder", mode = WebParam.Mode.INOUT) Holder holder); - - @XmlJavaTypeAdapter(type = BeanInterface.class, value = TestAdapter.class) - BeanInterface beanMethod(@XmlJavaTypeAdapter(type = BeanInterface.class, value = TestAdapter.class) BeanInterface in, - String str); -} diff --git a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java b/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java deleted file mode 100644 index b14ef19939..0000000000 --- a/sandbox/ant/sca/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.interfacedef.java.jaxws; - -import java.io.StringReader; -import java.io.StringWriter; -import java.lang.annotation.Annotation; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.List; -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; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class WrapperBeanGeneratorTestCase { - @Test - public void testGenerate() throws Exception { - List> classes = new WrapperBeanGenerator().generateWrapperBeans(TestInterface.class); - for (Class cls : classes) { - for (Field f : cls.getDeclaredFields()) { - System.out.println(f.getName()); - System.out.println(f.getGenericType()); - for (Annotation a : f.getAnnotations()) { - System.out.println(a); - } - } - for (Method m : cls.getDeclaredMethods()) { - System.out.println(m); - for (Annotation a : m.getAnnotations()) { - System.out.println(a); - } - } - } - JAXBContext context = JAXBContextHelper.createJAXBContext(classes.toArray(new Class[classes.size()])); - for (Class cls : classes) { - Object obj = cls.newInstance(); - StringWriter sw = new StringWriter(); - context.createMarshaller().marshal(obj, sw); - // 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> classes = new WrapperBeanGenerator().generateWrapperBeans(TestInterface.class); - JAXBContext context = JAXBContextHelper.createJAXBContext(classes.toArray(new Class[classes.size()])); - Map results = JAXBTypeHelper.generateSchema(context); - for (String xsd : results.values()) { - System.out.println(xsd); - } - } -} -- cgit v1.2.3