use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testDontIncludeSampleCodeServiceBuilder.
@Test
public void testDontIncludeSampleCodeServiceBuilder() throws Exception {
if (shouldSkipBundleTests())
return;
// test service-builder project
NewLiferayPluginProjectOp op = newProjectOp("test-dont-include-sample-code-service-builder");
op.setIncludeSampleCode(false);
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(0, countElements(portletXml, "portlet"));
assertEquals(0, countElements(liferayPortletXml, "portlet"));
assertEquals(0, countElements(liferayDisplayXml, "category"));
assertEquals(0, countElements(serviceXml, "entity"));
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testProjectProviderValueLabel.
@Test
public void testProjectProviderValueLabel() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("test-project-provider-value-label");
final ValueLabelService vls = op.getProjectProvider().service(ValueLabelService.class);
final Set<String> actualProviderShortNames = op.getProjectProvider().service(PossibleValuesService.class).values();
Set<String> actualLabels = new HashSet<String>();
for (String shortName : actualProviderShortNames) {
actualLabels.add(vls.provide(shortName));
}
assertNotNull(actualLabels);
Set<String> exceptedLabels = new HashSet<String>();
exceptedLabels.add("Ant (liferay-plugins-sdk)");
exceptedLabels.add("Maven (liferay-maven-plugin)");
assertEquals(true, exceptedLabels.containsAll(actualLabels));
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testNewServiceBuilderPortletAntProject.
@Test
public void testNewServiceBuilderPortletAntProject() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("portlet-with-servicexml");
op.setPluginType(PluginType.servicebuilder);
final IProject portletProject = createAntProject(op);
final IFolder webappRoot = LiferayCore.create(IWebProject.class, portletProject).getDefaultDocrootFolder();
assertNotNull(webappRoot);
final IFile serviceXml = webappRoot.getFile("WEB-INF/service.xml");
assertEquals(true, serviceXml.exists());
final String serviceXmlContent = CoreUtil.readStreamToString(serviceXml.getContents());
assertEquals(true, serviceXmlContent.contains(getServiceXmlDoctype()));
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testNewVaadinAntProject.
@Test
public void testNewVaadinAntProject() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("test-vaadin-project-sdk");
op.setPluginType(PluginType.portlet);
op.setPortletFramework("vaadin");
IProject vaadinProject = createAntProject(op);
final IFolder webappRoot = LiferayCore.create(IWebProject.class, vaadinProject).getDefaultDocrootFolder();
assertNotNull(webappRoot);
final IFile application = webappRoot.getFile("WEB-INF/src/testvaadinprojectsdk" + getRuntimeVersion() + "/TestVaadinProjectSdk" + getRuntimeVersion() + "Application.java");
assertEquals(true, application.exists());
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testNewLayoutAntProject.
protected void testNewLayoutAntProject() throws Exception {
final String projectName = "test-layouttpl-project-sdk";
final NewLiferayPluginProjectOp op = newProjectOp(projectName);
op.setPluginType(PluginType.layouttpl);
IProject layouttplProject = createAntProject(op);
final IFolder webappRoot = LiferayCore.create(IWebProject.class, layouttplProject).getDefaultDocrootFolder();
assertNotNull(webappRoot);
final IFile layoutXml = webappRoot.getFile("WEB-INF/liferay-layout-templates.xml");
assertEquals(true, layoutXml.exists());
}
Aggregations