Modified: directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/delete/BasicDeleteTests.java URL: http://svn.apache.org/viewcvs/directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/delete/BasicDeleteTests.java?rev=400067&r1=400066&r2=400067&view=diff ============================================================================== --- directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/delete/BasicDeleteTests.java (original) +++ directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/delete/BasicDeleteTests.java Fri May 5 05:52:49 2006 @@ -1,112 +1,112 @@ -/* - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.ldap.testsuite.ldaptests.jndi.ops.delete; - -import javax.naming.ContextNotEmptyException; -import javax.naming.NameNotFoundException; -import javax.naming.NamingException; -import javax.naming.directory.Attributes; -import javax.naming.directory.DirContext; - -import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; -import org.apache.ldap.testsuite.ldaptests.jndi.util.AttributesFactory; - -/** - * @author Apache Directory Project - * @version $Rev$ - */ -public class BasicDeleteTests extends BaseProtocolTest -{ - /** - * Basic deletion test. Creates an entry, delete it, and check whether it is - * gone. - * - * @throws NamingException - */ - public void testDeleteEntry() throws NamingException - { - - final String ou = "myUnit"; - final String rdn = "ou=myUnit"; - - DirContext ctx = this.createContext(); - DirContext target = (DirContext) ctx.lookup(this.getTestContainerRdn()); - - // Add an entry - Attributes attributes = AttributesFactory.createOrganizationalUnitAttributes(ou); - DirContext orgUnit = target.createSubcontext(rdn, attributes); - - // Check wether entry is created - orgUnit = (DirContext) target.lookup(rdn); - assertNotNull(orgUnit); - - // Delete Entry - target.unbind(rdn); - - // Check whether it is gone - try { - orgUnit = (DirContext) target.lookup(rdn); - fail("Deletion of entry failed"); - } catch (NameNotFoundException nnfe) { - // expected behaviour - assertTrue(true); - } - - ctx.close(); - } - - /** - * Deletion of an entry which is not a leaf. - * - * @throws NamingException - */ - public void testDeleteNonEmptyEntry() throws NamingException - { - DirContext ctx = this.createContext(); - DirContext target = (DirContext) ctx.lookup(this.getTestContainerRdn()); - - // Add an entry - final String ou = "nonLeaf"; - final String rdn = "ou=" + ou; - Attributes attributes = AttributesFactory.createOrganizationalUnitAttributes(ou); - target.createSubcontext(rdn, attributes); - - // Check wether entry is created - DirContext nonLeafRdn = (DirContext) target.lookup(rdn); - assertNotNull(nonLeafRdn); - - // Add an entry below this - final String ouLeaf = "leaf"; - final String rdnLeaf = "ou=" + ouLeaf; - attributes = AttributesFactory.createOrganizationalUnitAttributes(ouLeaf); - nonLeafRdn.createSubcontext(rdnLeaf, attributes); - - // Try to delete subtree Entry - try { - target.unbind(rdn); - fail("deletion of entry should fail."); - } catch (ContextNotEmptyException e) { - // expected; - } - - // Verify that entry soes exist - nonLeafRdn = (DirContext) target.lookup(rdn); - assertNotNull(nonLeafRdn); - - ctx.close(); - } -} +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.testsuite.ldaptests.jndi.ops.delete; + +import javax.naming.ContextNotEmptyException; +import javax.naming.NameNotFoundException; +import javax.naming.NamingException; +import javax.naming.directory.Attributes; +import javax.naming.directory.DirContext; + +import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; +import org.apache.ldap.testsuite.ldaptests.jndi.util.AttributesFactory; + +/** + * @author Apache Directory Project + * @version $Rev$ + */ +public class BasicDeleteTests extends BaseProtocolTest +{ + /** + * Basic deletion test. Creates an entry, delete it, and check whether it is + * gone. + * + * @throws NamingException + */ + public void testDeleteEntry() throws NamingException + { + + final String ou = "myUnit"; + final String rdn = "ou=myUnit"; + + DirContext ctx = this.createContext(); + DirContext target = (DirContext) ctx.lookup(this.getTestContainerRdn()); + + // Add an entry + Attributes attributes = AttributesFactory.createOrganizationalUnitAttributes(ou); + DirContext orgUnit = target.createSubcontext(rdn, attributes); + + // Check wether entry is created + orgUnit = (DirContext) target.lookup(rdn); + assertNotNull(orgUnit); + + // Delete Entry + target.unbind(rdn); + + // Check whether it is gone + try { + orgUnit = (DirContext) target.lookup(rdn); + fail("Deletion of entry failed"); + } catch (NameNotFoundException nnfe) { + // expected behaviour + assertTrue(true); + } + + ctx.close(); + } + + /** + * Deletion of an entry which is not a leaf. + * + * @throws NamingException + */ + public void testDeleteNonEmptyEntry() throws NamingException + { + DirContext ctx = this.createContext(); + DirContext target = (DirContext) ctx.lookup(this.getTestContainerRdn()); + + // Add an entry + final String ou = "nonLeaf"; + final String rdn = "ou=" + ou; + Attributes attributes = AttributesFactory.createOrganizationalUnitAttributes(ou); + target.createSubcontext(rdn, attributes); + + // Check wether entry is created + DirContext nonLeafRdn = (DirContext) target.lookup(rdn); + assertNotNull(nonLeafRdn); + + // Add an entry below this + final String ouLeaf = "leaf"; + final String rdnLeaf = "ou=" + ouLeaf; + attributes = AttributesFactory.createOrganizationalUnitAttributes(ouLeaf); + nonLeafRdn.createSubcontext(rdnLeaf, attributes); + + // Try to delete subtree Entry + try { + target.unbind(rdn); + fail("deletion of entry should fail."); + } catch (ContextNotEmptyException e) { + // expected; + } + + // Verify that entry soes exist + nonLeafRdn = (DirContext) target.lookup(rdn); + assertNotNull(nonLeafRdn); + + ctx.close(); + } +} Modified: directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/delete/TreeDeleteControlTests.java URL: http://svn.apache.org/viewcvs/directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/delete/TreeDeleteControlTests.java?rev=400067&r1=400066&r2=400067&view=diff ============================================================================== --- directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/delete/TreeDeleteControlTests.java (original) +++ directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/delete/TreeDeleteControlTests.java Fri May 5 05:52:49 2006 @@ -1,113 +1,113 @@ -/* - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.ldap.testsuite.ldaptests.jndi.ops.delete; - -import javax.naming.NameNotFoundException; -import javax.naming.NamingException; -import javax.naming.OperationNotSupportedException; -import javax.naming.directory.Attributes; -import javax.naming.directory.DirContext; -import javax.naming.ldap.Control; -import javax.naming.ldap.LdapContext; - -import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; -import org.apache.ldap.testsuite.ldaptests.jndi.util.AttributesFactory; - -/** - * @author Apache Directory Project - * @version $Rev$ - */ -public class TreeDeleteControlTests extends BaseProtocolTest -{ - class TreeDeleteControl implements Control - { - private static final long serialVersionUID = 1L; - - private boolean critical; - - TreeDeleteControl() { - this(Control.CRITICAL); - } - - TreeDeleteControl(boolean criticalValue) { - this.critical = criticalValue; - } - - public String getID() - { - return "1.2.840.113556.1.4.805"; - } - - public boolean isCritical() - { - return this.critical; - } - - public byte[] getEncodedValue() - { - return null; - } - } - - public void testDeleteSubtreeWithControl() throws NamingException - { - LdapContext ctx = this.createContext(); - LdapContext target = (LdapContext) ctx.lookup(this.getTestContainerRdn()); - - // Add an entry - final String ou = "nonLeaf"; - final String rdn = "ou=" + ou; - Attributes attributes = AttributesFactory.createOrganizationalUnitAttributes(ou); - target.createSubcontext(rdn, attributes); - - // Check wether entry is created - DirContext nonLeafRdn = (DirContext) target.lookup(rdn); - assertNotNull(nonLeafRdn); - - // Add an entry below this - final String ouLeaf = "leaf"; - final String rdnLeaf = "ou=" + ouLeaf; - attributes = AttributesFactory.createOrganizationalUnitAttributes(ouLeaf); - nonLeafRdn.createSubcontext(rdnLeaf, attributes); - - // Try to delete subtree Entry - boolean supported = true; - try { - target.setRequestControls(new Control[] { new TreeDeleteControl(Control.CRITICAL) }); - target.unbind(rdn); - } catch (OperationNotSupportedException e) { - // expected; - supported = false; - } - target.setRequestControls(null); - - // Check, whether entry is deleted - boolean deleted = false; - try { - target.lookup(rdn); - } catch (NameNotFoundException e) { - deleted = true; - } - - // Two option are valid here: - // 1. The control is not supported and the entry still exists - // 2. The control is supported and te entry is deleted - assertTrue((!supported & !deleted) || (supported & deleted)); - - ctx.close(); - } -} +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.testsuite.ldaptests.jndi.ops.delete; + +import javax.naming.NameNotFoundException; +import javax.naming.NamingException; +import javax.naming.OperationNotSupportedException; +import javax.naming.directory.Attributes; +import javax.naming.directory.DirContext; +import javax.naming.ldap.Control; +import javax.naming.ldap.LdapContext; + +import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; +import org.apache.ldap.testsuite.ldaptests.jndi.util.AttributesFactory; + +/** + * @author Apache Directory Project + * @version $Rev$ + */ +public class TreeDeleteControlTests extends BaseProtocolTest +{ + class TreeDeleteControl implements Control + { + private static final long serialVersionUID = 1L; + + private boolean critical; + + TreeDeleteControl() { + this(Control.CRITICAL); + } + + TreeDeleteControl(boolean criticalValue) { + this.critical = criticalValue; + } + + public String getID() + { + return "1.2.840.113556.1.4.805"; + } + + public boolean isCritical() + { + return this.critical; + } + + public byte[] getEncodedValue() + { + return null; + } + } + + public void testDeleteSubtreeWithControl() throws NamingException + { + LdapContext ctx = this.createContext(); + LdapContext target = (LdapContext) ctx.lookup(this.getTestContainerRdn()); + + // Add an entry + final String ou = "nonLeaf"; + final String rdn = "ou=" + ou; + Attributes attributes = AttributesFactory.createOrganizationalUnitAttributes(ou); + target.createSubcontext(rdn, attributes); + + // Check wether entry is created + DirContext nonLeafRdn = (DirContext) target.lookup(rdn); + assertNotNull(nonLeafRdn); + + // Add an entry below this + final String ouLeaf = "leaf"; + final String rdnLeaf = "ou=" + ouLeaf; + attributes = AttributesFactory.createOrganizationalUnitAttributes(ouLeaf); + nonLeafRdn.createSubcontext(rdnLeaf, attributes); + + // Try to delete subtree Entry + boolean supported = true; + try { + target.setRequestControls(new Control[] { new TreeDeleteControl(Control.CRITICAL) }); + target.unbind(rdn); + } catch (OperationNotSupportedException e) { + // expected; + supported = false; + } + target.setRequestControls(null); + + // Check, whether entry is deleted + boolean deleted = false; + try { + target.lookup(rdn); + } catch (NameNotFoundException e) { + deleted = true; + } + + // Two option are valid here: + // 1. The control is not supported and the entry still exists + // 2. The control is supported and te entry is deleted + assertTrue((!supported & !deleted) || (supported & deleted)); + + ctx.close(); + } +} Modified: directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/extended/AllTests.java URL: http://svn.apache.org/viewcvs/directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/extended/AllTests.java?rev=400067&r1=400066&r2=400067&view=diff ============================================================================== --- directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/extended/AllTests.java (original) +++ directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/extended/AllTests.java Fri May 5 05:52:49 2006 @@ -1,38 +1,38 @@ -/* - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.ldap.testsuite.ldaptests.jndi.ops.extended; - -import junit.framework.TestSuite; - -/** - * Contains the test classes for the LDAP extended operation executed via JNDI. - * It is used to form the complete suite into a structure. - * - * @author Apache Directory Project - * @version $Rev: $ - */ -public class AllTests extends TestSuite -{ - - public static TestSuite suite() - { - TestSuite suite = new TestSuite("Extended"); - suite.addTestSuite(UnknownExtendedOperationTest.class); - - return suite; - } -} +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.testsuite.ldaptests.jndi.ops.extended; + +import junit.framework.TestSuite; + +/** + * Contains the test classes for the LDAP extended operation executed via JNDI. + * It is used to form the complete suite into a structure. + * + * @author Apache Directory Project + * @version $Rev: $ + */ +public class AllTests extends TestSuite +{ + + public static TestSuite suite() + { + TestSuite suite = new TestSuite("Extended"); + suite.addTestSuite(UnknownExtendedOperationTest.class); + + return suite; + } +} Modified: directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/extended/UnknownExtendedOperationTest.java URL: http://svn.apache.org/viewcvs/directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/extended/UnknownExtendedOperationTest.java?rev=400067&r1=400066&r2=400067&view=diff ============================================================================== --- directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/extended/UnknownExtendedOperationTest.java (original) +++ directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/extended/UnknownExtendedOperationTest.java Fri May 5 05:52:49 2006 @@ -1,87 +1,87 @@ -/* - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.ldap.testsuite.ldaptests.jndi.ops.extended; - -import javax.naming.CommunicationException; -import javax.naming.NamingException; -import javax.naming.ldap.ExtendedRequest; -import javax.naming.ldap.ExtendedResponse; -import javax.naming.ldap.LdapContext; - -/** - * Checks the behaviour of the server for an unknown extended operation. Because - * extended operations are server dependent, this is the only test case for them - * within the suite. - * - * @author Apache Directory Project - * @version $Rev: $ - */ -public class UnknownExtendedOperationTest extends org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest -{ - - /** - * Checks the behaviour of the server for an unknown extended operation. It - * calls an extended exception, which does not exist. Expected behaviour is - * a CommunicationException. - * - * @throws NamingException - */ - public void testUnknownExtendedOperation() throws NamingException - { - LdapContext ctx = this.createContext(); - - try { - ctx.extendedOperation(new UnknownExtendedOperationRequest()); - fail("Calling an unknown extended operation should fail."); - } catch (CommunicationException ce) { - // expected behaviour - } - } - - /** - * Class for the request of an extended operation which does not exist. This - * is forced by using OID "1.1". - */ - private class UnknownExtendedOperationRequest implements ExtendedRequest - { - - private static final long serialVersionUID = 1L; - - public static final String OID = "1.1"; - - /** - * Returns the OID of the extended operation. - * - * @return the OID - */ - public String getID() - { - return OID; - } - - public byte[] getEncodedValue() - { - return null; - } - - public ExtendedResponse createExtendedResponse(String id, byte[] berValue, int offset, int length) - throws NamingException - { - return null; - } - } -} \ No newline at end of file +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.testsuite.ldaptests.jndi.ops.extended; + +import javax.naming.CommunicationException; +import javax.naming.NamingException; +import javax.naming.ldap.ExtendedRequest; +import javax.naming.ldap.ExtendedResponse; +import javax.naming.ldap.LdapContext; + +/** + * Checks the behaviour of the server for an unknown extended operation. Because + * extended operations are server dependent, this is the only test case for them + * within the suite. + * + * @author Apache Directory Project + * @version $Rev: $ + */ +public class UnknownExtendedOperationTest extends org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest +{ + + /** + * Checks the behaviour of the server for an unknown extended operation. It + * calls an extended exception, which does not exist. Expected behaviour is + * a CommunicationException. + * + * @throws NamingException + */ + public void testUnknownExtendedOperation() throws NamingException + { + LdapContext ctx = this.createContext(); + + try { + ctx.extendedOperation(new UnknownExtendedOperationRequest()); + fail("Calling an unknown extended operation should fail."); + } catch (CommunicationException ce) { + // expected behaviour + } + } + + /** + * Class for the request of an extended operation which does not exist. This + * is forced by using OID "1.1". + */ + private class UnknownExtendedOperationRequest implements ExtendedRequest + { + + private static final long serialVersionUID = 1L; + + public static final String OID = "1.1"; + + /** + * Returns the OID of the extended operation. + * + * @return the OID + */ + public String getID() + { + return OID; + } + + public byte[] getEncodedValue() + { + return null; + } + + public ExtendedResponse createExtendedResponse(String id, byte[] berValue, int offset, int length) + throws NamingException + { + return null; + } + } +} Modified: directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/AllTests.java URL: http://svn.apache.org/viewcvs/directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/AllTests.java?rev=400067&r1=400066&r2=400067&view=diff ============================================================================== --- directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/AllTests.java (original) +++ directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/AllTests.java Fri May 5 05:52:49 2006 @@ -1,42 +1,42 @@ -/* - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.ldap.testsuite.ldaptests.jndi.ops.modify; - -import junit.framework.TestSuite; - -/** - * Contains the test classes for the LDAP modify operation executed via JNDI. It - * is used to form the complete suite into a structure. - * - * @author Apache Directory Project - * @version $Rev$ - */ -public class AllTests extends TestSuite -{ - - public static TestSuite suite() - { - TestSuite suite = new TestSuite("Modify"); - - suite.addTestSuite(BasicModifyAddTests.class); - suite.addTestSuite(BasicModifyRemoveTests.class); - suite.addTestSuite(BasicModifyReplaceTests.class); - suite.addTestSuite(MixedModifyFailureTests.class); - - return suite; - } -} \ No newline at end of file +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.testsuite.ldaptests.jndi.ops.modify; + +import junit.framework.TestSuite; + +/** + * Contains the test classes for the LDAP modify operation executed via JNDI. It + * is used to form the complete suite into a structure. + * + * @author Apache Directory Project + * @version $Rev$ + */ +public class AllTests extends TestSuite +{ + + public static TestSuite suite() + { + TestSuite suite = new TestSuite("Modify"); + + suite.addTestSuite(BasicModifyAddTests.class); + suite.addTestSuite(BasicModifyRemoveTests.class); + suite.addTestSuite(BasicModifyReplaceTests.class); + suite.addTestSuite(MixedModifyFailureTests.class); + + return suite; + } +} Modified: directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyAddTests.java URL: http://svn.apache.org/viewcvs/directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyAddTests.java?rev=400067&r1=400066&r2=400067&view=diff ============================================================================== --- directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyAddTests.java (original) +++ directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyAddTests.java Fri May 5 05:52:49 2006 @@ -1,181 +1,181 @@ -/* - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.ldap.testsuite.ldaptests.jndi.ops.modify; - -import javax.naming.NamingException; -import javax.naming.directory.Attribute; -import javax.naming.directory.AttributeInUseException; -import javax.naming.directory.Attributes; -import javax.naming.directory.BasicAttribute; -import javax.naming.directory.BasicAttributes; -import javax.naming.directory.DirContext; - -import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; - -/** - * Tests for the modify operations with JNDI, which only include replace - * modifications. - * - * - * @author Apache Directory Project - * @version $Rev: $ - */ -public class BasicModifyAddTests extends BaseProtocolTest -{ - - DirContext start; - - DirContext ctx; - - public static final String RDN = "cn=Tori Amos"; - - public static final String PERSON_DESCRIPTION = "an American singer-songwriter"; - - protected Attributes getPersonAttributes(String sn, String cn) - { - Attributes attributes = new BasicAttributes(); - Attribute attribute = new BasicAttribute("objectClass"); - attribute.add("top"); - attribute.add("person"); - attributes.put(attribute); - attributes.put("cn", cn); - attributes.put("sn", sn); - - return attributes; - } - - public void setUp() throws NamingException - { - super.setUp(); - - start = this.createContext(); - ctx = (DirContext) start.lookup(this.getTestContainerRdn()); - - // Create a person with description - Attributes attributes = this.getPersonAttributes("Amos", "Tori Amos"); - attributes.put("description", PERSON_DESCRIPTION); - - ctx.createSubcontext(RDN, attributes); - } - - public void tearDown() throws NamingException - { - ctx.unbind(RDN); - ctx.close(); - - start.close(); - start = null; - - super.tearDown(); - } - - /** - * @throws NamingException - */ - public void testAddNewAttributeValue() throws NamingException - { - - // Change description attribute - String newValue = "1234567890"; - Attributes attrs = new BasicAttributes("telephoneNumber", newValue); - ctx.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, attrs); - - // Verify, that attribute value changed - attrs = ctx.getAttributes(RDN); - Attribute attr = attrs.get("telephoneNumber"); - assertNotNull(attr); - assertTrue(attr.contains(newValue)); - assertEquals(1, attr.size()); - } - - /** - * @throws NamingException - */ - public void testAddNewAttributeValues() throws NamingException - { - - // Change description attribute - String[] newValues = { "1234567890", "999999999" }; - Attribute attr = new BasicAttribute("telephoneNumber"); - attr.add(newValues[0]); - attr.add(newValues[1]); - Attributes attrs = new BasicAttributes(); - attrs.put(attr); - ctx.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, attrs); - - // Verify, that attribute values are present - attrs = ctx.getAttributes(RDN); - attr = attrs.get("telephoneNumber"); - assertNotNull(attr); - assertTrue(attr.contains(newValues[0])); - assertTrue(attr.contains(newValues[1])); - assertEquals(newValues.length, attr.size()); - } - - /** - * @throws NamingException - */ - public void testAddAdditionalAttributeValue() throws NamingException - { - - // A new description attribute value - String newValue = "A new description for this person"; - assertFalse(newValue.equals(PERSON_DESCRIPTION)); - Attributes attrs = new BasicAttributes("description", newValue); - - ctx.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, attrs); - - // Verify, that attribute value is added - attrs = ctx.getAttributes(RDN); - Attribute attr = attrs.get("description"); - assertNotNull(attr); - assertTrue(attr.contains(newValue)); - assertTrue(attr.contains(PERSON_DESCRIPTION)); - assertEquals(2, attr.size()); - } - - /** - * Try to add an already existing attribute value. - * - * Expected behaviour: Modify operation fails with an - * AttributeInUseException. Original LDAP Error code: 20 (Indicates that the - * attribute value specified in a modify or add operation already exists as - * a value for that attribute). - * - * @throws NamingException - */ - public void testAddExistingAttributeValue() throws NamingException - { - - // Change description attribute - Attributes attrs = new BasicAttributes("description", PERSON_DESCRIPTION); - try { - ctx.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, attrs); - fail("Adding an already existing atribute value should fail."); - } catch (AttributeInUseException e) { - // expected behaviour - } - - // Verify, that attribute is still there, and is the only one - attrs = ctx.getAttributes(RDN); - Attribute attr = attrs.get("description"); - assertNotNull(attr); - assertTrue(attr.contains(PERSON_DESCRIPTION)); - assertEquals(1, attr.size()); - } - -} \ No newline at end of file +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.testsuite.ldaptests.jndi.ops.modify; + +import javax.naming.NamingException; +import javax.naming.directory.Attribute; +import javax.naming.directory.AttributeInUseException; +import javax.naming.directory.Attributes; +import javax.naming.directory.BasicAttribute; +import javax.naming.directory.BasicAttributes; +import javax.naming.directory.DirContext; + +import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; + +/** + * Tests for the modify operations with JNDI, which only include replace + * modifications. + * + * + * @author Apache Directory Project + * @version $Rev: $ + */ +public class BasicModifyAddTests extends BaseProtocolTest +{ + + DirContext start; + + DirContext ctx; + + public static final String RDN = "cn=Tori Amos"; + + public static final String PERSON_DESCRIPTION = "an American singer-songwriter"; + + protected Attributes getPersonAttributes(String sn, String cn) + { + Attributes attributes = new BasicAttributes(); + Attribute attribute = new BasicAttribute("objectClass"); + attribute.add("top"); + attribute.add("person"); + attributes.put(attribute); + attributes.put("cn", cn); + attributes.put("sn", sn); + + return attributes; + } + + public void setUp() throws NamingException + { + super.setUp(); + + start = this.createContext(); + ctx = (DirContext) start.lookup(this.getTestContainerRdn()); + + // Create a person with description + Attributes attributes = this.getPersonAttributes("Amos", "Tori Amos"); + attributes.put("description", PERSON_DESCRIPTION); + + ctx.createSubcontext(RDN, attributes); + } + + public void tearDown() throws NamingException + { + ctx.unbind(RDN); + ctx.close(); + + start.close(); + start = null; + + super.tearDown(); + } + + /** + * @throws NamingException + */ + public void testAddNewAttributeValue() throws NamingException + { + + // Change description attribute + String newValue = "1234567890"; + Attributes attrs = new BasicAttributes("telephoneNumber", newValue); + ctx.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, attrs); + + // Verify, that attribute value changed + attrs = ctx.getAttributes(RDN); + Attribute attr = attrs.get("telephoneNumber"); + assertNotNull(attr); + assertTrue(attr.contains(newValue)); + assertEquals(1, attr.size()); + } + + /** + * @throws NamingException + */ + public void testAddNewAttributeValues() throws NamingException + { + + // Change description attribute + String[] newValues = { "1234567890", "999999999" }; + Attribute attr = new BasicAttribute("telephoneNumber"); + attr.add(newValues[0]); + attr.add(newValues[1]); + Attributes attrs = new BasicAttributes(); + attrs.put(attr); + ctx.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, attrs); + + // Verify, that attribute values are present + attrs = ctx.getAttributes(RDN); + attr = attrs.get("telephoneNumber"); + assertNotNull(attr); + assertTrue(attr.contains(newValues[0])); + assertTrue(attr.contains(newValues[1])); + assertEquals(newValues.length, attr.size()); + } + + /** + * @throws NamingException + */ + public void testAddAdditionalAttributeValue() throws NamingException + { + + // A new description attribute value + String newValue = "A new description for this person"; + assertFalse(newValue.equals(PERSON_DESCRIPTION)); + Attributes attrs = new BasicAttributes("description", newValue); + + ctx.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, attrs); + + // Verify, that attribute value is added + attrs = ctx.getAttributes(RDN); + Attribute attr = attrs.get("description"); + assertNotNull(attr); + assertTrue(attr.contains(newValue)); + assertTrue(attr.contains(PERSON_DESCRIPTION)); + assertEquals(2, attr.size()); + } + + /** + * Try to add an already existing attribute value. + * + * Expected behaviour: Modify operation fails with an + * AttributeInUseException. Original LDAP Error code: 20 (Indicates that the + * attribute value specified in a modify or add operation already exists as + * a value for that attribute). + * + * @throws NamingException + */ + public void testAddExistingAttributeValue() throws NamingException + { + + // Change description attribute + Attributes attrs = new BasicAttributes("description", PERSON_DESCRIPTION); + try { + ctx.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, attrs); + fail("Adding an already existing atribute value should fail."); + } catch (AttributeInUseException e) { + // expected behaviour + } + + // Verify, that attribute is still there, and is the only one + attrs = ctx.getAttributes(RDN); + Attribute attr = attrs.get("description"); + assertNotNull(attr); + assertTrue(attr.contains(PERSON_DESCRIPTION)); + assertEquals(1, attr.size()); + } + +} Modified: directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyRemoveTests.java URL: http://svn.apache.org/viewcvs/directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyRemoveTests.java?rev=400067&r1=400066&r2=400067&view=diff ============================================================================== --- directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyRemoveTests.java (original) +++ directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyRemoveTests.java Fri May 5 05:52:49 2006 @@ -1,273 +1,273 @@ -/* - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.ldap.testsuite.ldaptests.jndi.ops.modify; - -import javax.naming.InvalidNameException; -import javax.naming.NamingException; -import javax.naming.directory.Attribute; -import javax.naming.directory.Attributes; -import javax.naming.directory.BasicAttribute; -import javax.naming.directory.BasicAttributes; -import javax.naming.directory.DirContext; -import javax.naming.directory.InvalidAttributeIdentifierException; -import javax.naming.directory.NoSuchAttributeException; -import javax.naming.directory.SchemaViolationException; - -import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; - -/** - * Tests for the modify operations with JNDI, which only include simple remove - * modifications. - * - * @author Apache Directory Project - * @version $Rev: $ - */ -public class BasicModifyRemoveTests extends BaseProtocolTest -{ - - DirContext ctx; - - DirContext target; - - public static final String RDN = "cn=Tori Amos"; - - protected Attributes getInetOrgPersonAttributes(String sn, String cn) - { - Attributes attributes = new BasicAttributes(); - Attribute attribute = new BasicAttribute("objectClass"); - attribute.add("top"); - attribute.add("person"); - attribute.add("organizationalPerson"); - attribute.add("inetOrgPerson"); - - attributes.put(attribute); - attributes.put("cn", cn); - attributes.put("sn", sn); - - return attributes; - } - - public void setUp() throws NamingException - { - super.setUp(); - - ctx = this.createContext(); - target = (DirContext) ctx.lookup(this.getTestContainerRdn()); - - // Create a person with description - Attributes attributes = this.getInetOrgPersonAttributes("Amos", "Tori Amos"); - attributes.put("description", "an American singer-songwriter"); - - target.createSubcontext(RDN, attributes); - } - - public void tearDown() throws NamingException - { - target.unbind(RDN); - target.close(); - - ctx.close(); - ctx = null; - - super.tearDown(); - } - - /** - * Remove an attribute, which is not required. - * - * Expected result: After successful deletion, attribute is not present in - * entry. - * - * @throws NamingException - */ - public void testRemoveNotRequiredAttribute() throws NamingException - { - - // Remove description Attribute - Attribute attr = new BasicAttribute("description"); - Attributes attrs = new BasicAttributes(); - attrs.put(attr); - target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); - - // Verify, that attribute is deleted - attrs = target.getAttributes(RDN); - attr = attrs.get("description"); - assertNull(attr); - } - - /** - * Remove two not required attributes. - * - * Expected result: After successful deletion, both attributes ar not - * present in entry. - * - * @throws NamingException - */ - public void testRemoveTwoNotRequiredAttributes() throws NamingException - { - - // add telephoneNumber to entry - Attributes tn = new BasicAttributes("telephoneNumber", "12345678"); - target.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, tn); - - // Remove description and telephoneNumber to Attribute - Attributes attrs = new BasicAttributes(); - attrs.put(new BasicAttribute("description")); - attrs.put(new BasicAttribute("telephoneNumber")); - target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); - - // Verify, that attributes are deleted - attrs = target.getAttributes(RDN); - assertNull(attrs.get("description")); - assertNull(attrs.get("telephoneNumber")); - assertNotNull(attrs.get("cn")); - assertNotNull(attrs.get("sn")); - } - - /** - * Remove a required attribute. - * - * Expected Result: Deletion fails with NamingException (Schema Violation). - * - * @throws NamingException - */ - public void testRemoveRequiredAttribute() throws NamingException - { - - // Remove sn attribute - Attribute attr = new BasicAttribute("sn"); - Attributes attrs = new BasicAttributes(); - attrs.put(attr); - - try { - target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); - fail("Deletion of required attribute should fail."); - } catch (SchemaViolationException e) { - // expected behaviour - } - } - - /** - * Remove a required attribute from RDN. - * - * Expected Result: Deletion fails with SchemaViolationException. - * - * @throws NamingException - */ - public void testRemovePartOfRdn() throws NamingException - { - - // Remove sn attribute - Attribute attr = new BasicAttribute("cn"); - Attributes attrs = new BasicAttributes(); - attrs.put(attr); - - try { - target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); - fail("Deletion of RDN attribute should fail."); - } catch (NamingException e) { - // expected behaviour - } - } - - /** - * Remove a not required attribute from RDN. - * - * Expected Result: Deletion fails with SchemaViolationException. - * - * @throws NamingException - */ - public void testRemovePartOfRdnNotRequired() throws NamingException - { - - // add uid attribute - Attributes uid = new BasicAttributes("uid", "tamos"); - target.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, uid); - - // Change RDN to another attribute (uid) - String newRdn = "uid=tamos"; - target.addToEnvironment("java.naming.ldap.deleteRDN", "false"); - target.rename(RDN, newRdn); - - // Remove uid, which is now RDN attribute - Attribute attr = new BasicAttribute("uid"); - Attributes attrs = new BasicAttributes(); - attrs.put(attr); - - try { - target.modifyAttributes(newRdn, DirContext.REMOVE_ATTRIBUTE, attrs); - fail("Deletion of RDN attribute should fail."); - } catch (SchemaViolationException e) { - // expected behaviour - } catch (InvalidNameException e) { - // Expected behaviour - } - - // Change RDN back to original - target.addToEnvironment("java.naming.ldap.deleteRDN", "false"); - target.rename(newRdn, RDN); - } - - /** - * Remove a an attribute which is not present on the entry, but in the - * schema. - * - * Expected result: Deletion fails with NoSuchAttributeException - * - * @throws NamingException - */ - public void testRemoveAttributeNotPresent() throws NamingException - { - - // Remove telephoneNumber Attribute - Attribute attr = new BasicAttribute("telephoneNumber"); - Attributes attrs = new BasicAttributes(); - attrs.put(attr); - - try { - target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); - fail("Deletion of attribute, which is not present in the entry, should fail."); - } catch (NoSuchAttributeException e) { - // expected behaviour - } - } - - /** - * Remove a an attribute which is not present in the schema. - * - * Expected result: Deletion fails with NoSuchAttributeException - * - * @throws NamingException - */ - public void testRemoveAttributeNotValid() throws NamingException - { - - // Remove phantasy attribute - Attribute attr = new BasicAttribute("XXX"); - Attributes attrs = new BasicAttributes(); - attrs.put(attr); - - try { - target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); - fail("Deletion of an invalid attribute should fail."); - } catch (NoSuchAttributeException e) { - // expected behaviour - } catch (InvalidAttributeIdentifierException e) { - // expected behaviour - } - } -} \ No newline at end of file +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.testsuite.ldaptests.jndi.ops.modify; + +import javax.naming.InvalidNameException; +import javax.naming.NamingException; +import javax.naming.directory.Attribute; +import javax.naming.directory.Attributes; +import javax.naming.directory.BasicAttribute; +import javax.naming.directory.BasicAttributes; +import javax.naming.directory.DirContext; +import javax.naming.directory.InvalidAttributeIdentifierException; +import javax.naming.directory.NoSuchAttributeException; +import javax.naming.directory.SchemaViolationException; + +import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; + +/** + * Tests for the modify operations with JNDI, which only include simple remove + * modifications. + * + * @author Apache Directory Project + * @version $Rev: $ + */ +public class BasicModifyRemoveTests extends BaseProtocolTest +{ + + DirContext ctx; + + DirContext target; + + public static final String RDN = "cn=Tori Amos"; + + protected Attributes getInetOrgPersonAttributes(String sn, String cn) + { + Attributes attributes = new BasicAttributes(); + Attribute attribute = new BasicAttribute("objectClass"); + attribute.add("top"); + attribute.add("person"); + attribute.add("organizationalPerson"); + attribute.add("inetOrgPerson"); + + attributes.put(attribute); + attributes.put("cn", cn); + attributes.put("sn", sn); + + return attributes; + } + + public void setUp() throws NamingException + { + super.setUp(); + + ctx = this.createContext(); + target = (DirContext) ctx.lookup(this.getTestContainerRdn()); + + // Create a person with description + Attributes attributes = this.getInetOrgPersonAttributes("Amos", "Tori Amos"); + attributes.put("description", "an American singer-songwriter"); + + target.createSubcontext(RDN, attributes); + } + + public void tearDown() throws NamingException + { + target.unbind(RDN); + target.close(); + + ctx.close(); + ctx = null; + + super.tearDown(); + } + + /** + * Remove an attribute, which is not required. + * + * Expected result: After successful deletion, attribute is not present in + * entry. + * + * @throws NamingException + */ + public void testRemoveNotRequiredAttribute() throws NamingException + { + + // Remove description Attribute + Attribute attr = new BasicAttribute("description"); + Attributes attrs = new BasicAttributes(); + attrs.put(attr); + target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); + + // Verify, that attribute is deleted + attrs = target.getAttributes(RDN); + attr = attrs.get("description"); + assertNull(attr); + } + + /** + * Remove two not required attributes. + * + * Expected result: After successful deletion, both attributes ar not + * present in entry. + * + * @throws NamingException + */ + public void testRemoveTwoNotRequiredAttributes() throws NamingException + { + + // add telephoneNumber to entry + Attributes tn = new BasicAttributes("telephoneNumber", "12345678"); + target.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, tn); + + // Remove description and telephoneNumber to Attribute + Attributes attrs = new BasicAttributes(); + attrs.put(new BasicAttribute("description")); + attrs.put(new BasicAttribute("telephoneNumber")); + target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); + + // Verify, that attributes are deleted + attrs = target.getAttributes(RDN); + assertNull(attrs.get("description")); + assertNull(attrs.get("telephoneNumber")); + assertNotNull(attrs.get("cn")); + assertNotNull(attrs.get("sn")); + } + + /** + * Remove a required attribute. + * + * Expected Result: Deletion fails with NamingException (Schema Violation). + * + * @throws NamingException + */ + public void testRemoveRequiredAttribute() throws NamingException + { + + // Remove sn attribute + Attribute attr = new BasicAttribute("sn"); + Attributes attrs = new BasicAttributes(); + attrs.put(attr); + + try { + target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); + fail("Deletion of required attribute should fail."); + } catch (SchemaViolationException e) { + // expected behaviour + } + } + + /** + * Remove a required attribute from RDN. + * + * Expected Result: Deletion fails with SchemaViolationException. + * + * @throws NamingException + */ + public void testRemovePartOfRdn() throws NamingException + { + + // Remove sn attribute + Attribute attr = new BasicAttribute("cn"); + Attributes attrs = new BasicAttributes(); + attrs.put(attr); + + try { + target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); + fail("Deletion of RDN attribute should fail."); + } catch (NamingException e) { + // expected behaviour + } + } + + /** + * Remove a not required attribute from RDN. + * + * Expected Result: Deletion fails with SchemaViolationException. + * + * @throws NamingException + */ + public void testRemovePartOfRdnNotRequired() throws NamingException + { + + // add uid attribute + Attributes uid = new BasicAttributes("uid", "tamos"); + target.modifyAttributes(RDN, DirContext.ADD_ATTRIBUTE, uid); + + // Change RDN to another attribute (uid) + String newRdn = "uid=tamos"; + target.addToEnvironment("java.naming.ldap.deleteRDN", "false"); + target.rename(RDN, newRdn); + + // Remove uid, which is now RDN attribute + Attribute attr = new BasicAttribute("uid"); + Attributes attrs = new BasicAttributes(); + attrs.put(attr); + + try { + target.modifyAttributes(newRdn, DirContext.REMOVE_ATTRIBUTE, attrs); + fail("Deletion of RDN attribute should fail."); + } catch (SchemaViolationException e) { + // expected behaviour + } catch (InvalidNameException e) { + // Expected behaviour + } + + // Change RDN back to original + target.addToEnvironment("java.naming.ldap.deleteRDN", "false"); + target.rename(newRdn, RDN); + } + + /** + * Remove a an attribute which is not present on the entry, but in the + * schema. + * + * Expected result: Deletion fails with NoSuchAttributeException + * + * @throws NamingException + */ + public void testRemoveAttributeNotPresent() throws NamingException + { + + // Remove telephoneNumber Attribute + Attribute attr = new BasicAttribute("telephoneNumber"); + Attributes attrs = new BasicAttributes(); + attrs.put(attr); + + try { + target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); + fail("Deletion of attribute, which is not present in the entry, should fail."); + } catch (NoSuchAttributeException e) { + // expected behaviour + } + } + + /** + * Remove a an attribute which is not present in the schema. + * + * Expected result: Deletion fails with NoSuchAttributeException + * + * @throws NamingException + */ + public void testRemoveAttributeNotValid() throws NamingException + { + + // Remove phantasy attribute + Attribute attr = new BasicAttribute("XXX"); + Attributes attrs = new BasicAttributes(); + attrs.put(attr); + + try { + target.modifyAttributes(RDN, DirContext.REMOVE_ATTRIBUTE, attrs); + fail("Deletion of an invalid attribute should fail."); + } catch (NoSuchAttributeException e) { + // expected behaviour + } catch (InvalidAttributeIdentifierException e) { + // expected behaviour + } + } +} Modified: directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyReplaceTests.java URL: http://svn.apache.org/viewcvs/directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyReplaceTests.java?rev=400067&r1=400066&r2=400067&view=diff ============================================================================== --- directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyReplaceTests.java (original) +++ directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/BasicModifyReplaceTests.java Fri May 5 05:52:49 2006 @@ -1,134 +1,134 @@ -/* - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.ldap.testsuite.ldaptests.jndi.ops.modify; - -import javax.naming.NamingException; -import javax.naming.directory.Attribute; -import javax.naming.directory.Attributes; -import javax.naming.directory.BasicAttribute; -import javax.naming.directory.BasicAttributes; -import javax.naming.directory.DirContext; - -import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; - -/** - * Tests for the modify operations with JNDI, which only include replace - * modifications. - * - * @author Apache Directory Project - * @version $Rev: $ - */ -public class BasicModifyReplaceTests extends BaseProtocolTest -{ - - DirContext ctx; - - DirContext target; - - public static final String RDN = "cn=Tori Amos"; - - protected Attributes getPersonAttributes(String sn, String cn) - { - Attributes attributes = new BasicAttributes(); - Attribute attribute = new BasicAttribute("objectClass"); - attribute.add("top"); - attribute.add("person"); - attributes.put(attribute); - attributes.put("cn", cn); - attributes.put("sn", sn); - - return attributes; - } - - public void setUp() throws NamingException - { - super.setUp(); - - ctx = this.createContext(); - target = (DirContext) ctx.lookup(this.getTestContainerRdn()); - - // Create a person with description - Attributes attributes = this.getPersonAttributes("Amos", "Tori Amos"); - attributes.put("description", "an American singer-songwriter"); - - target.createSubcontext(RDN, attributes); - } - - public void tearDown() throws NamingException - { - target.unbind(RDN); - target.close(); - - ctx.close(); - ctx = null; - - super.tearDown(); - } - - /** - * Replace a not required attribute. - * - * Expected result: After successful deletion, attribute is not present in - * entry - * - * @throws NamingException - */ - public void testReplaceNotRequiredAttribute() throws NamingException - { - - // Change description attribute - String newValue = "A new description for this person"; - Attribute attr = new BasicAttribute("description", newValue); - Attributes attrs = new BasicAttributes(); - attrs.put(attr); - target.modifyAttributes(RDN, DirContext.REPLACE_ATTRIBUTE, attrs); - - // Verify, that attribute value changed - attrs = target.getAttributes(RDN); - attr = attrs.get("description"); - assertTrue(attr.contains(newValue)); - assertEquals(1, attr.size()); - - } - - /** - * Try to Replace RDN. - * - * @throws NamingException - */ - public void testTryToReplaceRdn() throws NamingException - { - - // Change RDN attribute cn - String newValue = "New Value"; - Attribute attr = new BasicAttribute("cn", newValue); - Attributes attrs = new BasicAttributes(); - attrs.put(attr); - try { - target.modifyAttributes(RDN, DirContext.REPLACE_ATTRIBUTE, attrs); - } catch (NamingException e) { - // expected behaviour - // TODO: refine Exception - } - - // Verify, that attribute value has not changed - attrs = target.getAttributes(RDN); - attr = attrs.get("cn"); - assertEquals(1, attr.size()); - assertFalse(attr.contains(newValue)); - } -} \ No newline at end of file +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.testsuite.ldaptests.jndi.ops.modify; + +import javax.naming.NamingException; +import javax.naming.directory.Attribute; +import javax.naming.directory.Attributes; +import javax.naming.directory.BasicAttribute; +import javax.naming.directory.BasicAttributes; +import javax.naming.directory.DirContext; + +import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; + +/** + * Tests for the modify operations with JNDI, which only include replace + * modifications. + * + * @author Apache Directory Project + * @version $Rev: $ + */ +public class BasicModifyReplaceTests extends BaseProtocolTest +{ + + DirContext ctx; + + DirContext target; + + public static final String RDN = "cn=Tori Amos"; + + protected Attributes getPersonAttributes(String sn, String cn) + { + Attributes attributes = new BasicAttributes(); + Attribute attribute = new BasicAttribute("objectClass"); + attribute.add("top"); + attribute.add("person"); + attributes.put(attribute); + attributes.put("cn", cn); + attributes.put("sn", sn); + + return attributes; + } + + public void setUp() throws NamingException + { + super.setUp(); + + ctx = this.createContext(); + target = (DirContext) ctx.lookup(this.getTestContainerRdn()); + + // Create a person with description + Attributes attributes = this.getPersonAttributes("Amos", "Tori Amos"); + attributes.put("description", "an American singer-songwriter"); + + target.createSubcontext(RDN, attributes); + } + + public void tearDown() throws NamingException + { + target.unbind(RDN); + target.close(); + + ctx.close(); + ctx = null; + + super.tearDown(); + } + + /** + * Replace a not required attribute. + * + * Expected result: After successful deletion, attribute is not present in + * entry + * + * @throws NamingException + */ + public void testReplaceNotRequiredAttribute() throws NamingException + { + + // Change description attribute + String newValue = "A new description for this person"; + Attribute attr = new BasicAttribute("description", newValue); + Attributes attrs = new BasicAttributes(); + attrs.put(attr); + target.modifyAttributes(RDN, DirContext.REPLACE_ATTRIBUTE, attrs); + + // Verify, that attribute value changed + attrs = target.getAttributes(RDN); + attr = attrs.get("description"); + assertTrue(attr.contains(newValue)); + assertEquals(1, attr.size()); + + } + + /** + * Try to Replace RDN. + * + * @throws NamingException + */ + public void testTryToReplaceRdn() throws NamingException + { + + // Change RDN attribute cn + String newValue = "New Value"; + Attribute attr = new BasicAttribute("cn", newValue); + Attributes attrs = new BasicAttributes(); + attrs.put(attr); + try { + target.modifyAttributes(RDN, DirContext.REPLACE_ATTRIBUTE, attrs); + } catch (NamingException e) { + // expected behaviour + // TODO: refine Exception + } + + // Verify, that attribute value has not changed + attrs = target.getAttributes(RDN); + attr = attrs.get("cn"); + assertEquals(1, attr.size()); + assertFalse(attr.contains(newValue)); + } +} Modified: directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/MixedModifyFailureTests.java URL: http://svn.apache.org/viewcvs/directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/MixedModifyFailureTests.java?rev=400067&r1=400066&r2=400067&view=diff ============================================================================== --- directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/MixedModifyFailureTests.java (original) +++ directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modify/MixedModifyFailureTests.java Fri May 5 05:52:49 2006 @@ -1,181 +1,181 @@ -/* - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.ldap.testsuite.ldaptests.jndi.ops.modify; - -import javax.naming.InvalidNameException; -import javax.naming.NamingException; -import javax.naming.directory.Attribute; -import javax.naming.directory.AttributeInUseException; -import javax.naming.directory.Attributes; -import javax.naming.directory.BasicAttribute; -import javax.naming.directory.BasicAttributes; -import javax.naming.directory.DirContext; -import javax.naming.directory.ModificationItem; -import javax.naming.directory.SchemaViolationException; - -import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; - -/** - * Tests with several modification items within one modify operation, which - * cause an error. Goal is to chcek whether the modify operation is atomic. - * - * @author Apache Directory Project - * @version $Rev: $ - */ -public class MixedModifyFailureTests extends BaseProtocolTest -{ - - DirContext start; - - DirContext ctx; - - public static final String RDN = "cn=Tori Amos"; - - public static final String PERSON_DESCRIPTION = "an American singer-songwriter"; - - protected Attributes getPersonAttributes(String sn, String cn) - { - Attributes attributes = new BasicAttributes(); - Attribute attribute = new BasicAttribute("objectClass"); - attribute.add("top"); - attribute.add("person"); - attributes.put(attribute); - attributes.put("cn", cn); - attributes.put("sn", sn); - - return attributes; - } - - public void setUp() throws NamingException - { - super.setUp(); - - start = this.createContext(); - ctx = (DirContext) start.lookup(this.getTestContainerRdn()); - - // Create a person with description - Attributes attributes = this.getPersonAttributes("Amos", "Tori Amos"); - attributes.put("description", PERSON_DESCRIPTION); - - ctx.createSubcontext(RDN, attributes); - } - - public void tearDown() throws NamingException - { - ctx.unbind(RDN); - ctx.close(); - - start.close(); - start = null; - - super.tearDown(); - } - - /** - * Try to add a new attribute (allowed) and to replace the RDN attribute - * (forbidden). - * - * @throws NamingException - */ - public void testAddAndIllegalReplace() throws NamingException - { - - // Add telephoneNumber attribute - String newValue = "1234567890"; - Attribute telephoneNumber = new BasicAttribute("telephoneNumber", newValue); - ModificationItem modAdd = new ModificationItem(DirContext.ADD_ATTRIBUTE, telephoneNumber); - - // Try to replace a desciption value, which does not exist - Attribute cn = new BasicAttribute("cn", "XXX"); - ModificationItem modReplace = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, cn); - - // execute modify: 1. add, 2. replace - ModificationItem[] mods = new ModificationItem[] { modAdd, modReplace }; - try { - ctx.modifyAttributes(RDN, mods); - fail("mofify operation should fail."); - } catch (SchemaViolationException e) { - // Expected behaviour - } catch (InvalidNameException e) { - // Expected behaviour - } - - // Verify, that no telephone attribute was created, and cn has bot been - // changed - Attributes attrs = ctx.getAttributes(RDN); - assertNull(attrs.get("telephoneNumber")); - cn = attrs.get("cn"); - assertNotNull(cn); - assertTrue(cn.contains("Tori Amos")); - - // Mix the sequence of modification items: 1. replace, 2. add - mods = new ModificationItem[] { modReplace, modAdd }; - try { - ctx.modifyAttributes(RDN, mods); - fail("modify operation should fail."); - } catch (SchemaViolationException e) { - // Expected behaviour - } catch (InvalidNameException e) { - // Expected behaviour - } - - // Verify again, that no telephone attribute was created, and cn has bot - // been changed - attrs = ctx.getAttributes(RDN); - assertNull(attrs.get("telephoneNumber")); - cn = attrs.get("cn"); - assertNotNull(cn); - assertTrue(cn.contains("Tori Amos")); - } - - /** - * Try to remove an attribute (allowed) and add an attribute value twice - * (forbidden) within one modify op. Expected behaviour is that the modify - * op fails and the entry is not changed. - * - * @throws NamingException - */ - public void testRemoveAndDuplicateAdd() throws NamingException - { - - // Remove description attribute - Attribute description = new BasicAttribute("description"); - ModificationItem modRemove = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, description); - - // Try to add a new desciption value - Attribute telephoneNumber = new BasicAttribute("telephoneNumber", "01234567890"); - ModificationItem modAdd = new ModificationItem(DirContext.ADD_ATTRIBUTE, telephoneNumber); - - // execute modify: 1. remove, 2. add, 3. same add - ModificationItem[] mods = new ModificationItem[] { modRemove, modAdd, modAdd }; - try { - ctx.modifyAttributes(RDN, mods); - fail("modify operation should fail."); - } catch (AttributeInUseException e) { - // Expected behaviour - } - - // Verify, that description has not been removed, and telephoneNumber - // has not been added - Attributes attrs = ctx.getAttributes(RDN); - System.err.println(attrs); - description = attrs.get("description"); - assertNotNull(description); - assertTrue(description.contains(PERSON_DESCRIPTION)); - assertNull(attrs.get("telephoneNumber")); - } -} \ No newline at end of file +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.testsuite.ldaptests.jndi.ops.modify; + +import javax.naming.InvalidNameException; +import javax.naming.NamingException; +import javax.naming.directory.Attribute; +import javax.naming.directory.AttributeInUseException; +import javax.naming.directory.Attributes; +import javax.naming.directory.BasicAttribute; +import javax.naming.directory.BasicAttributes; +import javax.naming.directory.DirContext; +import javax.naming.directory.ModificationItem; +import javax.naming.directory.SchemaViolationException; + +import org.apache.ldap.testsuite.ldaptests.jndi.BaseProtocolTest; + +/** + * Tests with several modification items within one modify operation, which + * cause an error. Goal is to chcek whether the modify operation is atomic. + * + * @author Apache Directory Project + * @version $Rev: $ + */ +public class MixedModifyFailureTests extends BaseProtocolTest +{ + + DirContext start; + + DirContext ctx; + + public static final String RDN = "cn=Tori Amos"; + + public static final String PERSON_DESCRIPTION = "an American singer-songwriter"; + + protected Attributes getPersonAttributes(String sn, String cn) + { + Attributes attributes = new BasicAttributes(); + Attribute attribute = new BasicAttribute("objectClass"); + attribute.add("top"); + attribute.add("person"); + attributes.put(attribute); + attributes.put("cn", cn); + attributes.put("sn", sn); + + return attributes; + } + + public void setUp() throws NamingException + { + super.setUp(); + + start = this.createContext(); + ctx = (DirContext) start.lookup(this.getTestContainerRdn()); + + // Create a person with description + Attributes attributes = this.getPersonAttributes("Amos", "Tori Amos"); + attributes.put("description", PERSON_DESCRIPTION); + + ctx.createSubcontext(RDN, attributes); + } + + public void tearDown() throws NamingException + { + ctx.unbind(RDN); + ctx.close(); + + start.close(); + start = null; + + super.tearDown(); + } + + /** + * Try to add a new attribute (allowed) and to replace the RDN attribute + * (forbidden). + * + * @throws NamingException + */ + public void testAddAndIllegalReplace() throws NamingException + { + + // Add telephoneNumber attribute + String newValue = "1234567890"; + Attribute telephoneNumber = new BasicAttribute("telephoneNumber", newValue); + ModificationItem modAdd = new ModificationItem(DirContext.ADD_ATTRIBUTE, telephoneNumber); + + // Try to replace a desciption value, which does not exist + Attribute cn = new BasicAttribute("cn", "XXX"); + ModificationItem modReplace = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, cn); + + // execute modify: 1. add, 2. replace + ModificationItem[] mods = new ModificationItem[] { modAdd, modReplace }; + try { + ctx.modifyAttributes(RDN, mods); + fail("mofify operation should fail."); + } catch (SchemaViolationException e) { + // Expected behaviour + } catch (InvalidNameException e) { + // Expected behaviour + } + + // Verify, that no telephone attribute was created, and cn has bot been + // changed + Attributes attrs = ctx.getAttributes(RDN); + assertNull(attrs.get("telephoneNumber")); + cn = attrs.get("cn"); + assertNotNull(cn); + assertTrue(cn.contains("Tori Amos")); + + // Mix the sequence of modification items: 1. replace, 2. add + mods = new ModificationItem[] { modReplace, modAdd }; + try { + ctx.modifyAttributes(RDN, mods); + fail("modify operation should fail."); + } catch (SchemaViolationException e) { + // Expected behaviour + } catch (InvalidNameException e) { + // Expected behaviour + } + + // Verify again, that no telephone attribute was created, and cn has bot + // been changed + attrs = ctx.getAttributes(RDN); + assertNull(attrs.get("telephoneNumber")); + cn = attrs.get("cn"); + assertNotNull(cn); + assertTrue(cn.contains("Tori Amos")); + } + + /** + * Try to remove an attribute (allowed) and add an attribute value twice + * (forbidden) within one modify op. Expected behaviour is that the modify + * op fails and the entry is not changed. + * + * @throws NamingException + */ + public void testRemoveAndDuplicateAdd() throws NamingException + { + + // Remove description attribute + Attribute description = new BasicAttribute("description"); + ModificationItem modRemove = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, description); + + // Try to add a new desciption value + Attribute telephoneNumber = new BasicAttribute("telephoneNumber", "01234567890"); + ModificationItem modAdd = new ModificationItem(DirContext.ADD_ATTRIBUTE, telephoneNumber); + + // execute modify: 1. remove, 2. add, 3. same add + ModificationItem[] mods = new ModificationItem[] { modRemove, modAdd, modAdd }; + try { + ctx.modifyAttributes(RDN, mods); + fail("modify operation should fail."); + } catch (AttributeInUseException e) { + // Expected behaviour + } + + // Verify, that description has not been removed, and telephoneNumber + // has not been added + Attributes attrs = ctx.getAttributes(RDN); + System.err.println(attrs); + description = attrs.get("description"); + assertNotNull(description); + assertTrue(description.contains(PERSON_DESCRIPTION)); + assertNull(attrs.get("telephoneNumber")); + } +} Modified: directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modifydn/AllTests.java URL: http://svn.apache.org/viewcvs/directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modifydn/AllTests.java?rev=400067&r1=400066&r2=400067&view=diff ============================================================================== --- directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modifydn/AllTests.java (original) +++ directory/trunks/testsuites/src/main/java/org/apache/ldap/testsuite/ldaptests/jndi/ops/modifydn/AllTests.java Fri May 5 05:52:49 2006 @@ -1,40 +1,40 @@ -/* - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.ldap.testsuite.ldaptests.jndi.ops.modifydn; - -import junit.framework.TestSuite; - -/** - * Contains the test classes for the LDAP modify DN operation executed via JNDI. - * It is used to form the complete suite into a structure. - * - * @author Apache Directory Project - * @version $Rev$ - */ -public class AllTests extends TestSuite -{ - - public static TestSuite suite() - { - TestSuite suite = new TestSuite("Modify DN"); - - suite.addTestSuite(BasicModifyDnTests.class); - suite.addTestSuite(ModifyDnSameAttributeTests.class); - - return suite; - } -} +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.testsuite.ldaptests.jndi.ops.modifydn; + +import junit.framework.TestSuite; + +/** + * Contains the test classes for the LDAP modify DN operation executed via JNDI. + * It is used to form the complete suite into a structure. + * + * @author Apache Directory Project + * @version $Rev$ + */ +public class AllTests extends TestSuite +{ + + public static TestSuite suite() + { + TestSuite suite = new TestSuite("Modify DN"); + + suite.addTestSuite(BasicModifyDnTests.class); + suite.addTestSuite(ModifyDnSameAttributeTests.class); + + return suite; + } +}