Author: antelder
Date: Fri Feb 22 04:40:32 2008
New Revision: 630179

URL: http://svn.apache.org/viewvc?rev=630179&view=rev
Log:
Fix for no arg invocations and add an itest for exceptions

Added:
    
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
   (with props)
    
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
   (with props)
    
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java
   (with props)
    
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
   (with props)
    incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/
    
incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/client.composite
    
incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/service.composite
Modified:
    
incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java

Added: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java?rev=630179&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
 Fri Feb 22 04:40:32 2008
@@ -0,0 +1,28 @@
+/*
+ * 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.binding.jms;
+
+public class CheckedExcpetion extends Exception {
+    private static final long serialVersionUID = 1L;
+
+    public CheckedExcpetion(String s) {
+        super(s);
+    }
+}

Propchange: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java?rev=630179&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
 Fri Feb 22 04:40:32 2008
@@ -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.sca.binding.jms;
+
+import org.osoa.sca.annotations.Remotable;
+
[EMAIL PROTECTED]
+public interface ExceptionService {
+
+    public void throwChecked() throws CheckedExcpetion;
+
+    public void throwUnChecked();
+}

Propchange: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java?rev=630179&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java
 Fri Feb 22 04:40:32 2008
@@ -0,0 +1,45 @@
+/*
+ * 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.binding.jms;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the HelloWorld service.
+ */
[EMAIL PROTECTED](ExceptionService.class)
+public class ExceptionServiceClient implements ExceptionService {
+
+    private ExceptionService service;
+
+    @Reference
+    public void setService(ExceptionService service) {
+        this.service = service;
+    }
+
+    public void throwChecked() throws CheckedExcpetion {
+        service.throwChecked();
+    }
+
+    public void throwUnChecked() {
+        service.throwUnChecked();
+    }
+
+}

Propchange: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java?rev=630179&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
 Fri Feb 22 04:40:32 2008
@@ -0,0 +1,32 @@
+/*
+ * 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.binding.jms;
+
+public class ExceptionServiceImpl implements ExceptionService {
+
+    public void throwChecked() throws CheckedExcpetion {
+        throw new CheckedExcpetion("foo");
+    }
+
+    public void throwUnChecked() {
+        throw new RuntimeException("bla");
+    }
+
+}

Propchange: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/client.composite
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/client.composite?rev=630179&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/client.composite
 (added)
+++ 
incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/client.composite
 Fri Feb 22 04:40:32 2008
@@ -0,0 +1,33 @@
+<?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";
+           name="ExceptionClientComposite">
+
+    <component name="ExceptionServiceClient">
+        <implementation.java 
class="org.apache.tuscany.sca.binding.jms.ExceptionServiceClient"/>
+        <reference name="service" />
+    </component>
+
+    <reference name="service" promote="ExceptionServiceClient/service">
+        <interface.java 
interface="org.apache.tuscany.sca.binding.jms.ExceptionService" />
+        <binding.jms uri="jms:ExceptionService" />
+    </reference>
+
+</composite>

Added: 
incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/service.composite
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/service.composite?rev=630179&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/service.composite
 (added)
+++ 
incubator/tuscany/java/sca/itest/jms/src/main/resources/exceptions/service.composite
 Fri Feb 22 04:40:32 2008
@@ -0,0 +1,30 @@
+<?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";
+           name="ExceptionServiceComposite">
+
+    <component name="ExceptionService">
+        <implementation.java 
class="org.apache.tuscany.sca.binding.jms.ExceptionServiceImpl"/>
+        <service name="ExceptionService">
+            <binding.jms />
+        </service> 
+    </component>       
+
+</composite>

Modified: 
incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java?rev=630179&r1=630178&r2=630179&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
 Fri Feb 22 04:40:32 2008
@@ -25,7 +25,6 @@
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.osoa.sca.ServiceRuntimeException;
 
 /**
  * This shows how to test the JMS binding using a simple HelloWorld 
application.
@@ -37,18 +36,28 @@
     @Before
     public void init() {
         scaDomain =
-            SCADomain.newInstance("http://localhost";, "/", 
"simple/client.composite", "simple/service.composite");
-        // scaDomain = SCADomain.newInstance("http://localhost";, "/", 
"simple/client.composite");
+            SCADomain.newInstance("http://localhost";, "/", 
"exceptions/client.composite", "exceptions/service.composite");
     }
 
     @Test
-    public void testHelloWorldCreate() throws Exception {
-        HelloWorldService helloWorldService = 
scaDomain.getService(HelloWorldService.class, "HelloWorldClient");
+    public void testChecked() {
+        ExceptionService service = 
scaDomain.getService(ExceptionService.class, "ExceptionServiceClient");
         try {
-            helloWorldService.sayHello("bang");
+            service.throwChecked();
             fail();
-        } catch (ServiceRuntimeException e) {
-            assertEquals("blem wit", e.getCause().getMessage());
+        } catch (CheckedExcpetion e) {
+            assertEquals("foo", e.getMessage());
+        }
+    }
+
+    @Test
+    public void testUnChecked() {
+        ExceptionService service = 
scaDomain.getService(ExceptionService.class, "ExceptionServiceClient");
+        try {
+            service.throwUnChecked();
+            fail();
+        } catch (Exception e) {
+            assertEquals("bla", e.getCause().getCause().getMessage());
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to