use of com.liferay.ide.hook.core.model.internal.StrutsActionPathPossibleValuesService in project liferay-ide by liferay.
the class LiferayHookModelTests method strutsActionPathPossibleValuesService.
/**
* @throws Exception
*/
@Test
public void strutsActionPathPossibleValuesService() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("testPossibleValues");
op.setPluginType(PluginType.hook);
final IProject hookProject = createAntProject(op);
final IFolder webappRoot = LiferayCore.create(IWebProject.class, hookProject).getDefaultDocrootFolder();
assertNotNull(webappRoot);
final IFile hookXml = webappRoot.getFile("WEB-INF/liferay-hook.xml");
assertEquals(true, hookXml.exists());
final XmlResourceStore store = new XmlResourceStore(hookXml.getContents()) {
public <A> A adapt(Class<A> adapterType) {
if (IProject.class.equals(adapterType)) {
return adapterType.cast(hookProject);
}
return super.adapt(adapterType);
}
};
final Hook hook = Hook6xx.TYPE.instantiate(new RootXmlResource(store));
assertNotNull(hook);
final StrutsAction strutsAction = hook.getStrutsActions().insert();
final Value<String> strutsActionPath = strutsAction.getStrutsActionPath();
final Set<String> values = strutsActionPath.service(StrutsActionPathPossibleValuesService.class).values();
assertNotNull(values);
assertTrue(values.size() > 10);
}
Aggregations