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/18 18:34:58 UTC
svn commit: r924913 [2/2] -
/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java?rev=924913&r1=924912&r2=924913&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java Thu Mar 18 17:34:57 2010
@@ -32,7 +32,7 @@ import java.util.List;
import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
+import javax.naming.OperationNotSupportedException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttribute;
@@ -43,6 +43,7 @@ import javax.naming.directory.SearchCont
import javax.naming.directory.SearchResult;
import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
import org.apache.directory.shared.ldap.ldif.LdifUtils;
@@ -103,8 +104,9 @@ public class MetaSyntaxHandlerIT extends
DN dn = getSyntaxContainer( "apachemeta" );
dn.add( "m-oid" + "=" + OID );
+
createDummySyntaxChecker( OID, "apachemeta" );
- getSchemaContext( service ).createSubcontext( dn, attrs );
+ getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
assertTrue( schemaManager.getLdapSyntaxRegistry().contains( OID ) );
assertEquals( schemaManager.getLdapSyntaxRegistry().getSchemaName( OID ), "apachemeta" );
@@ -126,7 +128,7 @@ public class MetaSyntaxHandlerIT extends
DN dn = getSyntaxContainer( "nis" );
dn.add( "m-oid" + "=" + OID );
createDummySyntaxChecker( OID, "nis" );
- getSchemaContext( service ).createSubcontext( dn, attrs );
+ getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
assertFalse( "adding new syntax to disabled schema should not register it into the registries",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
@@ -151,7 +153,7 @@ public class MetaSyntaxHandlerIT extends
try
{
- getSchemaContext( service ).createSubcontext( dn, attrs );
+ getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
fail( "Should not be there" );
}
catch( NameNotFoundException nnfe )
@@ -176,7 +178,7 @@ public class MetaSyntaxHandlerIT extends
assertTrue( "syntax should be removed from the registry after being deleted",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
- getSchemaContext( service ).destroySubcontext( dn );
+ getSchemaContext( service ).destroySubcontext( DN.toName( dn ) );
assertFalse( "syntax should be removed from the registry after being deleted",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
@@ -186,7 +188,7 @@ public class MetaSyntaxHandlerIT extends
schemaManager.getLdapSyntaxRegistry().lookup( OID );
fail( "syntax lookup should fail after deleting it" );
}
- catch( NamingException e )
+ catch( LdapException e )
{
}
@@ -205,7 +207,7 @@ public class MetaSyntaxHandlerIT extends
assertFalse( "syntax should be removed from the registry after being deleted",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
- getSchemaContext( service ).destroySubcontext( dn );
+ getSchemaContext( service ).destroySubcontext( DN.toName( dn ) );
assertFalse( "syntax should be removed from the registry after being deleted",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
@@ -215,7 +217,7 @@ public class MetaSyntaxHandlerIT extends
schemaManager.getLdapSyntaxRegistry().lookup( OID );
fail( "syntax lookup should fail after deleting it" );
}
- catch( NamingException e )
+ catch( LdapException e )
{
}
@@ -233,7 +235,7 @@ public class MetaSyntaxHandlerIT extends
DN newdn = getSyntaxContainer( "apachemeta" );
newdn.add( "m-oid" + "=" + NEW_OID );
- getSchemaContext( service ).rename( dn, newdn );
+ getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
assertFalse( "old syntax OID should be removed from the registry after being renamed",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
@@ -244,7 +246,7 @@ public class MetaSyntaxHandlerIT extends
schemaManager.getLdapSyntaxRegistry().lookup( OID );
fail( "syntax lookup should fail after deleting the syntax" );
}
- catch( NamingException e )
+ catch( LdapException e )
{
}
@@ -264,7 +266,7 @@ public class MetaSyntaxHandlerIT extends
DN newdn = getSyntaxContainer( "apache" );
newdn.add( "m-oid" + "=" + OID );
- getSchemaContext( service ).rename( dn, newdn );
+ getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
assertTrue( "syntax OID should still be present",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
@@ -286,7 +288,7 @@ public class MetaSyntaxHandlerIT extends
DN newdn = getSyntaxContainer( "apache" );
newdn.add( "m-oid" + "=" + NEW_OID );
- getSchemaContext( service ).rename( dn, newdn );
+ getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
assertFalse( "old syntax OID should NOT be present",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
@@ -314,7 +316,7 @@ public class MetaSyntaxHandlerIT extends
ModificationItem[] mods = new ModificationItem[1];
Attribute attr = new BasicAttribute( "m-description", DESCRIPTION1 );
mods[0] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
- getSchemaContext( service ).modifyAttributes( dn, mods );
+ getSchemaContext( service ).modifyAttributes( DN.toName( dn ), mods );
assertTrue( "syntax OID should still be present",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
@@ -341,7 +343,7 @@ public class MetaSyntaxHandlerIT extends
Attributes mods = new BasicAttributes( true );
mods.put( "m-description", DESCRIPTION1 );
- getSchemaContext( service ).modifyAttributes( dn, DirContext.REPLACE_ATTRIBUTE, mods );
+ getSchemaContext( service ).modifyAttributes( DN.toName( dn ), DirContext.REPLACE_ATTRIBUTE, mods );
assertTrue( "syntax OID should still be present",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
@@ -369,12 +371,11 @@ public class MetaSyntaxHandlerIT extends
try
{
- getSchemaContext( service ).destroySubcontext( dn );
+ getSchemaContext( service ).destroySubcontext( DN.toName( dn ) );
fail( "should not be able to delete a syntax in use" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( e.getResultCode(), ResultCodeEnum.UNWILLING_TO_PERFORM );
}
assertTrue( "syntax should still be in the registry after delete failure",
@@ -397,7 +398,7 @@ public class MetaSyntaxHandlerIT extends
try
{
- getSchemaContext( service ).rename( dn, newdn );
+ getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
fail( "should not be able to move a syntax in use" );
}
catch( LdapUnwillingToPerformException e )
@@ -425,7 +426,7 @@ public class MetaSyntaxHandlerIT extends
try
{
- getSchemaContext( service ).rename( dn, newdn );
+ getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
fail( "should not be able to move a syntax in use" );
}
catch( LdapUnwillingToPerformException e )
@@ -450,7 +451,7 @@ public class MetaSyntaxHandlerIT extends
DN dn = getMatchingRuleContainer( "apachemeta" );
dn.add( "m-oid" + "=" + MR_OID );
- getSchemaContext( service ).createSubcontext( dn, attrs );
+ getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
assertTrue( schemaManager.getMatchingRuleRegistry().contains( MR_OID ) );
assertEquals( schemaManager.getMatchingRuleRegistry().getSchemaName( MR_OID ), "apachemeta" );
@@ -471,7 +472,7 @@ public class MetaSyntaxHandlerIT extends
try
{
- getSchemaContext( service ).rename( dn, newdn );
+ getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
fail( "should not be able to rename a syntax in use" );
}
catch( LdapUnwillingToPerformException e )
@@ -503,7 +504,7 @@ public class MetaSyntaxHandlerIT extends
try
{
- getSchemaContext( service ).rename( dn, top );
+ getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( top ) );
fail( "should not be able to move a syntax up to ou=schema" );
}
catch( LdapInvalidDnException e )
@@ -530,7 +531,7 @@ public class MetaSyntaxHandlerIT extends
try
{
- getSchemaContext( service ).rename( dn, newdn );
+ getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
fail( "should not be able to move a syntax into comparators container" );
}
catch( LdapInvalidDnException e )
@@ -556,7 +557,7 @@ public class MetaSyntaxHandlerIT extends
DN newdn = getSyntaxContainer( "nis" );
newdn.add( "m-oid" + "=" + OID );
- getSchemaContext( service ).rename( dn, newdn );
+ getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
assertFalse( "syntax OID should no longer be present",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
@@ -579,7 +580,7 @@ public class MetaSyntaxHandlerIT extends
DN newdn = getSyntaxContainer( "apachemeta" );
newdn.add( "m-oid" + "=" + OID );
- getSchemaContext( service ).rename( dn, newdn );
+ getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
assertTrue( "syntax OID should be present when moved to enabled schema",
schemaManager.getLdapSyntaxRegistry().contains( OID ) );
@@ -612,7 +613,7 @@ public class MetaSyntaxHandlerIT extends
Attributes mods = new BasicAttributes( true );
mods.put( attr );
- getRootContext( service ).modifyAttributes( dn, op, mods );
+ getRootContext( service ).modifyAttributes( DN.toName( dn ), op, mods );
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java?rev=924913&r1=924912&r2=924913&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java Thu Mar 18 17:34:57 2010
@@ -40,6 +40,7 @@ import javax.naming.directory.SearchResu
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.name.DN;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -104,7 +105,7 @@ public class ObjectClassCreateIT extends
DN dn = new DN( "ou=attributeTypes,cn=apachemeta" );
dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22.249" );
- getSchemaContext( service ).createSubcontext( dn, attributes );
+ getSchemaContext( service ).createSubcontext( DN.toName( dn ), attributes );
//--------------------------------------------------------------------
// The extendPerson OC
@@ -142,7 +143,7 @@ public class ObjectClassCreateIT extends
dn = new DN( "ou=objectClasses,cn=apachemeta" );
dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22" );
- getSchemaContext( service ).createSubcontext( dn, attributes );
+ getSchemaContext( service ).createSubcontext( DN.toName( dn ), attributes );
}
/**
@@ -152,7 +153,7 @@ public class ObjectClassCreateIT extends
* @return the dn of the objectClass container
* @throws NamingException on error
*/
- private DN getObjectClassContainer( String schemaName ) throws NamingException
+ private DN getObjectClassContainer( String schemaName ) throws LdapInvalidDnException
{
return new DN( "ou=objectClasses,cn=" + schemaName );
}
@@ -183,7 +184,7 @@ public class ObjectClassCreateIT extends
try
{
- getSchemaContext( service ).createSubcontext( dn, attributes );
+ getSchemaContext( service ).createSubcontext( DN.toName( dn ), attributes );
fail(); // Should not reach this point
}
catch ( NamingException ne )
@@ -218,7 +219,7 @@ public class ObjectClassCreateIT extends
try
{
- getSchemaContext( service ).createSubcontext( dn, attributes );
+ getSchemaContext( service ).createSubcontext( DN.toName( dn ), attributes );
fail(); // Should not reach this point
}
catch ( NamingException ne )
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaPersistenceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaPersistenceIT.java?rev=924913&r1=924912&r2=924913&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaPersistenceIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaPersistenceIT.java Thu Mar 18 17:34:57 2010
@@ -148,7 +148,7 @@ public class SchemaPersistenceIT extends
Attributes mods = new BasicAttributes( true );
mods.put( attr );
- getRootContext( service ).modifyAttributes( dn, op, mods );
+ getRootContext( service ).modifyAttributes( DN.toName( dn ), op, mods );
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java?rev=924913&r1=924912&r2=924913&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java Thu Mar 18 17:34:57 2010
@@ -39,6 +39,7 @@ import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.SchemaViolationException;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.naming.ldap.LdapContext;
@@ -47,10 +48,9 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.entry.DefaultServerEntry;
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
-import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.exception.LdapOtherException;
import org.apache.directory.shared.ldap.ldif.LdifEntry;
import org.apache.directory.shared.ldap.ldif.LdifReader;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -101,9 +101,8 @@ public class SchemaServiceIT extends Abs
{
getSystemContext( service ).createSubcontext( "uid=invalid", attrs );
}
- catch ( LdapSchemaViolationException e )
+ catch ( SchemaViolationException e )
{
- assertEquals( ResultCodeEnum.OBJECT_CLASS_VIOLATION, e.getResultCode() );
}
}
@@ -127,9 +126,8 @@ public class SchemaServiceIT extends Abs
{
getSystemContext( service ).createSubcontext( "cn=Jack Black", attrs );
}
- catch ( LdapSchemaViolationException e )
+ catch ( SchemaViolationException e )
{
- assertEquals( ResultCodeEnum.OBJECT_CLASS_VIOLATION, e.getResultCode() );
}
}
@@ -188,7 +186,7 @@ public class SchemaServiceIT extends Abs
fail( "Should not be possible to create two schema entities with the same OID." );
}
- catch( NamingException e )
+ catch( LdapOtherException e )
{
assertTrue( true );
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=924913&r1=924912&r2=924913&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Thu Mar 18 17:34:57 2010
@@ -41,8 +41,10 @@ import java.util.List;
import java.util.TimeZone;
import javax.naming.Context;
+import javax.naming.NameAlreadyBoundException;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
+import javax.naming.OperationNotSupportedException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttribute;
@@ -60,9 +62,6 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.entry.ServerEntryUtils;
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
-import org.apache.directory.shared.ldap.exception.LdapEntryAlreadyExistsException;
-import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.LdapSyntax;
@@ -148,9 +147,8 @@ public class SubschemaSubentryIT extends
getRootContext( service ).destroySubcontext( getSubschemaSubentryDN() );
fail( "You are not allowed to delete the global schema subentry" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
}
@@ -168,9 +166,8 @@ public class SubschemaSubentryIT extends
getRootContext( service ).createSubcontext( getSubschemaSubentryDN(), getSubschemaSubentryAttributes() );
fail( "You are not allowed to add the global schema subentry which exists by default" );
}
- catch( LdapEntryAlreadyExistsException e )
+ catch( NameAlreadyBoundException e )
{
- assertEquals( ResultCodeEnum.ENTRY_ALREADY_EXISTS, e.getResultCode() );
}
}
@@ -188,9 +185,8 @@ public class SubschemaSubentryIT extends
getRootContext( service ).rename( getSubschemaSubentryDN(), "cn=schema,ou=system" );
fail( "You are not allowed to rename the global schema subentry which is fixed" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
}
@@ -208,9 +204,8 @@ public class SubschemaSubentryIT extends
getRootContext( service ).rename( getSubschemaSubentryDN(), "cn=blah,ou=schema" );
fail( "You are not allowed to move the global schema subentry which is fixed" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
try
@@ -218,9 +213,8 @@ public class SubschemaSubentryIT extends
getRootContext( service ).rename( getSubschemaSubentryDN(), "cn=schema,ou=schema" );
fail( "You are not allowed to move the global schema subentry which is fixed" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
}
@@ -354,9 +348,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.REPLACE_ATTRIBUTE, descriptions, "syntaxCheckers" );
fail( "modify REPLACE operations should not be allowed" );
}
- catch ( LdapUnwillingToPerformException e )
+ catch ( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
// -------------------------------------------------------------------
@@ -518,9 +511,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.REPLACE_ATTRIBUTE, descriptions, "comparators" );
fail( "modify REPLACE operations should not be allowed" );
}
- catch ( LdapUnwillingToPerformException e )
+ catch ( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
// -------------------------------------------------------------------
@@ -673,9 +665,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.REPLACE_ATTRIBUTE, descriptions, "normalizers" );
fail( "modify REPLACE operations should not be allowed" );
}
- catch ( LdapUnwillingToPerformException e )
+ catch ( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
// -------------------------------------------------------------------
@@ -810,9 +801,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.ADD_ATTRIBUTE, descriptions, "ldapSyntaxes" );
fail( "should not be able to add syntaxes without their syntaxCheckers" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
// none of the syntaxes should be present
@@ -865,9 +855,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.REPLACE_ATTRIBUTE, descriptions, "ldapSyntaxes" );
fail( "modify REPLACE operations should not be allowed" );
}
- catch ( LdapUnwillingToPerformException e )
+ catch ( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
// -------------------------------------------------------------------
@@ -981,9 +970,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.ADD_ATTRIBUTE, descriptions, "matchingRules" );
fail( "Cannot add matchingRule with bogus non-existant syntax" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
checkMatchingRulePresent( "1.3.6.1.4.1.18060.0.4.1.1.10000", "nis", false );
@@ -1075,9 +1063,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.REPLACE_ATTRIBUTE, descriptions, "matchingRules" );
fail( "modify REPLACE operations should not be allowed" );
}
- catch ( LdapUnwillingToPerformException e )
+ catch ( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
// -------------------------------------------------------------------
@@ -1196,9 +1183,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.ADD_ATTRIBUTE, descriptions, "attributeTypes" );
fail( "Cannot add attributeType with bogus non-existant syntax" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
checkAttributeTypePresent( "1.3.6.1.4.1.18060.0.4.1.2.10000", "nis", false );
@@ -1219,9 +1205,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.ADD_ATTRIBUTE, descriptions, "attributeTypes" );
fail( "Cannot add attributeType with bogus non-existant syntax" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
checkAttributeTypePresent( "1.3.6.1.4.1.18060.0.4.1.2.10000", "nis", false );
@@ -1242,9 +1227,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.ADD_ATTRIBUTE, descriptions, "attributeTypes" );
fail( "Cannot add attributeType with bogus non-existant equality MatchingRule" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
checkAttributeTypePresent( "1.3.6.1.4.1.18060.0.4.1.2.10000", "nis", false );
@@ -1265,9 +1249,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.ADD_ATTRIBUTE, descriptions, "attributeTypes" );
fail( "Cannot add attributeType with bogus non-existant ordering MatchingRule" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
checkAttributeTypePresent( "1.3.6.1.4.1.18060.0.4.1.2.10000", "nis", false );
@@ -1288,9 +1271,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.ADD_ATTRIBUTE, descriptions, "attributeTypes" );
fail( "Cannot add attributeType with bogus non-existant substrings MatchingRule" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
checkAttributeTypePresent( "1.3.6.1.4.1.18060.0.4.1.2.10000", "nis", false );
@@ -1364,9 +1346,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.REPLACE_ATTRIBUTE, descriptions, "attributeTypes" );
fail( "modify REPLACE operations should not be allowed" );
}
- catch ( LdapUnwillingToPerformException e )
+ catch ( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
// -------------------------------------------------------------------
@@ -1408,7 +1389,7 @@ public class SubschemaSubentryIT extends
mods[0] = new ModificationItem( DirContext.ADD_ATTRIBUTE,
new BasicAttribute( "attributeTypes", substrate ) );
- getRootContext( service ).modifyAttributes( dn, mods );
+ getRootContext( service ).modifyAttributes( DN.toName( dn ), mods );
Attributes attrs = getSubschemaSubentryAttributes();
Attribute attrTypes = attrs.get( "attributeTypes" );
@@ -1462,7 +1443,7 @@ public class SubschemaSubentryIT extends
mods[0] = new ModificationItem( DirContext.ADD_ATTRIBUTE,
new BasicAttribute( "attributeTypes", substrate ) );
- getRootContext( service ).modifyAttributes( dn, mods );
+ getRootContext( service ).modifyAttributes( DN.toName( dn ), mods );
Attributes attrs = getSubschemaSubentryAttributes();
Attribute attrTypes = attrs.get( "attributeTypes" );
@@ -1611,9 +1592,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.ADD_ATTRIBUTE, descriptions, "objectClasses" );
fail( "Cannot add objectClass with bogus non-existant super" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
checkObjectClassPresent( "1.3.6.1.4.1.18060.0.4.1.3.10000", "nis", false );
@@ -1712,9 +1692,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.ADD_ATTRIBUTE, descriptions, "objectClasses" );
fail( "Cannot add objectClass with bogus non-existant attributeTypes" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
checkObjectClassPresent( "1.3.6.1.4.1.18060.0.4.1.3.10000", "nis", false );
@@ -1737,9 +1716,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.ADD_ATTRIBUTE, descriptions, "objectClasses" );
fail( "Cannot add objectClass with bogus non-existant attributeTypes" );
}
- catch( LdapUnwillingToPerformException e )
+ catch( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
checkObjectClassPresent( "1.3.6.1.4.1.18060.0.4.1.3.10000", "nis", false );
@@ -1821,9 +1799,8 @@ public class SubschemaSubentryIT extends
modify( DirContext.REPLACE_ATTRIBUTE, descriptions, "objectClasses" );
fail( "modify REPLACE operations should not be allowed" );
}
- catch ( LdapUnwillingToPerformException e )
+ catch ( OperationNotSupportedException e )
{
- assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
}
// -------------------------------------------------------------------
@@ -1900,7 +1877,7 @@ public class SubschemaSubentryIT extends
mods[0] = new ModificationItem( DirContext.ADD_ATTRIBUTE,
new BasicAttribute( "attributeTypes", substrate ) );
- getRootContext( service ).modifyAttributes( dn, mods );
+ getRootContext( service ).modifyAttributes( DN.toName( dn ), mods );
// now check the modification timestamp and the modifiers name
@@ -1955,7 +1932,7 @@ public class SubschemaSubentryIT extends
"DESC 'bogus description' SUP name SINGLE-VALUE X-SCHEMA 'nis' )";
mods[0] = new ModificationItem( DirContext.ADD_ATTRIBUTE,
new BasicAttribute( "attributeTypes", substrate ) );
- ctx.modifyAttributes( dn, mods );
+ ctx.modifyAttributes( DN.toName( dn ), mods );
// now let's verify the new values for the modification attributes
@@ -1999,7 +1976,7 @@ public class SubschemaSubentryIT extends
modifications[i++] = new ModificationItem( op, new BasicAttribute( opAttr, description ) );
}
- getRootContext( service ).modifyAttributes( dn, modifications );
+ getRootContext( service ).modifyAttributes( DN.toName( dn ), modifications );
}