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 2009/10/06 13:00:48 UTC
svn commit: r822217 - in /tuscany/java/sca/itest/jms/policy-headers: ./ 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/sca/
src/main/java/org/apache/tuscany/...
Author: antelder
Date: Tue Oct 6 11:00:47 2009
New Revision: 822217
URL: http://svn.apache.org/viewvc?rev=822217&view=rev
Log:
Separate out the policy headers test from the jmsgeneral itests and bring up in 2.x. Is working now which is a bit of a surprise as i didn't think the policy stuff was done yet
Added:
tuscany/java/sca/itest/jms/policy-headers/ (with props)
tuscany/java/sca/itest/jms/policy-headers/pom.xml
tuscany/java/sca/itest/jms/policy-headers/src/
tuscany/java/sca/itest/jms/policy-headers/src/main/
tuscany/java/sca/itest/jms/policy-headers/src/main/java/
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java
tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java
tuscany/java/sca/itest/jms/policy-headers/src/main/resources/
tuscany/java/sca/itest/jms/policy-headers/src/main/resources/META-INF/
tuscany/java/sca/itest/jms/policy-headers/src/main/resources/META-INF/sca-contribution.xml
tuscany/java/sca/itest/jms/policy-headers/src/main/resources/jndi.properties
tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/
tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/definitions.xml
tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite
tuscany/java/sca/itest/jms/policy-headers/src/test/
tuscany/java/sca/itest/jms/policy-headers/src/test/java/
tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/
tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/apache/
tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/apache/tuscany/
tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/
tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/
tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/jms/
tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java
Propchange: tuscany/java/sca/itest/jms/policy-headers/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Oct 6 11:00:47 2009
@@ -0,0 +1,20 @@
+target
+work
+dojo
+*.iws
+*.ipr
+*.iml
+derby.log
+maven.log
+maven-eclipse.xml
+build.xml
+build-dependency.xml
+velocity.log*
+junit*.properties
+surefire*.properties
+.project
+.classpath
+.settings
+.deployables
+.wtpmodules
+.externalToolBuilders
Added: tuscany/java/sca/itest/jms/policy-headers/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/pom.xml?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/pom.xml (added)
+++ tuscany/java/sca/itest/jms/policy-headers/pom.xml Tue Oct 6 11:00:47 2009
@@ -0,0 +1,83 @@
+<?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>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-policy-headers</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with Policy Headers</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-core</artifactId>
+ <version>5.2.0</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
Added: tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java Tue Oct 6 11:00:47 2009
@@ -0,0 +1,28 @@
+/*
+ * 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;
+
+
+/**
+ * The client interface
+ */
+public interface JMSClient {
+
+ void aClientMethod();
+}
Added: tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java Tue Oct 6 11:00:47 2009
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+
+/**
+ * The client interface
+ */
+public interface MsgClient {
+
+ void aClientMethod();
+ void op2();
+}
Added: tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java Tue Oct 6 11:00:47 2009
@@ -0,0 +1,38 @@
+/*
+ * 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 org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(MsgClient.class)
+public class MsgClientImpl implements MsgClient {
+
+ @Reference protected MsgClientService myService;
+
+ public void aClientMethod() {
+ myService.aClientMethod();
+ }
+
+ public void op2() {
+ myService.op2();
+ }
+
+}
Added: tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java Tue Oct 6 11:00:47 2009
@@ -0,0 +1,33 @@
+/*
+ * 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 org.oasisopen.sca.annotation.Remotable;
+
+
+/**
+ * The client interface
+ */
+@Remotable
+public interface MsgClientService {
+
+ void aClientMethod();
+
+ void op2();
+}
Added: tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java Tue Oct 6 11:00:47 2009
@@ -0,0 +1,32 @@
+/*
+ * 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 org.oasisopen.sca.annotation.AllowsPassByReference;
+import org.oasisopen.sca.annotation.Remotable;
+
+
+@Remotable
+@AllowsPassByReference
+public interface MsgService {
+
+ void onMessage(javax.jms.Message msg);
+
+}
Added: tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java Tue Oct 6 11:00:47 2009
@@ -0,0 +1,39 @@
+/*
+ * 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 javax.jms.Message;
+
+import org.oasisopen.sca.annotation.Service;
+
+@Service(MsgService.class)
+public class MsgServiceImpl implements MsgService {
+
+ public static Object lock = new Object();
+ public static Message msg;
+
+ public void onMessage(Message msg) {
+ MsgServiceImpl.msg = msg;
+ synchronized(lock) {
+ lock.notifyAll();
+ }
+ }
+
+}
Added: tuscany/java/sca/itest/jms/policy-headers/src/main/resources/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/main/resources/META-INF/sca-contribution.xml?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/main/resources/META-INF/sca-contribution.xml (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/main/resources/META-INF/sca-contribution.xml Tue Oct 6 11:00:47 2009
@@ -0,0 +1,23 @@
+<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:itest="http://itest">
+ <deployable composite="itest:PropertiesClientComposite"/>
+</contribution>
\ No newline at end of file
Added: tuscany/java/sca/itest/jms/policy-headers/src/main/resources/jndi.properties
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/main/resources/jndi.properties?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/main/resources/jndi.properties (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/main/resources/jndi.properties Tue Oct 6 11:00:47 2009
@@ -0,0 +1,39 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.RequestQueue = RequestQueue
+queue.ResponseQueue = ResponseQueue
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
Added: tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/definitions.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/definitions.xml?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/definitions.xml (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/definitions.xml Tue Oct 6 11:00:47 2009
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
+
+ <policySet name="JMSPolicySet1"
+ provides="priority"
+ appliesTo="sca:binding.jms">
+ <intentMap provides="priority" default="medium">
+ <qualifier name="high">
+ <tuscany:jmsHeader JMSPriority="9"/>
+ </qualifier>
+ <qualifier name="medium">
+ <tuscany:jmsHeader JMSPriority="4"/>
+ </qualifier>
+ <qualifier name="low">
+ <tuscany:jmsHeader JMSPriority="0"/>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+ <policySet name="JMSPolicySet2"
+ provides="deliveryMode"
+ appliesTo="sca:binding.jms">
+ <intentMap provides="deliveryMode" default="nonPersistent">
+ <qualifier name="persistent">
+ <tuscany:jmsHeader JMSDeliveryMode="PERSISTENT"/>
+ </qualifier>
+ <qualifier name="nonPersistent">
+ <tuscany:jmsHeader JMSDeliveryMode="NON_PERSISTENT"/>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+</definitions>
\ No newline at end of file
Added: tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite Tue Oct 6 11:00:47 2009
@@ -0,0 +1,45 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://itest"
+ name="PropertiesClientComposite">
+
+ <component name="ClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.MsgClientImpl" />
+ <reference name="myService" requires="priority.medium">
+ <binding.jms uri="jms:ServiceQueue">
+ <headers type="myType"
+ deliveryMode="persistent"
+ timeToLive="4321"
+ priority="7">
+ <property name="headP1">myHeadP1</property>
+ </headers>
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="ServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.MsgServiceImpl" />
+ <service name="MsgService">
+ <binding.jms uri="jms:ServiceQueue"/>
+ </service>
+ </component>
+
+</composite>
Added: tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java?rev=822217&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java (added)
+++ tuscany/java/sca/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java Tue Oct 6 11:00:47 2009
@@ -0,0 +1,94 @@
+/*
+ * 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.assertNotNull;
+
+import javax.jms.DeliveryMode;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ */
+public class PolicyHeadersTestCase {
+
+ private Node node;
+
+ @Before
+ public void init() {
+ node = NodeFactory.newInstance().createNode().start();
+ }
+
+ @Test
+ public void testProps1() throws Exception {
+ JMSClient client = node.getService(JMSClient.class, "ClientComponent");
+
+ client.aClientMethod();
+
+ // wait for up to 5 seconds but should wake up as soon as done
+ synchronized(MsgServiceImpl.lock) {
+ if (MsgServiceImpl.msg == null) {
+ MsgServiceImpl.lock.wait(5000); // For debugging set higher.
+ }
+ }
+ assertNotNull(MsgServiceImpl.msg);
+
+ assertEquals("myType", MsgServiceImpl.msg.getJMSType());
+ assertEquals(DeliveryMode.PERSISTENT, MsgServiceImpl.msg.getJMSDeliveryMode());
+ assertEquals(7, MsgServiceImpl.msg.getJMSPriority());
+ assertEquals("myHeadP1", MsgServiceImpl.msg.getStringProperty("headP1"));
+ }
+
+ @Test
+ @Ignore
+ public void testOp2() throws Exception {
+ MsgClient client = node.getService(MsgClient.class, "ClientComponent");
+
+ client.op2();
+
+ // wait for up to 5 seconds but should wake up as soon as done
+ synchronized(MsgServiceImpl.lock) {
+ if (MsgServiceImpl.msg == null) {
+ MsgServiceImpl.lock.wait(5000);
+ }
+ }
+ assertNotNull(MsgServiceImpl.msg);
+
+ assertEquals("op2Type", MsgServiceImpl.msg.getJMSType());
+ assertEquals(DeliveryMode.NON_PERSISTENT, MsgServiceImpl.msg.getJMSDeliveryMode());
+ assertEquals(3, MsgServiceImpl.msg.getJMSPriority());
+ assertEquals("myHeadP1", MsgServiceImpl.msg.getStringProperty("headP1"));
+ assertEquals("foo", MsgServiceImpl.msg.getStringProperty("op2P2"));
+ assertEquals("nativeOp2", MsgServiceImpl.msg.getStringProperty("scaOperationName"));
+ }
+
+ @After
+ public void end() {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}