PluginConfigManagerTestCase.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-2008 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* A set of test cases for the plugin config manager.
*/
public class PluginConfigManagerTestCase
extends CoreTestCase
{
/**
* The name of the delay preoperation plugin, formatted in all lowercase.
*/
/**
* The name of the disconnect client plugin, formatted in all lowercase.
*/
private static final String PLUGIN_NAME_DISCONNECT =
"disconnect client plugin";
/**
* The name of the invocation counter plugin, formatted in all lowercase.
*/
private static final String PLUGIN_NAME_INVOCATION_COUNTER =
"invocation counter plugin";
/**
* The name of the short-circuit plugin, formatted in all lowercase.
*/
private static final String PLUGIN_NAME_SHORT_CIRCUIT =
"short circuit plugin";
/**
* The name of the update preoperation plugin, formatted in all lowercase.
*/
/**
* Ensure that the server is running.
*
* @throws Exception If an unexpected problem occurs.
*/
public void startServer()
throws Exception
{
}
/**
* Retrieves a set of data that may be used for testing plugin ordering. The
* returned array will be two-dimensional, with the first element being a
* plugin order string and the second being a string array of the names of the
* plugins in the order they should appear when using the specified order.
*
* @return A set of data that may be used for testing plugin ordering.
*/
public Object[][] getPluginOrders()
{
return new Object[][]
{
new Object[]
{
null,
new String[]
{
}
},
new Object[]
{
"",
new String[]
{
}
},
new Object[]
{
"*",
new String[]
{
}
},
new Object[]
{
"undefined",
new String[]
{
}
},
new Object[]
{
"undefined1, undefined2",
new String[]
{
}
},
new Object[]
{
"undefined1, *, undefined2",
new String[]
{
}
},
new Object[]
{
"undefined, *",
new String[]
{
}
},
new Object[]
{
"*, undefined",
new String[]
{
}
},
new Object[]
{
new String[]
{
}
},
new Object[]
{
new String[]
{
}
},
new Object[]
{
new String[]
{
}
},
new Object[]
{
new String[]
{
}
},
new Object[]
{
new String[]
{
}
},
new Object[]
{
PLUGIN_NAME_DELAY + ", *",
new String[]
{
}
},
new Object[]
{
PLUGIN_NAME_DISCONNECT + ", *",
new String[]
{
}
},
new Object[]
{
PLUGIN_NAME_INVOCATION_COUNTER + ", *",
new String[]
{
}
},
new Object[]
{
PLUGIN_NAME_SHORT_CIRCUIT + ", *",
new String[]
{
}
},
new Object[]
{
PLUGIN_NAME_UPDATE + ", *",
new String[]
{
}
},
new Object[]
{
"*, " + PLUGIN_NAME_DELAY,
new String[]
{
}
},
new Object[]
{
"*, " + PLUGIN_NAME_DISCONNECT,
new String[]
{
}
},
new Object[]
{
"*, " + PLUGIN_NAME_INVOCATION_COUNTER,
new String[]
{
}
},
new Object[]
{
"*, " + PLUGIN_NAME_SHORT_CIRCUIT,
new String[]
{
}
},
new Object[]
{
"*, " + PLUGIN_NAME_UPDATE,
new String[]
{
}
},
new Object[]
{
new String[]
{
}
},
new Object[]
{
", " + PLUGIN_NAME_UPDATE,
new String[]
{
}
},
new Object[]
{
new String[]
{
}
},
new Object[]
{
", " + PLUGIN_NAME_UPDATE,
new String[]
{
}
},
new Object[]
{
", " + PLUGIN_NAME_UPDATE,
new String[]
{
}
},
new Object[]
{
", " + PLUGIN_NAME_UPDATE,
new String[]
{
}
},
new Object[]
{
", " + PLUGIN_NAME_DELAY,
new String[]
{
}
},
new Object[]
{
new String[]
{
}
},
new Object[]
{
", " + PLUGIN_NAME_DELAY,
new String[]
{
}
},
new Object[]
{
", " + PLUGIN_NAME_DELAY,
new String[]
{
}
},
new Object[]
{
new String[]
{
}
},
};
}
/**
* Tests the ability of the server to order plugins correctly.
*
* @param pluginOrderString The string that defines the plugin order to be
* used.
* @param expectedNameOrder An array of the plugin names in the order they
* are expected to appear when sorted.
*
* @throws Exception If an unexpected problem occurs.
*/
throws Exception
{
{
pluginList.add(p);
}
for (DirectoryServerPlugin p : pluginList)
{
}
boolean match = true;
{
if (i > 0)
{
}
{
match = false;
}
}
}
}