summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/domain-node/src/test/java/sample
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-09-04 11:57:55 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-09-04 11:57:55 +0000
commit5ddabdaf1ff856aae79dadc045ef2aeff08c7887 (patch)
treeb68df6f87a2b04b02e0896ad36da10980ddb2b1d /sca-java-2.x/trunk/modules/domain-node/src/test/java/sample
parent97c5df7ed0c38ee8375683bc43d9aaee4fdcb978 (diff)
Add a test for the DOMInvoker and exceptions
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1380582 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/test/java/sample')
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/HelloworldFaults.java27
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/HelloworldFaultsImpl.java16
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/MyException.java9
3 files changed, 52 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/HelloworldFaults.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/HelloworldFaults.java
new file mode 100644
index 0000000000..2cb1a8f206
--- /dev/null
+++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/HelloworldFaults.java
@@ -0,0 +1,27 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloworldFaults {
+ String sayHello(String name) throws MyException;
+}
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/HelloworldFaultsImpl.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/HelloworldFaultsImpl.java
new file mode 100644
index 0000000000..2784445867
--- /dev/null
+++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/HelloworldFaultsImpl.java
@@ -0,0 +1,16 @@
+package sample;
+
+public class HelloworldFaultsImpl implements HelloworldFaults {
+
+ @Override
+ public String sayHello(String name) throws MyException {
+ if ("beate".equals(name)) {
+ throw new MyException("Bad Beate");
+ }
+ if ("bang".equals(name)) {
+ throw new RuntimeException("got bang");
+ }
+ return "Hello " + name;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/MyException.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/MyException.java
new file mode 100644
index 0000000000..ee31f0a80c
--- /dev/null
+++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/sample/MyException.java
@@ -0,0 +1,9 @@
+package sample;
+
+public class MyException extends Exception {
+
+ public MyException(String msg) {
+ super(msg);
+ }
+
+}