use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testServiceBuilderProjectName.
@Test
public void testServiceBuilderProjectName() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("test-sb");
op.setPluginType(PluginType.servicebuilder);
op.setUseDefaultLocation(true);
final IProject expectedProject = createAntProject(op);
String expectedProjectName = expectedProject.getName();
String actualProjectName = op.getProjectNames().get(0).getName().content();
assertEquals(expectedProjectName, actualProjectName);
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testHookProjectName.
@Test
public void testHookProjectName() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("test-hook");
op.setPluginType(PluginType.hook);
op.setUseDefaultLocation(true);
final IProject expectedProject = createAntProject(op);
String expectedProjectName = expectedProject.getName();
String actualProjectName = op.getProjectNames().get(0).getName().content();
assertEquals(expectedProjectName, actualProjectName);
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testIncludeSampleCodeServiceBuilder.
@Test
public void testIncludeSampleCodeServiceBuilder() throws Exception {
if (shouldSkipBundleTests())
return;
// test service-builder project
NewLiferayPluginProjectOp op = newProjectOp("test-include-sample-code-service-builder");
op.setIncludeSampleCode(true);
op.setPluginType(PluginType.servicebuilder);
IProject project = createAntProject(op);
IWebProject webProject = LiferayCore.create(IWebProject.class, project);
IFile portletXml = webProject.getDescriptorFile(ILiferayConstants.PORTLET_XML_FILE);
IFile liferayPortletXml = webProject.getDescriptorFile(ILiferayConstants.LIFERAY_PORTLET_XML_FILE);
IFile liferayDisplayXml = webProject.getDescriptorFile(ILiferayConstants.LIFERAY_DISPLAY_XML_FILE);
IFile serviceXml = webProject.getDescriptorFile(ILiferayConstants.SERVICE_XML_FILE);
assertNotNull(portletXml);
assertNotNull(liferayPortletXml);
assertNotNull(liferayDisplayXml);
assertNotNull(serviceXml);
assertEquals(1, countElements(portletXml, "portlet"));
assertEquals(1, countElements(liferayPortletXml, "portlet"));
assertEquals(1, countElements(liferayDisplayXml, "category"));
assertEquals(1, countElements(serviceXml, "entity"));
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method createNewJsfAntProject.
protected IProject createNewJsfAntProject(String jsfSuite, String suffix) throws Exception {
final String projectName = jsfSuite + suffix;
final NewLiferayPluginProjectOp op = newProjectOp(projectName);
op.setPortletFramework("jsf-2.x");
op.setPortletFrameworkAdvanced(jsfSuite);
final IProject jsfProject = createAntProject(op);
final IFolder defaultDocroot = LiferayCore.create(IWebProject.class, jsfProject).getDefaultDocrootFolder();
assertNotNull(defaultDocroot);
final IFile config = defaultDocroot.getFile("WEB-INF/faces-config.xml");
assertEquals(true, config.exists());
checkNewJsfAntProjectXHtmlPagesLocation(jsfProject);
return checkNewJsfAntProjectIvyFile(jsfProject, jsfSuite);
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testDontIncludeSampleCode.
@Test
public void testDontIncludeSampleCode() throws Exception {
if (shouldSkipBundleTests())
return;
// test portlet project
NewLiferayPluginProjectOp op = newProjectOp("test-dont-include-sample-code-portlet");
op.setIncludeSampleCode(false);
op.setPluginType(PluginType.portlet);
IProject project = createAntProject(op);
IWebProject webProject = LiferayCore.create(IWebProject.class, project);
IFile portletXml = webProject.getDescriptorFile(ILiferayConstants.PORTLET_XML_FILE);
IFile liferayPortletXml = webProject.getDescriptorFile(ILiferayConstants.LIFERAY_PORTLET_XML_FILE);
IFile liferayDisplayXml = webProject.getDescriptorFile(ILiferayConstants.LIFERAY_DISPLAY_XML_FILE);
assertNotNull(portletXml);
assertNotNull(liferayPortletXml);
assertNotNull(liferayDisplayXml);
assertEquals(0, countElements(portletXml, "portlet"));
assertEquals(0, countElements(liferayPortletXml, "portlet"));
assertEquals(0, countElements(liferayDisplayXml, "category"));
}
Aggregations