Search in sources :

Example 86 with NewLiferayPluginProjectOp

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

Example 87 with NewLiferayPluginProjectOp

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

Example 88 with NewLiferayPluginProjectOp

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"));
}
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 89 with NewLiferayPluginProjectOp

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);
}
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)

Example 90 with NewLiferayPluginProjectOp

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"));
}
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)

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