Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 63292 invoked from network); 27 Feb 2010 18:18:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Feb 2010 18:18:42 -0000 Received: (qmail 47952 invoked by uid 500); 27 Feb 2010 18:18:42 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 47890 invoked by uid 500); 27 Feb 2010 18:18:42 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 47883 invoked by uid 99); 27 Feb 2010 18:18:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Feb 2010 18:18:42 +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; Sat, 27 Feb 2010 18:18:41 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8331D23889E2; Sat, 27 Feb 2010 18:18:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r917003 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/util/LdapURL.java test/java/org/apache/directory/shared/ldap/util/LdapUrlTest.java Date: Sat, 27 Feb 2010 18:18:21 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100227181821.8331D23889E2@eris.apache.org> Author: elecharny Date: Sat Feb 27 18:18:20 2010 New Revision: 917003 URL: http://svn.apache.org/viewvc?rev=917003&view=rev Log: Removed the last references to SearchControls in shared-ldap Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/LdapUrlTest.java Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java?rev=917003&r1=917002&r2=917003&view=diff ============================================================================== --- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java (original) +++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java Sat Feb 27 18:18:20 2010 @@ -1744,6 +1744,26 @@ /** + * Sets the scope. Must be one of {@link SearchScope.OBJECT}, + * {@link SearchScope.ONELEVEL} or {@link SearchScope.SUBTREE}, + * otherwise {@link SearchScope.OBJECT} is assumed as default. + * + * @param scope the new scope + */ + public void setScope( SearchScope scope ) + { + if ( scope == null ) + { + this.scope = SearchScope.OBJECT; + } + else + { + this.scope = scope; + } + } + + + /** * Sets the filter. * * @param filter the new filter Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/LdapUrlTest.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/LdapUrlTest.java?rev=917003&r1=917002&r2=917003&view=diff ============================================================================== --- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/LdapUrlTest.java (original) +++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/LdapUrlTest.java Sat Feb 27 18:18:20 2010 @@ -20,22 +20,23 @@ package org.apache.directory.shared.ldap.util; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.util.ArrayList; import java.util.List; import javax.naming.InvalidNameException; -import javax.naming.directory.SearchControls; import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException; +import org.apache.directory.shared.ldap.filter.SearchScope; import org.apache.directory.shared.ldap.name.LdapDN; import org.apache.directory.shared.ldap.util.LdapURL.Extension; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertFalse; /** @@ -790,20 +791,20 @@ public void testLdapDNSetScope() throws LdapURLEncodingException, InvalidNameException { LdapURL url = new LdapURL(); - assertEquals( SearchControls.OBJECT_SCOPE, url.getScope() ); + assertEquals( SearchScope.OBJECT, url.getScope() ); url.setDn( new LdapDN( "dc=example,dc=com" ) ); - url.setScope( SearchControls.ONELEVEL_SCOPE ); - assertEquals( SearchControls.ONELEVEL_SCOPE, url.getScope() ); + url.setScope( SearchScope.ONELEVEL ); + assertEquals( SearchScope.ONELEVEL, url.getScope() ); assertEquals( "ldap:///dc=example,dc=com??one", url.toString() ); - url.setScope( SearchControls.SUBTREE_SCOPE ); - assertEquals( SearchControls.SUBTREE_SCOPE, url.getScope() ); + url.setScope( SearchScope.SUBTREE ); + assertEquals( SearchScope.SUBTREE, url.getScope() ); assertEquals( "ldap:///dc=example,dc=com??sub", url.toString() ); url.setScope( -1 ); - assertEquals( SearchControls.OBJECT_SCOPE, url.getScope() ); + assertEquals( SearchScope.OBJECT, url.getScope() ); assertEquals( "ldap:///dc=example,dc=com", url.toString() ); }