Search in sources :

Example 41 with NewLiferayPluginProjectOp

use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.

the class LiferayMavenProjectTests method testNewLiferayPortletProject.

@Test
public void testNewLiferayPortletProject() throws Exception {
    if (shouldSkipBundleTests())
        return;
    NewLiferayPluginProjectOp op = NewLiferayPluginProjectOp.TYPE.instantiate();
    op.setProjectName("mvc");
    op.setProjectProvider("maven");
    op.setPortletFramework("mvc");
    createTestBundleProfile(op);
    final IProject project = base.createProject(op);
    assertNotNull(project);
    String pomContents = CoreUtil.readStreamToString(project.getFile("pom.xml").getContents());
    assertTrue(pomContents.contains("<liferay.version>"));
    assertTrue(pomContents.contains("<artifactId>liferay-maven-plugin</artifactId>"));
    assertTrue(pomContents.contains("<artifactId>portal-service</artifactId>"));
    waitForJobsToComplete();
    project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
    waitForJobsToComplete();
    IVirtualComponent projectComponent = ComponentCore.createComponent(project);
    assertEquals("mvc-portlet", projectComponent.getDeployedName());
}
Also used : NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp) IVirtualComponent(org.eclipse.wst.common.componentcore.resources.IVirtualComponent) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Example 42 with NewLiferayPluginProjectOp

use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.

the class LiferayMavenProjectTests method testNewLiferayLayouttplProject.

@Test
public void testNewLiferayLayouttplProject() throws Exception {
    NewLiferayPluginProjectOp op = NewLiferayPluginProjectOp.TYPE.instantiate();
    op.setProjectName("template");
    op.setProjectProvider("maven");
    op.setPluginType(PluginType.layouttpl);
    createTestBundleProfile(op);
    final IProject project = base.createProject(op);
    assertNotNull(project);
    String pomContents = CoreUtil.readStreamToString(project.getFile("pom.xml").getContents());
    assertTrue(pomContents.contains("<pluginType>layouttpl</pluginType>"));
    assertTrue(pomContents.contains("<artifactId>liferay-maven-plugin</artifactId>"));
    waitForJobsToComplete();
    project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
    waitForJobsToComplete();
    IVirtualComponent projectComponent = ComponentCore.createComponent(project);
    assertEquals("template-layouttpl", projectComponent.getDeployedName());
}
Also used : NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp) IVirtualComponent(org.eclipse.wst.common.componentcore.resources.IVirtualComponent) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Example 43 with NewLiferayPluginProjectOp

use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.

the class LiferayMavenProjectTests method testNewLiferayHookProject.

@Test
public void testNewLiferayHookProject() throws Exception {
    NewLiferayPluginProjectOp op = NewLiferayPluginProjectOp.TYPE.instantiate();
    op.setProjectName("hookproject");
    op.setProjectProvider("maven");
    op.setPluginType(PluginType.hook);
    createTestBundleProfile(op);
    final IProject project = base.createProject(op);
    assertNotNull(project);
    String pomContents = CoreUtil.readStreamToString(project.getFile("pom.xml").getContents());
    assertTrue(pomContents.contains("<pluginType>hook</pluginType>"));
    assertTrue(pomContents.contains("<artifactId>liferay-maven-plugin</artifactId>"));
    assertTrue(pomContents.contains("<artifactId>portal-service</artifactId>"));
    waitForJobsToComplete();
    project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
    waitForJobsToComplete();
    IVirtualComponent projectComponent = ComponentCore.createComponent(project);
    assertEquals("hookproject-hook", projectComponent.getDeployedName());
}
Also used : NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp) IVirtualComponent(org.eclipse.wst.common.componentcore.resources.IVirtualComponent) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Example 44 with NewLiferayPluginProjectOp

use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.

the class SpringPortletProjectTests method newMavenProjectOp.

private NewLiferayPluginProjectOp newMavenProjectOp(String name, String framework) {
    NewLiferayPluginProjectOp op = NewLiferayPluginProjectOp.TYPE.instantiate();
    op.setProjectName(name);
    op.setProjectProvider("maven");
    op.setPortletFramework(framework);
    createTestBundleProfile(op);
    return op;
}
Also used : NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)

Example 45 with NewLiferayPluginProjectOp

use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.

the class SpringPortletProjectTests method testNewSpringPortletProject.

@Test
public void testNewSpringPortletProject() throws Exception {
    NewLiferayPluginProjectOp op = newMavenProjectOp("spring-mvc", "spring_mvc");
    final IProject newProject = base.createProject(op);
    assertNotNull(newProject);
    String pomContents = CoreUtil.readStreamToString(newProject.getFile("pom.xml").getContents());
    assertTrue(pomContents.contains("<artifactId>spring-aop</artifactId>"));
    assertTrue(pomContents.contains("<artifactId>spring-beans</artifactId>"));
    assertTrue(pomContents.contains("<artifactId>spring-context</artifactId>"));
    assertTrue(pomContents.contains("<artifactId>spring-core</artifactId>"));
    assertTrue(pomContents.contains("<artifactId>spring-expression</artifactId>"));
    assertTrue(pomContents.contains("<artifactId>spring-web</artifactId>"));
    assertTrue(pomContents.contains("<artifactId>spring-webmvc</artifactId>"));
    assertTrue(pomContents.contains("<artifactId>spring-webmvc-portlet</artifactId>"));
}
Also used : 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