Search in sources :

Example 56 with NewLiferayPluginProjectOp

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"));
}
Also used : IFile(org.eclipse.core.resources.IFile) IWebProject(com.liferay.ide.core.IWebProject) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Example 57 with NewLiferayPluginProjectOp

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));
}
Also used : ValueLabelService(org.eclipse.sapphire.services.ValueLabelService) PossibleValuesService(org.eclipse.sapphire.PossibleValuesService) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 58 with NewLiferayPluginProjectOp

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()));
}
Also used : IFile(org.eclipse.core.resources.IFile) IWebProject(com.liferay.ide.core.IWebProject) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp) IProject(org.eclipse.core.resources.IProject) IFolder(org.eclipse.core.resources.IFolder) Test(org.junit.Test)

Example 59 with NewLiferayPluginProjectOp

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());
}
Also used : IFile(org.eclipse.core.resources.IFile) IWebProject(com.liferay.ide.core.IWebProject) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp) IProject(org.eclipse.core.resources.IProject) IFolder(org.eclipse.core.resources.IFolder) Test(org.junit.Test)

Example 60 with NewLiferayPluginProjectOp

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());
}
Also used : IFile(org.eclipse.core.resources.IFile) IWebProject(com.liferay.ide.core.IWebProject) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp) IProject(org.eclipse.core.resources.IProject) IFolder(org.eclipse.core.resources.IFolder)

Aggregations

NewLiferayPluginProjectOp (com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)122 Test (org.junit.Test)61 IProject (org.eclipse.core.resources.IProject)48 IWebProject (com.liferay.ide.core.IWebProject)18 IFile (org.eclipse.core.resources.IFile)18 IPath (org.eclipse.core.runtime.IPath)14 IFolder (org.eclipse.core.resources.IFolder)13 SDK (com.liferay.ide.sdk.core.SDK)12 Status (org.eclipse.sapphire.modeling.Status)10 PropertyContentEvent (org.eclipse.sapphire.PropertyContentEvent)9 Path (org.eclipse.sapphire.modeling.Path)8 CoreException (org.eclipse.core.runtime.CoreException)7 IPortletFramework (com.liferay.ide.project.core.IPortletFramework)6 HashSet (java.util.HashSet)5 PossibleValuesService (org.eclipse.sapphire.PossibleValuesService)5 ValidationService (org.eclipse.sapphire.services.ValidationService)5 IVirtualComponent (org.eclipse.wst.common.componentcore.resources.IVirtualComponent)5 NewLiferayProfile (com.liferay.ide.project.core.model.NewLiferayProfile)4 IStatus (org.eclipse.core.runtime.IStatus)4 LayoutTplDescriptorHelper (com.liferay.ide.layouttpl.core.operation.LayoutTplDescriptorHelper)3