DirectoryServerPluginTestCase.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* 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-2010 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* A set of generic test cases for the Directory Server plugin API.
*/
public class DirectoryServerPluginTestCase
extends PluginAPITestCase
{
public void initServer() throws Exception
{
}
/**
* Tests to ensure that no new abstract methods have been introduced which
* could impact backwards compatibility.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
public void testAbstractMethods()
throws Exception
{
{
{
for (Class c : m.getParameterTypes())
{
}
for (Class c : m.getExceptionTypes())
{
}
boolean found = false;
{
{
found = true;
break;
}
}
if (! found)
{
}
}
}
if (! newAbstractMethods.isEmpty())
{
"have been added to the plugin API:");
{
for (String s : methodList)
{
}
}
}
if (! expectedAbstractMethods.isEmpty())
{
"been removed from the plugin API:");
{
for (String s : methodList)
{
}
}
}
if ((! newAbstractMethods.isEmpty()) ||
(! expectedAbstractMethods.isEmpty()))
{
fail("It appears that set of abstract methods defined in the plugin " +
"API have been altered. This will only be allowed under " +
"extremely limited circumstances, as it will impact backward " +
"compatibility.");
}
}
/**
* Tests to ensure that none of the non-abstract public methods exposed by the
* plugin interface as part of the public API have been removed.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
public void testNonAbstractPublicAPIMethods()
throws Exception
{
"PreOperationExtendedOperation");
"PreOperationDeleteOperation");
"PreOperationSearchOperation");
"PreOperationCompareOperation");
"PreOperationModifyOperation");
"PreOperationModifyDNOperation");
"PostOperationCompareOperation");
"PostOperationModifyDNOperation");
"PostOperationExtendedOperation");
"PostOperationBindOperation");
"PostOperationAbandonOperation");
"PostOperationUnbindOperation");
"PostOperationModifyOperation");
"PostOperationDeleteOperation");
"PostOperationSearchOperation");
"PostResponseCompareOperation");
"PostResponseDeleteOperation");
"PostResponseSearchOperation");
"PostResponseExtendedOperation");
"PostResponseModifyOperation");
"PostResponseModifyDNOperation");
"PostSynchronizationAddOperation");
"PostSynchronizationDeleteOperation");
"PostSynchronizationModifyOperation");
"PostSynchronizationModifyDNOperation");
"PluginResult$IntermediateResponse");
"PluginResult$IntermediateResponse");
"SearchReferenceSearchOperation");
"PluginResult$SubordinateModifyDN");
"SubordinateModifyDNOperation");
"PluginResult$SubordinateDelete");
"DeleteOperation");
"PluginResult$IntermediateResponse");
{
{
// This is a method added by AspectJ weaving. We can ignore it.
continue;
}
{
for (Class c : m.getParameterTypes())
{
}
for (Class c : m.getExceptionTypes())
{
}
boolean found = false;
{
{
found = true;
break;
}
}
if (! found)
{
}
}
}
if (! expectedPublicMethods.isEmpty())
{
"been removed from the plugin API:");
{
for (String s : methodList)
{
}
}
fail("It appears that set of methods defined in the plugin API has " +
"been altered in a manner that could impact backward " +
"compatibility. This will only be allowed under extremely " +
"limited circumstances.");
}
if (! newPublicMethods.isEmpty())
{
"have been added to the plugin API:");
{
for (String s : methodList)
{
}
}
fail("It appears that one or more new public methods have been added " +
"to the plugin API. This is not actually an error, but if you " +
"intend to make the new method(s) part of the official plugin API " +
"then you must add its signature to the expectedPublicMethods " +
"list above so that we can ensure that it is not removed or " +
"altered in an incompatible way in the future.");
}
}
/**
* Tests the <CODE>getPluginEntryDN</CODE> method.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
public void testGetPluginEntryDN()
throws Exception
{
"dn: cn=Null Plugin,cn=Plugins,cn=config",
"objectClass: top",
"objectClass: ds-cfg-plugin",
"cn: Null Plugin",
"ds-cfg-java-class: org.opends.server.plugins.NullPlugin",
"ds-cfg-enabled: true",
"ds-cfg-plugin-type: startup",
"ds-cfg-plugin-type: shutdown",
"ds-cfg-plugin-type: postConnect",
"ds-cfg-plugin-type: postDisconnect",
"ds-cfg-plugin-type: ldifImport",
"ds-cfg-plugin-type: ldifExport",
"ds-cfg-plugin-type: preParseAbandon",
"ds-cfg-plugin-type: preParseAdd",
"ds-cfg-plugin-type: preParsebind",
"ds-cfg-plugin-type: preParseCompare",
"ds-cfg-plugin-type: preParseDelete",
"ds-cfg-plugin-type: preParseExtended",
"ds-cfg-plugin-type: preParseModify",
"ds-cfg-plugin-type: preParseModifyDN",
"ds-cfg-plugin-type: preParseSearch",
"ds-cfg-plugin-type: preParseUnbind",
"ds-cfg-plugin-type: preOperationAdd",
"ds-cfg-plugin-type: preOperationbind",
"ds-cfg-plugin-type: preOperationCompare",
"ds-cfg-plugin-type: preOperationDelete",
"ds-cfg-plugin-type: preOperationExtended",
"ds-cfg-plugin-type: preOperationModify",
"ds-cfg-plugin-type: preOperationModifyDN",
"ds-cfg-plugin-type: preOperationSearch",
"ds-cfg-plugin-type: postOperationAbandon",
"ds-cfg-plugin-type: postOperationAdd",
"ds-cfg-plugin-type: postOperationbind",
"ds-cfg-plugin-type: postOperationCompare",
"ds-cfg-plugin-type: postOperationDelete",
"ds-cfg-plugin-type: postOperationExtended",
"ds-cfg-plugin-type: postOperationModify",
"ds-cfg-plugin-type: postOperationModifyDN",
"ds-cfg-plugin-type: postOperationSearch",
"ds-cfg-plugin-type: postOperationUnbind",
"ds-cfg-plugin-type: postResponseAdd",
"ds-cfg-plugin-type: postResponsebind",
"ds-cfg-plugin-type: postResponseCompare",
"ds-cfg-plugin-type: postResponseDelete",
"ds-cfg-plugin-type: postResponseExtended",
"ds-cfg-plugin-type: postResponseModify",
"ds-cfg-plugin-type: postResponseModifyDN",
"ds-cfg-plugin-type: postResponseSearch",
"ds-cfg-plugin-type: postsynchronizationAdd",
"ds-cfg-plugin-type: postsynchronizationDelete",
"ds-cfg-plugin-type: postsynchronizationModify",
"ds-cfg-plugin-type: postsynchronizationModifyDN",
"ds-cfg-plugin-type: searchResultEntry",
"ds-cfg-plugin-type: searchResultReference",
"ds-cfg-plugin-type: subordinateModifyDN",
"ds-cfg-plugin-type: intermediateResponse");
{
pluginTypes.add(t);
}
}
/**
* Tests the <CODE>getPluginTypes</CODE> method.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test
public void testGetPluginTypes()
throws Exception
{
"dn: cn=Null Plugin,cn=Plugins,cn=config",
"objectClass: top",
"objectClass: ds-cfg-plugin",
"cn: Null Plugin",
"ds-cfg-java-class: org.opends.server.plugins.NullPlugin",
"ds-cfg-enabled: true",
"ds-cfg-plugin-type: startup",
"ds-cfg-plugin-type: shutdown",
"ds-cfg-plugin-type: postConnect",
"ds-cfg-plugin-type: postDisconnect",
"ds-cfg-plugin-type: ldifImport",
"ds-cfg-plugin-type: ldifExport",
"ds-cfg-plugin-type: preParseAbandon",
"ds-cfg-plugin-type: preParseAdd",
"ds-cfg-plugin-type: preParsebind",
"ds-cfg-plugin-type: preParseCompare",
"ds-cfg-plugin-type: preParseDelete",
"ds-cfg-plugin-type: preParseExtended",
"ds-cfg-plugin-type: preParseModify",
"ds-cfg-plugin-type: preParseModifyDN",
"ds-cfg-plugin-type: preParseSearch",
"ds-cfg-plugin-type: preParseUnbind",
"ds-cfg-plugin-type: preOperationAdd",
"ds-cfg-plugin-type: preOperationbind",
"ds-cfg-plugin-type: preOperationCompare",
"ds-cfg-plugin-type: preOperationDelete",
"ds-cfg-plugin-type: preOperationExtended",
"ds-cfg-plugin-type: preOperationModify",
"ds-cfg-plugin-type: preOperationModifyDN",
"ds-cfg-plugin-type: preOperationSearch",
"ds-cfg-plugin-type: postOperationAbandon",
"ds-cfg-plugin-type: postOperationAdd",
"ds-cfg-plugin-type: postOperationbind",
"ds-cfg-plugin-type: postOperationCompare",
"ds-cfg-plugin-type: postOperationDelete",
"ds-cfg-plugin-type: postOperationExtended",
"ds-cfg-plugin-type: postOperationModify",
"ds-cfg-plugin-type: postOperationModifyDN",
"ds-cfg-plugin-type: postOperationSearch",
"ds-cfg-plugin-type: postOperationUnbind",
"ds-cfg-plugin-type: postResponseAdd",
"ds-cfg-plugin-type: postResponsebind",
"ds-cfg-plugin-type: postResponseCompare",
"ds-cfg-plugin-type: postResponseDelete",
"ds-cfg-plugin-type: postResponseExtended",
"ds-cfg-plugin-type: postResponseModify",
"ds-cfg-plugin-type: postResponseModifyDN",
"ds-cfg-plugin-type: postResponseSearch",
"ds-cfg-plugin-type: postsynchronizationAdd",
"ds-cfg-plugin-type: postsynchronizationDelete",
"ds-cfg-plugin-type: postsynchronizationModify",
"ds-cfg-plugin-type: postsynchronizationModifyDN",
"ds-cfg-plugin-type: searchResultEntry",
"ds-cfg-plugin-type: searchResultReference",
"ds-cfg-plugin-type: subordinateModifyDN",
"ds-cfg-plugin-type: intermediateResponse");
{
pluginTypes.add(t);
}
}
/**
* Invokes the default plugin finalizer.
*/
@Test
public void testDefaultFinalizer()
{
new NullPlugin().finalizePlugin();
}
/**
* Ensures that the default <CODE>doStartup</CODE> method throws an
* exception.
*/
public void testDoStartup()
{
new NullPlugin().doStartup();
}
/**
* Ensures that the default <CODE>doShutdown</CODE> method throws an
* exception.
*/
public void testDoShutdown()
{
}
/**
* Ensures that the default <CODE>doPostConnect</CODE> method throws an
* exception.
*/
public void testDoPostConnect()
{
}
/**
* Ensures that the default <CODE>doPostDisconnect</CODE> method throws an
* exception.
*/
public void testDoPostDisconnect()
{
null);
}
/**
* Ensures that the default <CODE>doLDIFImport</CODE> method throws an
* exception.
*/
public void testDoLDIFImport()
{
}
/**
* Ensures that the default <CODE>doLDIFExport</CODE> method throws an
* exception.
*/
public void testDoLDIFExport()
{
}
/**
* Ensures that the default <CODE>doPreParse</CODE> method throws an
* exception for abandon operations.
*/
public void testDoPreParseAbandon()
{
}
/**
* Ensures that the default <CODE>doPreParse</CODE> method throws an
* exception for add operations.
*/
public void testDoPreParseAdd() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreParse</CODE> method throws an
* exception for bind operations.
*/
public void testDoPreParseBind()
{
}
/**
* Ensures that the default <CODE>doPreParse</CODE> method throws an
* exception for compare operations.
*/
public void testDoPreParseCompare() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreParse</CODE> method throws an
* exception for delete operations.
*/
public void testDoPreParseDelete() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreParse</CODE> method throws an
* exception for extended operations.
*/
public void testDoPreParseExtended() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreParse</CODE> method throws an
* exception for modify operations.
*/
public void testDoPreParseModify() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreParse</CODE> method throws an
* exception for modify DN operations.
*/
public void testDoPreParseModifyDN() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreParse</CODE> method throws an
* exception for search operations.
*/
public void testDoPreParseSearch() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreParse</CODE> method throws an
* exception for unbind operations.
*/
public void testDoPreParseUnbind()
{
}
/**
* Ensures that the default <CODE>doPreOperation</CODE> method throws an
* exception for add operations.
*/
public void testDoPreOperationAdd() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreOperation</CODE> method throws an
* exception for bind operations.
*/
public void testDoPreOperationBind()
{
}
/**
* Ensures that the default <CODE>doPreOperation</CODE> method throws an
* exception for compare operations.
*/
public void testDoPreOperationCompare() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreOperation</CODE> method throws an
* exception for delete operations.
*/
public void testDoPreOperationDelete() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreOperation</CODE> method throws an
* exception for extended operations.
*/
public void testDoPreOperationExtended() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreOperation</CODE> method throws an
* exception for modify operations.
*/
public void testDoPreOperationModify() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreOperation</CODE> method throws an
* exception for modify DN operations.
*/
public void testDoPreOperationModifyDN() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPreOperation</CODE> method throws an
* exception for search operations.
*/
public void testDoPreOperationSearch() throws CanceledOperationException {
}
/**
* Ensures that the default <CODE>doPostOperation</CODE> method throws an
* exception for abandon operations.
*/
public void testDoPostOperationAbandon()
{
}
/**
* Ensures that the default <CODE>doPostOperation</CODE> method throws an
* exception for add operations.
*/
public void testDoPostOperationAdd()
{
}
/**
* Ensures that the default <CODE>doPostOperation</CODE> method throws an
* exception for bind operations.
*/
public void testDoPostOperationBind()
{
}
/**
* Ensures that the default <CODE>doPostOperation</CODE> method throws an
* exception for compare operations.
*/
public void testDoPostOperationCompare()
{
}
/**
* Ensures that the default <CODE>doPostOperation</CODE> method throws an
* exception for delete operations.
*/
public void testDoPostOperationDelete()
{
}
/**
* Ensures that the default <CODE>doPostOperation</CODE> method throws an
* exception for extended operations.
*/
public void testDoPostOperationExtended()
{
}
/**
* Ensures that the default <CODE>doPostOperation</CODE> method throws an
* exception for modify operations.
*/
public void testDoPostOperationModify()
{
}
/**
* Ensures that the default <CODE>doPostOperation</CODE> method throws an
* exception for modify DN operations.
*/
public void testDoPostOperationModifyDN()
{
}
/**
* Ensures that the default <CODE>doPostOperation</CODE> method throws an
* exception for search operations.
*/
public void testDoPostOperationSearch()
{
}
/**
* Ensures that the default <CODE>doPostOperation</CODE> method throws an
* exception for unbind operations.
*/
public void testDoPostOperationUnbind()
{
}
/**
* Ensures that the default <CODE>doPostResponse</CODE> method throws an
* exception for add operations.
*/
public void testDoPostResponseAdd()
{
}
/**
* Ensures that the default <CODE>doPostResponse</CODE> method throws an
* exception for bind operations.
*/
public void testDoPostResponseBind()
{
}
/**
* Ensures that the default <CODE>doPostResponse</CODE> method throws an
* exception for compare operations.
*/
public void testDoPostResponseCompare()
{
}
/**
* Ensures that the default <CODE>doPostResponse</CODE> method throws an
* exception for delete operations.
*/
public void testDoPostResponseDelete()
{
}
/**
* Ensures that the default <CODE>doPostResponse</CODE> method throws an
* exception for extended operations.
*/
public void testDoPostResponseExtended()
{
}
/**
* Ensures that the default <CODE>doPostResponse</CODE> method throws an
* exception for modify operations.
*/
public void testDoPostResponseModify()
{
}
/**
* Ensures that the default <CODE>doPostResponse</CODE> method throws an
* exception for modify DN operations.
*/
public void testDoPostResponseModifyDN()
{
}
/**
* Ensures that the default <CODE>doPostResponse</CODE> method throws an
* exception for search operations.
*/
public void testDoPostResponseSearch()
{
}
/**
* Ensures that the default <CODE>processSearchEntry</CODE> method throws an
* exception.
*/
public void testProcessSearchEntry()
{
}
/**
* Ensures that the default <CODE>processSearchReference</CODE> method throws
* an exception.
*/
public void testProcessSearchReference()
{
}
/**
* Ensures that the default <CODE>processIntermediateResponse</CODE> method
* throws an exception.
*/
public void testProcessIntermediateResponse()
{
}
}