Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 9785 invoked from network); 29 Apr 2009 17:14:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Apr 2009 17:14:38 -0000 Received: (qmail 83866 invoked by uid 500); 29 Apr 2009 17:14:38 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 83830 invoked by uid 500); 29 Apr 2009 17:14:38 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 83820 invoked by uid 99); 29 Apr 2009 17:14:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2009 17:14:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2009 17:14:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9606C238895F; Wed, 29 Apr 2009 17:14:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r769838 - in /activemq/trunk: ./ activemq-jaas/ activemq-jaas/src/main/java/org/apache/activemq/jaas/ activemq-jaas/src/test/java/org/apache/activemq/jaas/ activemq-jaas/src/test/java/org/apache/activemq/jaas/ldap/ activemq-jaas/src/test/re... Date: Wed, 29 Apr 2009 17:14:15 -0000 To: commits@activemq.apache.org From: dejanb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090429171416.9606C238895F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dejanb Date: Wed Apr 29 17:14:15 2009 New Revision: 769838 URL: http://svn.apache.org/viewvc?rev=769838&view=rev Log: fix for https://issues.apache.org/activemq/browse/AMQ-1781 - ldap login module npe Added: activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginProperty.java activemq/trunk/activemq-jaas/src/test/resources/log4j.properties Removed: activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/ldap/ Modified: activemq/trunk/activemq-jaas/pom.xml activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/LDAPLoginModuleTest.java activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java activemq/trunk/activemq-jaas/src/test/resources/login.config activemq/trunk/pom.xml Modified: activemq/trunk/activemq-jaas/pom.xml URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/pom.xml?rev=769838&r1=769837&r2=769838&view=diff ============================================================================== --- activemq/trunk/activemq-jaas/pom.xml (original) +++ activemq/trunk/activemq-jaas/pom.xml Wed Apr 29 17:14:15 2009 @@ -36,84 +36,74 @@ - maven-surefire-plugin - true - once - - **/LDAPLoginModuleTest.* - - - **/*Test.* - + pertest + false + true + -Xmx512M + + + + org.apache.activemq.default.directory.prefix + target/ + + + log4j.configuration + file:target/test-classes/log4j.properties + + - - commons-logging - commons-logging - - - directory - apacheds-core - test - - - directory - apacheds-shared - test - - - directory-shared - apache-ldapber-provider - test - - - directory-shared - ldap-common - test - + commons-logging + commons-logging + - directory-asn1 - asn1-codec - test + commons-collections + commons-collections + test - directory-asn1 - asn1-der + org.apache.directory.server + apacheds-core-integ + ${directory-version} test - + + - directory-shared - kerberos-common + org.apache.directory.server + apacheds-server-integ + ${directory-version} test - + + - directory-network - mina + junit + junit test - directory-protocols - kerberos-protocol + org.apache.xbean + xbean-spring + true test - directory-protocols - ldap-protocol - test + log4j + log4j - junit - junit + org.slf4j + nlog4j + ${nlog4j-version} test Modified: activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java?rev=769838&r1=769837&r2=769838&view=diff ============================================================================== --- activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java (original) +++ activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java Wed Apr 29 17:14:15 2009 @@ -77,48 +77,35 @@ protected DirContext context; private Subject subject; - private CallbackHandler handler; - private String initialContextFactory; - private String connectionURL; - private String connectionUsername; - private String connectionPassword; - private String connectionProtocol; - private String authentication; - private String userBase; - private String roleBase; - private String roleName; - private String userRoleName; + private CallbackHandler handler; + private LDAPLoginProperty [] config; private String username; - private MessageFormat userSearchMatchingFormat; - private MessageFormat roleSearchMatchingFormat; - private boolean userSearchSubtreeBool; - private boolean roleSearchSubtreeBool; private Set groups = new HashSet(); public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { this.subject = subject; this.handler = callbackHandler; - initialContextFactory = (String)options.get(INITIAL_CONTEXT_FACTORY); - connectionURL = (String)options.get(CONNECTION_URL); - connectionUsername = (String)options.get(CONNECTION_USERNAME); - connectionPassword = (String)options.get(CONNECTION_PASSWORD); - connectionProtocol = (String)options.get(CONNECTION_PROTOCOL); - authentication = (String)options.get(AUTHENTICATION); - userBase = (String)options.get(USER_BASE); - String userSearchMatching = (String)options.get(USER_SEARCH_MATCHING); - String userSearchSubtree = (String)options.get(USER_SEARCH_SUBTREE); - roleBase = (String)options.get(ROLE_BASE); - roleName = (String)options.get(ROLE_NAME); - String roleSearchMatching = (String)options.get(ROLE_SEARCH_MATCHING); - String roleSearchSubtree = (String)options.get(ROLE_SEARCH_SUBTREE); - userRoleName = (String)options.get(USER_ROLE_NAME); - userSearchMatchingFormat = new MessageFormat(userSearchMatching); - roleSearchMatchingFormat = new MessageFormat(roleSearchMatching); - userSearchSubtreeBool = Boolean.valueOf(userSearchSubtree).booleanValue(); - roleSearchSubtreeBool = Boolean.valueOf(roleSearchSubtree).booleanValue(); + + config = new LDAPLoginProperty [] { + new LDAPLoginProperty (INITIAL_CONTEXT_FACTORY, (String)options.get(INITIAL_CONTEXT_FACTORY)), + new LDAPLoginProperty (CONNECTION_URL, (String)options.get(CONNECTION_URL)), + new LDAPLoginProperty (CONNECTION_USERNAME, (String)options.get(CONNECTION_USERNAME)), + new LDAPLoginProperty (CONNECTION_PASSWORD, (String)options.get(CONNECTION_PASSWORD)), + new LDAPLoginProperty (CONNECTION_PROTOCOL, (String)options.get(CONNECTION_PROTOCOL)), + new LDAPLoginProperty (AUTHENTICATION, (String)options.get(AUTHENTICATION)), + new LDAPLoginProperty (USER_BASE, (String)options.get(USER_BASE)), + new LDAPLoginProperty (USER_SEARCH_MATCHING, (String)options.get(USER_SEARCH_MATCHING)), + new LDAPLoginProperty (USER_SEARCH_SUBTREE, (String)options.get(USER_SEARCH_SUBTREE)), + new LDAPLoginProperty (ROLE_BASE, (String)options.get(ROLE_BASE)), + new LDAPLoginProperty (ROLE_NAME, (String)options.get(ROLE_NAME)), + new LDAPLoginProperty (ROLE_SEARCH_MATCHING, (String)options.get(ROLE_SEARCH_MATCHING)), + new LDAPLoginProperty (ROLE_SEARCH_SUBTREE, (String)options.get(ROLE_SEARCH_SUBTREE)), + new LDAPLoginProperty (USER_ROLE_NAME, (String)options.get(USER_ROLE_NAME)), + }; } public boolean login() throws LoginException { + Callback[] callbacks = new Callback[2]; callbacks[0] = new NameCallback("User name"); @@ -130,12 +117,17 @@ } catch (UnsupportedCallbackException uce) { throw (LoginException)new LoginException().initCause(uce); } + + String password; + username = ((NameCallback)callbacks[0]).getName(); - String password = new String(((PasswordCallback)callbacks[1]).getPassword()); - - if (username == null || "".equals(username) || password == null || "".equals(password)) { - return false; - } + if (username == null) + return false; + + if (((PasswordCallback)callbacks[1]).getPassword() != null) + password = new String(((PasswordCallback)callbacks[1]).getPassword()); + else + password=""; try { boolean result = authenticate(username, password); @@ -179,8 +171,17 @@ protected boolean authenticate(String username, String password) throws Exception { + MessageFormat userSearchMatchingFormat; + boolean userSearchSubtreeBool; + DirContext context = null; context = open(); + + if (!isLoginPropertySet(USER_SEARCH_MATCHING)) + return false; + + userSearchMatchingFormat = new MessageFormat(getLDAPPropertyValue(USER_SEARCH_MATCHING)); + userSearchSubtreeBool = Boolean.valueOf(getLDAPPropertyValue(USER_SEARCH_SUBTREE)).booleanValue(); try { @@ -196,14 +197,14 @@ // setup attributes ArrayList list = new ArrayList(); - if (userRoleName != null) { - list.add(userRoleName); + if (isLoginPropertySet(USER_ROLE_NAME)) { + list.add(getLDAPPropertyValue(USER_ROLE_NAME)); } String[] attribs = new String[list.size()]; list.toArray(attribs); constraints.setReturningAttributes(attribs); - NamingEnumeration results = context.search(userBase, filter, constraints); + NamingEnumeration results = context.search(getLDAPPropertyValue(USER_BASE), filter, constraints); if (results == null || !results.hasMore()) { return false; @@ -216,7 +217,7 @@ } NameParser parser = context.getNameParser(""); Name contextName = parser.parse(context.getNameInNamespace()); - Name baseName = parser.parse(userBase); + Name baseName = parser.parse(getLDAPPropertyValue(USER_BASE)); Name entryName = parser.parse(result.getName()); Name name = contextName.addAll(baseName); name = name.addAll(entryName); @@ -227,8 +228,8 @@ return false; } ArrayList roles = null; - if (userRoleName != null) { - roles = addAttributeValues(userRoleName, attrs, roles); + if (isLoginPropertySet(USER_ROLE_NAME)) { + roles = addAttributeValues(getLDAPPropertyValue(USER_ROLE_NAME), attrs, roles); } // check the credentials by binding to server @@ -255,10 +256,15 @@ protected ArrayList getRoles(DirContext context, String dn, String username, ArrayList currentRoles) throws NamingException { ArrayList list = currentRoles; + MessageFormat roleSearchMatchingFormat; + boolean roleSearchSubtreeBool; + roleSearchMatchingFormat = new MessageFormat(getLDAPPropertyValue(ROLE_SEARCH_MATCHING)); + roleSearchSubtreeBool = Boolean.valueOf(getLDAPPropertyValue(ROLE_SEARCH_SUBTREE)).booleanValue(); + if (list == null) { list = new ArrayList(); } - if (roleName == null || "".equals(roleName)) { + if (!isLoginPropertySet(ROLE_NAME)) { return list; } String filter = roleSearchMatchingFormat.format(new String[] { @@ -271,14 +277,14 @@ } else { constraints.setSearchScope(SearchControls.ONELEVEL_SCOPE); } - NamingEnumeration results = context.search(roleBase, filter, constraints); + NamingEnumeration results = context.search(getLDAPPropertyValue(ROLE_BASE), filter, constraints); while (results.hasMore()) { SearchResult result = (SearchResult)results.next(); Attributes attrs = result.getAttributes(); if (attrs == null) { continue; } - list = addAttributeValues(roleName, attrs, list); + list = addAttributeValues(getLDAPPropertyValue(ROLE_NAME), attrs, list); } return list; @@ -325,14 +331,14 @@ log.debug("Authentication failed for dn=" + dn); } - if (connectionUsername != null) { - context.addToEnvironment(Context.SECURITY_PRINCIPAL, connectionUsername); + if (isLoginPropertySet(CONNECTION_USERNAME)) { + context.addToEnvironment(Context.SECURITY_PRINCIPAL, getLDAPPropertyValue(CONNECTION_USERNAME)); } else { context.removeFromEnvironment(Context.SECURITY_PRINCIPAL); } - if (connectionPassword != null) { - context.addToEnvironment(Context.SECURITY_CREDENTIALS, connectionPassword); + if (isLoginPropertySet(CONNECTION_PASSWORD)) { + context.addToEnvironment(Context.SECURITY_CREDENTIALS, getLDAPPropertyValue(CONNECTION_PASSWORD)); } else { context.removeFromEnvironment(Context.SECURITY_CREDENTIALS); } @@ -361,22 +367,18 @@ } protected DirContext open() throws NamingException { - if (context != null) { - return context; - } - try { Hashtable env = new Hashtable(); - env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory); - if (connectionUsername != null || !"".equals(connectionUsername)) { - env.put(Context.SECURITY_PRINCIPAL, connectionUsername); - } - if (connectionPassword != null || !"".equals(connectionPassword)) { - env.put(Context.SECURITY_CREDENTIALS, connectionPassword); - } - env.put(Context.SECURITY_PROTOCOL, connectionProtocol); - env.put(Context.PROVIDER_URL, connectionURL); - env.put(Context.SECURITY_AUTHENTICATION, authentication); + env.put(Context.INITIAL_CONTEXT_FACTORY, getLDAPPropertyValue(INITIAL_CONTEXT_FACTORY)); + if (isLoginPropertySet(CONNECTION_USERNAME)) { + env.put(Context.SECURITY_PRINCIPAL, getLDAPPropertyValue(CONNECTION_USERNAME)); + } + if (isLoginPropertySet(CONNECTION_PASSWORD)) { + env.put(Context.SECURITY_CREDENTIALS, getLDAPPropertyValue(CONNECTION_PASSWORD)); + } + env.put(Context.SECURITY_PROTOCOL, getLDAPPropertyValue(CONNECTION_PROTOCOL)); + env.put(Context.PROVIDER_URL, getLDAPPropertyValue(CONNECTION_URL)); + env.put(Context.SECURITY_AUTHENTICATION, getLDAPPropertyValue(AUTHENTICATION)); context = new InitialDirContext(env); } catch (NamingException e) { @@ -385,5 +387,20 @@ } return context; } + + private String getLDAPPropertyValue (String propertyName){ + for (int i=0; i < config.length; i++ ) + if (config[i].getPropertyName() == propertyName) + return config[i].getPropertyValue(); + return null; + } + + private boolean isLoginPropertySet(String propertyName) { + for (int i=0; i < config.length; i++ ) { + if (config[i].getPropertyName() == propertyName && config[i].getPropertyValue() != null) + return true; + } + return false; + } } Added: activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginProperty.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginProperty.java?rev=769838&view=auto ============================================================================== --- activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginProperty.java (added) +++ activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginProperty.java Wed Apr 29 17:14:15 2009 @@ -0,0 +1,40 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.activemq.jaas; + +public class LDAPLoginProperty { + private String name; + private String value; + + public LDAPLoginProperty(String name) { + this.name = name; + } + + public LDAPLoginProperty(String name, String value) { + this.name = name; + this.value = value; + } + + public String getPropertyName() { + return this.name; + } + public String getPropertyValue() { + return this.value; + } + +} Modified: activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/LDAPLoginModuleTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/LDAPLoginModuleTest.java?rev=769838&r1=769837&r2=769838&view=diff ============================================================================== --- activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/LDAPLoginModuleTest.java (original) +++ activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/LDAPLoginModuleTest.java Wed Apr 29 17:14:15 2009 @@ -16,12 +16,13 @@ */ package org.apache.activemq.jaas; -import java.io.File; +import static org.junit.Assert.assertTrue; + import java.io.IOException; -import java.net.InetAddress; +import java.net.URL; import java.util.HashSet; import java.util.Hashtable; -import java.util.Properties; + import javax.naming.Context; import javax.naming.NameClassPair; import javax.naming.NamingEnumeration; @@ -35,40 +36,60 @@ import javax.security.auth.login.LoginContext; import javax.security.auth.login.LoginException; -import junit.framework.TestCase; +import org.apache.directory.server.core.integ.Level; +import org.apache.directory.server.core.integ.annotations.ApplyLdifs; +import org.apache.directory.server.core.integ.annotations.CleanupLevel; +import org.apache.directory.server.integ.SiRunner; +import org.apache.directory.server.ldap.LdapService; +import org.junit.Test; +import org.junit.runner.RunWith; -import org.apache.activemq.jaas.ldap.MutableServerStartupConfiguration; -import org.apache.activemq.jaas.ldap.ServerContextFactory; -import org.apache.ldap.server.configuration.ShutdownConfiguration; -import org.apache.ldap.server.jndi.CoreContextFactory; -/** - * @version $Rev: $ $Date: $ - */ -public class LDAPLoginModuleTest extends TestCase { - +@RunWith ( SiRunner.class ) +@CleanupLevel ( Level.CLASS ) +@ApplyLdifs( { + "dn: uid=first,ou=system\n" + + "uid: first\n" + + "userPassword: secret\n" + + "objectClass: account\n" + + "objectClass: simpleSecurityObject\n" + + "objectClass: top\n" +} +) +public class LDAPLoginModuleTest { + + 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); + } + } + } + + private static final String BASE = "ou=system"; + public static LdapService ldapService; + private static final String FILTER = "(objectclass=*)"; + private static final String PRINCIPAL = "uid=admin,ou=system"; private static final String CREDENTIALS = "secret"; - - public void testNothing() { - } - + @SuppressWarnings("unchecked") + @Test public void testRunning() throws Exception { Hashtable env = new Hashtable(); - env.put(Context.PROVIDER_URL, "ldap://localhost:9389"); + env.put(Context.PROVIDER_URL, "ldap://localhost:1024"); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, PRINCIPAL); env.put(Context.SECURITY_CREDENTIALS, CREDENTIALS); DirContext ctx = new InitialDirContext(env); - // Perform search using URL - // NamingEnumeration answer = ctx.search( - // "ldap://localhost:389/ou=system", "(uid=admin)", null); HashSet set = new HashSet(); NamingEnumeration list = ctx.list("ou=system"); @@ -85,8 +106,9 @@ assertTrue(set.contains("prefNodeName=sysPrefRoot")); } - - public void xtestLogin() throws LoginException { + + @Test + public void testLogin() throws LoginException { LoginContext context = new LoginContext("LDAPLogin", new CallbackHandler() { public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (int i = 0; i < callbacks.length; i++) { @@ -104,39 +126,4 @@ context.logout(); } - @SuppressWarnings("unchecked") - public void setUp() throws Exception { - MutableServerStartupConfiguration startup = new MutableServerStartupConfiguration(); - // put some mandatory JNDI properties here - startup.setWorkingDirectory(new File("target/ldap")); - startup.setAllowAnonymousAccess(true); - startup.setLdapPort(9389); - startup.setEnableNetworking(true); - startup.setHost(InetAddress.getByName("localhost")); - - Properties env = new Properties(); - env.putAll(startup.toJndiEnvironment()); - env.put(Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName()); - env.put(Context.PROVIDER_URL, "ou=system"); - env.put(Context.SECURITY_AUTHENTICATION, "simple"); - env.put(Context.SECURITY_PRINCIPAL, PRINCIPAL); - env.put(Context.SECURITY_CREDENTIALS, CREDENTIALS); - - //Fire it up - new InitialDirContext(env); - } - - @SuppressWarnings("unchecked") - public void tearDown() throws Exception { - Properties env = new Properties(); - env.putAll(new ShutdownConfiguration().toJndiEnvironment()); - env.put(Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName()); - env.put(Context.PROVIDER_URL, "ou=system"); - env.put(Context.SECURITY_AUTHENTICATION, "simple"); - env.put(Context.SECURITY_PRINCIPAL, PRINCIPAL); - env.put(Context.SECURITY_CREDENTIALS, CREDENTIALS); - - //Shut it down - new InitialDirContext(env); - } } Modified: activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java?rev=769838&r1=769837&r2=769838&view=diff ============================================================================== --- activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java (original) +++ activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java Wed Apr 29 17:14:15 2009 @@ -46,7 +46,6 @@ System.setProperty("java.security.auth.login.config", path); } } - System.out.println("Path to login config: " + path); } public void testLogin() throws LoginException { Added: activemq/trunk/activemq-jaas/src/test/resources/log4j.properties URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/test/resources/log4j.properties?rev=769838&view=auto ============================================================================== --- activemq/trunk/activemq-jaas/src/test/resources/log4j.properties (added) +++ activemq/trunk/activemq-jaas/src/test/resources/log4j.properties Wed Apr 29 17:14:15 2009 @@ -0,0 +1,35 @@ +## --------------------------------------------------------------------------- +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## --------------------------------------------------------------------------- + +# +# The logging properties used during tests.. +# +log4j.rootLogger=INFO, out, stdout + +log4j.logger.org.apache.activemq=INFO + +# CONSOLE appender not used by default +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n + +# File appender +log4j.appender.out=org.apache.log4j.FileAppender +log4j.appender.out.layout=org.apache.log4j.PatternLayout +log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n +log4j.appender.out.file=target/activemq-test.log +log4j.appender.out.append=true Modified: activemq/trunk/activemq-jaas/src/test/resources/login.config URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/test/resources/login.config?rev=769838&r1=769837&r2=769838&view=diff ============================================================================== --- activemq/trunk/activemq-jaas/src/test/resources/login.config (original) +++ activemq/trunk/activemq-jaas/src/test/resources/login.config Wed Apr 29 17:14:15 2009 @@ -12,7 +12,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License. */ PropertiesLogin { org.apache.activemq.jaas.PropertiesLoginModule required @@ -25,11 +25,18 @@ org.apache.activemq.jaas.LDAPLoginModule required debug=true initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory - connectionURL="ldap://localhost:9389" + connectionURL="ldap://localhost:1024" connectionUsername="uid=admin,ou=system" connectionPassword=secret connectionProtocol=s authentication=simple + userBase="ou=system" + userSearchMatching="(uid={0})" + userSearchSubtree=false + roleBase="ou=system" + roleName=dummyRoleName + roleSearchMatching="(uid={1})" + roleSearchSubtree=false ; }; Modified: activemq/trunk/pom.xml URL: http://svn.apache.org/viewvc/activemq/trunk/pom.xml?rev=769838&r1=769837&r2=769838&view=diff ============================================================================== --- activemq/trunk/pom.xml (original) +++ activemq/trunk/pom.xml Wed Apr 29 17:14:15 2009 @@ -45,7 +45,7 @@ 2.0-SNAPSHOT 2.0 1.6.1 - 3.1 + 3.2.1 1.2.0 1.2.2 2.0.1 @@ -55,18 +55,19 @@ 0.3.2 0.5 0.7.3 - 0.9.2 + 1.5.4 1.0 0.1.8 1.7.2.2 1.0 6.1.9 1.0.1 - 3.8.1 + 4.4 2.0 1.2.14 + 1.2.25 10.1.3.1 - 2.2 + 2.3 1.1.2 1.3 0.8 @@ -853,70 +854,6 @@ ${jdom-version} - - - directory - apacheds-core - ${directory-version} - - - directory - apacheds-shared - ${directory-version} - - - directory-shared - apache-ldapber-provider - ${directory-version} - - - commons-test - commons-test - - - - - directory-shared - ldap-common - ${directory-version} - - - directory-asn1 - asn1-codec - ${directory-asn1-version} - - - directory-asn1 - asn1-der - ${directory-asn1-version} - - - commons-test - commons-test - - - - - directory-shared - kerberos-common - ${directory-kerboros-version} - - - directory-network - mina - ${directory-mina-version} - - - directory-protocols - kerberos-protocol - ${directory-kerboros-version} - - - directory-protocols - ldap-protocol - ${directory-version} - - p2psockets p2psockets-core