From 9f79c8a050ff86907695027893e56080988c09d8 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:20:01 +0000 Subject: Moving 2.x tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835147 13f79535-47bb-0310-9956-ffa450edef68 --- .../2.0-M1/vtest/java-api/apis/exception/pom.xml | 45 ------- .../vtest/javaapi/apis/exception/AComponent.java | 40 ------- .../vtest/javaapi/apis/exception/BCallback.java | 26 ---- .../vtest/javaapi/apis/exception/BComponent.java | 35 ------ .../vtest/javaapi/apis/exception/CComponent.java | 34 ------ .../vtest/javaapi/apis/exception/DComponent.java | 33 ------ .../vtest/javaapi/apis/exception/DException.java | 30 ----- .../apis/exception/impl/AComponentImpl.java | 128 -------------------- .../apis/exception/impl/BComponentImpl.java | 64 ---------- .../apis/exception/impl/CComponentImpl.java | 50 -------- .../apis/exception/impl/DComponentImpl.java | 37 ------ .../src/main/resources/exception.composite | 44 ------- .../javaapi/apis/exception/ExceptionTestCase.java | 132 --------------------- 13 files changed, 698 deletions(-) delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/pom.xml delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.java delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.java delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/resources/exception.composite delete mode 100644 tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java (limited to 'tags/java/sca/2.0-M1/vtest/java-api/apis/exception') diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/pom.xml deleted file mode 100644 index 48588acb19..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - java-api-apis - 2.0-M1 - ../pom.xml - - vtest-java-api-apis-exception - Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - Exception - - - - org.apache.tuscany.sca - tuscany-host-embedded - 2.0-M1 - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-M1 - runtime - - - diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java deleted file mode 100644 index 90582e88a2..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.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.vtest.javaapi.apis.exception; - -import org.oasisopen.sca.annotation.Conversational; - -/** - * Simple Service A. - */ -@Conversational -public interface AComponent { - - public String getName(); - - public void testConversation(); - public void testCallBack(); - - public boolean testServiceRuntimeException(); - public boolean testServiceUnavailableException(); - - public boolean testCheckedException(); - -} diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java deleted file mode 100644 index c1c1c6544c..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java +++ /dev/null @@ -1,26 +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.vtest.javaapi.apis.exception; - -public interface BCallback { - - public void processResults(String result); - -} diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.java deleted file mode 100644 index 11886277ad..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.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.vtest.javaapi.apis.exception; - -import org.oasisopen.sca.annotation.Callback; - -/** - * Simple Service B. - */ -@Callback(BCallback.class) -public interface BComponent { - - public String getName(); - - public void testCallback(); - public void testRedirectedCallback(); - -} diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java deleted file mode 100644 index 466a32731a..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java +++ /dev/null @@ -1,34 +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.vtest.javaapi.apis.exception; - -import org.oasisopen.sca.annotation.Conversational; - -/** - * Simple Service C. - */ -@Conversational -public interface CComponent { - - public String getName(); - - public void testConversation(); - -} diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java deleted file mode 100644 index c0aed7a707..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java +++ /dev/null @@ -1,33 +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.vtest.javaapi.apis.exception; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * Simple Remote Service D. - */ -@Remotable -public interface DComponent { - - public String getName(); - public void testException() throws DException; - -} diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java deleted file mode 100644 index 82873ed96d..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java +++ /dev/null @@ -1,30 +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.vtest.javaapi.apis.exception; - -public class DException extends Exception { - - private static final long serialVersionUID = -3819913841563109423L; - - public DException(String message) { - super(message); - } - -} diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java deleted file mode 100644 index 1190e6900f..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java +++ /dev/null @@ -1,128 +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.vtest.javaapi.apis.exception.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.AComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.BComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.CComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DException; -import org.junit.Assert; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.ConversationEndedException; -import org.oasisopen.sca.NoRegisteredCallbackException; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.ServiceRuntimeException; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.ConversationID; -import org.oasisopen.sca.annotation.Destroy; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(AComponent.class) -@Scope("CONVERSATION") -public class AComponentImpl implements AComponent { - - protected ComponentContext componentContext; - - @Reference - protected CallableReference bReference; - - @Reference - protected ServiceReference cReference; - - @Reference - protected ServiceReference dReference; - - @ConversationID - protected String cid; - - public String getName() { - return "ComponentA"; - } - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public void testConversation() { - ServiceReference cSR = componentContext.getServiceReference(CComponent.class, "cReference"); - cSR.setConversationID("AConversationID"); - Assert.assertEquals("ComponentC", cSR.getService().getName()); - - try { - Thread.sleep(1100); - cSR.getService().testConversation(); - - Assert.fail(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } catch (ConversationEndedException cee) { - // Expected - } - } - - public void testCallBack() { - ServiceReference bSR = componentContext.getServiceReference(BComponent.class, "bReference"); - bSR.setCallbackID("ComponentACallBack"); - - try { - bSR.getService().testCallback(); - Assert.fail(); - } catch (NoRegisteredCallbackException e) { - // Expected - } - } - - public boolean testServiceRuntimeException() { - try { - componentContext.getServiceReference(BComponent.class, "dummyBReference").getService().getName(); - } catch (ServiceRuntimeException sre) { - return true; - } - - return false; - } - - public boolean testServiceUnavailableException() { - return false; - } - - public boolean testCheckedException() { - try { - dReference.getService().testException(); - } catch (DException e) { - if (e.getMessage().equals("ADException")) { - return true; - } - } - - return false; - } - - @Destroy - public void destroy() { - System.out.println("This is a Destroy of AComponent .."); - } - -} diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.java deleted file mode 100644 index eca4b54109..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.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.vtest.javaapi.apis.exception.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.BCallback; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.BComponent; -import org.junit.Assert; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.Service; - -@Service(BComponent.class) -public class BComponentImpl implements BComponent { - - protected ComponentContext componentContext; - - @Callback - protected BCallback callback; - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public String getName() { - return "ComponentB"; - } - - public void testCallback() { - callback = componentContext.getRequestContext().getCallback(); - callback.processResults("CallBackFromB"); - - CallableReference bCR = componentContext.getRequestContext().getCallbackReference(); - Assert.assertEquals("ComponentACallBack", bCR.getCallbackID()); - } - - public void testRedirectedCallback() { - callback = componentContext.getRequestContext().getCallback(); - callback.processResults("RedirectedCallBackFromB"); - - CallableReference bCR = componentContext.getRequestContext().getCallbackReference(); - Assert.assertEquals("RedirectedCallBack", bCR.getCallbackID()); - } - -} diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java deleted file mode 100644 index 57a34716e6..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java +++ /dev/null @@ -1,50 +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.vtest.javaapi.apis.exception.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.CComponent; -import org.junit.Assert; -import org.oasisopen.sca.RequestContext; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.ConversationAttributes; -import org.oasisopen.sca.annotation.ConversationID; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(CComponent.class) -@Scope("CONVERSATION") -@ConversationAttributes(maxIdleTime="1 seconds") -public class CComponentImpl implements CComponent { - - @Context - protected RequestContext requestContext; - - @ConversationID - protected String cid; - - public String getName() { - return "ComponentC"; - } - - public void testConversation() { - Assert.assertEquals("AConversationID", cid); - } - -} diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java deleted file mode 100644 index c1f5a56a9a..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java +++ /dev/null @@ -1,37 +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.vtest.javaapi.apis.exception.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DException; -import org.oasisopen.sca.annotation.Service; - -@Service(DComponent.class) -public class DComponentImpl implements DComponent { - - public String getName() { - return "ComponentD"; - } - - public void testException() throws DException { - throw new DException("ADException"); - } - -} diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/resources/exception.composite b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/resources/exception.composite deleted file mode 100644 index 5bd933ce96..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/resources/exception.composite +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java deleted file mode 100644 index da7b1da0fa..0000000000 --- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java +++ /dev/null @@ -1,132 +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.vtest.javaapi.apis.exception; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -/** - * This test class tests the Exceptions described in 1.7.6, 1.7.7, 1.7.8, and 1.7.9 of the SCA Java Annotations & APIs Specification 1.0. - * This also covers 1.5 of the specification. - */ -public class ExceptionTestCase { - - protected static SCADomain domain; - protected static String compositeName = "exception.composite"; - protected static AComponent a; - protected static BComponent b; - - @BeforeClass - public static void init() throws Exception { - try { - System.out.println("Setting up"); - domain = SCADomain.newInstance(compositeName); - a = domain.getService(AComponent.class, "AComponent"); - b = domain.getService(BComponent.class, "BComponent"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @AfterClass - public static void destroy() throws Exception { - System.out.println("Cleaning up"); - if (domain != null) { - domain.close(); - } - } - - /** - * Lines 951
- * NoRegisteredCallbackException. - * - * @throws Exception - */ - @Test - public void testNoRegisteredCallbackException() throws Exception { - a.testCallBack(); - } - - /** - * Lines 960
- * ServiceRuntimeException - This exception signals problems in the management of SCA component execution. - * - * @throws Exception - */ - @Test - public void testServiceRuntimeException() throws Exception { - Assert.assertTrue(a.testServiceRuntimeException()); - } - - /** - * Lines 970
- * ServiceUnavailableException – This exception signals problems in the interaction with remote services. - * - * @throws Exception - */ - @Test - //@Ignore - public void testServiceUnavailableException() throws Exception { - domain.getComponentManager().stopComponent("AComponent"); - - try { - a.getName(); - } catch (Exception e) { - e.printStackTrace(); - } - - try { - AComponent ac = domain.getService(AComponent.class, "AComponent"); - ac.getName(); - } catch (Exception e) { - e.printStackTrace(); - } - - domain.getComponentManager().startComponent("AComponent"); - } - - /** - * Lines 983
- * ConversationEndedException. - * - * @throws Exception - */ - @Test - public void testConversationEndedException() throws Exception { - a.testConversation(); - } - - /** - * Lines 360-361
- * Business exceptions are thrown by the implementation of the called service method, - * and are defined as checked exceptions on the interface that types the service. - * - * @throws Exception - */ - @Test - public void testCheckedException() throws Exception { - Assert.assertTrue(a.testCheckedException()); - } - -} -- cgit v1.2.3