/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
* Portions Copyright 2011-2015 ForgeRock AS.
*/
/**
* A set of test cases for delete operations.
*/
@SuppressWarnings("javadoc")
{
/** Some of the tests disable the backends, so we reenable them here. */
@AfterMethod(alwaysRun=true)
}
/** {@inheritDoc} */
{
return new Operation[]
{
};
}
{
return new DeleteOperationBasis(
}
{
return new DeleteOperationBasis(
}
/**
* Tests the <CODE>getRawEntryDN</CODE> and <CODE>setRawEntryDN</CODE>
* methods.
*
* @param deleteOperation The delete operation to use in the test.
*/
{
}
/**
* Tests the <CODE>getEntryDN</CODE> method that should decode the rawEntryDN
* to compute the entryDN.
*/
@Test
public void testGetEntryDNNull()
{
}
/**
* Tests the <CODE>getEntryDN</CODE> method when it should not be null.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the <CODE>getEntryDN</CODE> method when it originally started as
* non-null, then was changed to null; because of the call to the
* <CODE>setRawEntry<CODE> method, and becomes non-null again because
* of the call to the <CODE>getEntryDN</CODE> again.
*
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Retrieves a number of generic elements from a completed delete operation.
* It should have completed successfully.
*/
private void retrieveCompletedOperationElements(
throws Exception
{
}
/**
* Tests the <CODE>getEntryToDelete</CODE> method for a successful delete
* operation.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
@SuppressWarnings("unchecked")
(List<LocalBackendDeleteOperation>) deleteOperation.getAttachment(Operation.LOCALBACKENDOPERATIONS);
{
}
}
{
}
{
}
/**
* Tests the <CODE>getEntryToDelete</CODE> method for a delete operation that
* fails because the target entry doesn't exist.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
@SuppressWarnings("unchecked")
(List<LocalBackendDeleteOperation>) deleteOperation.getAttachment(Operation.LOCALBACKENDOPERATIONS);
{
}
}
/**
* Tests an external delete operation.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation with a valid raw DN that is a suffix.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation with a valid processed DN that is a suffix.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation with a valid raw DN that is a leaf.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
"objectClass: top",
"objectClass: device",
"cn: test");
}
/**
* Tests the delete operation with a valid processed DN that is a leaf.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
"objectClass: top",
"objectClass: device",
"cn: test");
}
/**
* Tests the delete operation with a malformed raw DN.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation with a nonexistent raw DN that should be a
* suffix.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation with a nonexistent processed DN that should be a
* suffix.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation with a raw DN below a suffix that doesn't exist.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation with a processed DN below a suffix that doesn't
* exist.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation with a nonexistent raw DN below a suffix that
* does exist.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation with a nonexistent processed DN below a suffix
* that does exist.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation for a nonleaf raw DN.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
"objectClass: top",
"objectClass: device",
"cn: test");
}
/**
* Tests the delete operation for a nonleaf processed DN.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
"objectClass: top",
"objectClass: device",
"cn: test");
}
/**
* Tests the delete operation when the server has a writability mode of
* disabled.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests an internal delete operation when the server has a writability mode
* of internal-only.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests an external delete operation when the server has a writability mode
* of internal-only.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests the delete operation when the backend has a writability mode of
* disabled.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests an internal delete operation when the backend has a writability mode
* of internal-only.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests an external delete operation when the backend has a writability mode
* of internal-only.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
{
return new String[] {
"-h", "127.0.0.1",
"-D", "cn=Directory Manager",
"-w", "password",
};
}
/**
* Tests a delete operation that gets canceled before startup.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests a delete operation that gets canceled before startup.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
/**
* Tests a delete operation in which the server cannot obtain a lock on the
* target entry because there is already a read lock held on it.
*
* @throws Exception If an unexpected problem occurs.
*/
{
try
{
}
finally
{
}
}
/**
* Tests a delete operation that should be disconnected in a pre-parse plugin.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
LDAPWriter w = new LDAPWriter(s);
w.writeMessage(message);
message = r.readMessage();
w.writeMessage(message);
message = r.readMessage();
{
// If we got an element back, then it must be a notice of disconnect
// unsolicited notification.
}
StaticUtils.close(s);
}
/**
* Tests a delete operation that should be disconnected in a pre-operation
* plugin.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
LDAPWriter w = new LDAPWriter(s);
w.writeMessage(message);
message = r.readMessage();
"PreOperation"));
w.writeMessage(message);
message = r.readMessage();
{
// If we got an element back, then it must be a notice of disconnect
// unsolicited notification.
}
StaticUtils.close(s);
}
/**
* Tests a delete operation that should be disconnected in a post-operation
* plugin.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
LDAPWriter w = new LDAPWriter(s);
w.writeMessage(message);
message = r.readMessage();
"PostOperation"));
w.writeMessage(message);
message = r.readMessage();
{
// If we got an element back, then it must be a notice of disconnect
// unsolicited notification.
}
StaticUtils.close(s);
}
/**
* Tests a delete operation that should be disconnected in a post-response
* plugin.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
LDAPWriter w = new LDAPWriter(s);
w.writeMessage(message);
message = r.readMessage();
"PostResponse"));
w.writeMessage(message);
while (true)
{
message = r.readMessage();
{
// The connection has been closed.
break responseLoop;
}
switch (message.getProtocolOpType())
{
case OP_TYPE_DELETE_RESPONSE:
// This was expected. The disconnect didn't happen until after the
// response was sent.
break;
// The server is notifying us that it will be closing the connection.
break responseLoop;
default:
// This is a problem. It's an unexpected response.
StaticUtils.close(s);
" encountered in " +
"testDisconnectInPostResponseDelete");
}
}
StaticUtils.close(s);
}
/**
* Tests to ensure that any registered notification listeners are invoked for
* a successful delete operation.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
try
{
}
finally
{
}
}
/**
* Tests to ensure that any registered notification listeners are not invoked
* for a failed delete operation.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
try
{
}
finally
{
}
}
/**
* Tests the behavior of the server when short-circuiting out of a delete
* operation in the pre-parse phase with a success result code.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
{
}
}