qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject svn commit: r1172657 [18/21] - in /qpid/branches/qpid-3346/qpid: ./ cpp/ cpp/bindings/ cpp/bindings/qmf2/examples/cpp/ cpp/bindings/qpid/dotnet/ cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/Properties/ cpp/bindings/qpid/dotnet/examples/csha...
Date Mon, 19 Sep 2011 15:13:38 GMT
Modified: qpid/branches/qpid-3346/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java (original)
+++ qpid/branches/qpid-3346/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java Mon Sep 19 15:13:18 2011
@@ -27,7 +27,9 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.List;
+import java.util.Properties;
 
 public class FileUtilsTest extends TestCase
 {
@@ -182,6 +184,20 @@ public class FileUtilsTest extends TestC
         }
     }
 
+
+    /**
+     * Helper method to create a temporary file with test content.
+     *
+     * @param test_data The data to store in the file
+     *
+     * @return The File reference
+     */
+    private File createTestFileInTmpDir(final String testData) throws Exception 
+    {
+        final File tmpFile = File.createTempFile("test", "tmp");
+        
+        return createTestFile(tmpFile.getCanonicalPath(), testData);
+    }
     /**
      * Helper method to create a test file with a string content
      *
@@ -302,8 +318,74 @@ public class FileUtilsTest extends TestC
             // expected path
         }
     }
+    
+    /**
+     * Tests that openFileOrDefaultResource can open a file on the filesystem.
+     *
+     */
+    public void testOpenFileOrDefaultResourceOpensFileOnFileSystem() throws Exception
+    {
+        final File testFile = createTestFileInTmpDir("src=tmpfile");
+        final String filenameOnFilesystem = testFile.getCanonicalPath();
+        final String defaultResource = "org/apache/qpid/util/default.properties";
+
+        
+        final InputStream is = FileUtils.openFileOrDefaultResource(filenameOnFilesystem, defaultResource, this.getClass().getClassLoader());
+        assertNotNull("Stream must not be null", is);
+        final Properties p = new Properties();
+        p.load(is);
+        assertEquals("tmpfile", p.getProperty("src"));
+    }
+
+    /**
+     * Tests that openFileOrDefaultResource can open a file on the classpath.
+     *
+     */
+    public void testOpenFileOrDefaultResourceOpensFileOnClasspath() throws Exception
+    {
+        final String mydefaultsResource = "org/apache/qpid/util/mydefaults.properties";
+        final String defaultResource = "org/apache/qpid/util/default.properties";
+
+        
+        final InputStream is = FileUtils.openFileOrDefaultResource(mydefaultsResource, defaultResource, this.getClass().getClassLoader());
+        assertNotNull("Stream must not be null", is);
+        final Properties p = new Properties();
+        p.load(is);
+        assertEquals("mydefaults", p.getProperty("src"));
+    }
 
     /**
+     * Tests that openFileOrDefaultResource returns the default resource when file cannot be found.
+     */
+    public void testOpenFileOrDefaultResourceOpensDefaultResource() throws Exception
+    {
+        final File fileThatDoesNotExist = new File("/does/not/exist.properties");
+        assertFalse("Test must not exist", fileThatDoesNotExist.exists());
+        
+        final String defaultResource = "org/apache/qpid/util/default.properties";
+        
+        final InputStream is = FileUtils.openFileOrDefaultResource(fileThatDoesNotExist.getCanonicalPath(), defaultResource, this.getClass().getClassLoader());
+        assertNotNull("Stream must not be null", is);
+        Properties p = new Properties();
+        p.load(is);
+        assertEquals("default.properties", p.getProperty("src"));
+    }
+    
+    /**
+     * Tests that openFileOrDefaultResource returns null if neither the file nor
+     * the default resource can be found..
+     */
+    public void testOpenFileOrDefaultResourceReturnsNullWhenNeitherCanBeFound() throws Exception
+    {
+
+        final String mydefaultsResource = "org/apache/qpid/util/doesnotexisteiether.properties";        
+        final String defaultResource = "org/apache/qpid/util/doesnotexisteiether.properties";
+        
+        final InputStream is = FileUtils.openFileOrDefaultResource(mydefaultsResource, defaultResource, this.getClass().getClassLoader());
+        assertNull("Stream must  be null", is);
+    }
+    
+    /**
      * Given two lists of File arrays ensure they are the same length and all entries in Before are in After
      *
      * @param filesBefore File[]

Modified: qpid/branches/qpid-3346/qpid/java/common/templates/method/version/MethodBodyClass.vm
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/common/templates/method/version/MethodBodyClass.vm?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/common/templates/method/version/MethodBodyClass.vm (original)
+++ qpid/branches/qpid-3346/qpid/java/common/templates/method/version/MethodBodyClass.vm Mon Sep 19 15:13:18 2011
@@ -46,9 +46,11 @@
  
 package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
 
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
 import java.util.HashMap;
 
-import org.apache.mina.common.ByteBuffer;
 import org.apache.qpid.framing.*;
 import org.apache.qpid.AMQException;
 
@@ -56,7 +58,7 @@ public class ${javaClassName} extends AM
 {
     private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
     {
-        public AMQMethodBody newInstance(ByteBuffer in, long size) throws AMQFrameDecodingException
+        public AMQMethodBody newInstance(DataInputStream in, long size) throws AMQFrameDecodingException, IOException
         {
             return new ${javaClassName}(in);
         }
@@ -84,7 +86,7 @@ public class ${javaClassName} extends AM
     
     // Constructor
 
-    public ${javaClassName}(ByteBuffer buffer) throws AMQFrameDecodingException
+    public ${javaClassName}(DataInputStream buffer) throws AMQFrameDecodingException, IOException
     {
 #foreach( $field in $method.ConsolidatedFields )
         _$field.Name = read$field.getEncodingType()( buffer );
@@ -169,7 +171,7 @@ public class ${javaClassName} extends AM
         return size;        
     }
 
-    public void writeMethodPayload(ByteBuffer buffer)
+    public void writeMethodPayload(DataOutputStream buffer) throws IOException
     {
 #foreach( $field in $method.ConsolidatedFields )
         write$field.getEncodingType()( buffer, _$field.Name );

Modified: qpid/branches/qpid-3346/qpid/java/common/templates/model/MethodRegistryClass.vm
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/common/templates/model/MethodRegistryClass.vm?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/common/templates/model/MethodRegistryClass.vm (original)
+++ qpid/branches/qpid-3346/qpid/java/common/templates/model/MethodRegistryClass.vm Mon Sep 19 15:13:18 2011
@@ -30,7 +30,8 @@
  
 package org.apache.qpid.framing;
 
-import org.apache.mina.common.ByteBuffer;
+import java.io.DataInputStream;
+import java.io.IOException;
 
 import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
 
@@ -53,8 +54,8 @@ public abstract class MethodRegistry
 #end
  			
 			
-    public abstract AMQMethodBody convertToBody(ByteBuffer in, long size)
-        throws AMQFrameDecodingException;
+    public abstract AMQMethodBody convertToBody(DataInputStream in, long size)
+        throws AMQFrameDecodingException, IOException;
 
     public abstract int getMaxClassId();
 
@@ -101,4 +102,4 @@ public abstract class MethodRegistry
 
 	public abstract ProtocolVersionMethodConverter getProtocolVersionMethodConverter();
 	
-}
\ No newline at end of file
+}

Modified: qpid/branches/qpid-3346/qpid/java/common/templates/model/version/MethodRegistryClass.vm
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/common/templates/model/version/MethodRegistryClass.vm?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/common/templates/model/version/MethodRegistryClass.vm (original)
+++ qpid/branches/qpid-3346/qpid/java/common/templates/model/version/MethodRegistryClass.vm Mon Sep 19 15:13:18 2011
@@ -35,32 +35,33 @@ import org.apache.qpid.protocol.AMQConst
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.mina.common.ByteBuffer;
+import java.io.DataInputStream;
+import java.io.IOException;
 
 import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
 
 
 public class MethodRegistry_$version.getMajor()_$version.getMinor() extends MethodRegistry
 {
-	
+    
     private static final Logger _log = LoggerFactory.getLogger(MethodRegistry.class);
 
-	private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_$version.getMajor()_$version.getMinor()();
-	
-#set( $specificModel = $model.asSingleVersionModel() )	
-	
-	
-#set( $maxClassId = $specificModel.getMaximumClassId()+1 )	
-	private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[$maxClassId][];
-
-	public MethodRegistry_$version.getMajor()_$version.getMinor()()
-	{
-	    this(new ProtocolVersion((byte)$version.getMajor(),(byte)$version.getMinor()));
-    }
-	
-	public MethodRegistry_$version.getMajor()_$version.getMinor()(ProtocolVersion pv)
-	{
-        super(pv);	
+    private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_$version.getMajor()_$version.getMinor()();
+    
+#set( $specificModel = $model.asSingleVersionModel() )    
+    
+    
+#set( $maxClassId = $specificModel.getMaximumClassId()+1 )    
+    private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[$maxClassId][];
+
+    public MethodRegistry_$version.getMajor()_$version.getMinor()()
+    {
+        this(new ProtocolVersion((byte)$version.getMajor(),(byte)$version.getMinor()));
+    }
+    
+    public MethodRegistry_$version.getMajor()_$version.getMinor()(ProtocolVersion pv)
+    {
+        super(pv);    
 #foreach( $amqpClass in $specificModel.getClassList() )
 #set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
 #set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
@@ -68,30 +69,30 @@ public class MethodRegistry_$version.get
 
 
 
-		// Register method body instance factories for the $amqpClassNameUpperCamel class.
+        // Register method body instance factories for the $amqpClassNameUpperCamel class.
 
-#set( $maxMethodId = $amqpClass.getMaximumMethodId()+1 )		
+#set( $maxMethodId = $amqpClass.getMaximumMethodId()+1 )        
         _factories[$amqpClass.getClassId()] = new AMQMethodBodyInstanceFactory[$maxMethodId];
-		
+        
 #foreach( $amqpMethod in $amqpClass.getMethodList() )
 #set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
 #set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
 #set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
         _factories[$amqpClass.getClassId()][$amqpMethod.getMethodId()] = ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl.getFactory(); 
-#end		
-		
+#end        
+        
 #end
-		
-		
-	}
+        
+        
+    }
 
 
-    public AMQMethodBody convertToBody(ByteBuffer in, long size)
-        throws AMQFrameDecodingException
+    public AMQMethodBody convertToBody(DataInputStream in, long size)
+        throws AMQFrameDecodingException, IOException
     {
-	    int classId = in.getUnsignedShort();
-		int methodId = in.getUnsignedShort();
-	
+        int classId = in.readUnsignedShort();
+        int methodId = in.readUnsignedShort();
+    
         AMQMethodBodyInstanceFactory bodyFactory;
         try
         {
@@ -137,15 +138,15 @@ public class MethodRegistry_$version.get
 
 
     public int getMaxClassId()
-	{
-	    return $specificModel.getMaximumClassId();
-	}
+    {
+        return $specificModel.getMaximumClassId();
+    }
     
     public int getMaxMethodId(int classId)
-	{
-        return _factories[classId].length - 1;	
-	}
-	
+    {
+        return _factories[classId].length - 1;    
+    }
+    
 
 
 #foreach( $amqpClass in $specificModel.getClassList() )
@@ -153,12 +154,12 @@ public class MethodRegistry_$version.get
 #set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
 #set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
 
-		
+        
 #foreach( $amqpMethod in $amqpClass.getMethodList() )
 #set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
 #set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
 #set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
-    public ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body create${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body(	
+    public ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body create${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body(    
 #foreach( $field in $amqpMethod.FieldList )
 #if( $velocityCount == $amqpMethod.getFieldList().size() )
                                 final $field.NativeType $field.Name
@@ -166,9 +167,9 @@ public class MethodRegistry_$version.get
                                 final $field.NativeType $field.Name,
 #end
 #end                            
-	                        )
+                            )
     {
-	    return new ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl(
+        return new ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl(
 #foreach( $field in $amqpMethod.FieldList )
 #if( $velocityCount == $amqpMethod.getFieldList().size() )
                                 $field.Name
@@ -176,18 +177,18 @@ public class MethodRegistry_$version.get
                                 $field.Name,
 #end
 #end                            
-		                    );
+                            );
     }
     
-#end		
-		
+#end        
+        
 #end
-		
-	
+        
+    
     public ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
     {
         return _protocolVersionConverter;
-    }	
+    }    
 
     
 }

Modified: qpid/branches/qpid-3346/qpid/java/ivy.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/ivy.xml?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/ivy.xml (original)
+++ qpid/branches/qpid-3346/qpid/java/ivy.xml Mon Sep 19 15:13:18 2011
@@ -18,7 +18,7 @@
 <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
 
-  <info organisation="org/apache" module="qpid" revision="0.10"/>
+  <info organisation="org/apache" module="qpid" revision="0.13"/>
 
   <publications xmlns:e="urn:ant.apache.org:ivy-extras">
     <artifact name="qpid-client" type="pom" ext="pom"/>

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ConfigurationManagement.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ConfigurationManagement.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ConfigurationManagement.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/management/ConfigurationManagement.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ConfigurationManagement.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ConfigurationManagement.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747869,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -3,4 +3,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -3,4 +3,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java:753219-753220,753253,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java:1144319-1172654

Modified: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java (original)
+++ qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java Mon Sep 19 15:13:18 2011
@@ -53,25 +53,6 @@ public interface UserManagement
 
     //********** Operations *****************//
     /**
-     * set password for user.
-     * 
-     * Since Qpid JMX API 1.2 this operation expects plain text passwords to be provided. Prior to this, MD5 hashed passwords were supplied.
-     * 
-     * @deprecated since Qpid JMX API 1.7
-     *
-     * @param username The username for which the password is to be set
-     * @param password The password for the user
-     *
-     * @return The result of the operation
-     */
-    @Deprecated
-    @MBeanOperation(name = "setPassword", description = "Set password for user.",
-                    impact = MBeanOperationInfo.ACTION)
-    boolean setPassword(@MBeanOperationParameter(name = "username", description = "Username")String username,
-                        //NOTE: parameter name was changed to 'passwd' in Qpid JMX API 1.7 to protect against older, incompatible management clients
-                        @MBeanOperationParameter(name = "passwd", description = "Password")char[] password);
-
-    /**
      * Set password for a given user.
      * 
      * @since Qpid JMX API 1.7
@@ -85,85 +66,11 @@ public interface UserManagement
                     impact = MBeanOperationInfo.ACTION)
     boolean setPassword(@MBeanOperationParameter(name = "username", description = "Username")String username,
                         @MBeanOperationParameter(name = "password", description = "Password")String password);
-    
-    /**
-     * Set rights for users with given details.
-     * Since Qpid JMX API 2.3 all invocations will cause an exception to be thrown
-     * as access rights can no longer be maintain via this interface.
-     * 
-     * @deprecated since Qpid JMX API 2.3
-     *
-     * @param username The username to create
-     * @param read     The set of permission to give the new user
-     * @param write    The set of permission to give the new user
-     * @param admin    The set of permission to give the new user
-     *
-     * @return The result of the operation
-     */
-    @Deprecated
-    @MBeanOperation(name = "setRights", description = "Set access rights for user.",
-                    impact = MBeanOperationInfo.ACTION)
-    boolean setRights(@MBeanOperationParameter(name = "username", description = "Username")String username,
-                      @MBeanOperationParameter(name = "read", description = "Administration read")boolean read,
-                      @MBeanOperationParameter(name = "readAndWrite", description = "Administration write")boolean write,
-                      @MBeanOperationParameter(name = "admin", description = "Administration rights")boolean admin);
-
-    /**
-     * Create users with given details.
-     * Since Qpid JMX API 2.3 if the user passes true for parameters read, write, or admin, a
-     * exception will be thrown as access rights can no longer be maintain via this interface.
-     *
-     * Since Qpid JMX API 1.2 this operation expects plain text passwords to be provided. Prior to this, MD5 hashed passwords were supplied.
-     * 
-     * @deprecated since Qpid JMX API 1.7
-     * 
-     * @param username The username to create
-     * @param password The password for the user
-     * @param read     The set of permission to give the new user
-     * @param write    The set of permission to give the new user
-     * @param admin    The set of permission to give the new user
-     *
-     * @return true if the user was created successfully, or false otherwise
-     */
-    @Deprecated
-    @MBeanOperation(name = "createUser", description = "Create new user from system.",
-                    impact = MBeanOperationInfo.ACTION)
-    boolean createUser(@MBeanOperationParameter(name = "username", description = "Username")String username,
-                       //NOTE: parameter name was changed to 'passwd' in Qpid JMX API 1.7 to protect against older, incompatible management clients
-                       @MBeanOperationParameter(name = "passwd", description = "Password")char[] password,
-                       @MBeanOperationParameter(name = "read", description = "Administration read")boolean read,
-                       @MBeanOperationParameter(name = "readAndWrite", description = "Administration write")boolean write,
-                       @MBeanOperationParameter(name = "admin", description = "Administration rights")boolean admin);
-
-    /**
-     * Create users with given details.
-     * Since Qpid JMX API 2.3 if the user passes true for parameters read, write, or admin, a
-     * exception will be thrown as access rights can no longer be maintain via this interface.
-     * 
-     * @deprecated since Qpid JMX API 2.3
-     * @since Qpid JMX API 1.7
-     * 
-     * @param username The username to create
-     * @param password The password for the user
-     * @param read     The set of permission to give the new user
-     * @param write    The set of permission to give the new user
-     * @param admin    The set of permission to give the new user
-     *
-     * @return true if the user was created successfully, or false otherwise
-     */
-    @Deprecated
-    @MBeanOperation(name = "createUser", description = "Create a new user.",
-                    impact = MBeanOperationInfo.ACTION)
-    boolean createUser(@MBeanOperationParameter(name = "username", description = "Username")String username,
-                       @MBeanOperationParameter(name = "password", description = "Password")String password,
-                       @MBeanOperationParameter(name = "read", description = "Administration read")boolean read,
-                       @MBeanOperationParameter(name = "readAndWrite", description = "Administration write")boolean write,
-                       @MBeanOperationParameter(name = "admin", description = "Administration rights")boolean admin);
 
     /**
      * Create users with given details.
      * 
-     * @since Qpid JMX API 2.3
+     * @since Qpid JMX API 2.3 / 1.12
      * 
      * @param username The username to create
      * @param password The password for the user
@@ -188,9 +95,11 @@ public interface UserManagement
 
 
     /**
-     * Reload the date from disk
+     * Reload the user data
      * 
-     * Since Qpid JMX API 1.2 this operation reloads the password and authorisation files. Prior to this, only the authorisation file was reloaded.
+     * Since Qpid JMX API 2.3 / 1.12 this operation reloads only the password data.
+     * Since Qpid JMX API 1.2 but prior to 2.3 / 1.12 this operation reloads the password and authorisation files.
+     * Prior to 1.2, only the authorisation file was reloaded.
      *
      * @return The result of the operation
      */
@@ -201,7 +110,7 @@ public interface UserManagement
     /**
      * View users returns all the users that are currently available to the system.
      * 
-     * Since Qpid JMX API 2.3 the items that corresponded to read, write and admin flags 
+     * Since Qpid JMX API 2.3 / 1.12 the items that corresponded to read, write and admin flags
      * are deprecated and always return false.
      *
      * @return a table of users data (Username, read, write, admin)

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/UserManagement.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -3,4 +3,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -3,4 +3,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -3,4 +3,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -3,4 +3,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -3,4 +3,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java:1061302-1072333
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java:1156188
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/eclipse-plugin/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src:805429-821809
 /qpid/branches/jmx_mc_gsoc09/qpid/java/management/eclipse-plugin/src:788755
 /qpid/branches/qpid-2935/qpid/java/management/eclipse-plugin/src:1061302-1072333
-/qpid/trunk/qpid/java/management/eclipse-plugin/src:1156188
+/qpid/trunk/qpid/java/management/eclipse-plugin/src:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java:1061302-1072333
-/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java:1156188
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java:1061302-1072333
-/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java:1156188
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java:1061302-1072333
-/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java:1156188
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java:1144319-1172654

Propchange: qpid/branches/qpid-3346/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java:1061302-1072333
-/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java:1156188
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java:1144319-1172654

Modified: qpid/branches/qpid-3346/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/users/UserManagementTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/users/UserManagementTabControl.java?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/users/UserManagementTabControl.java (original)
+++ qpid/branches/qpid-3346/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/users/UserManagementTabControl.java Mon Sep 19 15:13:18 2011
@@ -37,7 +37,6 @@ import javax.management.openmbean.Tabula
 import org.apache.qpid.management.ui.ApiVersion;
 import org.apache.qpid.management.ui.ApplicationRegistry;
 import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.common.mbeans.UserManagement;
 import org.apache.qpid.management.ui.jmx.JMXManagedObject;
 import org.apache.qpid.management.ui.jmx.MBeanUtility;
 import org.apache.qpid.management.ui.views.TabControl;
@@ -83,7 +82,7 @@ public class UserManagementTabControl ex
     private TableViewer _tableViewer = null;
 
     private TabularDataSupport _userDetails = null;
-    private UserManagement _ummb;
+    private LegacySupportingUserManagement _ummb;
     private ApiVersion _ApiVersion;
     
     public UserManagementTabControl(TabFolder tabFolder, JMXManagedObject mbean, MBeanServerConnection mbsc)
@@ -91,9 +90,9 @@ public class UserManagementTabControl ex
         super(tabFolder);
         _mbean = mbean;
         _ApiVersion = ApplicationRegistry.getServerRegistry(mbean).getManagementApiVersion();
-        _ummb = (UserManagement)
+        _ummb = (LegacySupportingUserManagement)
                 MBeanServerInvocationHandler.newProxyInstance(mbsc, mbean.getObjectName(),
-                                                            UserManagement.class, false);
+                                                            LegacySupportingUserManagement.class, false);
         _toolkit = new FormToolkit(_tabFolder.getDisplay());
         _form = _toolkit.createScrolledForm(_tabFolder);
         _form.getBody().setLayout(new GridLayout());
@@ -171,6 +170,13 @@ public class UserManagementTabControl ex
         
         String[] titles = { "Username", "JMX Management Rights" };
         int[] bounds = { 310, 200 };
+        if(!settingManagementRightsSupported())
+        {
+            //Since Qpid JMX API 2.3 / 1.12 only Username is used
+            titles = new String[]{ "Username"};
+            bounds = new int[]{ 310 };
+        }
+
         for (int i = 0; i < titles.length; i++) 
         {
             final int index = i;
@@ -214,7 +220,16 @@ public class UserManagementTabControl ex
         
         Composite buttonsComposite = _toolkit.createComposite(tableComposite);
         gridData = new GridData(SWT.FILL, SWT.TOP, false, false);
-        gridData.heightHint = 165;
+        if(!settingManagementRightsSupported())
+        {
+            //The 'Set Rights' button is not shown from Qpid JMX API 2.3 / 1.12
+            //onward, provide less space
+            gridData.heightHint = 135;
+        }
+        else
+        {
+            gridData.heightHint = 165;
+        }
         buttonsComposite.setLayoutData(gridData);
         buttonsComposite.setLayout(new GridLayout());
         
@@ -292,14 +307,14 @@ public class UserManagementTabControl ex
                     
                     if (returnValue  == InputDialog.OK)
                     {
-                        char[] password = id.getValue().toCharArray();
+                        char[] passwordArray = id.getValue().toCharArray();
 
                         // Qpid JMX API 1.1 and below expects the password to be sent as a hashed value.
                         if (_ApiVersion.lessThanOrEqualTo(1,1))
                         {
                             try
                             {
-                                password = ViewUtility.getHash(id.getValue());
+                                passwordArray = ViewUtility.getHash(id.getValue());
                             }
                             catch (Exception hashException)
                             {
@@ -312,7 +327,18 @@ public class UserManagementTabControl ex
 
                         try
                         {
-                            boolean result = _ummb.setPassword(user, password);
+                            boolean result;
+
+                            //For Qpid JMX API >=1.7 use String based method instead of older char[] based method.
+                            if(_ApiVersion.greaterThanOrEqualTo(1, 7))
+                            {
+                                result = _ummb.setPassword(user, id.getValue());
+                            }
+                            else
+                            {
+                                result = _ummb.setPassword(user, passwordArray);
+                            }
+
                             ViewUtility.operationResultFeedback(result, "Updated user password", "Failed to update user password");
                         }
                         catch(Exception e2)
@@ -324,25 +350,34 @@ public class UserManagementTabControl ex
                 }
             }
         });
-        
-        final Button setRightsButton = _toolkit.createButton(buttonsComposite, "Set Rights ...", SWT.PUSH);
-        gridData = new GridData(SWT.CENTER, SWT.BOTTOM, false, false);
-        gridData.widthHint = 125;
-        setRightsButton.setLayoutData(gridData);
-        setRightsButton.setEnabled(false);
-        setRightsButton.addSelectionListener(new SelectionAdapter()
+
+        final Button setRightsButton;
+        if(!settingManagementRightsSupported())
         {
-            public void widgetSelected(SelectionEvent e)
+            //The 'Set Rights' button is not used from Qpid JMX API 2.3 / 1.12 onward
+            setRightsButton = null;
+        }
+        else
+        {
+            setRightsButton = _toolkit.createButton(buttonsComposite, "Set Rights ...", SWT.PUSH);
+            gridData = new GridData(SWT.CENTER, SWT.BOTTOM, false, false);
+            gridData.widthHint = 125;
+            setRightsButton.setLayoutData(gridData);
+            setRightsButton.setEnabled(false);
+            setRightsButton.addSelectionListener(new SelectionAdapter()
             {
-                int selectionIndex = _table.getSelectionIndex();
-
-                if (selectionIndex != -1)
+                public void widgetSelected(SelectionEvent e)
                 {
-                    setRights(setRightsButton.getShell());
+                    int selectionIndex = _table.getSelectionIndex();
+
+                    if (selectionIndex != -1)
+                    {
+                        setRights(setRightsButton.getShell());
+                    }
                 }
-            }
-        });
-        
+            });
+        }
+
         _tableViewer.addSelectionChangedListener(new ISelectionChangedListener(){
             public void selectionChanged(SelectionChangedEvent evt)
             {
@@ -351,14 +386,20 @@ public class UserManagementTabControl ex
                 if (selectionIndex == -1)
                 {
                     deleteUsersButton.setEnabled(false);
-                    setRightsButton.setEnabled(false);
                     setPasswordButton.setEnabled(false);
+                    if(setRightsButton != null)
+                    {
+                        setRightsButton.setEnabled(false);
+                    }
                     return;
                 }
                 else
                 {
                     deleteUsersButton.setEnabled(true);
-                    setRightsButton.setEnabled(true);
+                    if(setRightsButton != null)
+                    {
+                        setRightsButton.setEnabled(true);
+                    }
                 }
                 
                 if (_table.getSelectionCount() > 1)
@@ -386,11 +427,17 @@ public class UserManagementTabControl ex
             //this only reloaded the JMX rights file before Qpid JMX API 1.2
             _toolkit.createLabel(miscGroup, " Loads the current management rights file from disk");
         }
-        else
+        else if(settingManagementRightsSupported())
         {
-            //since Qpid JMX API 1.2 it also reloads the password file
+            //from Qpid JMX API 1.2 to 2.3 / 1.12 it also reloads the password file
             _toolkit.createLabel(miscGroup, " Loads the current password and management rights files from disk");
         }
+        else
+        {
+            //since Qpid JMX API 2.3 / 1.12 it only reloads the password file
+            _toolkit.createLabel(miscGroup, " Loads the current password data");
+        }
+
         reloadUserDetails.addSelectionListener(new SelectionAdapter()
         {
             public void widgetSelected(SelectionEvent e)
@@ -453,7 +500,7 @@ public class UserManagementTabControl ex
             {
                 case 0 : // username column 
                     return (String) ((CompositeData) element).get(USERNAME);
-                case 1 : // rights column 
+                case 1 : // rights column (used for API < 2.3 / 1.12)
                     return classifyUserRights((CompositeData) element);
                 default :
                     return "-";
@@ -510,11 +557,11 @@ public class UserManagementTabControl ex
             int comparison = 0;
             switch(column)
             {
-                case 0:
+                case 0: //username column
                     comparison = String.valueOf(user1.get(USERNAME)).compareTo(
                                                 String.valueOf(user2.get(USERNAME)));
                     break;
-                case 1:
+                case 1: // rights column (used for API < 2.3 / 1.12)
                     comparison = classifyUserRights(user1).compareTo(classifyUserRights(user2));
                     break;
                 default:
@@ -555,7 +602,12 @@ public class UserManagementTabControl ex
     
     private void setRights(final Shell parent)
     {
-        
+        if(!settingManagementRightsSupported())
+        {
+            throw new UnsupportedOperationException("Setting management rights" +
+                        " is not supported using this version of the broker management API: " + (_ApiVersion));
+        }
+
         int selectionIndex = _table.getSelectionIndex();
 
         if (selectionIndex == -1)
@@ -699,6 +751,13 @@ public class UserManagementTabControl ex
         
         shell.open();
     }
+
+    protected boolean settingManagementRightsSupported()
+    {
+        //setting management access rights was supported until Qpid JMX API 1.12 / 2.3
+        return _ApiVersion.lessThan(1,12) ||
+                (_ApiVersion.greaterThanOrEqualTo(2, 0) && _ApiVersion.lessThan(2,3));
+    }
     
     private void addUser(final Shell parent)
     {
@@ -706,7 +765,8 @@ public class UserManagementTabControl ex
         
         Composite usernameComposite = _toolkit.createComposite(shell, SWT.NONE);
         usernameComposite.setBackground(shell.getBackground());
-        usernameComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+        GridData usernameCompGridData = new GridData(SWT.FILL, SWT.TOP, true, false);
+        usernameComposite.setLayoutData(usernameCompGridData);
         usernameComposite.setLayout(new GridLayout(2,false));
         
         _toolkit.createLabel(usernameComposite,"Username:").setBackground(shell.getBackground());
@@ -715,28 +775,45 @@ public class UserManagementTabControl ex
         
         Composite passwordComposite = _toolkit.createComposite(shell, SWT.NONE);
         passwordComposite.setBackground(shell.getBackground());
-        passwordComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+        GridData passwordCompGridData = new GridData(SWT.FILL, SWT.TOP, true, false);
+        passwordComposite.setLayoutData(passwordCompGridData);
         passwordComposite.setLayout(new GridLayout(2,false));
         
         _toolkit.createLabel(passwordComposite,"Password:").setBackground(shell.getBackground());
         final Text passwordText = new Text(passwordComposite, SWT.BORDER | SWT.PASSWORD);
         passwordText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-        
-        Group buttonGroup = new Group(shell, SWT.NONE);
-        buttonGroup.setText("JMX Management Rights");
-        buttonGroup.setBackground(shell.getBackground());
-        buttonGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-        buttonGroup.setLayout(new GridLayout(4,false));
 
-        final Button noneButton = new Button(buttonGroup, SWT.RADIO);
-        noneButton.setText("No Access");
-        noneButton.setSelection(true);
-        final Button readButton = new Button(buttonGroup, SWT.RADIO);
-        readButton.setText("Read Only");
-        final Button writeButton = new Button(buttonGroup, SWT.RADIO);
-        writeButton.setText("Read + Write");
-        final Button adminButton = new Button(buttonGroup, SWT.RADIO);
-        adminButton.setText("Admin");
+        final Button readButton;
+        final Button writeButton;
+        final Button adminButton;
+        if(settingManagementRightsSupported())
+        {
+            Group buttonGroup = new Group(shell, SWT.NONE);
+            buttonGroup.setText("JMX Management Rights");
+            buttonGroup.setBackground(shell.getBackground());
+            buttonGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+            buttonGroup.setLayout(new GridLayout(4,false));
+
+            final Button noneButton = new Button(buttonGroup, SWT.RADIO);
+            noneButton.setText("No Access");
+            noneButton.setSelection(true);
+            readButton = new Button(buttonGroup, SWT.RADIO);
+            readButton.setText("Read Only");
+            writeButton = new Button(buttonGroup, SWT.RADIO);
+            writeButton.setText("Read + Write");
+            adminButton = new Button(buttonGroup, SWT.RADIO);
+            adminButton.setText("Admin");
+        }
+        else
+        {
+            readButton = null;
+            writeButton = null;
+            adminButton = null;
+            //The lack of rights settings will cause the dialog to,
+            //shrink so add width hints to the other components
+            passwordCompGridData.widthHint = 350;
+            usernameCompGridData.widthHint = 350;
+        }
 
         Composite okCancelButtonsComp = _toolkit.createComposite(shell);
         okCancelButtonsComp.setBackground(shell.getBackground());
@@ -784,22 +861,36 @@ public class UserManagementTabControl ex
                         return;
                     }
                 }
-                
-                boolean read = readButton.getSelection();
-                boolean write = writeButton.getSelection();
-                boolean admin = adminButton.getSelection();
+
+                //read the access rights selections if required
+                boolean read = false;
+                boolean write = false;
+                boolean admin = false;
+                if(settingManagementRightsSupported())
+                {
+                    read = readButton.getSelection();
+                    write = writeButton.getSelection();
+                    admin = adminButton.getSelection();
+                }
                 
                 shell.dispose();
                 try
                 {
                     boolean result = false;
-                    // If we have Qpid JMX API 1.7 or above, use newer createUser method with String based password.
-                    if (_ApiVersion.greaterThanOrEqualTo(1,7))
+
+                    if (!settingManagementRightsSupported())
+                    {
+                        // If we have Qpid JMX API 2.3 / 1.12 or above, use newer createUser method without rights parameters.
+                        result = _ummb.createUser(username, password);
+                    }
+                    else if (_ApiVersion.greaterThanOrEqualTo(1,7))
                     {
+                        // If we have Qpid JMX API 1.7 or above, use newer createUser method with String based password.
                         result = _ummb.createUser(username, password, read, write, admin);
                     }
                     else
                     {
+                        // Else we have Qpid JMX API 1.6 or below, use older createUser method with char[] based password.
                         result = _ummb.createUser(username, passwordChars, read, write, admin);
                     }
                     

Propchange: qpid/branches/qpid-3346/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc:805429-821809
 /qpid/branches/qpid-2935/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc:1061302-1072333
-/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc:1156188
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc:1144319-1172654

Modified: qpid/branches/qpid-3346/qpid/java/module.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/module.xml?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/module.xml (original)
+++ qpid/branches/qpid-3346/qpid/java/module.xml Mon Sep 19 15:13:18 2011
@@ -281,7 +281,8 @@
     <javac target="${java.target}" source="${java.source}"
            destdir="${module.test.classes}" debug="on"
            deprecation="${javac.deprecation}"
-           srcdir="${module.test.src}">
+           srcdir="${module.test.src}"
+           includeantruntime="false">
       <classpath refid="module.test.path"/>
     </javac>
 

Modified: qpid/branches/qpid-3346/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java (original)
+++ qpid/branches/qpid-3346/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java Mon Sep 19 15:13:18 2011
@@ -20,9 +20,6 @@
  */
 package org.apache.qpid.client.message;
 
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.SimpleByteBufferAllocator;
-
 import javax.jms.JMSException;
 import javax.jms.Session;
 import javax.jms.ObjectMessage;

Modified: qpid/branches/qpid-3346/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java (original)
+++ qpid/branches/qpid-3346/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java Mon Sep 19 15:13:18 2011
@@ -21,8 +21,11 @@
 package org.apache.qpid.config;
 
 import org.apache.qpid.client.AMQConnectionFactory;
+import org.apache.qpid.client.AMQConnectionURL;
 import org.apache.qpid.config.ConnectionFactoryInitialiser;
 import org.apache.qpid.config.ConnectorConfig;
+import org.apache.qpid.jms.ConnectionURL;
+import org.apache.qpid.url.URLSyntaxException;
 
 import javax.jms.ConnectionFactory;
 
@@ -30,6 +33,15 @@ class AMQConnectionFactoryInitialiser im
 {
     public ConnectionFactory getFactory(ConnectorConfig config)
     {
-        return new AMQConnectionFactory(config.getHost(), config.getPort(), "/test_path");
+        try
+        {
+            final ConnectionURL connectionUrl = new AMQConnectionURL(ConnectionURL.AMQ_PROTOCOL + 
+                    "://guest:guest@/test_path?brokerlist='tcp://" + config.getHost() + ":" + config.getPort() + "'");
+            return new AMQConnectionFactory(connectionUrl);
+        }
+        catch (URLSyntaxException e)
+        {
+            throw new RuntimeException("Problem building URL", e);
+        }
     }
 }

Modified: qpid/branches/qpid-3346/qpid/java/resources/NOTICE
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/resources/NOTICE?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/resources/NOTICE (original)
+++ qpid/branches/qpid-3346/qpid/java/resources/NOTICE Mon Sep 19 15:13:18 2011
@@ -10,13 +10,6 @@ available from
 
    http://www.slf4j.org/
 
-Concurrency utlitity classes are provided by the backport-util-concurrent
-library package, which is open source software, written by
-Dawid Kurzyniec, and copyright by Distributed Computing Laboratory,
-Emory University.  The original software is available from
-
-   http://dcl.mathcs.emory.edu/util/backport-util-concurrent/
-
 Data compression support is provided by the JZLib library package,
 which is open source software, written by JCraft, and copyright
 by JCraft.  The original software is available from

Modified: qpid/branches/qpid-3346/qpid/java/systests/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/systests/build.xml?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/systests/build.xml (original)
+++ qpid/branches/qpid-3346/qpid/java/systests/build.xml Mon Sep 19 15:13:18 2011
@@ -22,7 +22,7 @@ nn - or more contributor license agreeme
     <property name="module.depends" value="client management/tools/qpid-cli management/common broker broker/test common common/test junit-toolkit"/>
     <property name="module.test.src" location="src/main/java"/>
     <property name="module.test.excludes"
-              value="**/TTLTest.java,**/DropInTest.java,**/TestClientControlledTest.java"/>
+              value="**/DropInTest.java,**/TestClientControlledTest.java"/>
 
     <import file="../module.xml"/>
 

Modified: qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-firewall-2.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-firewall-2.xml?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-firewall-2.xml (original)
+++ qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-firewall-2.xml Mon Sep 19 15:13:18 2011
@@ -42,13 +42,6 @@
     </connector>
     <management>
         <enabled>false</enabled>
-        <jmxport>8999</jmxport>
-        <ssl>
-            <enabled>false</enabled>
-            <!-- Update below path to your keystore location, eg ${conf}/qpid.keystore  -->
-            <keyStorePath>${prefix}/../test-profiles/test_resources/ssl/keystore.jks</keyStorePath>
-            <keyStorePassword>password</keyStorePassword>
-        </ssl>
     </management>
     <advanced>
         <filterchain enableExecutorPool="true"/>
@@ -61,10 +54,8 @@
     </advanced>
 
     <security>
-        <principal-databases>
-            <!-- Example use of Base64 encoded MD5 hashes for authentication via CRAM-MD5-Hashed -->
+        <pd-auth-manager>
             <principal-database>
-                <name>passwordfile</name>
                 <class>org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase</class>
                 <attributes>
                     <attribute>
@@ -73,7 +64,7 @@
                     </attribute>
                 </attributes>
             </principal-database>
-        </principal-databases>
+        </pd-auth-manager>
 
         <msg-auth>false</msg-auth>
         

Modified: qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-firewall-3.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-firewall-3.xml?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-firewall-3.xml (original)
+++ qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-firewall-3.xml Mon Sep 19 15:13:18 2011
@@ -42,13 +42,6 @@
     </connector>
     <management>
         <enabled>false</enabled>
-        <jmxport>8999</jmxport>
-        <ssl>
-            <enabled>false</enabled>
-            <!-- Update below path to your keystore location, eg ${conf}/qpid.keystore  -->
-            <keyStorePath>${prefix}/../test-profiles/test_resources/ssl/keystore.jks</keyStorePath>
-            <keyStorePassword>password</keyStorePassword>
-        </ssl>
     </management>
     <advanced>
         <filterchain enableExecutorPool="true"/>
@@ -61,10 +54,8 @@
     </advanced>
 
     <security>
-        <principal-databases>
-            <!-- Example use of Base64 encoded MD5 hashes for authentication via CRAM-MD5-Hashed -->
+        <pd-auth-manager>
             <principal-database>
-                <name>passwordfile</name>
                 <class>org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase</class>
                 <attributes>
                     <attribute>
@@ -73,7 +64,7 @@
                     </attribute>
                 </attributes>
             </principal-database>
-        </principal-databases>
+        </pd-auth-manager>
 
         <msg-auth>false</msg-auth>
         

Modified: qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-settings.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-settings.xml?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-settings.xml (original)
+++ qpid/branches/qpid-3346/qpid/java/systests/etc/config-systests-settings.xml Mon Sep 19 15:13:18 2011
@@ -20,11 +20,20 @@
  -
  -->
 <broker>
+    <connector>
+        <ssl>
+            <port>15671</port>
+            <enabled>false</enabled>
+            <sslOnly>false</sslOnly>
+            <keystorePath>${QPID_HOME}/../test-profiles/test_resources/ssl/java_broker_keystore.jks</keystorePath>
+            <keystorePassword>password</keystorePassword>
+        </ssl>
+    </connector>
     <management>
         <enabled>false</enabled>
         <ssl>
             <enabled>false</enabled>
-            <keyStorePath>${QPID_HOME}/../test-profiles/test_resources/ssl/keystore.jks</keyStorePath>
+            <keyStorePath>${QPID_HOME}/../test-profiles/test_resources/ssl/java_broker_keystore.jks</keyStorePath>
             <keyStorePassword>password</keyStorePassword>
         </ssl>
     </management>

Modified: qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java (original)
+++ qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java Mon Sep 19 15:13:18 2011
@@ -31,62 +31,72 @@ import org.apache.qpid.test.utils.QpidBr
 import org.apache.qpid.transport.Connection;
 
 public class SSLTest extends QpidBrokerTestCase
-{      
-    
+{
+    private static final String KEYSTORE = TEST_RESOURCES_DIR + "/ssl/java_client_keystore.jks";
+    private static final String KEYSTORE_PASSWORD = "password";
+    private static final String TRUSTSTORE = TEST_RESOURCES_DIR + "/ssl/java_client_truststore.jks";
+    private static final String TRUSTSTORE_PASSWORD = "password";
+    private static final String CERT_ALIAS_APP1 = "app1";
+    private static final String CERT_ALIAS_APP2 = "app2";
+
     @Override
     protected void setUp() throws Exception
     {
-        System.setProperty("javax.net.debug", "ssl");
+        if(isJavaBroker())
+        {
+            setTestClientSystemProperty("profile.use_ssl", "true");
+            setConfigurationProperty("connector.ssl.enabled", "true");
+            setConfigurationProperty("connector.ssl.sslOnly", "true");
+        }
+
+        // set the ssl system properties
+        setSystemProperty("javax.net.ssl.keyStore", KEYSTORE);
+        setSystemProperty("javax.net.ssl.keyStorePassword", KEYSTORE_PASSWORD);
+        setSystemProperty("javax.net.ssl.trustStore", TRUSTSTORE);
+        setSystemProperty("javax.net.ssl.trustStorePassword", TRUSTSTORE_PASSWORD);
+        setSystemProperty("javax.net.debug", "ssl");
         super.setUp();
     }
 
-    @Override
-    protected void tearDown() throws Exception
-    {
-        System.setProperty("javax.net.debug", "");
-        super.tearDown();
-    }
-        
-    public void testCreateSSLContextFromConnectionURLParams()
+    public void testCreateSSLConnectionUsingConnectionURLParams() throws Exception
     {
         if (Boolean.getBoolean("profile.use_ssl"))
-        {   
+        {
+            // Clear the ssl system properties
+            setSystemProperty("javax.net.ssl.keyStore", null);
+            setSystemProperty("javax.net.ssl.keyStorePassword", null);
+            setSystemProperty("javax.net.ssl.trustStore", null);
+            setSystemProperty("javax.net.ssl.trustStorePassword", null);
+            
             String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:%s" +
             "?ssl='true'&ssl_verify_hostname='true'" + 
             "&key_store='%s'&key_store_password='%s'" +
             "&trust_store='%s'&trust_store_password='%s'" +
             "'";
             
-            String keyStore = System.getProperty("javax.net.ssl.keyStore");
-            String keyStorePass = System.getProperty("javax.net.ssl.keyStorePassword");
-            String trustStore = System.getProperty("javax.net.ssl.trustStore");
-            String trustStorePass = System.getProperty("javax.net.ssl.trustStorePassword");
-            
-            url = String.format(url,System.getProperty("test.port.ssl"),
-                    keyStore,keyStorePass,trustStore,trustStorePass);
-            
-            // temporarily set the trust/key store jvm args to something else
-            // to ensure we only read from the connection URL param.
-            System.setProperty("javax.net.ssl.trustStore","fessgsdgd");
-            System.setProperty("javax.net.ssl.trustStorePassword","fessgsdgd");
-            System.setProperty("javax.net.ssl.keyStore","fessgsdgd");
-            System.setProperty("javax.net.ssl.keyStorePassword","fessgsdgd");
-            try
-            {
-                AMQConnection con = new AMQConnection(url);
-                Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE); 
-            }
-            catch (Exception e)
-            {
-                fail("SSL Connection should be successful");
-            }
-            finally
-            {
-                System.setProperty("javax.net.ssl.trustStore",trustStore);
-                System.setProperty("javax.net.ssl.trustStorePassword",trustStorePass);
-                System.setProperty("javax.net.ssl.keyStore",keyStore);
-                System.setProperty("javax.net.ssl.keyStorePassword",keyStorePass);
-            }
+            url = String.format(url,QpidBrokerTestCase.DEFAULT_SSL_PORT,
+                    KEYSTORE,KEYSTORE_PASSWORD,TRUSTSTORE,TRUSTSTORE_PASSWORD);
+            
+            AMQConnection con = new AMQConnection(url);
+            assertNotNull("connection should be successful", con);
+            Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE); 
+            assertNotNull("create session should be successful", ssn);
+        }        
+    }
+
+    public void testCreateSSLConnectionUsingSystemProperties() throws Exception
+    {
+        if (Boolean.getBoolean("profile.use_ssl"))
+        {
+
+            String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:%s?ssl='true''";
+
+            url = String.format(url,QpidBrokerTestCase.DEFAULT_SSL_PORT);
+            
+            AMQConnection con = new AMQConnection(url);
+            assertNotNull("connection should be successful", con);
+            Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE); 
+            assertNotNull("create session should be successful", ssn);
         }        
     }
 
@@ -95,8 +105,8 @@ public class SSLTest extends QpidBrokerT
         if (Boolean.getBoolean("profile.use_ssl"))
         {
             String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:" + 
-            System.getProperty("test.port.ssl") + 
-            "?ssl='true'&ssl_cert_alias='app1''";
+            QpidBrokerTestCase.DEFAULT_SSL_PORT + 
+            "?ssl='true'&ssl_cert_alias='" + CERT_ALIAS_APP1 + "''";
             
             AMQTestConnection_0_10 con = new AMQTestConnection_0_10(url);      
             Connection transportCon = con.getConnection();
@@ -105,8 +115,8 @@ public class SSLTest extends QpidBrokerT
             con.close();
             
             url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:" + 
-            System.getProperty("test.port.ssl") + 
-            "?ssl='true'&ssl_cert_alias='app2''";
+            QpidBrokerTestCase.DEFAULT_SSL_PORT + 
+            "?ssl='true'&ssl_cert_alias='" + CERT_ALIAS_APP2 + "''";
             
             con = new AMQTestConnection_0_10(url);      
             transportCon = con.getConnection();
@@ -116,12 +126,12 @@ public class SSLTest extends QpidBrokerT
         }        
     }
     
-    public void testVerifyHostName()
+    public void testVerifyHostNameWithIncorrectHostname()
     {
         if (Boolean.getBoolean("profile.use_ssl"))
         {
             String url = "amqp://guest:guest@test/?brokerlist='tcp://127.0.0.1:" + 
-            System.getProperty("test.port.ssl") + 
+            QpidBrokerTestCase.DEFAULT_SSL_PORT + 
             "?ssl='true'&ssl_verify_hostname='true''";
             
             try
@@ -140,42 +150,53 @@ public class SSLTest extends QpidBrokerT
         }        
     }
     
-    public void testVerifyLocalHost()
+    public void testVerifyLocalHost() throws Exception
     {
         if (Boolean.getBoolean("profile.use_ssl"))
         {
             String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:" + 
-            System.getProperty("test.port.ssl") + 
+            QpidBrokerTestCase.DEFAULT_SSL_PORT + 
             "?ssl='true'&ssl_verify_hostname='true''";
-            
-            try
-            {
-                AMQConnection con = new AMQConnection(url);
-            }
-            catch (Exception e)
-            {
-                fail("Hostname verification should succeed");
-            }            
-        }        
+
+            AMQConnection con = new AMQConnection(url);
+            assertNotNull("connection should have been created", con); 
+        }
     }
     
-    public void testVerifyLocalHostLocalDomain()
+    public void testVerifyLocalHostLocalDomain() throws Exception
     {
         if (Boolean.getBoolean("profile.use_ssl"))
         {
             String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost.localdomain:" + 
-            System.getProperty("test.port.ssl") + 
+            QpidBrokerTestCase.DEFAULT_SSL_PORT + 
             "?ssl='true'&ssl_verify_hostname='true''";
+
+            AMQConnection con = new AMQConnection(url);
+            assertNotNull("connection should have been created", con);
+        }        
+    }
+
+    public void testCreateSSLConnectionUsingConnectionURLParamsTrustStoreOnly() throws Exception
+    {
+        if (Boolean.getBoolean("profile.use_ssl"))
+        {
+            // Clear the ssl system properties
+            setSystemProperty("javax.net.ssl.keyStore", null);
+            setSystemProperty("javax.net.ssl.keyStorePassword", null);
+            setSystemProperty("javax.net.ssl.trustStore", null);
+            setSystemProperty("javax.net.ssl.trustStorePassword", null);
             
-            try
-            {
-                AMQConnection con = new AMQConnection(url);
-            }
-            catch (Exception e)
-            {
-                fail("Hostname verification should succeed");
-            }
-            
+            String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:%s" +
+            "?ssl='true'&ssl_verify_hostname='true'" + 
+            "&trust_store='%s'&trust_store_password='%s'" +
+            "'";
+
+            url = String.format(url,QpidBrokerTestCase.DEFAULT_SSL_PORT, TRUSTSTORE,TRUSTSTORE_PASSWORD);
+
+            AMQConnection con = new AMQConnection(url);
+            assertNotNull("connection should be successful", con);
+            Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE); 
+            assertNotNull("create session should be successful", ssn);
         }        
     }
 }

Modified: qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java (original)
+++ qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java Mon Sep 19 15:13:18 2011
@@ -68,61 +68,6 @@ public class ManagementActorLoggingTest 
 
     /**
      * Description:
-     * When a JMX Management connection is made then this will be logged out.
-     *
-     * Input:
-     *
-     * 1. Running Broker
-     * 2. Connect Management client via JMX
-     * Output:
-     *
-     * <date> MNG-1007 : Open <user>
-     *
-     * Validation Steps:
-     * 1. The MNG ID is correct
-     * 2. The user is correct
-     *
-     * On connection close a MNG-1008 is expected
-     *
-     * * <date> MNG-1008 : Close
-     *
-     * Validation Steps:
-     * 1. The MNG ID is correct
-     *
-     * @throws java.io.IOException - if there is a problem reseting the log monitor
-     */
-    public void testJMXManagementConsoleConnection() throws IOException
-    {
-        List<String> results = waitAndFindMatches("MNG-1007");
-
-        assertEquals("Unexpected Management Connection count", 1, results.size());
-
-        String log = getLogMessage(results, 0);
-
-        validateMessageID("MNG-1007", log);
-
-        assertTrue("User not in log message:" + log, log.endsWith(USER));
-        // Extract the id from the log string
-        //  MESSAGE [mng:1(rmi://169.24.29.116)] MNG-1007 : Open : User admin
-        int connectionID = Integer.parseInt(fromActor(getLog(results.get(0))).charAt(4) + "");
-
-        results = findMatches("MNG-1008");
-
-        assertEquals("Unexpected Management Connection close count", 0, results.size());
-
-        _jmxUtils.close();
-        _closed  = true;
-        
-        results = waitAndFindMatches("MNG-1008");
-
-        assertEquals("Unexpected Management Connection count", 1, results.size());
-
-        assertEquals("Close does not have same id as open,", connectionID,
-                     Integer.parseInt(fromActor(getLog(results.get(0))).charAt(4) + ""));
-    }
-
-    /**
-     * Description:
      * When a connected client has its connection closed via the Management Console this will be logged as a CON-1002 message.
      * Input:
      *

Modified: qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/MessageStatisticsDeliveryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/MessageStatisticsDeliveryTest.java?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/MessageStatisticsDeliveryTest.java (original)
+++ qpid/branches/qpid-3346/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/MessageStatisticsDeliveryTest.java Mon Sep 19 15:13:18 2011
@@ -103,7 +103,7 @@ public class MessageStatisticsDeliveryTe
         MessageConsumer consumer = session.createConsumer(_queue);
         for (int i = 0; i < number; i++)
         {
-            Message msg = consumer.receive(100);
+            Message msg = consumer.receive(1000);
             assertNotNull("Message " + i + " was not received", msg);
         }
     }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message