You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2006/11/02 09:44:20 UTC

svn commit: r470277 [2/2] - in /incubator/tuscany/java/sca/services/bindings/binding.jms: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/tuscany/ src/main/java/org/apache/tuscany/binding/ src/main...

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingService.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingService.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingService.java Thu Nov  2 00:44:18 2006
@@ -0,0 +1,24 @@
+/*
+ * 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.binding.jms;
+
+public interface GreetingService {
+
+	String greet(String name);
+}

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingService.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingServiceImpl.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingServiceImpl.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingServiceImpl.java Thu Nov  2 00:44:18 2006
@@ -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 org.apache.tuscany.binding.jms;
+
+public class GreetingServiceImpl implements GreetingService {
+
+	public String greet(String name) {
+		return "Hello " +  name;
+	}
+
+}

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingServiceImpl.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroService.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroService.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroService.java Thu Nov  2 00:44:18 2006
@@ -0,0 +1,24 @@
+/*
+ * 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.binding.jms;
+
+public interface IntroService {
+
+	public String greet(String name);
+}

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroService.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroServiceImpl.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroServiceImpl.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroServiceImpl.java Thu Nov  2 00:44:18 2006
@@ -0,0 +1,36 @@
+/*
+ * 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.binding.jms;
+
+import org.osoa.sca.annotations.Reference;
+
+public class IntroServiceImpl implements IntroService {
+
+	private GreetingService extService;
+	
+	@Reference
+    public void setExtService(GreetingService extService) {
+        this.extService = extService;
+    }
+	
+	public String greet(String name) {
+		return extService.greet(name);
+	}
+
+}

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroServiceImpl.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/JMSBindingTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/JMSBindingTestCase.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/JMSBindingTestCase.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/JMSBindingTestCase.java Thu Nov  2 00:44:18 2006
@@ -0,0 +1,70 @@
+/*
+ * 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.binding.jms;
+
+import org.activemq.broker.BrokerContainer;
+import org.activemq.broker.impl.BrokerContainerImpl;
+import org.apache.tuscany.test.SCATestCase;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+public class JMSBindingTestCase extends SCATestCase{
+
+	private IntroService introService;
+	private BrokerContainer broker;
+	
+    public void testJMSBinding() {
+    	String reply = introService.greet("Rajith");
+    	assertEquals("Hello Rajith",reply);
+    }
+	
+	protected void setUp() throws Exception {
+		startBroker();
+        setApplicationSCDL(IntroService.class, "META-INF/sca/default.scdl");
+        addExtension("jms.binding", getClass().getClassLoader().getResource("META-INF/sca/jms.system.scdl"));
+        super.setUp();
+        CompositeContext context = CurrentCompositeContext.getContext();
+        introService = context.locateService(IntroService.class, "IntroServiceComponent");
+    }
+	
+	
+	
+	protected void tearDown() throws Exception {		
+		super.tearDown();
+		broker.stop();
+	}
+
+	public static void main(String[] args){
+		JMSBindingTestCase test = new JMSBindingTestCase();
+		try {
+			test.setUp();
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		test.testJMSBinding();
+	}
+	
+	private void startBroker() throws Exception{
+		broker = new BrokerContainerImpl("JMS Binding Test");
+        // configure the broker
+		broker.addConnector("tcp://localhost:61616");
+		broker.start();
+	}
+}

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/JMSBindingTestCase.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/META-INF/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/META-INF/sca/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/META-INF/sca/default.scdl?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/META-INF/sca/default.scdl Thu Nov  2 00:44:18 2006
@@ -0,0 +1,50 @@
+ <!--
+ * 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="jms.sample">
+
+    <service name="GreetingJMSService">
+        <interface.java class="org.apache.tuscany.binding.jms.GreetingService"/>
+        <binding.jms xmlns="http://tuscany.apache.org/xmlns/binding/jms/1.0-SNAPSHOT" >
+        	<connection.jms destinationName="greetingServiceQueue"
+        	                connectionFactoryName="ConnectionFactory"
+        	                initialContextFactoryName="org.activemq.jndi.ActiveMQInitialContextFactory"
+        	                providerURL="tcp://localhost:61616" />   
+        </binding.jms>
+        <reference>GretingServiceComponent</reference>
+    </service>
+
+    <component name="GretingServiceComponent">
+        <implementation.java class="org.apache.tuscany.binding.jms.GreetingServiceImpl"/>
+    </component>
+    
+    <component name="IntroServiceComponent">
+        <implementation.java class="org.apache.tuscany.binding.jms.IntroServiceImpl"/>
+        <reference name="extService" target="GreetingJMSReference">GreetingJMSReference</reference>
+    </component>
+    
+    <reference name="GreetingJMSReference">
+        <interface.java class="org.apache.tuscany.binding.jms.GreetingService"/>
+        <binding.jms xmlns="http://tuscany.apache.org/xmlns/binding/jms/1.0-SNAPSHOT" >
+        	<connection.jms destinationName="dynamicQueues/greetingServiceQueue"
+        	                connectionFactoryName="ConnectionFactory"
+        	                initialContextFactoryName="org.activemq.jndi.ActiveMQInitialContextFactory"
+        	                providerURL="tcp://localhost:61616" />        	                 
+        </binding.jms>
+    </reference>
+    
+</composite>
+

Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/META-INF/sca/default.scdl
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov  2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org