diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 23:09:08 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 23:09:08 +0000 |
commit | cde3d2629677a07aa09e3c7fbe117b680c0f5df7 (patch) | |
tree | c6d50048ffad8dfa8a1c0019e7afb207cb6b4fe2 /branches/sca-equinox/vtest/java-api/conversation/id | |
parent | 4ef0430519e276c2bdecea75f7a0f42f49f0cf30 (diff) |
Moving 2.x branches
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835133 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-equinox/vtest/java-api/conversation/id')
10 files changed, 0 insertions, 565 deletions
diff --git a/branches/sca-equinox/vtest/java-api/conversation/id/pom.xml b/branches/sca-equinox/vtest/java-api/conversation/id/pom.xml deleted file mode 100644 index 4d77fcffe1..0000000000 --- a/branches/sca-equinox/vtest/java-api/conversation/id/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?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. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>java-api-annotations</artifactId> - <version>1.4-EQUINOX-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>vtest-java-api-conversation-id</artifactId> - <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Conversation - ID</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-embedded</artifactId> - <version>1.4-EQUINOX-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.4-EQUINOX-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - </dependencies> -</project> diff --git a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/AService.java b/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/AService.java deleted file mode 100644 index f49952828c..0000000000 --- a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/AService.java +++ /dev/null @@ -1,39 +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.conversation.id; - -import org.osoa.sca.annotations.Remotable; - -/** - * Simple Remotable Service - */ -@Remotable -public interface AService { - - public void testAnnotation(); - - public void testAnnotation2(); - - public void testAnnotation3(); - - public void testAnnotation4(); - - public void testAnnotation5(); - -} diff --git a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/BService.java b/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/BService.java deleted file mode 100644 index d4641c5ee6..0000000000 --- a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/BService.java +++ /dev/null @@ -1,41 +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.conversation.id; - -import org.osoa.sca.annotations.Conversational; -import org.osoa.sca.annotations.Remotable; - -/** - * Simple Local Service - */ -@Remotable -@Conversational -public interface BService { - - public void setState(String someState); - - public String getState(); - - public void testAnnotation(); - - public void testAnnotation2(); - - public void testAnnotation3(); - -} diff --git a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CService.java b/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CService.java deleted file mode 100644 index 66a9b3b6c3..0000000000 --- a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CService.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.conversation.id; - -import org.osoa.sca.annotations.Conversational; -import org.osoa.sca.annotations.Remotable; - -/** - * Simple Local Service - */ -@Remotable -@Conversational -public interface CService { - - public void setState(String someState); - - public String getState(); - - public void testAnnotation(); - -} diff --git a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CustomConversationId.java b/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CustomConversationId.java deleted file mode 100644 index ac40c56ee6..0000000000 --- a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CustomConversationId.java +++ /dev/null @@ -1,54 +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.conversation.id; - - -public class CustomConversationId { - - int id; - String name; - - public CustomConversationId(int id, String name) { - super(); - this.id = id; - this.name = name; - } - - public String getName() { - return name; - } - - public int getNumber() { - return id; - } - - public void setName(String someName) { - name = someName; - } - - public void setNumber(int someInt) { - id = someInt; - } - - public String toString() { - return "id->" + id + " name->" + name; - } - -} diff --git a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/AServiceImpl.java b/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/AServiceImpl.java deleted file mode 100644 index 517976ff73..0000000000 --- a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/AServiceImpl.java +++ /dev/null @@ -1,69 +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.conversation.id.impl; - -import org.apache.tuscany.sca.vtest.javaapi.conversation.id.AService; -import org.apache.tuscany.sca.vtest.javaapi.conversation.id.BService; -import org.apache.tuscany.sca.vtest.javaapi.conversation.id.CService; -import org.apache.tuscany.sca.vtest.javaapi.conversation.id.CustomConversationId; -import org.junit.Assert; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(AService.class) -@Scope("CONVERSATION") -public class AServiceImpl implements AService { - - @Reference - protected ServiceReference<BService> b; - - @Reference - protected ServiceReference<CService> c; - - public void testAnnotation() { - b.getService().testAnnotation(); - } - - public void testAnnotation2() { - b.getService().testAnnotation2(); - } - - public void testAnnotation3() { - b.getService().testAnnotation3(); - } - - public void testAnnotation4() { - CustomConversationId id = new CustomConversationId (1, "One"); - c.setConversationID(id); - c.getService().testAnnotation(); - } - - public void testAnnotation5() { - b.getService().getState(); - Assert.assertNotNull(b.getConversation().getConversationID()); -// Assert.assertNotNull(b.getConversationID()); - - CustomConversationId id = new CustomConversationId (1, "One"); - c.setConversationID(id); - Assert.assertSame(id, c.getConversationID()); - } -} diff --git a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/BServiceImpl.java b/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/BServiceImpl.java deleted file mode 100644 index 752476ebf7..0000000000 --- a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/BServiceImpl.java +++ /dev/null @@ -1,65 +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.conversation.id.impl; - -import org.apache.tuscany.sca.vtest.javaapi.conversation.id.BService; -import org.junit.Assert; -import org.osoa.sca.annotations.ConversationAttributes; -import org.osoa.sca.annotations.ConversationID; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(BService.class) -@Scope("CONVERSATION") -@ConversationAttributes(maxAge = "1 seconds") -public class BServiceImpl implements BService { - - String someState; - - @ConversationID - protected String conversationID; - - @ConversationID - protected Object conversationID2; - - public void setState(String someState) { - this.someState = someState; - } - - public String getState() { - return someState; - } - - public void testAnnotation() { - Assert.assertNotNull(conversationID); - System.out.println(conversationID); - } - - public void testAnnotation2() { - Assert.assertNotNull(conversationID2); - System.out.println(conversationID); - } - - public void testAnnotation3() { - Assert.assertTrue(conversationID2 instanceof String); - System.out.println(conversationID); - } - -} diff --git a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/CServiceImpl.java b/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/CServiceImpl.java deleted file mode 100644 index a01ceb7be4..0000000000 --- a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/CServiceImpl.java +++ /dev/null @@ -1,56 +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.conversation.id.impl; - -import org.apache.tuscany.sca.vtest.javaapi.conversation.id.CService; -import org.apache.tuscany.sca.vtest.javaapi.conversation.id.CustomConversationId; -import org.junit.Assert; -import org.osoa.sca.annotations.ConversationID; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(CService.class) -@Scope("CONVERSATION") -public class CServiceImpl implements CService { - - String someState; - - @ConversationID - protected Object conversationID; - - - public void setState(String someState) { - this.someState = someState; - } - - public String getState() { - return someState; - } - - public void testAnnotation() { - Assert.assertNotNull(conversationID); - Assert.assertTrue(conversationID instanceof CustomConversationId); - - Assert.assertSame(1, ((CustomConversationId)conversationID).getNumber()); - Assert.assertSame("One", ((CustomConversationId)conversationID).getName()); - System.out.println(conversationID); - } - -} diff --git a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/resources/conversation-id.composite b/branches/sca-equinox/vtest/java-api/conversation/id/src/main/resources/conversation-id.composite deleted file mode 100644 index 25e7154fca..0000000000 --- a/branches/sca-equinox/vtest/java-api/conversation/id/src/main/resources/conversation-id.composite +++ /dev/null @@ -1,40 +0,0 @@ -<?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" - targetNamespace="http://java-api-tests" name="Converstion-ID"> - - <component name="AComponent"> - <implementation.java - class="org.apache.tuscany.sca.vtest.javaapi.conversation.id.impl.AServiceImpl" /> - <reference name="b" target="BComponent" /> - <reference name="c" target="CComponent" /> - </component> - - <component name="BComponent"> - <implementation.java - class="org.apache.tuscany.sca.vtest.javaapi.conversation.id.impl.BServiceImpl" /> - </component> - - <component name="CComponent"> - <implementation.java - class="org.apache.tuscany.sca.vtest.javaapi.conversation.id.impl.CServiceImpl" /> - </component> - -</composite> diff --git a/branches/sca-equinox/vtest/java-api/conversation/id/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/ConversationIDTestCase.java b/branches/sca-equinox/vtest/java-api/conversation/id/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/ConversationIDTestCase.java deleted file mode 100644 index d3cb107a61..0000000000 --- a/branches/sca-equinox/vtest/java-api/conversation/id/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/ConversationIDTestCase.java +++ /dev/null @@ -1,118 +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.conversation.id; - -import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * - */ -public class ConversationIDTestCase { - - protected static String compositeName = "conversation-id.composite"; - protected static AService aService = null; - - @BeforeClass - public static void init() throws Exception { - try { - System.out.println("Setting up"); - ServiceFinder.init(compositeName); - aService = ServiceFinder.getService(AService.class, "AComponent"); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - - @AfterClass - public static void destroy() throws Exception { - - System.out.println("Cleaning up"); - ServiceFinder.cleanup(); - - } - - /** - * Lines 504, 505 - * <p> - * If a protected or public field or setter method is annotated with - * "@ConversationID", then the conversation ID for the conversation is - * injected onto the field - */ - @Test - public void idAnnotation() throws Exception { - aService.testAnnotation(); - } - - /** - * Lines 505 - * <p> - * The type of the field is not necessarily String - */ - @Test - public void idAnnotation2() throws Exception { - aService.testAnnotation2(); - } - - /** - * Lines 505, 506 - * <p> - * System generated conversation IDs are always strings - */ - @Test - public void idAnnotation3() throws Exception { - aService.testAnnotation3(); - } - - /** - * Lines 506, 507 - * <p> - * ... but application generated conversation IDs may be other complex - * types. - * <p> - * Lines 513, 514 - * <p> - * ... To do this, the client would not use reference injection, but would - * use the of ServiceReference.setConversationID() API. - */ - @Test - public void idAnnotation4() throws Exception { - aService.testAnnotation4(); - } - - /** - * Lines 522, 523 - * <p> - * Whether the conversation ID is chosen by the client or is generated by - * the system, the client may access the conversation ID by calling - * ServiceReference.getConversationID(). - * <p> - * This test is following updates to this section of the specification per - * the OASIS TC under issue JAVA-31. The updated text reads: "...by calling - * getConversationID() on the current conversation object". - */ - @Test - public void idAnnotation5() throws Exception { - aService.testAnnotation5(); - } - -} |