[maven-release-plugin]  copy for tag activemq-4.1.2

git-svn-id: https://svn.apache.org/repos/asf/activemq/tags/activemq-4.1.2@646984 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java
index 665aad1..357e7fa 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java
@@ -41,10 +41,10 @@
 public class SslTransportServer extends TcpTransportServer {
     
     // Specifies if sockets created from this server should needClientAuth.
-    private boolean needClientAuth = false;
+    private boolean needClientAuth;
     
     // Specifies if sockets created from this server should wantClientAuth.
-    private boolean wantClientAuth = false;
+    private boolean wantClientAuth;
     
     
     /**
@@ -107,8 +107,11 @@
      */
     public void bind() throws IOException {
         super.bind();
-        ((SSLServerSocket)this.serverSocket).setWantClientAuth(wantClientAuth);
-        ((SSLServerSocket)this.serverSocket).setNeedClientAuth(needClientAuth);
+        if (needClientAuth) {
+            ((SSLServerSocket)this.serverSocket).setNeedClientAuth(true);
+        } else if (wantClientAuth) {
+            ((SSLServerSocket)this.serverSocket).setWantClientAuth(true);
+        }
     }
     
     /**
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java
index c1e4caf..29684e8 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java
@@ -55,40 +55,41 @@
     
     public void testWantAndNeedClientAuthSetters() throws IOException {
         for (int i = 0; i < 4; ++i) {
-            final boolean wantClientAuth = ((i & 0x1) == 1);
-            final boolean needClientAuth = ((i & 0x2) == 1);
-            
-            final int expectedWantStatus = (wantClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE );
-            final int expectedNeedStatus = (needClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE );
-            
-            createAndBindTransportServer(wantClientAuth, needClientAuth, "");
-            
-            assertEquals("Created ServerSocket did not have correct wantClientAuth status.",
-                sslServerSocket.getWantClientAuthStatus(), expectedWantStatus);
-            
-            assertEquals("Created ServerSocket did not have correct needClientAuth status.",
-                sslServerSocket.getNeedClientAuthStatus(), expectedNeedStatus);
+            String options = "";
+            singleTest(i, options);
             }
     }
     
     public void testWantAndNeedAuthReflection() throws IOException {
         for (int i = 0; i < 4; ++i) {
-            final boolean wantClientAuth = ((i & 0x1) == 1);
-            final boolean needClientAuth = ((i & 0x2) == 1);
-            
-            final int expectedWantStatus = (wantClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE );
-            final int expectedNeedStatus = (needClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE );
-            
-            String options = "wantClientAuth=" + (wantClientAuth ? "true" : "false") +
-                "&needClientAuth=" + (needClientAuth ? "true" : "false");
-            
-            createAndBindTransportServer(wantClientAuth, needClientAuth, options);
-            
-            assertEquals("Created ServerSocket did not have correct wantClientAuth status.",
-                sslServerSocket.getWantClientAuthStatus(), expectedWantStatus);
-            
-            assertEquals("Created ServerSocket did not have correct needClientAuth status.",
-                sslServerSocket.getNeedClientAuthStatus(), expectedNeedStatus);
+            String options = "wantClientAuth=" + (getWantClientAuth(i) ? "true" : "false") +
+                "&needClientAuth=" + (getNeedClientAuth(i) ? "true" : "false");
+            singleTest(i, options);
         }
     }
+
+    private void singleTest(int i, String options) throws IOException {
+        final boolean wantClientAuth = getWantClientAuth(i);
+        final boolean needClientAuth = getNeedClientAuth(i);
+
+        final int expectedWantStatus = (needClientAuth? StubSSLServerSocket.UNTOUCHED: wantClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.UNTOUCHED);
+        final int expectedNeedStatus = (needClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.UNTOUCHED );
+
+
+        createAndBindTransportServer(wantClientAuth, needClientAuth, options);
+
+        assertEquals("Created ServerSocket did not have correct wantClientAuth status. wantClientAuth: " + wantClientAuth + ", needClientAuth: " + needClientAuth,
+            expectedWantStatus, sslServerSocket.getWantClientAuthStatus());
+
+        assertEquals("Created ServerSocket did not have correct needClientAuth status. wantClientAuth: " + wantClientAuth + ", needClientAuth: " + needClientAuth,
+            expectedNeedStatus, sslServerSocket.getNeedClientAuthStatus());
+    }
+
+    private boolean getNeedClientAuth(int i) {
+        return ((i & 0x2) == 0x2);
+    }
+
+    private boolean getWantClientAuth(int i) {
+        return ((i & 0x1) == 0x1);
+    }
 }
diff --git a/assembly/pom.xml b/assembly/pom.xml
index d8ef1ff..b0fe575 100755
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -261,35 +261,35 @@
             <id>unix-bin</id>
             <phase>package</phase>
             <goals>
-              <goal>single</goal>
+              <goal>attached</goal>
             </goals>
             <configuration>
               <descriptors>
                  <descriptor>src/main/descriptors/unix-bin.xml</descriptor>  
               </descriptors>
-              <finalName>${pom.artifactId}-${pom.version}</finalName>
-              <appendAssemblyId>false</appendAssemblyId>
+              <!--<finalName>${pom.artifactId}-${pom.version}</finalName>-->
+              <!--<appendAssemblyId>false</appendAssemblyId>-->
             </configuration>
           </execution>
           <execution>
             <id>windows-bin</id>
             <phase>package</phase>
             <goals>
-              <goal>single</goal>
+              <goal>attached</goal>
             </goals>
             <configuration>
               <descriptors>
                  <descriptor>src/main/descriptors/windows-bin.xml</descriptor>  
               </descriptors>
-              <finalName>${pom.artifactId}-${pom.version}</finalName>
-              <appendAssemblyId>false</appendAssemblyId>
+              <!--<finalName>${pom.artifactId}-${pom.version}</finalName>-->
+              <!--<appendAssemblyId>false</appendAssemblyId>-->
             </configuration>
           </execution>
           <execution>
             <id>unix-src</id>
             <phase>package</phase>
             <goals>
-              <goal>single</goal>
+              <goal>attached</goal>
             </goals>
             <configuration>
               <descriptors>
@@ -301,7 +301,7 @@
             <id>windows-src</id>
             <phase>package</phase>
             <goals>
-              <goal>single</goal>
+              <goal>attached</goal>
             </goals>
             <configuration>
               <descriptors>
diff --git a/assembly/src/main/descriptors/unix-bin.xml b/assembly/src/main/descriptors/unix-bin.xml
index ff898d4..4b90fe5 100644
--- a/assembly/src/main/descriptors/unix-bin.xml
+++ b/assembly/src/main/descriptors/unix-bin.xml
@@ -16,7 +16,7 @@
     limitations under the License.
 -->
 <assembly>
-  <id>unix-bin</id>
+  <id>bin</id>
   <formats>
     <format>tar.gz</format>
     <format>tar.bz2</format>
diff --git a/assembly/src/main/descriptors/windows-bin.xml b/assembly/src/main/descriptors/windows-bin.xml
index e1ccb90..1713585 100644
--- a/assembly/src/main/descriptors/windows-bin.xml
+++ b/assembly/src/main/descriptors/windows-bin.xml
@@ -16,7 +16,7 @@
     limitations under the License.
 -->
 <assembly>
-  <id>windows-bin</id>
+  <id>bin</id>
   <formats>
     <format>zip</format>
   </formats>