directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r411625 [1/2] - in /directory/branches/shared/optimization/ldap/src: main/java/org/apache/directory/shared/ldap/codec/ main/java/org/apache/directory/shared/ldap/codec/add/ main/java/org/apache/directory/shared/ldap/codec/bind/ main/java/or...
Date Mon, 05 Jun 2006 00:00:11 GMT
Author: elecharny
Date: Sun Jun  4 17:00:09 2006
New Revision: 411625

URL: http://svn.apache.org/viewvc?rev=411625&view=rev
Log:
implemented and Catched the NamingException

Removed:
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnOidContainer.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapDnNormalizer.java
Modified:
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlDecoder.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlValueAction.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixDecoder.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectDecoder.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownDecoder.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/MatchingRuleAssertionGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilterGrammar.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlDecoder.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlDecoder.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlDecoder.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownRequest.java
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java
    directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlDecoder.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlDecoder.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlDecoder.java Sun Jun  4 17:00:09 2006
@@ -17,6 +17,8 @@
 package org.apache.directory.shared.ldap.codec;
 
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 
@@ -45,5 +47,5 @@
      * @throws DecoderException
      *             if anything goes wrong
      */
-    Asn1Object decode( byte[] controlBytes ) throws DecoderException;
+    Asn1Object decode( byte[] controlBytes ) throws DecoderException, NamingException;
 }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlValueAction.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlValueAction.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlValueAction.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlValueAction.java Sun Jun  4 17:00:09 2006
@@ -20,6 +20,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
@@ -64,7 +66,7 @@
     }
 
 
-    public void action( IAsn1Container container ) throws DecoderException
+    public void action( IAsn1Container container ) throws DecoderException, NamingException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
         LdapMessage ldapMessage = ldapMessageContainer.getLdapMessage();

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixDecoder.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixDecoder.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixDecoder.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixDecoder.java Sun Jun  4 17:00:09 2006
@@ -5,11 +5,14 @@
 import java.nio.ByteBuffer;
 import java.util.Set;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.stateful.DecoderCallback;
 import org.apache.directory.shared.asn1.codec.stateful.DecoderMonitor;
+import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.spi.Provider;
 import org.apache.directory.shared.ldap.message.spi.ProviderDecoder;
 import org.apache.directory.shared.ldap.message.spi.ProviderException;
@@ -80,45 +83,51 @@
 
         while ( buf.hasRemaining() )
         {
-
-            ldapDecoder.decode( buf, ldapMessageContainer );
-
-            if ( log.isDebugEnabled() )
-            {
-                log.debug( "Decoding the PDU : " );
-
-                int size = buf.position();
-                buf.flip();
-                
-            	byte[] array = new byte[ size - position ];
-            	
-            	for ( int i = position; i < size; i++ )
-            	{
-            		array[ i ] = buf.get();
-            	}
-
-                position = size;
-                
-                log.debug( StringTools.dumpBytes( array ) );
-            }
-            
-            if ( ldapMessageContainer.getState() == TLVStateEnum.PDU_DECODED )
+            try
             {
+                ldapDecoder.decode( buf, ldapMessageContainer );
+    
                 if ( log.isDebugEnabled() )
                 {
-                    log.debug( "Decoded LdapMessage : " + ldapMessageContainer.getLdapMessage() );
-                    buf.mark();
+                    log.debug( "Decoding the PDU : " );
+    
+                    int size = buf.position();
+                    buf.flip();
+                    
+                	byte[] array = new byte[ size - position ];
+                	
+                	for ( int i = position; i < size; i++ )
+                	{
+                		array[ i ] = buf.get();
+                	}
+    
+                    position = size;
+                    
+                    log.debug( StringTools.dumpBytes( array ) );
+                }
+                
+                if ( ldapMessageContainer.getState() == TLVStateEnum.PDU_DECODED )
+                {
+                    if ( log.isDebugEnabled() )
+                    {
+                        log.debug( "Decoded LdapMessage : " + ldapMessageContainer.getLdapMessage() );
+                        buf.mark();
+                    }
+    
+                    decoderCallback.decodeOccurred( null, ldapMessageContainer.getLdapMessage() );
+                    ldapMessageContainer.clean();
+                }
+                else
+                {
+                	if ( log.isDebugEnabled() )
+                	{
+                		
+                	}
                 }
-
-                decoderCallback.decodeOccurred( null, ldapMessageContainer.getLdapMessage() );
-                ldapMessageContainer.clean();
             }
-            else
+            catch ( NamingException lne )
             {
-            	if ( log.isDebugEnabled() )
-            	{
-            		
-            	}
+                
             }
         }
     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestGrammar.java Sun Jun  4 17:00:09 2006
@@ -34,6 +34,9 @@
 import org.apache.directory.shared.ldap.codec.LdapStatesEnum;
 import org.apache.directory.shared.ldap.codec.util.LdapString;
 import org.apache.directory.shared.ldap.codec.util.LdapStringEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeIdentifierException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -89,7 +92,7 @@
             LdapStatesEnum.ADD_REQUEST_VALUE, LdapStatesEnum.ADD_REQUEST_ENTRY_TAG, new GrammarAction(
                 "Init addRequest" )
             {
-                public void action( IAsn1Container container ) throws DecoderException
+                public void action( IAsn1Container container ) throws DecoderException, NamingException
                 {
 
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
@@ -147,7 +150,6 @@
                         try
                         {
                             entry = new LdapDN( tlv.getValue().getData() );
-                            entry = LdapDN.normalize( entry );
                         }
                         catch ( InvalidNameException ine )
                         {
@@ -156,13 +158,6 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                             throw new DecoderException( msg, ine );
                         }
-                        catch ( NamingException ne )
-                        {
-                            String msg = "The DN is invalid : " + StringTools.dumpBytes( tlv.getValue().getData() )
-                                + " : " + ne.getMessage();
-                            log.error( "{} : {}", msg, ne.getMessage() );
-                            throw new DecoderException( msg, ne );
-                        }
 
                         addRequest.setEntry( entry );
                     }
@@ -233,7 +228,7 @@
             LdapStatesEnum.ADD_REQUEST_ATTRIBUTE_TYPE_VALUE, LdapStatesEnum.ADD_REQUEST_ATTRIBUTE_VALS_TAG,
             new GrammarAction( "Store attribute type" )
             {
-                public void action( IAsn1Container container ) throws DecoderException
+                public void action( IAsn1Container container ) throws DecoderException, NamingException
                 {
 
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
@@ -254,7 +249,7 @@
                     {
                         try
                         {
-                            type = LdapDN.normalizeAttribute( tlv.getValue().getData() );
+                            type = new LdapString( tlv.getValue().getData() );
 
                             addRequest.addAttributeType( type );
                         }
@@ -262,7 +257,7 @@
                         {
                             log.error( "The type is invalid : {} : {}", StringTools
                                 .dumpBytes( tlv.getValue().getData() ), lsee.getMessage() );
-                            throw new DecoderException( "Invalid attribute type : " + lsee.getMessage() );
+                            throw new LdapInvalidAttributeIdentifierException( "Invalid attribute type : " + lsee.getMessage() );
                         }
                     }
 

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindRequestGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindRequestGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindRequestGrammar.java Sun Jun  4 17:00:09 2006
@@ -18,7 +18,6 @@
 
 
 import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
 
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
@@ -217,7 +216,6 @@
                         try
                         {
                             name = new LdapDN( tlv.getValue().getData() );
-                            name = LdapDN.normalize( name );
                         }
                         catch ( InvalidNameException ine )
                         {
@@ -225,13 +223,6 @@
                                 + " : " + ine.getMessage();
                             log.error( "{} : {}", msg, ine.getMessage() );
                             throw new DecoderException( msg, ine );
-                        }
-                        catch ( NamingException ne )
-                        {
-                            String msg = "Incorrect DN given : " + StringTools.dumpBytes( tlv.getValue().getData() )
-                                + " : " + ne.getMessage();
-                            log.error( "{} : {}", msg, ne.getMessage() );
-                            throw new DecoderException( msg, ne );
                         }
 
                         bindRequestMessage.setName( name );

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestGrammar.java Sun Jun  4 17:00:09 2006
@@ -18,7 +18,6 @@
 
 
 import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
 
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
@@ -138,7 +137,6 @@
                         try
                         {
                             entry = new LdapDN( tlv.getValue().getData() );
-                            entry = LdapDN.normalize( entry );
                         }
                         catch ( InvalidNameException ine )
                         {
@@ -147,13 +145,6 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                             throw new DecoderException( msg, ine );
                         }
-                        catch ( NamingException ne )
-                        {
-                            String msg = "The DN to compare  (" + StringTools.dumpBytes( tlv.getValue().getData() )
-                                + ") is invalid";
-                            log.error( "{} : {}", msg, ne.getMessage() );
-                            throw new DecoderException( msg, ne );
-                        }
 
                         compareRequest.setEntry( entry );
                     }
@@ -219,7 +210,7 @@
                     {
                         try
                         {
-                            LdapString type = LdapDN.normalizeAttribute( tlv.getValue().getData() );
+                            LdapString type = new LdapString( tlv.getValue().getData() );
                             compareRequest.setAttributeDesc( type );
                         }
                         catch ( LdapStringEncodingException lsee )

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestGrammar.java Sun Jun  4 17:00:09 2006
@@ -18,7 +18,6 @@
 
 
 import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
 
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
@@ -110,7 +109,6 @@
                         try
                         {
                             entry = new LdapDN( tlv.getValue().getData() );
-                            entry = LdapDN.normalize( entry );
                         }
                         catch ( InvalidNameException ine )
                         {
@@ -119,14 +117,6 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                             throw new DecoderException( msg, ine );
                         }
-                        catch ( NamingException ne )
-                        {
-                            String msg = "The DN to delete  (" + StringTools.dumpBytes( tlv.getValue().getData() )
-                                + ") is invalid";
-                            log.error( "{} : {}", msg, ne.getMessage() );
-                            throw new DecoderException( msg, ne );
-                        }
-
                         delRequest.setEntry( entry );
                     }
 

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectDecoder.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectDecoder.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectDecoder.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectDecoder.java Sun Jun  4 17:00:09 2006
@@ -19,6 +19,8 @@
 
 import java.nio.ByteBuffer;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -45,7 +47,7 @@
      * @throws DecoderException
      *             If the decoding failed
      */
-    public Asn1Object decode( byte[] stream ) throws DecoderException
+    public Asn1Object decode( byte[] stream ) throws DecoderException, NamingException
     {
         ByteBuffer bb = ByteBuffer.wrap( stream );
         GracefulDisconnectContainer container = new GracefulDisconnectContainer();

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownDecoder.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownDecoder.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownDecoder.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownDecoder.java Sun Jun  4 17:00:09 2006
@@ -19,6 +19,8 @@
 
 import java.nio.ByteBuffer;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -45,7 +47,7 @@
      * @throws DecoderException
      *             If the decoding failed
      */
-    public Asn1Object decode( byte[] stream ) throws DecoderException
+    public Asn1Object decode( byte[] stream ) throws DecoderException, NamingException
     {
         ByteBuffer bb = ByteBuffer.wrap( stream );
         GracefulShutdownContainer container = new GracefulShutdownContainer();

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java Sun Jun  4 17:00:09 2006
@@ -18,7 +18,6 @@
 
 
 import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
 
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
@@ -142,7 +141,6 @@
                         try
                         {
                             object = new LdapDN( tlv.getValue().getData() );
-                            object = LdapDN.normalize( object );
                         }
                         catch ( InvalidNameException ine )
                         {
@@ -151,13 +149,6 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                             throw new DecoderException( msg, ine );
                         }
-                        catch ( NamingException ne )
-                        {
-                            String msg = "Invalid DN " + StringTools.dumpBytes( tlv.getValue().getData() ) + ", : "
-                                + ne.getMessage();
-                            log.error( "{} : {}", msg, ne.getMessage() );
-                            throw new DecoderException( msg, ne );
-                        }
 
                         modifyRequest.setObject( object );
                     }
@@ -349,7 +340,7 @@
                     {
                         try
                         {
-                            type = LdapDN.normalizeAttribute( tlv.getValue().getData() );
+                            type = new LdapString( tlv.getValue().getData() );
                             modifyRequest.addAttributeTypeAndValues( type );
                         }
                         catch ( LdapStringEncodingException lsee )

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestGrammar.java Sun Jun  4 17:00:09 2006
@@ -18,7 +18,6 @@
 
 
 import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
 
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
@@ -142,7 +141,6 @@
                         try
                         {
                             entry = new LdapDN( tlv.getValue().getData() );
-                            entry = LdapDN.normalize( entry );
                         }
                         catch ( InvalidNameException ine )
                         {
@@ -151,13 +149,6 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                             throw new DecoderException( msg, ine );
                         }
-                        catch ( NamingException ne )
-                        {
-                            String msg = "The DN to modify  (" + StringTools.dumpBytes( tlv.getValue().getData() )
-                                + ") is invalid";
-                            log.error( "{} : {}", msg, ne.getMessage() );
-                            throw new DecoderException( msg, ne );
-                        }
 
                         modifyDNRequest.setEntry( entry );
                     }
@@ -215,7 +206,6 @@
                         try
                         {
                             LdapDN dn = new LdapDN( tlv.getValue().getData() );
-                            dn = LdapDN.normalize( dn );
                             newRdn = ( ( LdapDN ) dn ).getRdn( 0 );
                         }
                         catch ( InvalidNameException ine )
@@ -225,13 +215,6 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                             throw new DecoderException( msg, ine );
                         }
-                        catch ( NamingException ne )
-                        {
-                            String msg = "The new RDN (" + StringTools.dumpBytes( tlv.getValue().getData() )
-                                + ") is invalid";
-                            log.error( "{} : {}", msg, ne.getMessage() );
-                            throw new DecoderException( msg, ne );
-                        }
 
                         modifyDNRequest.setNewRDN( newRdn );
                     }
@@ -366,7 +349,6 @@
                         try
                         {
                             newSuperior = new LdapDN( tlv.getValue().getData() );
-                            newSuperior = LdapDN.normalize( newSuperior );
                         }
                         catch ( InvalidNameException ine )
                         {
@@ -374,13 +356,6 @@
                                 + ") is invalid";
                             log.error( "{} : {}", msg, ine.getMessage() );
                             throw new DecoderException( msg, ine );
-                        }
-                        catch ( NamingException ne )
-                        {
-                            String msg = "The new superior DN (" + StringTools.dumpBytes( tlv.getValue().getData() )
-                                + ") is invalid";
-                            log.error( "{} : {}", msg, ne.getMessage() );
-                            throw new DecoderException( msg, ne );
                         }
 
                         modifyDNRequest.setNewSuperior( newSuperior );

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java Sun Jun  4 17:00:09 2006
@@ -32,7 +32,6 @@
 import org.apache.directory.shared.ldap.codec.LdapStatesEnum;
 import org.apache.directory.shared.ldap.codec.util.LdapString;
 import org.apache.directory.shared.ldap.codec.util.LdapStringEncodingException;
-import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -473,7 +472,7 @@
 
                     try
                     {
-                        LdapString type = LdapDN.normalizeAttribute( tlv.getValue().getData() );
+                        LdapString type = new LdapString( tlv.getValue().getData() );
                         assertion.setAttributeDesc( type );
                     }
                     catch ( LdapStringEncodingException lsee )
@@ -572,7 +571,7 @@
                     {
                         try
                         {
-                            LdapString type = LdapDN.normalizeAttribute( tlv.getValue().getData() );
+                            LdapString type = new LdapString( tlv.getValue().getData() );
                             assertion.setAttributeDesc( type );
                         }
                         catch ( LdapStringEncodingException lsee )
@@ -644,7 +643,7 @@
                         // Store the value.
                         try
                         {
-                            LdapString type = LdapDN.normalizeAttribute( tlv.getValue().getData() );
+                            LdapString type = new LdapString( tlv.getValue().getData() );
                             presentFilter.setAttributeDescription( type );
                         }
                         catch ( LdapStringEncodingException lsee )

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/MatchingRuleAssertionGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/MatchingRuleAssertionGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/MatchingRuleAssertionGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/MatchingRuleAssertionGrammar.java Sun Jun  4 17:00:09 2006
@@ -33,7 +33,6 @@
 import org.apache.directory.shared.ldap.codec.LdapStatesEnum;
 import org.apache.directory.shared.ldap.codec.util.LdapString;
 import org.apache.directory.shared.ldap.codec.util.LdapStringEncodingException;
-import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -224,7 +223,7 @@
 
                         try
                         {
-                            LdapString type = LdapDN.normalizeAttribute( tlv.getValue().getData() );
+                            LdapString type = new LdapString( tlv.getValue().getData() );
                             extensibleMatchFilter.setType( type );
                         }
                         catch ( LdapStringEncodingException lsee )

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestGrammar.java Sun Jun  4 17:00:09 2006
@@ -18,7 +18,6 @@
 
 
 import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
 
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
@@ -144,19 +143,12 @@
                         try
                         {
                             baseObject = new LdapDN( tlv.getValue().getData() );
-                            baseObject = LdapDN.normalize( baseObject );
                         }
                         catch ( InvalidNameException ine )
                         {
                             String msg = "The root DN " + baseObject.toString() + " is invalid";
                             log.error( "{} : {}", msg, ine.getMessage() );
                             throw new DecoderException( msg, ine );
-                        }
-                        catch ( NamingException ne )
-                        {
-                            String msg = "The root DN " + baseObject.toString() + " cannot be modified";
-                            log.error( "{} : {}", msg, ne.getMessage() );
-                            throw new DecoderException( msg, ne );
                         }
                     }
 

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryGrammar.java Sun Jun  4 17:00:09 2006
@@ -18,7 +18,6 @@
 
 
 import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
 
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
@@ -144,7 +143,6 @@
                         try
                         {
                             objectName = new LdapDN( tlv.getValue().getData() );
-                            objectName = LdapDN.normalize( objectName );
                         }
                         catch ( InvalidNameException ine )
                         {
@@ -153,13 +151,6 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                             throw new DecoderException( msg, ine );
                         }
-                        catch ( NamingException ne )
-                        {
-                            String msg = "The DN " + StringTools.dumpBytes( tlv.getValue().getData() )
-                                + "is invalid : " + ne.getMessage();
-                            log.error( "{} : {}", msg, ne.getMessage() );
-                            throw new DecoderException( msg, ne );
-                        }
 
                         searchResultEntry.setObjectName( objectName );
                     }
@@ -260,7 +251,7 @@
                     {
                         try
                         {
-                            type = LdapDN.normalizeAttribute( tlv.getValue().getData() );
+                            type = new LdapString( tlv.getValue().getData() );
                             searchResultEntry.addAttributeValues( type );
                         }
                         catch ( LdapStringEncodingException lsee )

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilterGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilterGrammar.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilterGrammar.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilterGrammar.java Sun Jun  4 17:00:09 2006
@@ -31,7 +31,6 @@
 import org.apache.directory.shared.ldap.codec.LdapStatesEnum;
 import org.apache.directory.shared.ldap.codec.util.LdapString;
 import org.apache.directory.shared.ldap.codec.util.LdapStringEncodingException;
-import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -174,7 +173,7 @@
                     {
                         try
                         {
-                            LdapString type = LdapDN.normalizeAttribute( tlv.getValue().getData() );
+                            LdapString type = new LdapString( tlv.getValue().getData() );
                             substringFilter.setType( type );
                         }
                         catch ( LdapStringEncodingException lsee )

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlDecoder.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlDecoder.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlDecoder.java Sun Jun  4 17:00:09 2006
@@ -19,6 +19,8 @@
 
 import java.nio.ByteBuffer;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -43,7 +45,7 @@
     }
 
 
-    public Asn1Object decode( byte[] controlBytes ) throws DecoderException
+    public Asn1Object decode( byte[] controlBytes ) throws DecoderException, NamingException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
         EntryChangeControlContainer container = new EntryChangeControlContainer();

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlDecoder.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlDecoder.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlDecoder.java Sun Jun  4 17:00:09 2006
@@ -19,6 +19,8 @@
 
 import java.nio.ByteBuffer;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -43,7 +45,7 @@
     }
 
 
-    public Asn1Object decode( byte[] controlBytes ) throws DecoderException
+    public Asn1Object decode( byte[] controlBytes ) throws DecoderException, NamingException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
         PSearchControlContainer container = new PSearchControlContainer();

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlDecoder.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlDecoder.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlDecoder.java Sun Jun  4 17:00:09 2006
@@ -19,6 +19,8 @@
 
 import java.nio.ByteBuffer;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -43,7 +45,7 @@
     }
 
 
-    public Asn1Object decode( byte[] controlBytes ) throws DecoderException
+    public Asn1Object decode( byte[] controlBytes ) throws DecoderException, NamingException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
         SubEntryControlContainer container = new SubEntryControlContainer();

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java Sun Jun  4 17:00:09 2006
@@ -21,6 +21,8 @@
 import java.util.Iterator;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
@@ -65,7 +67,7 @@
     private Referral replicatedContexts = new ReferralImpl();
 
 
-    public GracefulDisconnect(byte[] value)
+    public GracefulDisconnect(byte[] value) throws NamingException
     {
         super( 0 );
         this.value = value;
@@ -92,7 +94,7 @@
     }
 
 
-    private void decodeValue()
+    private void decodeValue() throws NamingException
     {
         GracefulDisconnectDecoder decoder = new GracefulDisconnectDecoder();
         org.apache.directory.shared.ldap.codec.extended.operations.GracefulDisconnect codec = null;
@@ -189,6 +191,11 @@
         {
             log.error( "Failed while decoding response", e );
         }
+        catch ( NamingException e )
+        {
+            log.error( "Failed while decoding response", e );
+        }
+
         org.apache.directory.shared.ldap.codec.extended.operations.GracefulDisconnect codec = container
             .getGracefulDisconnect();
         this.delay = codec.getDelay();

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownRequest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownRequest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownRequest.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownRequest.java Sun Jun  4 17:00:09 2006
@@ -101,6 +101,11 @@
             log.error( "failed to decode payload", e );
             throw new RuntimeException( e );
         }
+        catch ( NamingException e )
+        {
+            log.error( "failed to decode payload", e );
+            throw new RuntimeException( e );
+        }
     }
 
 

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java Sun Jun  4 17:00:09 2006
@@ -30,8 +30,6 @@
 import javax.naming.Name;
 import javax.naming.NamingException;
 
-import org.apache.directory.shared.ldap.codec.util.LdapString;
-import org.apache.directory.shared.ldap.codec.util.LdapStringEncodingException;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -1345,34 +1343,5 @@
         newDn.normalize( newDn.upName );
 
         return newDn;
-    }
-
-
-    public static LdapDN normalize( LdapDN dn ) throws InvalidNameException, NamingException
-    {
-        return normalize( dn, DnOidContainer.getOids() );
-    }
-
-    /**
-     * Substitute OIDs and aliases for the simplest alias
-     * 
-     * @param tlv
-     *            The TLV which contains the data
-     * @return A simple attribute
-     * @throws LdapStringEncodingException
-     *             If the attribute is not valid
-     */
-    public static LdapString normalizeAttribute( byte[] data ) throws LdapStringEncodingException
-    {
-        LdapString type = new LdapString( data );
-
-        OidNormalizer oidNormalizer = ( OidNormalizer ) DnOidContainer.getOids().get( type.getString() );
-
-        if ( oidNormalizer != null )
-        {
-            type = new LdapString( StringTools.getBytesUtf8( oidNormalizer.getName() ) );
-        }
-
-        return type;
     }
 }

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java Sun Jun  4 17:00:09 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();
@@ -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 );
 
@@ -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/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java Sun Jun  4 17:00:09 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/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java Sun Jun  4 17:00:09 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/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java Sun Jun  4 17:00:09 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/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java Sun Jun  4 17:00:09 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/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java Sun Jun  4 17:00:09 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();
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -1037,6 +1129,11 @@
         {
             de.printStackTrace();
             fail( de.getMessage() );
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         // Check the decoded BindRequest

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java Sun Jun  4 17:00:09 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/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java Sun Jun  4 17:00:09 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/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java Sun Jun  4 17:00:09 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/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java Sun Jun  4 17:00:09 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/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java Sun Jun  4 17:00:09 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/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java?rev=411625&r1=411624&r2=411625&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java Sun Jun  4 17:00:09 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" );



Mime
View raw message