directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r414013 [3/5] - in /directory/branches/shared/0.9.5: ./ asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/ ldap/ ldap/src/main/antlr/ ldap/src/main/java/org/apache...
Date Wed, 14 Jun 2006 01:00:41 GMT
Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java Tue Jun 13 18:00:35 2006
@@ -18,11 +18,10 @@
 
 
 import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import java.util.Set;
 import java.util.Collections;
-import javax.naming.Name;
 
 
 /**
@@ -37,7 +36,7 @@
 public class SubtreeSpecificationModifier
 {
     /** the subtree base relative to the administration point */
-    private Name base = new LdapName();
+    private LdapDN base = new LdapDN();
 
     /** the set of subordinates entries and their subordinates to exclude */
     private Set chopBefore = Collections.EMPTY_SET;
@@ -86,7 +85,7 @@
      * @param base
      *            subtree base relative to the administration point
      */
-    public void setBase( Name base )
+    public void setBase( LdapDN base )
     {
         this.base = base;
     }

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java Tue Jun 13 18:00:35 2006
@@ -21,7 +21,7 @@
 import java.io.StringReader;
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
+import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -66,14 +66,13 @@
     /**
      * Creates a normalizing subtree specification parser.
      */
-    public SubtreeSpecificationParser(NameComponentNormalizer normalizer)
+    public SubtreeSpecificationParser( NormalizerMappingResolver resolver )
     {
         StringReader in = new StringReader( "" ); // place holder for the
                                                     // first input
         this.lexer = new ReusableAntlrSubtreeSpecificationLexer( in );
         this.parser = new ReusableAntlrSubtreeSpecificationParser( lexer );
-
-        this.parser.setNormalizer( normalizer );
+        this.parser.setNormalizerMappingResolver( resolver );
         this.parser.init(); // this method MUST be called while we cannot do
         // constructor overloading for antlr generated parser
         this.isNormalizing = true;

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java Tue Jun 13 18:00:35 2006
@@ -37,12 +37,18 @@
 {
     public static boolean containsValue( Attribute attr, Object compared, AttributeType type ) throws NamingException
     {
+        // quick bypass test
+        if ( attr.contains( compared ) )
+        {
+            return true;
+        }
+        
         Normalizer normalizer = type.getEquality().getNormalizer();
 
         if ( type.getSyntax().isHumanReadible() )
         {
             String comparedStr = ( String ) normalizer.normalize( compared );
-            for ( int ii = attr.size(); ii >= 0; ii-- )
+            for ( int ii = attr.size() - 1; ii >= 0; ii-- )
             {
                 String value = ( String ) attr.get( ii );
                 if ( comparedStr.equals( normalizer.normalize( value ) ) )
@@ -54,7 +60,7 @@
         else
         {
             byte[] comparedBytes = ( byte[] ) compared;
-            for ( int ii = attr.size(); ii >= 0; ii-- )
+            for ( int ii = attr.size() - 1; ii >= 0; ii-- )
             {
                 if ( ArrayUtils.isEquals( comparedBytes, attr.get( ii ) ) )
                 {
@@ -70,6 +76,15 @@
     public static boolean containsAnyValues( Attribute attr, Object[] compared, AttributeType type )
         throws NamingException
     {
+        // quick bypass test
+        for ( int ii = 0; ii < compared.length; ii++ )
+        {
+            if ( attr.contains( compared ) )
+            {
+                return true;
+            }
+        }
+        
         Normalizer normalizer = type.getEquality().getNormalizer();
 
         if ( type.getSyntax().isHumanReadible() )

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java Tue Jun 13 18:00:35 2006
@@ -26,7 +26,7 @@
 package org.apache.directory.shared.ldap.util;
 
 
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.naming.*;
 import java.util.ArrayList;
@@ -390,7 +390,7 @@
      */
     public static Name getRelativeName( Name ancestor, Name descendant ) throws NamingException
     {
-        LdapName rdn = new LdapName( descendant.toString() );
+        LdapDN rdn = new LdapDN( descendant.toString() );
 
         if ( rdn.startsWith( ancestor ) )
         {

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java Tue Jun 13 18:00:35 2006
@@ -33,6 +33,8 @@
 
 import java.nio.ByteBuffer;
 
+import javax.naming.NamingException;
+
 
 /**
  * A global Ldap Decoder test
@@ -82,6 +84,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -89,7 +96,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
             .getSimple() ) );
@@ -129,6 +136,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         Assert.assertEquals( TLVStateEnum.VALUE_STATE_PENDING, ldapMessageContainer.getState() );
 
@@ -176,6 +188,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         assertEquals( TLVStateEnum.VALUE_STATE_PENDING, ldapMessageContainer.getState() );
 
@@ -201,6 +218,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         assertEquals( ldapMessageContainer.getState(), TLVStateEnum.PDU_DECODED );
 
@@ -210,7 +232,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
             .getSimple() ) );
@@ -258,6 +280,11 @@
             assertEquals( "The current Value length is above the expected length", de.getMessage() );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "Should never reach this point.." );
     }
@@ -303,6 +330,11 @@
             assertEquals( "Universal tag 14 is reserved", de.getMessage() );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "Should never reach this point." );
     }
@@ -347,6 +379,11 @@
         {
             assertEquals( "Bad transition !", de.getMessage() );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "Should never reach this point." );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java Tue Jun 13 18:00:35 2006
@@ -30,6 +30,8 @@
 
 import java.nio.ByteBuffer;
 
+import javax.naming.NamingException;
+
 
 /**
  * A global Ldap Decoder test
@@ -69,6 +71,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point !" );
     }
@@ -103,6 +110,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point !" );
     }
@@ -137,6 +149,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point !" );
     }
@@ -173,6 +190,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point !" );
     }
@@ -252,6 +274,11 @@
                         break;
                 }
             }
+            catch ( NamingException ne )
+            {
+                ne.printStackTrace();
+                fail( ne.getMessage() );
+            }
 
             stream.clear();
         }
@@ -289,6 +316,11 @@
         {
             de.printStackTrace();
             fail( de.getMessage() );
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java Tue Jun 13 18:00:35 2006
@@ -33,6 +33,8 @@
 
 import java.nio.ByteBuffer;
 
+import javax.naming.NamingException;
+
 
 /**
  * A test for LdapResults. We will use a AddResponse message to test the
@@ -76,6 +78,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -112,6 +119,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -153,6 +165,11 @@
             {
                 fail( "We should never reach this point" );
             }
+            catch ( NamingException ne )
+            {
+                ne.printStackTrace();
+                fail( ne.getMessage() );
+            }
 
             stream.clear();
         }
@@ -192,6 +209,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -229,6 +251,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -268,6 +295,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded AddResponse
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -331,6 +363,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded AddResponse
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -401,6 +438,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded AddResponse
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -475,6 +517,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded AddResponse
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -547,6 +594,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java Tue Jun 13 18:00:35 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -98,6 +100,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check that everything is OK
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -183,6 +190,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check that everything is OK
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -240,6 +252,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java Tue Jun 13 18:00:35 2006
@@ -103,7 +103,7 @@
 
         // Check the decoded message
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry().toString() );
 
         Attributes attributes = addRequest.getAttributes();
 
@@ -522,7 +522,7 @@
 
         // Check the decoded message
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry().toString() );
 
         Attributes attributes = addRequest.getAttributes();
 
@@ -609,7 +609,7 @@
 
         // Check the decoded message
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry().toString() );
 
         Attributes attributes = addRequest.getAttributes();
 

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java Tue Jun 13 18:00:35 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -79,6 +81,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded AddResponse
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -138,6 +145,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -184,6 +196,11 @@
         {
             de.printStackTrace();
             fail( de.getMessage() );
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         // Check the decoded AddResponse

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java Tue Jun 13 18:00:35 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -83,6 +85,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindRequest
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -90,7 +97,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
             .getSimple() ) );
@@ -163,6 +170,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindRequest
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -170,7 +182,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
             .getSimple() ) );
@@ -231,6 +243,11 @@
                 .getMessage() );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "Should never reach this point." );
     }
@@ -274,6 +291,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindRequest
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -281,7 +303,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
             .getSimple() ) );
@@ -348,6 +370,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindRequest
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -355,7 +382,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
 
@@ -429,6 +456,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindRequest
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -436,7 +468,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
         assertEquals( "abcdef", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() )
@@ -491,6 +523,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -526,6 +563,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -561,6 +603,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -596,6 +643,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -631,6 +683,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -666,6 +723,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -701,6 +763,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -737,6 +804,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindRequest
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -744,7 +816,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() ).getSimple() ) );
 
@@ -798,6 +870,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -834,6 +911,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindRequest
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -841,7 +923,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
 
@@ -896,6 +978,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindRequest
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -903,7 +990,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
         assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() ).getCredentials() ) );
@@ -963,6 +1050,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindRequest
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -970,7 +1062,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
         assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() ).getCredentials() ) );
@@ -1038,6 +1130,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindRequest
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -1045,7 +1142,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
         assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() ).getCredentials() ) );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java Tue Jun 13 18:00:35 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -80,6 +82,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindResponse
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -157,6 +164,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindResponse
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -239,6 +251,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindResponse
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -315,6 +332,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindResponse
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -397,6 +419,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded BindResponse
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -457,6 +484,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java Tue Jun 13 18:00:35 2006
@@ -90,7 +90,7 @@
         CompareRequest compareRequest = message.getCompareRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
         assertEquals( "test", compareRequest.getAttributeDesc() );
         assertEquals( "value", compareRequest.getAssertionValue().toString() );
 
@@ -312,7 +312,7 @@
         CompareRequest compareRequest = message.getCompareRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
         assertEquals( "test", compareRequest.getAttributeDesc() );
         assertEquals( "", compareRequest.getAssertionValue().toString() );
 
@@ -385,7 +385,7 @@
         CompareRequest compareRequest = message.getCompareRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
         assertEquals( "test", compareRequest.getAttributeDesc() );
         assertEquals( "value", compareRequest.getAssertionValue().toString() );
 

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java Tue Jun 13 18:00:35 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -82,6 +84,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded CompareResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -155,6 +162,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded CompareResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -224,6 +236,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java Tue Jun 13 18:00:35 2006
@@ -84,7 +84,7 @@
         DelRequest delRequest = message.getDelRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry().toString() );
 
         // Check the length
         assertEquals( 0x27, message.computeLength() );
@@ -187,7 +187,7 @@
         DelRequest delRequest = message.getDelRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry().toString() );
 
         // Check the length
         assertEquals( 0x44, message.computeLength() );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java Tue Jun 13 18:00:35 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -83,6 +85,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded DelResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -143,6 +150,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -193,6 +205,11 @@
         {
             de.printStackTrace();
             fail( de.getMessage() );
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         // Check the decoded DelResponse PDU

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java Tue Jun 13 18:00:35 2006
@@ -113,7 +113,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -208,7 +208,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 21, message.getMessageId() );
-        assertEquals( "cn=Tori Amos,ou=playground,dc=apache,dc=org", modifyRequest.getObject() );
+        assertEquals( "cn=Tori Amos,ou=playground,dc=apache,dc=org", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -325,7 +325,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 49, message.getMessageId() );
-        assertEquals( "cn=Tori Amos,ou=playground,dc=apache,dc=org", modifyRequest.getObject() );
+        assertEquals( "cn=Tori Amos,ou=playground,dc=apache,dc=org", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -459,7 +459,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -928,7 +928,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 49, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -1003,7 +1003,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 49, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -1084,7 +1084,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 49, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java Tue Jun 13 18:00:35 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -81,6 +83,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded ModifyResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -153,6 +160,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded ModifyResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -221,6 +233,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java Tue Jun 13 18:00:35 2006
@@ -89,10 +89,10 @@
         ModifyDNRequest modifyDNRequest = message.getModifyDNRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
-        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
-        assertEquals( "ou=system", modifyDNRequest.getNewSuperior() );
+        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
+        assertEquals( "ou=system", modifyDNRequest.getNewSuperior().toString() );
 
         // Check the length
         assertEquals( 0x48, message.computeLength() );
@@ -163,10 +163,10 @@
         ModifyDNRequest modifyDNRequest = message.getModifyDNRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
-        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
-        assertEquals( "ou=system", modifyDNRequest.getNewSuperior() );
+        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
+        assertEquals( "ou=system", modifyDNRequest.getNewSuperior().toString() );
 
         // Check the Control
         List controls = message.getControls();
@@ -243,9 +243,9 @@
         ModifyDNRequest modifyDNRequest = message.getModifyDNRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
-        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
+        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
 
         // Check the length
         assertEquals( 0x3D, message.computeLength() );
@@ -315,9 +315,9 @@
         ModifyDNRequest modifyDNRequest = message.getModifyDNRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
-        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
+        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
 
         // Check the Control
         List controls = message.getControls();

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java Tue Jun 13 18:00:35 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -82,6 +84,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded ModifyDNResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -155,6 +162,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         // Check the decoded ModifyDNResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -224,6 +236,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java Tue Jun 13 18:00:35 2006
@@ -21,6 +21,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
@@ -33,7 +34,6 @@
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequest;
-import org.apache.directory.shared.ldap.name.DnOidContainer;
 import org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -48,12 +48,12 @@
  */
 public class SearchRequestMatchingRuleAssertionTest extends TestCase
 {
+    static Map oids = new HashMap();
 
     protected void setUp() throws Exception
     {
         super.setUp();
 
-        Map oids = new HashMap();
         oids.put( "dc", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
         oids.put( "domaincomponent", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
         oids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
@@ -62,8 +62,6 @@
         oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
         oids.put( "objectclass", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer() ) );
         oids.put( "2.5.4.0", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer() ) );
-
-        DnOidContainer.setOids( oids );
     }
 
 
@@ -102,6 +100,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -180,6 +183,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -220,6 +228,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -260,6 +273,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -301,6 +319,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -369,6 +392,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -409,6 +437,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -449,6 +482,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -488,6 +526,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java Tue Jun 13 18:00:35 2006
@@ -22,6 +22,7 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
@@ -36,7 +37,6 @@
 import org.apache.directory.shared.ldap.codec.search.SearchRequest;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.codec.util.LdapString;
-import org.apache.directory.shared.ldap.name.DnOidContainer;
 import org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -51,12 +51,12 @@
  */
 public class SearchRequestSubstringTest extends TestCase
 {
+    static Map oids = new HashMap();
 
     protected void setUp() throws Exception
     {
         super.setUp();
 
-        Map oids = new HashMap();
         oids.put( "dc", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
         oids.put( "domaincomponent", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
         oids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
@@ -65,8 +65,6 @@
         oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
         oids.put( "objectclass", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer() ) );
         oids.put( "2.5.4.0", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer() ) );
-
-        DnOidContainer.setOids( oids );
     }
 
 
@@ -135,6 +133,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -251,6 +254,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -374,6 +382,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -491,6 +504,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -609,6 +627,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -726,6 +749,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -843,6 +871,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -961,6 +994,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -1078,6 +1116,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -1197,6 +1240,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -1284,6 +1332,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1326,6 +1379,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1366,6 +1424,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1406,6 +1469,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1448,6 +1516,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1490,6 +1563,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1532,6 +1610,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1575,6 +1658,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1618,6 +1706,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1661,6 +1754,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1703,6 +1801,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1744,6 +1847,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java Tue Jun 13 18:00:35 2006
@@ -22,6 +22,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
@@ -41,7 +42,6 @@
 import org.apache.directory.shared.ldap.codec.search.PresentFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequest;
 import org.apache.directory.shared.ldap.codec.search.controls.SubEntryControl;
-import org.apache.directory.shared.ldap.name.DnOidContainer;
 import org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -56,12 +56,12 @@
  */
 public class SearchRequestTest extends TestCase
 {
+    static Map oids = new HashMap(); 
 
     protected void setUp() throws Exception
     {
         super.setUp();
 
-        Map oids = new HashMap();
         oids.put( "dc", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
         oids.put( "domaincomponent", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
         oids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
@@ -70,8 +70,6 @@
         oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
         oids.put( "objectclass", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer() ) );
         oids.put( "2.5.4.0", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer() ) );
-
-        DnOidContainer.setOids( oids );
     }
 
 
@@ -163,6 +161,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -337,6 +340,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -505,6 +513,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -643,6 +656,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -735,6 +753,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -861,6 +884,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         assertEquals( 4, message.getMessageId() );
@@ -878,7 +906,7 @@
         assertEquals( manageReferralControlOID, manageReferralControl.getControlType() );
 
         SearchRequest sr = message.getSearchRequest();
-        assertEquals( "dc=my-domain,dc=com", sr.getBaseObject() );
+        assertEquals( "dc=my-domain,dc=com", sr.getBaseObject().toString() );
         assertEquals( LdapConstants.SCOPE_WHOLE_SUBTREE, sr.getScope() );
         assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
         assertEquals( 0, sr.getSizeLimit() );
@@ -993,6 +1021,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -1035,7 +1068,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "ou", assertion.getAttributeDesc().toString() );
+        assertEquals( "2.5.4.11", assertion.getAttributeDesc().toString() );
         assertEquals( "contacts", assertion.getAssertionValue().toString() );
 
         // (& (| (objectclass=top) (ou=contacts) ) (! ...
@@ -1049,7 +1082,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "ou", assertion.getAttributeDesc().toString() );
+        assertEquals( "organizationalUnitName", assertion.getAttributeDesc().toString() );
         assertEquals( "ttt", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -1106,6 +1139,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         assertEquals( 4, message.getMessageId() );
@@ -1119,7 +1157,7 @@
         assertTrue( ( ( SubEntryControl ) subEntryControl.getControlValue() ).isVisible() );
 
         SearchRequest sr = message.getSearchRequest();
-        assertEquals( "dc=my-domain,dc=com", sr.getBaseObject() );
+        assertEquals( "dc=my-domain,dc=com", sr.getBaseObject().toString() );
         assertEquals( LdapConstants.SCOPE_WHOLE_SUBTREE, sr.getScope() );
         assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
         assertEquals( 0, sr.getSizeLimit() );
@@ -1173,6 +1211,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1206,6 +1249,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1241,6 +1289,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1276,6 +1329,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1311,6 +1369,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1347,6 +1410,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1383,6 +1451,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1419,6 +1492,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1455,6 +1533,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1491,6 +1574,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1527,6 +1615,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1563,6 +1656,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1599,6 +1697,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1636,6 +1739,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1677,6 +1785,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -1757,6 +1870,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -1841,6 +1959,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchRequest sr = message.getSearchRequest();
@@ -1909,6 +2032,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1950,6 +2078,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -1991,6 +2124,11 @@
             assertTrue( true );
             return;
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         fail( "We should not reach this point" );
     }
@@ -2030,6 +2168,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java Tue Jun 13 18:00:35 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -81,6 +83,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchResultDone searchResultDone = message.getSearchResultDone();
@@ -153,6 +160,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         SearchResultDone searchResultDone = message.getSearchResultDone();
@@ -220,6 +232,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );



Mime
View raw message