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/04/29 11:35:42 UTC

svn commit: r769729 - in /tuscany/branches/sca-java-1.x/itest: ./ jms-ttl/ jms-ttl/src/ jms-ttl/src/main/ jms-ttl/src/main/java/ jms-ttl/src/main/java/itest/ jms-ttl/src/main/java/org/ jms-ttl/src/main/java/org/apache/ jms-ttl/src/main/java/org/apache/...

Author: antelder
Date: Wed Apr 29 09:35:39 2009
New Revision: 769729

URL: http://svn.apache.org/viewvc?rev=769729&view=rev
Log:
Add an itest for setting the JMS Time-To-Live header

Added:
    tuscany/branches/sca-java-1.x/itest/jms-ttl/   (with props)
    tuscany/branches/sca-java-1.x/itest/jms-ttl/pom.xml
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/itest/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/itest/MockInitialContextFactory.java
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/jndi.properties
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/ttl.composite
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/apache/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/apache/tuscany/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/apache/tuscany/sca/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/apache/tuscany/sca/binding/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/apache/tuscany/sca/binding/jms/
    tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java
Modified:
    tuscany/branches/sca-java-1.x/itest/pom.xml

Propchange: tuscany/branches/sca-java-1.x/itest/jms-ttl/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Apr 29 09:35:39 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/branches/sca-java-1.x/itest/jms-ttl/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms-ttl/pom.xml?rev=769729&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/jms-ttl/pom.xml (added)
+++ tuscany/branches/sca-java-1.x/itest/jms-ttl/pom.xml Wed Apr 29 09:35:39 2009
@@ -0,0 +1,99 @@
+<?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>1.6-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+    <artifactId>itest-jms-ttl</artifactId>
+    <name>Apache Tuscany SCA iTest JMS Time To Live</name>
+
+    <repositories>
+       <repository>
+          <id>apache.incubator</id>
+          <url>http://people.apache.org/repo/m2-incubating-repository</url>
+       </repository>
+    </repositories>
+
+    <dependencies>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <version>1.6-SNAPSHOT</version>
+        </dependency>        
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-embedded</artifactId>
+            <version>1.6-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency> 
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.6-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-jms-runtime</artifactId>
+            <version>1.6-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-jms-asf</artifactId>
+            <version>1.6-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-impl</artifactId>
+            <version>1.6-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+
+        <!--  uses ActiveMQ 5.1 as 4.1 Session.createQueue does not work using
+              a temporary queue name -->
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-core</artifactId>
+            <version>5.1.0</version>
+        </dependency>
+                
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+    </build>
+</project>

Added: tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/itest/MockInitialContextFactory.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/itest/MockInitialContextFactory.java?rev=769729&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/itest/MockInitialContextFactory.java (added)
+++ tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/itest/MockInitialContextFactory.java Wed Apr 29 09:35:39 2009
@@ -0,0 +1,904 @@
+/*
+ * 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 itest;
+
+import java.io.Serializable;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import javax.jms.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.ConnectionConsumer;
+import javax.jms.ConnectionFactory;
+import javax.jms.ConnectionMetaData;
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.ServerSessionPool;
+import javax.jms.Session;
+import javax.jms.StreamMessage;
+import javax.jms.TemporaryQueue;
+import javax.jms.TemporaryTopic;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.TopicSubscriber;
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NameClassPair;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+/**
+ * Some classes that mock up various JMS interfaces with the end result
+ * of having the Time-To-Live value set on the static timeToLive 
+ * 
+ * This class is referenced from the AMQ jndi.properties file
+ */
+public class MockInitialContextFactory extends org.apache.activemq.jndi.ActiveMQInitialContextFactory{
+    
+    public static Object lock = new Object();
+    public static Long timeToLive;
+
+    public Context getInitialContext(Hashtable environment) throws NamingException {
+        return new Context() {
+
+            public Object addToEnvironment(String propName, Object propVal) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public void bind(Name name, Object obj) throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }
+
+            public void bind(String name, Object obj) throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }
+
+            public void close() throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }
+
+            public Name composeName(Name name, Name prefix) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public String composeName(String name, String prefix) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public Context createSubcontext(Name name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public Context createSubcontext(String name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public void destroySubcontext(Name name) throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }
+
+            public void destroySubcontext(String name) throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }
+
+            public Hashtable<?, ?> getEnvironment() throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public String getNameInNamespace() throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public NameParser getNameParser(Name name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public NameParser getNameParser(String name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public NamingEnumeration<NameClassPair> list(String name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public NamingEnumeration<Binding> listBindings(String name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public Object lookup(Name name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public Object lookup(String name) throws NamingException {
+                if (name.endsWith("ConnectionFactory")) {
+                    return new ConnectionFactory() {
+                        public Connection createConnection() throws JMSException {
+                            return new Connection(){
+
+                                public void close() throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    
+                                }
+
+                                public ConnectionConsumer createConnectionConsumer(Destination arg0,
+                                                                                   String arg1,
+                                                                                   ServerSessionPool arg2,
+                                                                                   int arg3) throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    return null;
+                                }
+
+                                public ConnectionConsumer createDurableConnectionConsumer(Topic arg0,
+                                                                                          String arg1,
+                                                                                          String arg2,
+                                                                                          ServerSessionPool arg3,
+                                                                                          int arg4) throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    return null;
+                                }
+
+                                public Session createSession(boolean arg0, int arg1) throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    return new Session() {
+
+                                        public void close() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            
+                                        }
+
+                                        public void commit() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            
+                                        }
+
+                                        public QueueBrowser createBrowser(Queue arg0) throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public QueueBrowser createBrowser(Queue arg0, String arg1) throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public BytesMessage createBytesMessage() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return new BytesMessage() {
+
+                                                public long getBodyLength() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public boolean readBoolean() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return false;
+                                                }
+
+                                                public byte readByte() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public int readBytes(byte[] arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public int readBytes(byte[] arg0, int arg1) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public char readChar() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public double readDouble() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public float readFloat() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public int readInt() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public long readLong() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public short readShort() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public String readUTF() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public int readUnsignedByte() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public int readUnsignedShort() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public void reset() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeBoolean(boolean arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeByte(byte arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeBytes(byte[] arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeBytes(byte[] arg0, int arg1, int arg2)
+                                                    throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeChar(char arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeDouble(double arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeFloat(float arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeInt(int arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeLong(long arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeObject(Object arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeShort(short arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void writeUTF(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void acknowledge() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void clearBody() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void clearProperties() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public boolean getBooleanProperty(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return false;
+                                                }
+
+                                                public byte getByteProperty(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public double getDoubleProperty(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public float getFloatProperty(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public int getIntProperty(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public String getJMSCorrelationID() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public int getJMSDeliveryMode() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public Destination getJMSDestination() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public long getJMSExpiration() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public String getJMSMessageID() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public int getJMSPriority() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public boolean getJMSRedelivered() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return false;
+                                                }
+
+                                                public Destination getJMSReplyTo() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public long getJMSTimestamp() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public String getJMSType() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public long getLongProperty(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public Object getObjectProperty(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public Enumeration getPropertyNames() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public short getShortProperty(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public String getStringProperty(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public boolean propertyExists(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return false;
+                                                }
+
+                                                public void setBooleanProperty(String arg0, boolean arg1)
+                                                    throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setByteProperty(String arg0, byte arg1) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setDoubleProperty(String arg0, double arg1)
+                                                    throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setFloatProperty(String arg0, float arg1)
+                                                    throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setIntProperty(String arg0, int arg1) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSCorrelationID(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSCorrelationIDAsBytes(byte[] arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSDeliveryMode(int arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSDestination(Destination arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSExpiration(long arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSMessageID(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSPriority(int arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSRedelivered(boolean arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSReplyTo(Destination arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSTimestamp(long arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setJMSType(String arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setLongProperty(String arg0, long arg1) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setObjectProperty(String arg0, Object arg1)
+                                                    throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setShortProperty(String arg0, short arg1)
+                                                    throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setStringProperty(String arg0, String arg1)
+                                                    throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }};
+                                        }
+
+                                        public MessageConsumer createConsumer(Destination arg0) throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public MessageConsumer createConsumer(Destination arg0, String arg1)
+                                            throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public MessageConsumer createConsumer(Destination arg0,
+                                                                              String arg1,
+                                                                              boolean arg2) throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public TopicSubscriber createDurableSubscriber(Topic arg0, String arg1)
+                                            throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public TopicSubscriber createDurableSubscriber(Topic arg0,
+                                                                                       String arg1,
+                                                                                       String arg2,
+                                                                                       boolean arg3)
+                                            throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public MapMessage createMapMessage() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public Message createMessage() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public ObjectMessage createObjectMessage() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public ObjectMessage createObjectMessage(Serializable arg0) throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public MessageProducer createProducer(Destination arg0) throws JMSException {
+                                            return  new MessageProducer() {
+
+                                                public void close() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public int getDeliveryMode() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public Destination getDestination() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return null;
+                                                }
+
+                                                public boolean getDisableMessageID() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return false;
+                                                }
+
+                                                public boolean getDisableMessageTimestamp() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return false;
+                                                }
+
+                                                public int getPriority() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public long getTimeToLive() throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    return 0;
+                                                }
+
+                                                public void send(Message arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void send(Destination arg0, Message arg1) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void send(Message arg0, int arg1, int arg2, long arg3)
+                                                    throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void send(Destination arg0,
+                                                                 Message arg1,
+                                                                 int arg2,
+                                                                 int arg3,
+                                                                 long arg4) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setDeliveryMode(int arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setDisableMessageID(boolean arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setDisableMessageTimestamp(boolean arg0)
+                                                    throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setPriority(int arg0) throws JMSException {
+                                                    // TODO Auto-generated method stub
+                                                    
+                                                }
+
+                                                public void setTimeToLive(long arg0) throws JMSException {
+                                                    MockInitialContextFactory.timeToLive = Long.valueOf(arg0);
+                                                    synchronized(MockInitialContextFactory.lock) {
+                                                        MockInitialContextFactory.lock.notifyAll();
+                                                    }
+                                                }};
+                                        }
+
+                                        public Queue createQueue(String arg0) throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public StreamMessage createStreamMessage() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public TemporaryQueue createTemporaryQueue() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public TemporaryTopic createTemporaryTopic() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public TextMessage createTextMessage() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public TextMessage createTextMessage(String arg0) throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public Topic createTopic(String arg0) throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public int getAcknowledgeMode() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return 0;
+                                        }
+
+                                        public MessageListener getMessageListener() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return null;
+                                        }
+
+                                        public boolean getTransacted() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            return false;
+                                        }
+
+                                        public void recover() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            
+                                        }
+
+                                        public void rollback() throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            
+                                        }
+
+                                        public void run() {
+                                            // TODO Auto-generated method stub
+                                            
+                                        }
+
+                                        public void setMessageListener(MessageListener arg0) throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            
+                                        }
+
+                                        public void unsubscribe(String arg0) throws JMSException {
+                                            // TODO Auto-generated method stub
+                                            
+                                        }};
+                                }
+
+                                public String getClientID() throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    return null;
+                                }
+
+                                public ExceptionListener getExceptionListener() throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    return null;
+                                }
+
+                                public ConnectionMetaData getMetaData() throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    return null;
+                                }
+
+                                public void setClientID(String arg0) throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    
+                                }
+
+                                public void setExceptionListener(ExceptionListener arg0) throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    
+                                }
+
+                                public void start() throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    
+                                }
+
+                                public void stop() throws JMSException {
+                                    // TODO Auto-generated method stub
+                                    
+                                }};
+                        }
+                        public Connection createConnection(String arg0, String arg1) throws JMSException {
+                            return null;
+                        }};
+                } else {
+                    return new Queue(){
+                        public String getQueueName() throws JMSException {
+                            return null;
+                        }};
+                }
+            }
+
+            public Object lookupLink(Name name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public Object lookupLink(String name) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public void rebind(Name name, Object obj) throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }
+
+            public void rebind(String name, Object obj) throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }
+
+            public Object removeFromEnvironment(String propName) throws NamingException {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            public void rename(Name oldName, Name newName) throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }
+
+            public void rename(String oldName, String newName) throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }
+
+            public void unbind(Name name) throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }
+
+            public void unbind(String name) throws NamingException {
+                // TODO Auto-generated method stub
+                
+            }};
+    }
+    
+}

Added: tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java?rev=769729&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java (added)
+++ tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java Wed Apr 29 09:35:39 2009
@@ -0,0 +1,30 @@
+/*
+ * 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.osoa.sca.annotations.OneWay;
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface ClientIface {
+
+    @OneWay
+    void sayHello(String s);
+}

Added: tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java?rev=769729&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java (added)
+++ tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java Wed Apr 29 09:35:39 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 org.osoa.sca.annotations.Reference;
+
+/**
+ * This class implements the OneWay service.
+ */
+public class ClientImpl implements ClientIface {
+
+    private ClientIface serviceA;
+
+    @Reference
+    public void setServiceA(ClientIface service) {
+        this.serviceA = service;
+    }
+
+    public void sayHello(String name) {
+        serviceA.sayHello(name);
+    }
+
+}

Added: tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/jndi.properties
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/jndi.properties?rev=769729&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/jndi.properties (added)
+++ tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/jndi.properties Wed Apr 29 09:35:39 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = itest.MockInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false&broker.useJmx=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as. 
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory, ConnectionFactory2
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+topic.ServiceTopic = ServiceTopic
+
+# END SNIPPET: jndi

Added: tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/ttl.composite
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/ttl.composite?rev=769729&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/ttl.composite (added)
+++ tuscany/branches/sca-java-1.x/itest/jms-ttl/src/main/resources/ttl.composite Wed Apr 29 09:35:39 2009
@@ -0,0 +1,36 @@
+<?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://jms"
+           xmlns:itest="http://jms"
+           name="DefinitionsTests">
+
+    <component name="Client1">
+        <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
+        <reference name="serviceA">
+           <interface.java interface="org.apache.tuscany.sca.binding.jms.ClientIface" />
+           <binding.jms >
+               <destination name="dynamic/MyService"/>
+               <headers JMSTimeToLive="123" />
+           </binding.jms>
+        </reference>
+    </component>
+
+</composite>

Added: tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java?rev=769729&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java (added)
+++ tuscany/branches/sca-java-1.x/itest/jms-ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java Wed Apr 29 09:35:39 2009
@@ -0,0 +1,63 @@
+/*
+ * 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 itest.MockInitialContextFactory;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ */
+public class TTLTestCase {
+
+    private static SCADomain scaDomain;
+
+    @Before
+    public void init() {
+        scaDomain = SCADomain.newInstance("http://localhost", "/", "ttl.composite");
+    }
+
+    @Test
+    public void testSayHello() throws Exception {
+        ClientIface client1 = scaDomain.getService(ClientIface.class, "Client1");
+
+        client1.sayHello("petra");
+
+        synchronized(MockInitialContextFactory.lock) {
+            if (MockInitialContextFactory.timeToLive == null) {
+                MockInitialContextFactory.lock.wait(500);
+            }
+        }
+
+        assertNotNull(MockInitialContextFactory.timeToLive);
+        assertEquals(123, MockInitialContextFactory.timeToLive.longValue());
+    }
+
+    @After
+    public void end() {
+        if (scaDomain != null) {
+            scaDomain.close();
+        }
+    }
+}

Modified: tuscany/branches/sca-java-1.x/itest/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/pom.xml?rev=769729&r1=769728&r2=769729&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/pom.xml (original)
+++ tuscany/branches/sca-java-1.x/itest/pom.xml Wed Apr 29 09:35:39 2009
@@ -104,6 +104,7 @@
                 <module>jms-nonscaclient-exceptions</module>
                 <module>jms-nulls</module>
                 <module>jms-selectors</module>
+                <module>jms-ttl</module>
                 <module>large-sdo-ws</module>
                 <module>late-reference-resolution</module>
                 <module>oneway</module>