Author: antelder
Date: Fri Feb 22 02:32:41 2008
New Revision: 630146
URL: http://svn.apache.org/viewvc?rev=630146&view=rev
Log:
Add jms exception itest
Added:
incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
(with props)
Modified:
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
Modified:
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java?rev=630146&r1=630145&r2=630146&view=diff
==============================================================================
---
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
(original)
+++
incubator/tuscany/java/sca/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
Fri Feb 22 02:32:41 2008
@@ -21,6 +21,9 @@
public class HelloWorldServiceImpl implements HelloWorldService {
public String sayHello(String name) {
+ if ("bang".equals(name)) {
+ throw new RuntimeException("blem wit");
+ }
return "jmsHello " + name;
}
Added:
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=630146&view=auto
==============================================================================
---
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/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
Fri Feb 22 02:32:41 2008
@@ -0,0 +1,61 @@
+/*
+ * 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+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.
+ */
+public class ExceptionsTestCase {
+
+ private static SCADomain scaDomain;
+
+ @Before
+ public void init() {
+ scaDomain =
+ SCADomain.newInstance("http://localhost", "/",
"simple/client.composite", "simple/service.composite");
+ // scaDomain = SCADomain.newInstance("http://localhost", "/",
"simple/client.composite");
+ }
+
+ @Test
+ public void testHelloWorldCreate() throws Exception {
+ HelloWorldService helloWorldService =
scaDomain.getService(HelloWorldService.class, "HelloWorldClient");
+ try {
+ helloWorldService.sayHello("bang");
+ fail();
+ } catch (ServiceRuntimeException e) {
+ assertEquals("blem wit", e.getCause().getMessage());
+ }
+ }
+
+ @After
+ public void end() {
+ if (scaDomain != null) {
+ scaDomain.close();
+ }
+ }
+}
Propchange:
incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]