}
public void testPluginConfiguration() throws Exception
{
ActionConfiguration ac =
new ActionConfiguration("org.exoplatform.services.jcr.usecases.action.DummyAction", "addNode,addProperty",
"/test,/exo:test1", true, null, "nt:base", null);
List actionsList = new ArrayList();
ActionsConfig actions = new ActionsConfig();
actions.setActions(actionsList);
actionsList.add(ac);
InitParams params = new InitParams();
ObjectParameter op = new ObjectParameter();
op.setObject(actions);
op.setName("actions");
params.addParameter(op);
AddActionsPlugin aap = new AddActionsPlugin(params);
SessionActionCatalog catalog =
(SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
catalog.clear();
catalog.addPlugin(aap);
assertEquals(1, aap.getActions().size());
assertEquals(1, catalog.getAllActions().size());
ActionConfiguration ac1 = aap.getActions().get(0);
assertEquals("org.exoplatform.services.jcr.usecases.action.DummyAction", ac1.getActionClassName());
assertEquals("/test,/exo:test1", ac1.getPath());
Condition cond = new Condition();
cond.put(SessionEventMatcher.EVENTTYPE_KEY, Event.NODE_ADDED);
assertEquals(1, catalog.getActions(cond).size());