activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r386090 - in /incubator/activemq/trunk/activemq-jaas: pom.xml src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java
Date Wed, 15 Mar 2006 15:11:51 GMT
Author: chirino
Date: Wed Mar 15 07:11:48 2006
New Revision: 386090

URL: http://svn.apache.org/viewcvs?rev=386090&view=rev
Log:
The testcase now sets the system properties so that they don't need to be set by maven

Modified:
    incubator/activemq/trunk/activemq-jaas/pom.xml
    incubator/activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java

Modified: incubator/activemq/trunk/activemq-jaas/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-jaas/pom.xml?rev=386090&r1=386089&r2=386090&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-jaas/pom.xml (original)
+++ incubator/activemq/trunk/activemq-jaas/pom.xml Wed Mar 15 07:11:48 2006
@@ -43,12 +43,6 @@
           <includes>
             <include implementation="java.lang.String">**/*Test.*</include>
           </includes>
-          <systemProperties>
-            <property>
-              <name>java.security.auth.login.config</name>
-              <value>${basedir}/src/test/resources/login.config</value>
-            </property>
-          </systemProperties>
         </configuration>
       </plugin>
 

Modified: incubator/activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java?rev=386090&r1=386089&r2=386090&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java
(original)
+++ incubator/activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java
Wed Mar 15 07:11:48 2006
@@ -17,6 +17,8 @@
 package org.apache.activemq.jaas;
 
 import java.io.IOException;
+import java.net.URL;
+
 import javax.security.auth.Subject;
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
@@ -27,9 +29,6 @@
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
 
-import org.apache.activemq.jaas.GroupPrincipal;
-import org.apache.activemq.jaas.UserPrincipal;
-
 import junit.framework.TestCase;
 
 
@@ -37,6 +36,18 @@
  * @version $Rev: $ $Date: $
  */
 public class PropertiesLoginModuleTest extends TestCase {
+    
+    static {
+        String path = System.getProperty("java.security.auth.login.config");
+        if (path == null) {
+            URL resource = PropertiesLoginModuleTest.class.getClassLoader().getResource("login.config");
+            if (resource != null) {
+                path = resource.getFile();
+                System.setProperty("java.security.auth.login.config", path);
+            }
+        }
+        System.out.println("Path to login config: " + path);
+    }
 
     public void testLogin() throws LoginException {
         LoginContext context = new LoginContext("PropertiesLogin", new CallbackHandler()
{



Mime
View raw message