qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r683683 [3/3] - in /incubator/qpid/trunk/qpid/java: broker/src/test/java/org/apache/qpid/server/util/ client/src/main/java/org/apache/qpid/client/ client/src/main/java/org/apache/qpid/client/message/ client/src/main/java/org/apache/qpid/fil...
Date Thu, 07 Aug 2008 19:25:14 GMT
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java
Thu Aug  7 12:25:12 2008
@@ -31,7 +31,6 @@
 import org.apache.qpid.framing.BasicContentHeaderProperties;
 import org.apache.qpid.framing.ContentHeaderBody;
 import org.apache.qpid.transport.Struct;
-import org.apache.qpid.transport.DeliveryProperties;
 import org.apache.qpid.transport.MessageProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -92,8 +91,7 @@
      * @param deliveryTag   the AMQ message id
      * @param redelivered   true if redelivered
      * @param contentHeader the content header that was received
-     * @param bodies        a list of ContentBody instances
-     * @return the message.
+     * @param bodies        a list of ContentBody instances @return the message.
      * @throws AMQException
      * @throws JMSException
      */
@@ -120,9 +118,8 @@
         }
     }
 
-    public AbstractJMSMessage createMessage(long deliveryTag, boolean redelivered, AMQShortString
exchange,
-                                            AMQShortString routingKey, Struct[] contentHeader,
List bodies,
-                                            String replyTo) throws AMQException, JMSException
+    public AbstractJMSMessage createMessage(long deliveryTag, boolean redelivered,
+                                            Struct[] contentHeader, List bodies) throws AMQException,
JMSException
     {
         MessageProperties mprop = (MessageProperties) contentHeader[0];
         String messageType = mprop.getContentType();
@@ -138,12 +135,12 @@
         }
         else
         {
-            return mf.createMessage(deliveryTag, redelivered, contentHeader, exchange, routingKey,
bodies, replyTo);
+            return mf.createMessage(deliveryTag, redelivered, contentHeader, bodies);
         }
     }
 
 
-    public AbstractJMSMessage createMessage(String mimeType) throws AMQException, JMSException
+    public AbstractJMSMessage createMessage(AMQMessageDelegateFactory delegateFactory, String
mimeType) throws AMQException, JMSException
     {
         if (mimeType == null)
         {
@@ -157,7 +154,7 @@
         }
         else
         {
-            return mf.createMessage();
+            return mf.createMessage(delegateFactory);
         }
     }
 }

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/filter/PropertyExpression.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/filter/PropertyExpression.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/filter/PropertyExpression.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/filter/PropertyExpression.java
Thu Aug  7 12:25:12 2008
@@ -17,10 +17,9 @@
  */
 package org.apache.qpid.filter;
 
-import org.apache.qpid.framing.CommonContentHeaderProperties;
-import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.client.message.AbstractJMSMessage;
 import org.apache.qpid.QpidException;
+import org.apache.qpid.ErrorCode;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -54,20 +53,7 @@
                                      {
                                          public Object evaluate(AbstractJMSMessage message)
                                          {
-                                             try
-                                             {
-                                                 CommonContentHeaderProperties _properties
=
-                                                         message.getContentHeaderProperties();
-                                                 AMQShortString replyTo = _properties.getReplyTo();
-
-                                                 return (replyTo == null) ? null : replyTo.toString();
-                                             }
-                                             catch (Exception e)
-                                             {
-                                                 _logger.warn("Error evaluating property",
e);
-
-                                                 return null;
-                                             }
+                                             return message.getReplyToString();
                                          }
                                      });
 
@@ -77,13 +63,9 @@
                                          {
                                              try
                                              {
-                                                  CommonContentHeaderProperties _properties
=
-                                                         message.getContentHeaderProperties();
-                                                 AMQShortString type = _properties.getType();
-
-                                                 return (type == null) ? null : type.toString();
+                                                 return message.getJMSType();
                                              }
-                                             catch (Exception e)
+                                             catch (JMSException e)
                                              {
                                                  _logger.warn("Error evaluating property",
e);
 
@@ -107,7 +89,7 @@
 
                                                  return mode;
                                              }
-                                             catch (Exception e)
+                                             catch (JMSException e)
                                              {
                                                  _logger.warn("Error evaluating property",e);
                                              }
@@ -122,9 +104,7 @@
                                          {
                                              try
                                              {
-                                              CommonContentHeaderProperties _properties =
-                                                         message.getContentHeaderProperties();
-                                                 return (int) _properties.getPriority();
+                                                 return message.getJMSPriority();
                                              }
                                              catch (Exception e)
                                              {
@@ -142,13 +122,9 @@
 
                                              try
                                              {
-                                                  CommonContentHeaderProperties _properties
=
-                                                         message.getContentHeaderProperties();
-                                                 AMQShortString messageId = _properties.getMessageId();
-
-                                                 return (messageId == null) ? null : messageId;
+                                                 return message.getJMSMessageID();
                                              }
-                                             catch (Exception e)
+                                             catch (JMSException e)
                                              {
                                                  _logger.warn("Error evaluating property",e);
 
@@ -164,9 +140,7 @@
                                          {
                                              try
                                              {
-                                               CommonContentHeaderProperties _properties
=
-                                                         message.getContentHeaderProperties();
-                                                 return _properties.getTimestamp();
+                                                 return message.getJMSTimestamp();
                                              }
                                              catch (Exception e)
                                              {
@@ -185,12 +159,9 @@
 
                                              try
                                              {
-                                                 CommonContentHeaderProperties _properties
=
-                                                                                        
       message.getContentHeaderProperties();
-                                                 AMQShortString correlationId = _properties.getCorrelationId();
-                                                 return (correlationId == null) ? null :
correlationId.toString();
+                                                 return message.getJMSCorrelationID();
                                              }
-                                             catch (Exception e)
+                                             catch (JMSException e)
                                              {
                                                  _logger.warn("Error evaluating property",e);
 
@@ -207,11 +178,9 @@
 
                                              try
                                              {
-                                                     CommonContentHeaderProperties _properties
=
-                                                                                        
       message.getContentHeaderProperties();
-                                                 return _properties.getExpiration();
+                                                 return message.getJMSExpiration();
                                              }
-                                             catch (Exception e)
+                                             catch (JMSException e)
                                              {
                                                  _logger.warn("Error evaluating property",e);
                                                  return null;
@@ -257,13 +226,20 @@
         else
         {
 
-           CommonContentHeaderProperties _properties =     message.getContentHeaderProperties();
-            if (_logger.isDebugEnabled())
+            try
+            {
+
+                if (_logger.isDebugEnabled())
+                {
+                    _logger.debug("Looking up property:" + name);
+                    _logger.debug("Properties are:" + message.getPropertyNames());
+                }
+                return message.getObjectProperty(name);
+            }
+            catch(JMSException e)
             {
-                _logger.debug("Looking up property:" + name);
-                _logger.debug("Properties are:" + _properties.getHeaders().keySet());
+                throw new QpidException("Exception evaluating properties for filter", ErrorCode.INTERNAL_ERROR,
e);
             }
-            return _properties.getHeaders().getObject(name);
         }
     }
 

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jms/Message.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jms/Message.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jms/Message.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jms/Message.java Thu
Aug  7 12:25:12 2008
@@ -24,5 +24,7 @@
 
 public interface Message extends javax.jms.Message
 {
+    public static final String JMS_TYPE = "x-jms-type";
+
     public void acknowledgeThis() throws JMSException;
 }

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/ByteBufferMessage.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/ByteBufferMessage.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/ByteBufferMessage.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/ByteBufferMessage.java
Thu Aug  7 12:25:12 2008
@@ -30,6 +30,12 @@
     private int _transferId;
     private Header _header;
 
+    public ByteBufferMessage(MessageProperties messageProperties, DeliveryProperties deliveryProperties)
+    {
+        _currentMessageProps = messageProperties;
+        _currentDeliveryProps = deliveryProperties;
+    }
+
     public void setHeader(Header header) {
         _header = header;
     }

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java
Thu Aug  7 12:25:12 2008
@@ -26,21 +26,21 @@
 {
     public static JMSTextMessage newJMSTextMessage() throws JMSException
     {
-        return new JMSTextMessage();
+        return new JMSTextMessage(AMQMessageDelegateFactory.FACTORY_0_8);
     }
 
     public static JMSBytesMessage newJMSBytesMessage() throws JMSException
     {
-        return new JMSBytesMessage();
+        return new JMSBytesMessage(AMQMessageDelegateFactory.FACTORY_0_8);
     }
 
     public static JMSMapMessage newJMSMapMessage() throws JMSException
     {
-        return new JMSMapMessage();
+        return new JMSMapMessage(AMQMessageDelegateFactory.FACTORY_0_8);
     }
 
     public static JMSStreamMessage newJMSStreamMessage()
     {
-        return new JMSStreamMessage();
+        return new JMSStreamMessage(AMQMessageDelegateFactory.FACTORY_0_8);
     }
 }

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java
Thu Aug  7 12:25:12 2008
@@ -20,20 +20,20 @@
  */
 package org.apache.qpid.test.unit.message;
 
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.TextMessage;
+import javax.jms.*;
 
 import junit.framework.TestCase;
 
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-import org.apache.qpid.client.message.JMSMapMessage;
-import org.apache.qpid.client.message.JMSTextMessage;
-import org.apache.qpid.client.message.MessageConverter;
+import org.apache.qpid.client.*;
+import org.apache.qpid.client.protocol.AMQProtocolHandler;
+import org.apache.qpid.client.failover.FailoverException;
+import org.apache.qpid.client.message.*;
 import org.apache.qpid.exchange.ExchangeDefaults;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.AMQException;
+
+import java.util.Map;
 
 
 public class MessageConverterTest extends TestCase
@@ -47,36 +47,38 @@
     protected JMSTextMessage testTextMessage;
 
     protected JMSMapMessage testMapMessage;
+    private AMQSession _session = new TestAMQSession();
+
 
     protected void setUp() throws Exception
     {
         super.setUp();
-        testTextMessage = new JMSTextMessage();
+        testTextMessage = new JMSTextMessage(AMQMessageDelegateFactory.FACTORY_0_8);
 
         //Set Message Text
         testTextMessage.setText("testTextMessage text");
         setMessageProperties(testTextMessage);
 
-        testMapMessage = new JMSMapMessage();
+        testMapMessage = new JMSMapMessage(AMQMessageDelegateFactory.FACTORY_0_8);
         testMapMessage.setString("testMapString", "testMapStringValue");
         testMapMessage.setDouble("testMapDouble", Double.MAX_VALUE);
     }
 
     public void testSetProperties() throws Exception
     {
-        AbstractJMSMessage newMessage = new MessageConverter((TextMessage) testTextMessage).getConvertedMessage();
+        AbstractJMSMessage newMessage = new MessageConverter(_session, (TextMessage) testTextMessage).getConvertedMessage();
         mesagePropertiesTest(testTextMessage, newMessage);
     }
 
     public void testJMSTextMessageConversion() throws Exception
     {
-        AbstractJMSMessage newMessage = new MessageConverter((TextMessage) testTextMessage).getConvertedMessage();
+        AbstractJMSMessage newMessage = new MessageConverter(_session, (TextMessage) testTextMessage).getConvertedMessage();
         assertEquals("Converted message text mismatch", ((JMSTextMessage) newMessage).getText(),
testTextMessage.getText());
     }
 
     public void testJMSMapMessageConversion() throws Exception
     {
-        AbstractJMSMessage newMessage = new MessageConverter((MapMessage) testMapMessage).getConvertedMessage();
+        AbstractJMSMessage newMessage = new MessageConverter(_session, (MapMessage) testMapMessage).getConvertedMessage();
         assertEquals("Converted map message String mismatch", ((JMSMapMessage) newMessage).getString("testMapString"),
                      testMapMessage.getString("testMapString"));
         assertEquals("Converted map message Double mismatch", ((JMSMapMessage) newMessage).getDouble("testMapDouble"),

Added: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java?rev=683683&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java
(added)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java
Thu Aug  7 12:25:12 2008
@@ -0,0 +1,171 @@
+/*
+ *
+ * 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.qpid.test.unit.message;
+
+import org.apache.qpid.client.*;
+import org.apache.qpid.client.message.AMQMessageDelegateFactory;
+import org.apache.qpid.client.protocol.AMQProtocolHandler;
+import org.apache.qpid.client.failover.FailoverException;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.AMQException;
+
+import javax.jms.*;
+import java.util.Map;
+
+public class TestAMQSession extends AMQSession
+{
+
+    public TestAMQSession()
+    {
+        super(null, 0, false, AUTO_ACKNOWLEDGE, null, 0, 0);
+    }
+
+    public void acknowledgeMessage(long deliveryTag, boolean multiple)
+    {
+
+    }
+
+    public void sendQueueBind(AMQShortString queueName, AMQShortString routingKey, FieldTable
arguments, AMQShortString exchangeName, AMQDestination destination) throws AMQException, FailoverException
+    {
+
+    }
+
+    public void sendClose(long timeout) throws AMQException, FailoverException
+    {
+
+    }
+
+    public void sendCommit() throws AMQException, FailoverException
+    {
+
+    }
+
+    public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
+    {
+        return null;
+    }
+
+    public void sendCreateQueue(AMQShortString name, boolean autoDelete, boolean durable,
boolean exclusive, Map<String, Object> arguments) throws AMQException, FailoverException
+    {
+
+    }
+
+    public TemporaryQueue createTemporaryQueue() throws JMSException
+    {
+        return null;
+    }
+
+    protected void sendRecover() throws AMQException, FailoverException
+    {
+
+    }
+
+    public void rejectMessage(long deliveryTag, boolean requeue)
+    {
+
+    }
+
+    public void releaseForRollback()
+    {
+
+    }
+
+    public void sendRollback() throws AMQException, FailoverException
+    {
+
+    }
+
+    public BasicMessageConsumer createMessageConsumer(AMQDestination destination, int prefetchHigh,
int prefetchLow, boolean noLocal, boolean exclusive, String selector, FieldTable arguments,
boolean noConsume, boolean autoClose) throws JMSException
+    {
+        return null;
+    }
+
+    public boolean isQueueBound(AMQShortString exchangeName, AMQShortString queueName, AMQShortString
routingKey) throws JMSException
+    {
+        return false;
+    }
+
+    public boolean isQueueBound(AMQDestination destination) throws JMSException
+    {
+        return false;
+    }
+
+    public void sendConsume(BasicMessageConsumer consumer, AMQShortString queueName, AMQProtocolHandler
protocolHandler, boolean nowait, String messageSelector, AMQShortString tag) throws AMQException,
FailoverException
+    {
+
+    }
+
+    public BasicMessageProducer createMessageProducer(Destination destination, boolean mandatory,
boolean immediate, boolean waitUntilSent, long producerId)
+    {
+        return null;
+    }
+
+    protected Long requestQueueDepth(AMQDestination amqd) throws AMQException, FailoverException
+    {
+        return null;
+    }
+
+    public void sendExchangeDeclare(AMQShortString name, AMQShortString type, AMQProtocolHandler
protocolHandler, boolean nowait) throws AMQException, FailoverException
+    {
+
+    }
+
+    public void sendQueueDeclare(AMQDestination amqd, AMQProtocolHandler protocolHandler)
throws AMQException, FailoverException
+    {
+
+    }
+
+    public void sendQueueDelete(AMQShortString queueName) throws AMQException, FailoverException
+    {
+
+    }
+
+    public void sendSuspendChannel(boolean suspend) throws AMQException, FailoverException
+    {
+
+    }
+
+    protected boolean tagLE(long tag1, long tag2)
+    {
+        return false;
+    }
+
+    protected boolean updateRollbackMark(long current, long deliveryTag)
+    {
+        return false;
+    }
+
+    public AMQMessageDelegateFactory getMessageDelegateFactory()
+    {
+        return AMQMessageDelegateFactory.FACTORY_0_8;
+    }
+
+    protected Object getFailoverMutex()
+    {
+        return this;
+    }
+
+    public void checkNotClosed()
+    {
+
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java
(original)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java
Thu Aug  7 12:25:12 2008
@@ -29,7 +29,6 @@
 import javax.jms.StreamMessage;
 import javax.jms.BytesMessage;
 import javax.jms.TextMessage;
-import javax.jms.Queue;
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 
@@ -42,10 +41,10 @@
         return session.createTextMessage(createMessagePayload(size));
     }
 
-    public static JMSTextMessage newJMSTextMessage(int size, String encoding) throws JMSException
+    public static TextMessage newJMSTextMessage(Session session, int size, String encoding)
throws JMSException
     {
-        ByteBuffer byteBuffer = (new SimpleByteBufferAllocator()).allocate(size, true);
-        JMSTextMessage message = new JMSTextMessage(byteBuffer, encoding);
+
+        TextMessage message = session.createTextMessage();
         message.clearBody();
         message.setText(createMessagePayload(size));
         return message;

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/message/NonQpidObjectMessage.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/message/NonQpidObjectMessage.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/message/NonQpidObjectMessage.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/message/NonQpidObjectMessage.java
Thu Aug  7 12:25:12 2008
@@ -26,20 +26,22 @@
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.ObjectMessage;
+import javax.jms.Session;
 
 public class NonQpidObjectMessage implements ObjectMessage {
 
-    private JMSObjectMessage _realMessage;
+    private ObjectMessage _realMessage;
     private String _contentString;
 
     /**
      * Allows us to construct a JMS message which
      * does not inherit from the Qpid message superclasses
      * and expand our unit testing of MessageConverter et al
+     * @param session
      */
-    public NonQpidObjectMessage()
+    public NonQpidObjectMessage(Session session) throws JMSException
     {
-        _realMessage = new JMSObjectMessage();
+        _realMessage = session.createObjectMessage();
     }
 
     public String getJMSMessageID() throws JMSException {

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java
Thu Aug  7 12:25:12 2008
@@ -33,7 +33,7 @@
 import org.apache.qpid.server.queue.AMQMessageHandle;
 import org.apache.qpid.server.queue.AMQQueueFactory;
 import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
+import org.apache.qpid.server.store.TestMemoryMessageStore;
 import org.apache.qpid.server.store.StoreContext;
 import org.apache.qpid.server.store.MemoryMessageStore;
 import org.apache.qpid.server.txn.NonTransactionalContext;
@@ -105,7 +105,7 @@
 
         Scenario(int messageCount, List<Long> acked, List<Long> unacked) throws
Exception
         {
-            TransactionalContext txnContext = new NonTransactionalContext(new TestableMemoryMessageStore(),
+            TransactionalContext txnContext = new NonTransactionalContext(new TestMemoryMessageStore(),
                                                                           _storeContext,
null,
                                                                           new LinkedList<RequiredDeliveryException>()
             );

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
Thu Aug  7 12:25:12 2008
@@ -34,7 +34,7 @@
 import org.apache.qpid.server.flow.LimitlessCreditManager;
 import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
 import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
+import org.apache.qpid.server.store.TestMemoryMessageStore;
 import org.apache.qpid.server.store.StoreContext;
 import org.apache.qpid.server.txn.NonTransactionalContext;
 import org.apache.qpid.server.txn.TransactionalContext;
@@ -56,7 +56,7 @@
 
     private MockProtocolSession _protocolSession;
 
-    private TestableMemoryMessageStore _messageStore;
+    private TestMemoryMessageStore _messageStore;
 
     private StoreContext _storeContext = new StoreContext();
 
@@ -74,7 +74,7 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        _messageStore = new TestableMemoryMessageStore();
+        _messageStore = new TestMemoryMessageStore();
         _protocolSession = new MockProtocolSession(_messageStore);
         _channel = new AMQChannel(_protocolSession,5, _messageStore /*dont need exchange
registry*/);
 

Copied: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestMemoryMessageStore.java
(from r682852, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestMemoryMessageStore.java?p2=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestMemoryMessageStore.java&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java&r1=682852&r2=683683&rev=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestMemoryMessageStore.java
Thu Aug  7 12:25:12 2008
@@ -31,9 +31,9 @@
 /**
  * Adds some extra methods to the memory message store for testing purposes.
  */
-public class TestableMemoryMessageStore extends MemoryMessageStore
+public class TestMemoryMessageStore extends MemoryMessageStore
 {
-    public TestableMemoryMessageStore()
+    public TestMemoryMessageStore()
     {
         _metaDataMap = new ConcurrentHashMap<Long, MessageMetaData>();
         _contentBodyMap = new ConcurrentHashMap<Long, List<ContentChunk>>();

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java
Thu Aug  7 12:25:12 2008
@@ -29,14 +29,13 @@
 import org.apache.qpid.server.queue.AMQMessage;
 import org.apache.qpid.server.queue.MessageHandleFactory;
 import org.apache.qpid.server.queue.AMQMessageHandle;
-import org.apache.qpid.server.txn.NonTransactionalContext;
 
 /**
  * Tests that reference counting works correctly with AMQMessage and the message store
  */
 public class TestReferenceCounting extends TestCase
 {
-    private TestableMemoryMessageStore _store;
+    private TestMemoryMessageStore _store;
 
     private StoreContext _storeContext = new StoreContext();
 
@@ -44,7 +43,7 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        _store = new TestableMemoryMessageStore();
+        _store = new TestMemoryMessageStore();
     }
 
     /**

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java
Thu Aug  7 12:25:12 2008
@@ -23,7 +23,7 @@
 import junit.framework.TestCase;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
+import org.apache.qpid.server.store.TestMemoryMessageStore;
 import org.apache.qpid.server.store.StoreContext;
 
 import java.util.LinkedList;
@@ -194,7 +194,7 @@
         }
     }
 
-    class MockStore extends TestableMemoryMessageStore
+    class MockStore extends TestMemoryMessageStore
     {
         final Object BEGIN = "BEGIN";
         final Object ABORT = "ABORT";

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/util/TestApplicationRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/util/TestApplicationRegistry.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/util/TestApplicationRegistry.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/util/TestApplicationRegistry.java
Thu Aug  7 12:25:12 2008
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.util;
-
-import org.apache.qpid.server.exchange.ExchangeFactory;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.management.ManagedObjectRegistry;
-import org.apache.qpid.server.plugins.PluginManager;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabaseManager;
-import org.apache.qpid.server.security.auth.database.PropertiesPrincipalDatabaseManager;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.plugins.AllowAll;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.MapConfiguration;
-
-import java.util.HashMap;
-import java.util.Collection;
-import java.util.Properties;
-
-public class TestApplicationRegistry extends ApplicationRegistry
-{
-    private QueueRegistry _queueRegistry;
-
-    private ExchangeRegistry _exchangeRegistry;
-
-    private ExchangeFactory _exchangeFactory;
-
-    private MessageStore _messageStore;
-
-    private VirtualHost _vHost;
-
-    public TestApplicationRegistry()
-    {
-        super(new MapConfiguration(new HashMap()));
-    }
-
-    public void initialise() throws Exception
-    {
-        _logger.info("Initialising TestApplicationRegistry");
-
-        Properties users = new Properties();
-
-        users.put("guest", "guest");
-
-        _databaseManager = new PropertiesPrincipalDatabaseManager("default", users);
-
-        _accessManager = new AllowAll();
-
-        _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
-
-        IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
-        _managedObjectRegistry = appRegistry.getManagedObjectRegistry();
-        _vHost = appRegistry.getVirtualHostRegistry().getVirtualHost("test");
-        _queueRegistry = _vHost.getQueueRegistry();
-        _exchangeFactory = _vHost.getExchangeFactory();
-        _exchangeRegistry = _vHost.getExchangeRegistry();
-
-        _messageStore = new TestableMemoryMessageStore();
-
-        _configuration.addProperty("heartbeat.delay", 10 * 60); // 10 minutes
-    }
-
-    public QueueRegistry getQueueRegistry()
-    {
-        return _queueRegistry;
-    }
-
-    public ExchangeRegistry getExchangeRegistry()
-    {
-        return _exchangeRegistry;
-    }
-
-    public ExchangeFactory getExchangeFactory()
-    {
-        return _exchangeFactory;
-    }
-
-    public Collection<String> getVirtualHostNames()
-    {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
-    }
-
-    public VirtualHostRegistry getVirtualHostRegistry()
-    {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
-    }
-
-    public void setAccessManager(ACLPlugin newManager)
-    {
-        _accessManager = newManager;
-    }
-
-    public MessageStore getMessageStore()
-    {
-        return _messageStore;
-    }
-
-    public PluginManager getPluginManager()
-    {
-        return null;
-    }
-}
-
-

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java
Thu Aug  7 12:25:12 2008
@@ -114,9 +114,14 @@
     {
         synchronized (received)
         {
+            long endTime = System.currentTimeMillis() + 30000L;
             while (received.size() < count)
             {
-                received.wait();
+                received.wait(30000);
+                if(received.size() < count && System.currentTimeMillis() >
endTime)
+                {
+                    throw new RuntimeException("Only received " + received.size() + " messages,
was expecting " + count);
+                }
             }
         }
     }

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
Thu Aug  7 12:25:12 2008
@@ -25,10 +25,12 @@
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.AMQMessage;
+import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.message.JMSTextMessage;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.test.utils.QpidTestCase;
+import org.apache.qpid.url.BindingURL;
+import org.apache.qpid.url.AMQBindingURL;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -45,6 +47,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.net.URISyntaxException;
 
 public class PropertyValueTest extends QpidTestCase implements MessageListener
 {
@@ -183,43 +186,6 @@
             m.setShortProperty("Short", (short) Short.MAX_VALUE);
             m.setStringProperty("String", "Test");
 
-            // AMQP Specific values
-
-            // Timestamp
-            long nano = System.nanoTime();
-            m.setStringProperty("time-str", String.valueOf(nano));
-            ((AMQMessage) m).setTimestampProperty(new AMQShortString("time"), nano);
-
-            // Decimal
-            BigDecimal bd = new BigDecimal(Integer.MAX_VALUE);
-            ((AMQMessage) m).setDecimalProperty(new AMQShortString("decimal"), bd.setScale(Byte.MAX_VALUE));
-
-            bd = new BigDecimal((long) Integer.MAX_VALUE + 1L);
-
-            try
-            {
-                ((AMQMessage) m).setDecimalProperty(new AMQShortString("decimal-bad-value"),
bd.setScale(Byte.MAX_VALUE));
-                fail("UnsupportedOperationException should be thrown as value can't be correctly
transmitted");
-            }
-            catch (UnsupportedOperationException uoe)
-            {
-                // normal path.
-            }
-
-            try
-            {
-                ((AMQMessage) m).setDecimalProperty(new AMQShortString("decimal-bad-scale"),
-                    bd.setScale(Byte.MAX_VALUE + 1));
-                fail("UnsupportedOperationException should be thrown as scale can't be correctly
transmitted");
-            }
-            catch (UnsupportedOperationException uoe)
-            {
-                // normal path.
-            }
-
-            // Void
-            ((AMQMessage) m).setVoidProperty(new AMQShortString("void"));
-
             _logger.debug("Sending Msg:" + m);
             producer.send(m);
         }
@@ -236,7 +202,7 @@
         }
     }
 
-    void check() throws JMSException
+    void check() throws JMSException, URISyntaxException
     {
         List<String> actual = new ArrayList<String>();
         for (JMSTextMessage m : received)
@@ -259,8 +225,8 @@
             Assert.assertEquals("Check Priority properties are correctly transported", 8,
m.getJMSPriority());
 
             // Queue
-            Assert.assertEquals("Check ReplyTo properties are correctly transported", m.getStringProperty("TempQueue"),
-                m.getJMSReplyTo().toString());
+            Assert.assertEquals("Check ReplyTo properties are correctly transported", AMQDestination.createDestination(new
AMQBindingURL(m.getStringProperty("TempQueue"))),
+                m.getJMSReplyTo());
 
             Assert.assertEquals("Check Type properties are correctly transported", "Test",
m.getJMSType());
 
@@ -271,7 +237,7 @@
             Assert.assertEquals("Check Long properties are correctly transported", (long)
Long.MAX_VALUE,
                 m.getLongProperty("Long"));
             Assert.assertEquals("Check String properties are correctly transported", "Test",
m.getStringProperty("String"));
-
+/*
             // AMQP Tests Specific values
 
             Assert.assertEquals("Check Timestamp properties are correctly transported", m.getStringProperty("time-str"),
@@ -288,7 +254,7 @@
 
             Assert.assertTrue("Check void properties are correctly transported",
                               ((AMQMessage) m).getPropertyHeaders().containsKey("void"));
-
+*/
             //JMSXUserID
             if (m.getStringProperty("JMSXUserID") != null)
             {

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
Thu Aug  7 12:25:12 2008
@@ -76,7 +76,7 @@
         MessageProducer producer = producerSession.createProducer(queue);
         Destination JMS_REPLY_TO = new AMQQueue(con2, "my.replyto");
         // create a test message to send
-        ObjectMessage sentMsg = new NonQpidObjectMessage();
+        ObjectMessage sentMsg = new NonQpidObjectMessage(producerSession);
         sentMsg.setJMSCorrelationID(JMS_CORR_ID);
         sentMsg.setJMSDeliveryMode(JMS_DELIV_MODE);
         sentMsg.setJMSType(JMS_TYPE);

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/StreamMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/StreamMessageTest.java?rev=683683&r1=683682&r2=683683&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/StreamMessageTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/StreamMessageTest.java
Thu Aug  7 12:25:12 2008
@@ -106,7 +106,8 @@
         _logger.info("Starting consumer connection");
         con.start();
 
-        StreamMessage msg2 = (StreamMessage) consumer.receive();
+        StreamMessage msg2 = (StreamMessage) consumer.receive(2000);
+        assertNotNull(msg2);
 
         msg2.readByte();
         try



Mime
View raw message