qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1585979 [6/6] - in /qpid/trunk/qpid/java: bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/ broker-core/src/main/java/org/apache/qpid/server/binding/ br...
Date Wed, 09 Apr 2014 14:13:17 GMT
Modified: qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_10_v1_0/MessageConverter_1_0_to_v0_10.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_10_v1_0/MessageConverter_1_0_to_v0_10.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_10_v1_0/MessageConverter_1_0_to_v0_10.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_10_v1_0/MessageConverter_1_0_to_v0_10.java
Wed Apr  9 14:13:13 2014
@@ -21,7 +21,6 @@
 package org.apache.qpid.server.protocol.converter.v0_10_v1_0;
 
 import org.apache.qpid.server.message.AMQMessageHeader;
-import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.plugin.MessageConverter;
 import org.apache.qpid.server.protocol.v0_10.MessageMetaData_0_10;
 import org.apache.qpid.server.protocol.v0_10.MessageTransferMessage;
@@ -29,7 +28,7 @@ import org.apache.qpid.server.protocol.v
 import org.apache.qpid.server.protocol.v1_0.Message_1_0;
 import org.apache.qpid.server.store.StoreFuture;
 import org.apache.qpid.server.store.StoredMessage;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 import org.apache.qpid.transport.DeliveryProperties;
 import org.apache.qpid.transport.Header;
 import org.apache.qpid.transport.MessageDeliveryPriority;
@@ -53,13 +52,13 @@ public class MessageConverter_1_0_to_v0_
     }
 
     @Override
-    public MessageTransferMessage convert(Message_1_0 serverMsg, VirtualHost vhost)
+    public MessageTransferMessage convert(Message_1_0 serverMsg, VirtualHostImpl vhost)
     {
         return new MessageTransferMessage(convertToStoredMessage(serverMsg, vhost), null);
     }
 
     private StoredMessage<MessageMetaData_0_10> convertToStoredMessage(final Message_1_0
serverMsg,
-                                                                       final VirtualHost
vhost)
+                                                                       final VirtualHostImpl
vhost)
     {
         Object bodyObject = MessageConverter_from_1_0.convertBodyToObject(serverMsg);
 
@@ -124,7 +123,7 @@ public class MessageConverter_1_0_to_v0_
     }
 
     private MessageMetaData_0_10 convertMetaData(Message_1_0 serverMsg,
-                                                 final VirtualHost vhost,
+                                                 final VirtualHostImpl vhost,
                                                  final String bodyMimeType,
                                                  final int size)
     {

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_10_to_0_8.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_10_to_0_8.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_10_to_0_8.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_10_to_0_8.java
Wed Apr  9 14:13:13 2014
@@ -37,7 +37,7 @@ import org.apache.qpid.server.protocol.v
 import org.apache.qpid.server.protocol.v0_8.MessageMetaData;
 import org.apache.qpid.server.store.StoreFuture;
 import org.apache.qpid.server.store.StoredMessage;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 import org.apache.qpid.transport.DeliveryProperties;
 import org.apache.qpid.transport.Header;
 import org.apache.qpid.transport.MessageDeliveryMode;
@@ -49,7 +49,7 @@ public class MessageConverter_0_10_to_0_
     private static final int BASIC_CLASS_ID = 60;
 
     public static BasicContentHeaderProperties convertContentHeaderProperties(MessageTransferMessage
messageTransferMessage,
-                                                                              VirtualHost
vhost)
+                                                                              VirtualHostImpl
vhost)
     {
         BasicContentHeaderProperties props = new BasicContentHeaderProperties();
 
@@ -166,13 +166,13 @@ public class MessageConverter_0_10_to_0_
     }
 
     @Override
-    public AMQMessage convert(MessageTransferMessage message, VirtualHost vhost)
+    public AMQMessage convert(MessageTransferMessage message, VirtualHostImpl vhost)
     {
         return new AMQMessage(convertToStoredMessage(message, vhost));
     }
 
     private StoredMessage<MessageMetaData> convertToStoredMessage(final MessageTransferMessage
message,
-                                                                  VirtualHost vhost)
+                                                                  VirtualHostImpl vhost)
     {
         final MessageMetaData metaData = convertMetaData(message, vhost);
         return new StoredMessage<org.apache.qpid.server.protocol.v0_8.MessageMetaData>()
@@ -221,14 +221,14 @@ public class MessageConverter_0_10_to_0_
         };
     }
 
-    private MessageMetaData convertMetaData(MessageTransferMessage message, VirtualHost vhost)
+    private MessageMetaData convertMetaData(MessageTransferMessage message, VirtualHostImpl
vhost)
     {
         return new MessageMetaData(convertPublishBody(message),
                 convertContentHeaderBody(message, vhost),
                 message.getArrivalTime());
     }
 
-    private ContentHeaderBody convertContentHeaderBody(MessageTransferMessage message, VirtualHost
vhost)
+    private ContentHeaderBody convertContentHeaderBody(MessageTransferMessage message, VirtualHostImpl
vhost)
     {
         BasicContentHeaderProperties props = convertContentHeaderProperties(message, vhost);
         ContentHeaderBody chb = new ContentHeaderBody(props, BASIC_CLASS_ID);

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_8_to_0_10.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_8_to_0_10.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_8_to_0_10.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_8_to_0_10.java
Wed Apr  9 14:13:13 2014
@@ -33,7 +33,7 @@ import org.apache.qpid.server.protocol.v
 import org.apache.qpid.server.protocol.v0_8.AMQMessage;
 import org.apache.qpid.server.store.StoreFuture;
 import org.apache.qpid.server.store.StoredMessage;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 import org.apache.qpid.transport.DeliveryProperties;
 import org.apache.qpid.transport.Header;
 import org.apache.qpid.transport.MessageDeliveryPriority;
@@ -56,7 +56,7 @@ public class MessageConverter_0_8_to_0_1
     }
 
     @Override
-    public MessageTransferMessage convert(AMQMessage message_0_8, VirtualHost vhost)
+    public MessageTransferMessage convert(AMQMessage message_0_8, VirtualHostImpl vhost)
     {
         return new MessageTransferMessage(convertToStoredMessage(message_0_8), null);
     }

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v1_0/MessageConverter_1_0_to_v0_8.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v1_0/MessageConverter_1_0_to_v0_8.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v1_0/MessageConverter_1_0_to_v0_8.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v1_0/MessageConverter_1_0_to_v0_8.java
Wed Apr  9 14:13:13 2014
@@ -33,7 +33,7 @@ import org.apache.qpid.server.protocol.v
 import org.apache.qpid.server.protocol.v1_0.Message_1_0;
 import org.apache.qpid.server.store.StoreFuture;
 import org.apache.qpid.server.store.StoredMessage;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 
 import java.nio.ByteBuffer;
 import java.util.LinkedHashMap;
@@ -56,7 +56,7 @@ public class MessageConverter_1_0_to_v0_
     }
 
     @Override
-    public AMQMessage convert(Message_1_0 serverMsg, VirtualHost vhost)
+    public AMQMessage convert(Message_1_0 serverMsg, VirtualHostImpl vhost)
     {
         return new AMQMessage(convertToStoredMessage(serverMsg), null);
     }

Modified: qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
Wed Apr  9 14:13:13 2014
@@ -48,7 +48,7 @@ import org.apache.qpid.server.txn.AutoCo
 import org.apache.qpid.server.txn.ServerTransaction;
 import org.apache.qpid.server.util.Action;
 import org.apache.qpid.server.util.StateChangeListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 
 import java.nio.charset.Charset;
 import java.security.AccessControlException;
@@ -92,7 +92,7 @@ class ManagementNode implements MessageS
     public static final String RESULTS = "results";
 
 
-    private final VirtualHost _virtualHost;
+    private final VirtualHostImpl _virtualHost;
 
     private final UUID _id;
 

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverter.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverter.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverter.java
Wed Apr  9 14:13:13 2014
@@ -69,6 +69,22 @@ public class ConfiguredObjectToMapConver
             {
                 object.put(name, ((ConfiguredObject) value).getName());
             }
+            else if(value instanceof Collection)
+            {
+                List<Object> converted = new ArrayList();
+                for(Object member : (Collection)value)
+                {
+                    if(member instanceof ConfiguredObject)
+                    {
+                        converted.add(((ConfiguredObject)member).getName());
+                    }
+                    else
+                    {
+                        converted.add(member);
+                    }
+                }
+                object.put(name, converted);
+            }
             else if(value != null)
             {
                 object.put(name, value);

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
Wed Apr  9 14:13:13 2014
@@ -20,17 +20,32 @@ import java.io.BufferedWriter;
 import java.io.IOException;
 import java.io.Writer;
 import java.security.AccessControlException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.log4j.Logger;
-import org.apache.qpid.server.model.*;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.map.SerializationConfig;
 
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.Model;
+import org.apache.qpid.server.model.State;
+
 public class RestServlet extends AbstractServlet
 {
     private static final Logger LOGGER = Logger.getLogger(RestServlet.class);
@@ -458,7 +473,6 @@ public class RestServlet extends Abstrac
         catch (RuntimeException e)
         {
             setResponseStatus(response, e);
-            e.printStackTrace();
         }
     }
 

Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/JMXManagementFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/JMXManagementFactoryTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/JMXManagementFactoryTest.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/JMXManagementFactoryTest.java
Wed Apr  9 14:13:13 2014
@@ -18,15 +18,15 @@
  */
 package org.apache.qpid.server.jmx;
 
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.test.utils.QpidTestCase;
+import static org.mockito.Mockito.mock;
 
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
 
-import static org.mockito.Mockito.mock;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.test.utils.QpidTestCase;
 
 public class JMXManagementFactoryTest extends QpidTestCase
 {
@@ -41,7 +41,7 @@ public class JMXManagementFactoryTest ex
         _attributes.put(ConfiguredObject.TYPE, JMXManagement.PLUGIN_TYPE);
 
         JMXManagement jmxManagement = _jmxManagementFactory.createInstance( _attributes,
_broker);
-
+        jmxManagement.open();
         assertNotNull(jmxManagement);
         assertEquals("Unexpected plugin type", JMXManagement.PLUGIN_TYPE, jmxManagement.getType());
         assertEquals("Unexpected default mbean platform", JMXManagement.DEFAULT_USE_PLATFORM_MBEAN_SERVER,
jmxManagement.getAttribute(JMXManagement.USE_PLATFORM_MBEAN_SERVER));

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java Wed Apr  9
14:13:13 2014
@@ -102,11 +102,39 @@ public final class Strings
 
     private static final Pattern VAR = Pattern.compile("(?:\\$\\{([^\\}]*)\\})|(?:\\$(\\$))");
 
+    public static Resolver chain(Resolver... resolvers)
+    {
+        Resolver resolver;
+        if(resolvers.length == 0)
+        {
+            resolver =  NULL_RESOLVER;
+        }
+        else
+        {
+            resolver = resolvers[resolvers.length - 1];
+            for (int i = resolvers.length - 2; i >= 0; i--)
+            {
+                resolver = new ChainedResolver(resolvers[i], resolver);
+            }
+        }
+        return resolver;
+    }
+
     public static interface Resolver
     {
         String resolve(String variable);
     }
 
+    private static final Resolver NULL_RESOLVER =
+            new Resolver()
+            {
+                @Override
+                public String resolve(final String variable)
+                {
+                    return null;
+                }
+            };
+
     public static class MapResolver implements Resolver
     {
 
@@ -161,19 +189,28 @@ public final class Strings
         }
     }
 
-    public static final Resolver SYSTEM_RESOLVER = new Resolver()
-    {
-        public String resolve(String variable)
+    public static final Resolver ENV_VARS_RESOLVER = new Resolver()
         {
-            String result = System.getProperty(variable);
-            if (result == null)
+            @Override
+            public String resolve(final String variable)
             {
-                result = System.getenv(variable);
+                return System.getenv(variable);
             }
-            return result;
+        };
+
+
+    public static final Resolver JAVA_SYS_PROPS_RESOLVER = new Resolver()
+    {
+        @Override
+        public String resolve(final String variable)
+        {
+            return System.getProperty(variable);
         }
     };
 
+
+    public static final Resolver SYSTEM_RESOLVER = chain(JAVA_SYS_PROPS_RESOLVER, ENV_VARS_RESOLVER);
+
     public static final String expand(String input)
     {
         return expand(input, SYSTEM_RESOLVER);
@@ -181,10 +218,14 @@ public final class Strings
 
     public static final String expand(String input, Resolver resolver)
     {
-        return expand(input, resolver, new Stack<String>());
+        return expand(input, resolver, new Stack<String>(),true);
+    }
+    public static final String expand(String input, boolean failOnUnresolved, Resolver...
resolvers)
+    {
+        return expand(input, chain(resolvers), new Stack<String>(), failOnUnresolved);
     }
 
-    private static final String expand(String input, Resolver resolver, Stack<String>
stack)
+    private static final String expand(String input, Resolver resolver, Stack<String>
stack, boolean failOnUnresolved)
     {
         Matcher m = VAR.matcher(input);
         StringBuffer result = new StringBuffer();
@@ -205,14 +246,17 @@ public final class Strings
             }
             else
             {
-                m.appendReplacement(result, Matcher.quoteReplacement(resolve(var, resolver,
stack)));
+                m.appendReplacement(result, Matcher.quoteReplacement(resolve(var, resolver,
stack, failOnUnresolved)));
             }
         }
         m.appendTail(result);
         return result.toString();
     }
 
-    private static final String resolve(String var, Resolver resolver, Stack<String>
stack)
+    private static final String resolve(String var,
+                                        Resolver resolver,
+                                        Stack<String> stack,
+                                        final boolean failOnUnresolved)
     {
         if (stack.contains(var))
         {
@@ -224,13 +268,20 @@ public final class Strings
         String result = resolver.resolve(var);
         if (result == null)
         {
-            throw new IllegalArgumentException("no such variable: " + var);
+            if(failOnUnresolved)
+            {
+                throw new IllegalArgumentException("no such variable: " + var);
+            }
+            else
+            {
+                return "${"+var+"}";
+            }
         }
 
         stack.push(var);
         try
         {
-            return expand(result, resolver, stack);
+            return expand(result, resolver, stack, failOnUnresolved);
         }
         finally
         {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java
Wed Apr  9 14:13:13 2014
@@ -32,7 +32,7 @@ import java.util.Set;
 import org.apache.qpid.protocol.ServerProtocolEngine;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.util.BrokerTestHelper;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
 import org.apache.qpid.test.utils.QpidTestCase;
 import org.apache.qpid.transport.Sender;
@@ -40,7 +40,7 @@ import org.apache.qpid.transport.network
 
 public class MultiVersionProtocolEngineFactoryTest extends QpidTestCase
 {
-    private VirtualHost _virtualHost;
+    private VirtualHostImpl _virtualHost;
     private Broker _broker;
 
     @Override
@@ -51,6 +51,7 @@ public class MultiVersionProtocolEngineF
         _broker = BrokerTestHelper.createBrokerMock();
         VirtualHostRegistry virtualHostRegistry = _broker.getVirtualHostRegistry();
         when(_broker.getAttribute(Broker.DEFAULT_VIRTUAL_HOST)).thenReturn("default");
+        when(_broker.getDefaultVirtualHost()).thenReturn("default");
 
         // AMQP 1-0 connection needs default vhost to be present
         _virtualHost = BrokerTestHelper.createVirtualHost("default", virtualHostRegistry);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
Wed Apr  9 14:13:13 2014
@@ -20,7 +20,6 @@ package org.apache.qpid.server.security.
 
 import org.apache.qpid.management.common.mbeans.ServerInformation;
 import org.apache.qpid.server.security.access.ObjectType;
-import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.test.utils.JMXTestUtils;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java
Wed Apr  9 14:13:13 2014
@@ -58,7 +58,7 @@ import org.apache.qpid.server.txn.Server
 import org.apache.qpid.server.util.BrokerTestHelper;
 import org.apache.qpid.server.virtualhost.AbstractVirtualHost;
 import org.apache.qpid.server.virtualhost.StandardVirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
 import org.apache.qpid.test.utils.QpidTestCase;
 import org.apache.qpid.util.FileUtils;
@@ -154,14 +154,14 @@ public class VirtualHostMessageStoreTest
         }
     }
 
-    public VirtualHost getVirtualHost()
+    public VirtualHostImpl getVirtualHost()
     {
         return _virtualHost;
     }
 
     protected void reloadVirtualHost()
     {
-        VirtualHost original = getVirtualHost();
+        VirtualHostImpl original = getVirtualHost();
 
         if (getVirtualHost() != null)
         {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
Wed Apr  9 14:13:13 2014
@@ -31,6 +31,7 @@ import java.util.Map;
 import javax.jms.JMSException;
 
 import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.server.model.AbstractConfiguredObject;
 import org.apache.qpid.server.model.Binding;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
@@ -43,7 +44,6 @@ import org.apache.qpid.server.model.Prot
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.model.AbstractConfiguredObject;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 public class Asserts
@@ -60,6 +60,7 @@ public class Asserts
                                 ConfiguredObject.LAST_UPDATED_BY,
                                 ConfiguredObject.LAST_UPDATED_TIME,
                                 ConfiguredObject.DESCRIPTION,
+                                ConfiguredObject.CONTEXT,
                                 VirtualHost.SUPPORTED_QUEUE_TYPES,
                                 VirtualHost.TYPE,
                                 VirtualHost.CONFIGURATION_STORE_SETTINGS,
@@ -117,7 +118,8 @@ public class Asserts
                                         Queue.SORT_KEY,
                                         Queue.MESSAGE_GROUP_KEY,
                                         Queue.MESSAGE_GROUP_SHARED_GROUPS,
-                                        Queue.PRIORITIES);
+                                        Queue.PRIORITIES,
+                                        ConfiguredObject.CONTEXT);
 
         assertEquals("Unexpected value of queue attribute " + Queue.NAME, queueName, queueData.get(Queue.NAME));
         assertNotNull("Unexpected value of queue attribute " + Queue.ID, queueData.get(Queue.ID));
@@ -222,7 +224,8 @@ public class Asserts
                                 ConfiguredObject.CREATED_TIME,
                                 ConfiguredObject.LAST_UPDATED_BY,
                                 ConfiguredObject.LAST_UPDATED_TIME,
-                                ConfiguredObject.DESCRIPTION);
+                                ConfiguredObject.DESCRIPTION,
+                                ConfiguredObject.CONTEXT);
 
         assertEquals("Unexpected value for connection attribute " + Connection.PORT,
                      TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT, connectionData.get(Connection.PORT));
@@ -283,6 +286,7 @@ public class Asserts
                                     ConfiguredObject.LAST_UPDATED_BY,
                                     ConfiguredObject.LAST_UPDATED_TIME,
                                     ConfiguredObject.DESCRIPTION,
+                                    ConfiguredObject.CONTEXT,
                                     Port.AUTHENTICATION_PROVIDER,
                                     Port.KEY_STORE,
                                     Port.TRUST_STORES);
@@ -298,6 +302,7 @@ public class Asserts
                                     ConfiguredObject.LAST_UPDATED_BY,
                                     ConfiguredObject.LAST_UPDATED_TIME,
                                     ConfiguredObject.DESCRIPTION,
+                                    ConfiguredObject.CONTEXT,
                                     Port.AUTHENTICATION_PROVIDER,
                                     Port.BINDING_ADDRESS,
                                     Port.TCP_NO_DELAY,
@@ -332,7 +337,8 @@ public class Asserts
                                 ConfiguredObject.CREATED_TIME,
                                 ConfiguredObject.LAST_UPDATED_BY,
                                 ConfiguredObject.LAST_UPDATED_TIME,
-                                ConfiguredObject.DESCRIPTION);
+                                ConfiguredObject.DESCRIPTION,
+                                ConfiguredObject.CONTEXT);
 
         assertEquals("Unexpected value of exchange attribute " + Exchange.NAME, exchangeName,
                      exchangeData.get(Exchange.NAME));
@@ -367,7 +373,8 @@ public class Asserts
                                 ConfiguredObject.CREATED_TIME,
                                 ConfiguredObject.LAST_UPDATED_BY,
                                 ConfiguredObject.LAST_UPDATED_TIME,
-                                ConfiguredObject.DESCRIPTION);
+                                ConfiguredObject.DESCRIPTION,
+                                ConfiguredObject.CONTEXT);
 
         assertEquals("Unexpected binding attribute " + Binding.NAME, bindingName, binding.get(Binding.NAME));
         assertEquals("Unexpected binding attribute " + Binding.QUEUE, queueName, binding.get(Binding.QUEUE));

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java
Wed Apr  9 14:13:13 2014
@@ -306,7 +306,7 @@ public class AuthenticationProviderRestT
     {
         Asserts.assertAttributesPresent(provider, AbstractConfiguredObject.getAttributeNames(
                 AuthenticationProvider.class),
-                AuthenticationProvider.DESCRIPTION, ConfiguredObject.CREATED_BY,
+                AuthenticationProvider.DESCRIPTION, ConfiguredObject.CONTEXT, ConfiguredObject.CREATED_BY,
                 ConfiguredObject.CREATED_TIME, ConfiguredObject.LAST_UPDATED_BY, ConfiguredObject.LAST_UPDATED_TIME);
         assertEquals("Unexpected value of provider attribute " + AuthenticationProvider.STATE,
State.ACTIVE.name(),
                 provider.get(AuthenticationProvider.STATE));

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
Wed Apr  9 14:13:13 2014
@@ -70,6 +70,7 @@ public class BrokerRestHttpsTest extends
                 ConfiguredObject.CREATED_TIME,
                 ConfiguredObject.LAST_UPDATED_BY,
                 ConfiguredObject.LAST_UPDATED_TIME,
-                ConfiguredObject.DESCRIPTION);
+                ConfiguredObject.DESCRIPTION,
+                ConfiguredObject.CONTEXT);
     }
 }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
Wed Apr  9 14:13:13 2014
@@ -33,14 +33,13 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 
 import org.apache.qpid.common.QpidProperties;
-import org.apache.qpid.server.configuration.BrokerConfigurationStoreCreator;
+import org.apache.qpid.server.model.AbstractConfiguredObject;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.model.AbstractConfiguredObject;
 import org.apache.qpid.server.plugin.MessageStoreFactory;
 import org.apache.qpid.test.client.UnroutableMessageTestExceptionListener;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
@@ -241,7 +240,8 @@ public class BrokerRestTest extends Qpid
                 ConfiguredObject.CREATED_TIME,
                 ConfiguredObject.LAST_UPDATED_BY,
                 ConfiguredObject.LAST_UPDATED_TIME,
-                ConfiguredObject.DESCRIPTION);
+                ConfiguredObject.DESCRIPTION,
+                ConfiguredObject.CONTEXT);
 
         assertEquals("Unexpected value of attribute " + Broker.BUILD_VERSION, QpidProperties.getBuildVersion(),
                 brokerDetails.get(Broker.BUILD_VERSION));

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java
Wed Apr  9 14:13:13 2014
@@ -181,6 +181,7 @@ public class ConnectionRestTest extends 
                                         ConfiguredObject.LAST_UPDATED_BY,
                                         ConfiguredObject.LAST_UPDATED_TIME,
                                         ConfiguredObject.DESCRIPTION,
+                                        ConfiguredObject.CONTEXT,
                                         Session.STATE,
                                         Session.DURABLE,
                                         Session.LIFETIME_POLICY);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java
Wed Apr  9 14:13:13 2014
@@ -328,7 +328,8 @@ public class GroupProviderRestTest exten
                 ConfiguredObject.CREATED_TIME,
                 ConfiguredObject.LAST_UPDATED_BY,
                 ConfiguredObject.LAST_UPDATED_TIME,
-                ConfiguredObject.DESCRIPTION);
+                ConfiguredObject.DESCRIPTION,
+                ConfiguredObject.CONTEXT);
         assertEquals("Unexpected value of provider attribute " + GroupProvider.STATE, State.ACTIVE.name(),
                 provider.get(GroupProvider.STATE));
         assertEquals("Unexpected value of provider attribute " + GroupProvider.LIFETIME_POLICY,

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java
Wed Apr  9 14:13:13 2014
@@ -167,7 +167,8 @@ public class PreferencesProviderRestTest
                                         ConfiguredObject.CREATED_TIME,
                                         ConfiguredObject.LAST_UPDATED_BY,
                                         ConfiguredObject.LAST_UPDATED_TIME,
-                                        ConfiguredObject.DESCRIPTION);
+                                        ConfiguredObject.DESCRIPTION,
+                                        ConfiguredObject.CONTEXT);
         assertEquals("Unexpected value of provider attribute " + PreferencesProvider.STATE,
State.ACTIVE.name(),
                 provider.get(PreferencesProvider.STATE));
         assertEquals("Unexpected value of provider attribute " + PreferencesProvider.LIFETIME_POLICY,

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java
Wed Apr  9 14:13:13 2014
@@ -218,7 +218,8 @@ public class QueueRestTest extends QpidR
                 ConfiguredObject.CREATED_TIME,
                 ConfiguredObject.LAST_UPDATED_BY,
                 ConfiguredObject.LAST_UPDATED_TIME,
-                ConfiguredObject.DESCRIPTION);
+                ConfiguredObject.DESCRIPTION,
+                ConfiguredObject.CONTEXT);
 
         assertEquals("Unexpected binding attribute " + Consumer.NAME, "1", consumer.get(Consumer.NAME));
         assertEquals("Unexpected binding attribute " + Consumer.DURABLE, Boolean.FALSE, consumer.get(Consumer.DURABLE));

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java
Wed Apr  9 14:13:13 2014
@@ -179,7 +179,7 @@ public class RestTestHelper
             JsonParseException, JsonMappingException
     {
         byte[] data = readConnectionInputStream(connection);
-
+String dataAsString = new String(data);
         ObjectMapper mapper = new ObjectMapper();
 
         TypeReference<List<LinkedHashMap<String, Object>>> typeReference
= new TypeReference<List<LinkedHashMap<String, Object>>>()

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java?rev=1585979&r1=1585978&r2=1585979&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
Wed Apr  9 14:13:13 2014
@@ -17,8 +17,39 @@
  */
 package org.apache.qpid.test.utils;
 
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import javax.jms.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.StreamMessage;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
+
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.AMQConnectionFactory;
 import org.apache.qpid.client.AMQConnectionURL;
@@ -41,23 +72,6 @@ import org.apache.qpid.url.URLSyntaxExce
 import org.apache.qpid.util.FileUtils;
 import org.apache.qpid.util.SystemUtils;
 
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import java.lang.IllegalStateException;
-
 /**
  * Qpid base class for system testing test cases.
  */
@@ -529,6 +543,16 @@ public class QpidBrokerTestCase extends 
                 setSystemProperty(BrokerProperties.PROPERTY_BROKER_DEFAULT_AMQP_PROTOCOL_EXCLUDES);
                 setSystemProperty(BrokerProperties.PROPERTY_BROKER_DEFAULT_AMQP_PROTOCOL_INCLUDES);
 
+                setSystemProperty("test.port");
+                setSystemProperty("test.mport");
+                setSystemProperty("test.cport");
+                setSystemProperty("test.hport");
+                setSystemProperty("test.port.ssl");
+                setSystemProperty("test.port.alt");
+                setSystemProperty("test.port.alt.ssl");
+                setSystemProperty("messagestore.type");
+
+
                 // Add all the specified system properties to QPID_OPTS
                 if (!_propertiesSetForBroker.isEmpty())
                 {



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


Mime
View raw message