tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1032313 - in /tuscany/sca-java-1.x/trunk/itest/jaxws/src: main/java/jtest/ main/java/jtest/impl/ test/java/jtest/
Date Sun, 07 Nov 2010 17:12:30 GMT
Author: nash
Date: Sun Nov  7 17:12:30 2010
New Revision: 1032313

URL: http://svn.apache.org/viewvc?rev=1032313&view=rev
Log:
Add test for abstract exceptions

Added:
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/AbstractException.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/ConcreteException.java
Modified:
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestClient.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestService.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestClientImpl.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestServiceImpl.java
    tuscany/sca-java-1.x/trunk/itest/jaxws/src/test/java/jtest/DatatypesTestCase.java

Added: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/AbstractException.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/AbstractException.java?rev=1032313&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/AbstractException.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/AbstractException.java Sun
Nov  7 17:12:30 2010
@@ -0,0 +1,31 @@
+/*
+ * 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 jtest;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+/**
+ * The abstract exception class
+ */
+@XmlJavaTypeAdapter(TestAdapter.class)
+public abstract class AbstractException extends Exception {
+
+    public abstract String getGreeting();
+}

Added: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/ConcreteException.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/ConcreteException.java?rev=1032313&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/ConcreteException.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/ConcreteException.java Sun
Nov  7 17:12:30 2010
@@ -0,0 +1,40 @@
+/*
+ * 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 jtest;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+/**
+ * The concrete exception class
+ */
+@XmlJavaTypeAdapter(TestAdapter.class)
+public class ConcreteException extends AbstractException {
+
+    private String greeting;
+
+    public ConcreteException() {
+        super();
+        this.greeting = "Goodbye...";
+    }
+
+    public String getGreeting() {
+        return greeting;
+    }
+}

Modified: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestClient.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestClient.java?rev=1032313&r1=1032312&r2=1032313&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestClient.java (original)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestClient.java Sun Nov  7
17:12:30 2010
@@ -24,5 +24,7 @@ package jtest;
  */
 public interface TestClient {
 
-    void runTest();
+    void runAbstractTypeTest();
+
+    void runAbstractExceptionTest();
 }

Modified: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestService.java?rev=1032313&r1=1032312&r2=1032313&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestService.java (original)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/TestService.java Sun Nov  7
17:12:30 2010
@@ -21,6 +21,7 @@ package jtest;
 
 import org.osoa.sca.annotations.Remotable;
 
+import jtest.AbstractException;
 import jtest.TestAbstract;
 
 /**
@@ -30,4 +31,6 @@ import jtest.TestAbstract;
 public interface TestService {
 
     void sendAbstract(TestAbstract data1, TestAbstract data2);
+
+    void throwAbstract() throws AbstractException;
 }

Modified: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestClientImpl.java?rev=1032313&r1=1032312&r2=1032313&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestClientImpl.java (original)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestClientImpl.java Sun
Nov  7 17:12:30 2010
@@ -22,6 +22,7 @@ package jtest.impl;
 import org.osoa.sca.annotations.Reference;
 import org.osoa.sca.annotations.Service;
 
+import jtest.AbstractException;
 import jtest.TestClient;
 import jtest.TestConcrete1;
 import jtest.TestConcrete2;
@@ -36,9 +37,18 @@ public class TestClientImpl implements T
     @Reference
     protected TestService ref;
 
-    public void runTest() {
+    public void runAbstractTypeTest() {
         TestConcrete1 data1 = new TestConcrete1();
         TestConcrete2 data2 = new TestConcrete2();
         ref.sendAbstract(data1, data2);
     }
+
+    public void runAbstractExceptionTest() {
+        try {
+            ref.throwAbstract();
+        } catch (AbstractException e) {
+            System.out.println("Caught exception " + e);
+            System.out.println(e.getGreeting());
+        }
+    }
 }

Modified: tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestServiceImpl.java?rev=1032313&r1=1032312&r2=1032313&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestServiceImpl.java (original)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/main/java/jtest/impl/TestServiceImpl.java Sun
Nov  7 17:12:30 2010
@@ -21,6 +21,8 @@ package jtest.impl;
 
 import org.osoa.sca.annotations.Service;
 
+import jtest.AbstractException;
+import jtest.ConcreteException;
 import jtest.TestAbstract;
 import jtest.TestService;
 
@@ -35,4 +37,8 @@ public class TestServiceImpl implements 
         System.out.println("data2 is instance of class " + data2.getClass().getName());
         System.out.println(data1.getGreeting() + " " + data2.getGreeting());
     }
+
+    public void throwAbstract() throws AbstractException {
+        throw new ConcreteException();
+    }
 }

Modified: tuscany/sca-java-1.x/trunk/itest/jaxws/src/test/java/jtest/DatatypesTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/jaxws/src/test/java/jtest/DatatypesTestCase.java?rev=1032313&r1=1032312&r2=1032313&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/jaxws/src/test/java/jtest/DatatypesTestCase.java (original)
+++ tuscany/sca-java-1.x/trunk/itest/jaxws/src/test/java/jtest/DatatypesTestCase.java Sun
Nov  7 17:12:30 2010
@@ -25,6 +25,7 @@ import org.apache.tuscany.sca.node.SCANo
 import org.apache.tuscany.sca.node.SCANodeFactory;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class DatatypesTestCase {
@@ -38,10 +39,18 @@ public class DatatypesTestCase {
     }
     
     @Test
-    public void runTest() {
+    public void runAbstractTypeTest() {
         SCAClient client = (SCAClient)node;
         TestClient testClient = client.getService(TestClient.class, "TestClient");
-        testClient.runTest();
+        testClient.runAbstractTypeTest();
+    }
+
+    @Test
+    @Ignore
+    public void runAbstractExceptionTest() {
+        SCAClient client = (SCAClient)node;
+        TestClient testClient = client.getService(TestClient.class, "TestClient");
+        testClient.runAbstractExceptionTest();
     }
     
     @AfterClass



Mime
View raw message