### Question:
WorkflowKernel { public void registerPlugin(final Plugin plugin) throws PluginException { if (plugin instanceof PluginDependency) { List<String> dependencies = ((PluginDependency) plugin).dependsOn(); for (String dependency : dependencies) { boolean found = false; for (Plugin regiseredPlugin : pluginRegistry) { if (regiseredPlugin.getClass().getName().equals(dependency)) { found = true; break; } } if (!found) { logger.warning("Plugin '" + plugin.getClass().getName() + "' depends on unregistered Plugin class '" + dependency + "'"); } } } plugin.init(ctx); pluginRegistry.add(plugin); } WorkflowKernel(final WorkflowContext actx); static String generateUniqueID(); static String generateTransactionID(); void registerPlugin(final Plugin plugin); void registerAdapter(final Adapter adapter); void registerPlugin(final String pluginClass); void unregisterPlugin(final String pluginClass); void unregisterAllPlugins(); List<Plugin> getPluginRegistry(); ItemCollection process(final ItemCollection workitem); int eval(final ItemCollection workitem); List<ItemCollection> getSplitWorkitems(); static final String MISSING_WORKFLOWCONTEXT; static final String UNDEFINED_PROCESSID; static final String UNDEFINED_ACTIVITYID; static final String UNDEFINED_WORKITEM; static final String UNDEFINED_PLUGIN_ERROR; static final String ACTIVITY_NOT_FOUND; static final String MODEL_ERROR; static final String PLUGIN_NOT_CREATEABLE; static final String PLUGIN_NOT_REGISTERED; static final String PLUGIN_ERROR; static final String ISO8601_FORMAT; static final String UNIQUEID; static final String UNIQUEIDSOURCE; static final String UNIQUEIDVERSIONS; static final String WORKITEMID; static final String MODELVERSION; static final String TRANSACTIONID; @Deprecated
    static final String PROCESSID; static final String TASKID; static final String EVENTID; static final String ACTIVITYIDLIST; static final String WORKFLOWGROUP; static final String WORKFLOWSTATUS; static final String ISVERSION; static final String LASTTASK; static final String LASTEVENT; static final String LASTEVENTDATE; static final String CREATOR; static final String EDITOR; static final String LASTEDITOR; static final String CREATED; static final String MODIFIED; static final String TYPE; static final int MAXIMUM_ACTIVITYLOGENTRIES; }### Answer:
@Test @Category(org.imixs.workflow.WorkflowKernel.class) public void testRegisterPlugin() { try { kernel.unregisterPlugin(MokPlugin.class.getName()); } catch (PluginException e1) { Assert.fail(); e1.printStackTrace(); } try { kernel.unregisterPlugin(MokPlugin.class.getName()); Assert.fail(); } catch (PluginException e1) { Assert.assertEquals(WorkflowKernel.PLUGIN_NOT_REGISTERED, e1.getErrorCode()); } try { MokPlugin mokPlugin = new MokPlugin(); kernel.registerPlugin(mokPlugin); } catch (PluginException e) { Assert.fail(); e.printStackTrace(); } }