You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/03/16 18:04:12 UTC

svn commit: r923870 - in /directory/shared/trunk/ldap-schema-manager/src: main/java/org/apache/directory/shared/ldap/schema/manager/impl/ test/java/org/apache/directory/shared/ldap/schema/loader/ldif/

Author: elecharny
Date: Tue Mar 16 17:04:12 2010
New Revision: 923870

URL: http://svn.apache.org/viewvc?rev=923870&view=rev
Log:
Fixed the exceptions

Modified:
    directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java
    directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerAddTest.java
    directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerDelTest.java

Modified: directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java?rev=923870&r1=923869&r2=923870&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java (original)
+++ directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java Tue Mar 16 17:04:12 2010
@@ -34,8 +34,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.exception.LdapProtocolErrorException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
-import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+//import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -671,7 +672,7 @@ public class DefaultSchemaManager implem
                         // The dependency has not been loaded.
                         String msg = I18n.err( I18n.ERR_11002, schema.getSchemaName() );
                         LOG.info( msg );
-                        Throwable error = new LdapSchemaViolationException( ResultCodeEnum.OTHER, msg );
+                        Throwable error = new LdapProtocolErrorException( msg );
                         errors.add( error );
                         return false;
                     }
@@ -1639,7 +1640,7 @@ public class DefaultSchemaManager implem
             // The new schemaObject's OID must not already exist
             if ( checkOidExist( copy ) )
             {
-                Throwable error = new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                Throwable error = new LdapProtocolErrorException(
                 		I18n.err( I18n.ERR_11008, schemaObject.getOid() ) );
                 errors.add( error );
 
@@ -1669,7 +1670,7 @@ public class DefaultSchemaManager implem
                 // The SchemaObject must be associated with an existing schema
                 String msg = I18n.err( I18n.ERR_11010, copy.getOid() );
                 LOG.info( msg );
-                Throwable error = new LdapSchemaViolationException( ResultCodeEnum.OTHER, msg );
+                Throwable error = new LdapProtocolErrorException( msg );
                 errors.add( error );
                 return false;
             }
@@ -1742,7 +1743,7 @@ public class DefaultSchemaManager implem
             // The new schemaObject's OID must exist
             if ( !checkOidExist( schemaObject ) )
             {
-                Throwable error = new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                Throwable error = new LdapProtocolErrorException( 
                 		I18n.err( I18n.ERR_11011, schemaObject.getOid() ) );
                 errors.add( error );
                 return false;
@@ -1758,7 +1759,7 @@ public class DefaultSchemaManager implem
             {
                 String msg = I18n.err( I18n.ERR_11012, schemaObject.getOid(), StringTools.setToString( referencing ) );
 
-                Throwable error = new LdapSchemaViolationException( ResultCodeEnum.OTHER, msg );
+                Throwable error = new LdapProtocolErrorException( msg );
                 errors.add( error );
                 return false;
             }
@@ -1774,7 +1775,7 @@ public class DefaultSchemaManager implem
                 // The SchemaObject must be associated with an existing schema
                 String msg = I18n.err( I18n.ERR_11013, schemaObject.getOid() );
                 LOG.info( msg );
-                Throwable error = new LdapSchemaViolationException( ResultCodeEnum.OTHER, msg );
+                Throwable error = new LdapProtocolErrorException( msg );
                 errors.add( error );
                 return false;
             }

Modified: directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerAddTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerAddTest.java?rev=923870&r1=923869&r2=923870&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerAddTest.java (original)
+++ directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerAddTest.java Tue Mar 16 17:04:12 2010
@@ -33,7 +33,9 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.shared.ldap.exception.LdapAttributeInUseException;
 import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapProtocolErrorException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -223,7 +225,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
         assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
@@ -283,7 +285,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
         assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
@@ -316,7 +318,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
         assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
@@ -375,7 +377,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
         assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
@@ -407,7 +409,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
         assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
@@ -439,7 +441,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
         assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
@@ -495,7 +497,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         // The AT must be there
         assertTrue( isATPresent( schemaManager, "2.5.18.4" ) );
@@ -532,7 +534,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapAttributeInUseException );
 
         // The AT must not be there
         assertFalse( isATPresent( schemaManager, "1.1.1.0" ) );
@@ -635,7 +637,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
         assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
@@ -667,7 +669,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
         assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
@@ -699,7 +701,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
         assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
@@ -873,7 +875,7 @@ public class SchemaManagerAddTest
 
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isMRPresent( schemaManager, "1.1.0" ) );
 
@@ -902,7 +904,7 @@ public class SchemaManagerAddTest
 
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         // Check that the existing MR has not been replaced
         assertTrue( isMRPresent( schemaManager, "2.5.13.0" ) );
@@ -936,7 +938,7 @@ public class SchemaManagerAddTest
 
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapAttributeInUseException );
 
         assertEquals( mrrSize, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( goidSize, schemaManager.getGlobalOidRegistry().size() );
@@ -997,7 +999,8 @@ public class SchemaManagerAddTest
 
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
-        assertTrue( error instanceof LdapSchemaViolationException );
+        
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertEquals( mrrSize, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( goidSize, schemaManager.getGlobalOidRegistry().size() );
@@ -1200,7 +1203,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, schemaManager.getErrors().size() );
         Throwable error = schemaManager.getErrors().get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         ObjectClass added = schemaManager.lookupObjectClassRegistry( "2.5.17.0" );
 
@@ -1229,7 +1232,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, schemaManager.getErrors().size() );
         Throwable error = schemaManager.getErrors().get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapAttributeInUseException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.0" ) );
 
@@ -1284,7 +1287,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, schemaManager.getErrors().size() );
         Throwable error = schemaManager.getErrors().get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1311,7 +1314,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, schemaManager.getErrors().size() );
         Throwable error = schemaManager.getErrors().get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1336,7 +1339,7 @@ public class SchemaManagerAddTest
         assertFalse( schemaManager.add( objectClass ) );
 
         assertEquals( 1, schemaManager.getErrors().size() );
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1361,7 +1364,7 @@ public class SchemaManagerAddTest
         assertFalse( schemaManager.add( objectClass ) );
 
         assertEquals( 1, schemaManager.getErrors().size() );
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1388,7 +1391,7 @@ public class SchemaManagerAddTest
         assertFalse( schemaManager.add( objectClass ) );
 
         assertEquals( 1, schemaManager.getErrors().size() );
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1459,7 +1462,7 @@ public class SchemaManagerAddTest
 
         assertFalse( schemaManager.add( objectClass ) );
 
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1485,7 +1488,7 @@ public class SchemaManagerAddTest
 
         assertFalse( schemaManager.add( objectClass ) );
 
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1511,7 +1514,7 @@ public class SchemaManagerAddTest
 
         assertFalse( schemaManager.add( objectClass ) );
 
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1537,7 +1540,7 @@ public class SchemaManagerAddTest
 
         assertFalse( schemaManager.add( objectClass ) );
 
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1563,7 +1566,7 @@ public class SchemaManagerAddTest
 
         assertFalse( schemaManager.add( objectClass ) );
 
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1589,7 +1592,7 @@ public class SchemaManagerAddTest
 
         assertFalse( schemaManager.add( objectClass ) );
 
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1615,7 +1618,7 @@ public class SchemaManagerAddTest
 
         assertFalse( schemaManager.add( objectClass ) );
 
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1688,7 +1691,7 @@ public class SchemaManagerAddTest
 
         assertEquals( 1, schemaManager.getErrors().size() );
 
-        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( schemaManager.getErrors().get( 0 ) instanceof LdapProtocolErrorException );
 
         assertFalse( isOCPresent( schemaManager, "1.1.1" ) );
 
@@ -1749,7 +1752,7 @@ public class SchemaManagerAddTest
         assertEquals( 1, errors.size() );
         Throwable error = errors.get( 0 );
 
-        assertTrue( error instanceof LdapSchemaViolationException );
+        assertTrue( error instanceof LdapProtocolErrorException );
         assertEquals( sSize, schemaManager.getLdapSyntaxRegistry().size() );
         assertEquals( goidSize, schemaManager.getGlobalOidRegistry().size() );
     }

Modified: directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerDelTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerDelTest.java?rev=923870&r1=923869&r2=923870&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerDelTest.java (original)
+++ directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerDelTest.java Tue Mar 16 17:04:12 2010
@@ -32,7 +32,7 @@ import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.exception.LdapProtocolErrorException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.LdapSyntax;
@@ -398,7 +398,7 @@ public class SchemaManagerDelTest
 
         List<Throwable> errors = schemaManager.getErrors();
         assertFalse( errors.isEmpty() );
-        assertTrue( errors.get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );
 
         assertNotNull( schemaManager.lookupComparatorRegistry( "2.5.13.0" ) );
         assertEquals( ctrSize, schemaManager.getComparatorRegistry().size() );
@@ -432,7 +432,7 @@ public class SchemaManagerDelTest
 
         List<Throwable> errors = schemaManager.getErrors();
         assertFalse( errors.isEmpty() );
-        assertTrue( errors.get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );
 
         // Now delete the using MR : it should be OK
         MatchingRule mr = new MatchingRule( OID );
@@ -539,7 +539,7 @@ public class SchemaManagerDelTest
 
         List<Throwable> errors = schemaManager.getErrors();
         assertFalse( errors.isEmpty() );
-        assertTrue( errors.get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );
 
         // Now delete the using AT : it should be OK
         AttributeType at = new AttributeType( AT_OID );
@@ -639,7 +639,7 @@ public class SchemaManagerDelTest
 
         List<Throwable> errors = schemaManager.getErrors();
         assertFalse( errors.isEmpty() );
-        assertTrue( errors.get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );
 
         assertNotNull( schemaManager.lookupNormalizerRegistry( "2.5.13.0" ) );
         assertEquals( nrSize, schemaManager.getNormalizerRegistry().size() );
@@ -673,7 +673,7 @@ public class SchemaManagerDelTest
 
         List<Throwable> errors = schemaManager.getErrors();
         assertFalse( errors.isEmpty() );
-        assertTrue( errors.get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );
 
         // Now delete the using MR : it should be OK
         MatchingRule mr = new MatchingRule( OID );
@@ -753,7 +753,7 @@ public class SchemaManagerDelTest
         
         List<Throwable> errors = schemaManager.getErrors();
         assertFalse( errors.isEmpty() );
-        assertTrue( errors.get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );
 
         assertEquals( ocSize, schemaManager.getObjectClassRegistry().size() );
         assertEquals( goidSize, schemaManager.getGlobalOidRegistry().size() );
@@ -886,7 +886,7 @@ public class SchemaManagerDelTest
 
         List<Throwable> errors = schemaManager.getErrors();
         assertFalse( errors.isEmpty() );
-        assertTrue( errors.get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );
 
         // Now delete the using MR : it should be OK
         MatchingRule mr = new MatchingRule( MR_OID );
@@ -933,7 +933,7 @@ public class SchemaManagerDelTest
 
         List<Throwable> errors = schemaManager.getErrors();
         assertFalse( errors.isEmpty() );
-        assertTrue( errors.get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );
 
         // Now delete the using AT : it should be OK
         AttributeType at = new AttributeType( AT_OID );
@@ -979,7 +979,7 @@ public class SchemaManagerDelTest
 
         List<Throwable> errors = schemaManager.getErrors();
         assertFalse( errors.isEmpty() );
-        assertTrue( errors.get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );
 
         // Now delete the using S : it should be OK
         LdapSyntax syntax = new LdapSyntax( OID );
@@ -1069,7 +1069,7 @@ public class SchemaManagerDelTest
 
         List<Throwable> errors = schemaManager.getErrors();
         assertFalse( errors.isEmpty() );
-        assertTrue( errors.get( 0 ) instanceof LdapSchemaViolationException );
+        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );
 
         assertEquals( scrSize, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( goidSize, schemaManager.getGlobalOidRegistry().size() );