Search in sources :

Example 91 with NewLiferayModuleProjectOp

use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.

the class MavenModuleProjectTests method testProjectTemplatePortletConfigurationIcon.

@Test
public void testProjectTemplatePortletConfigurationIcon() throws Exception {
    NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
    op.setProjectName("portlet-configuration-icon-test");
    op.setProjectProvider("maven-module");
    op.setProjectTemplateName("portlet-configuration-icon");
    createAndBuild(op);
}
Also used : NewLiferayModuleProjectOp(com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp) Test(org.junit.Test)

Example 92 with NewLiferayModuleProjectOp

use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.

the class MavenModuleProjectTests method testNewLiferayMavenModuleMVCPortletProjectCustomPackage.

@Test
public void testNewLiferayMavenModuleMVCPortletProjectCustomPackage() throws Exception {
    NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
    op.setProjectName("foo-bar");
    op.setProjectProvider("maven-module");
    op.setComponentName("FooBar");
    op.setPackageName("my.custom.pname");
    IProject project = create(op);
    assertTrue(project.getFile("src/main/java/my/custom/pname/portlet/FooBarPortlet.java").exists());
    verifyProject(project);
}
Also used : NewLiferayModuleProjectOp(com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Example 93 with NewLiferayModuleProjectOp

use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.

the class MavenModuleProjectTests method testProjectTemplateThemeContributor.

@Test
public void testProjectTemplateThemeContributor() throws Exception {
    NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
    op.setProjectName("theme-contributor-test");
    op.setProjectProvider("maven-module");
    op.setProjectTemplateName("theme-contributor");
    createAndBuild(op);
}
Also used : NewLiferayModuleProjectOp(com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp) Test(org.junit.Test)

Example 94 with NewLiferayModuleProjectOp

use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.

the class MavenModuleProjectTests method testProjectTemplateService.

@Test
public void testProjectTemplateService() throws Exception {
    NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
    op.setProjectName("service-test");
    op.setProjectProvider("maven-module");
    op.setProjectTemplateName("service");
    op.setServiceName("com.liferay.portal.kernel.events.LifecycleAction");
    IProject project = create(op);
    IFile serviceFile = project.getFile("src/main/java/service/test/ServiceTest.java");
    assertTrue(serviceFile.exists());
    String contents = "package service.test;\n" + "import com.liferay.portal.kernel.events.ActionException;\n" + "import com.liferay.portal.kernel.events.LifecycleAction;\n" + "import com.liferay.portal.kernel.events.LifecycleEvent;\n" + "import org.osgi.service.component.annotations.Component;\n" + "@Component(\n" + "immediate = true, property = {\"key=login.events.pre\"},\n" + "service = LifecycleAction.class\n" + ")\n" + "public class ServiceTest implements LifecycleAction {\n" + "@Override public void processLifecycleEvent(LifecycleEvent lifecycleEvent) throws ActionException { }\n" + "}";
    serviceFile.setContents(new ByteArrayInputStream(contents.getBytes()), IResource.FORCE, monitor);
    verifyProject(project);
}
Also used : IFile(org.eclipse.core.resources.IFile) ByteArrayInputStream(java.io.ByteArrayInputStream) NewLiferayModuleProjectOp(com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Example 95 with NewLiferayModuleProjectOp

use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.

the class MavenModuleProjectTests method testProjectTemplateLayoutTemplate.

@Test
public void testProjectTemplateLayoutTemplate() throws Exception {
    NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
    op.setProjectName("layout-test");
    op.setProjectProvider("maven-module");
    op.setProjectTemplateName("layout-template");
    IProject project = createAndBuild(op);
    project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
    assertTrue(project.getFile("target/layout-test-1.0.0.war").exists());
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) NewLiferayModuleProjectOp(com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Aggregations

NewLiferayModuleProjectOp (com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp)95 Test (org.junit.Test)94 IProject (org.eclipse.core.resources.IProject)30 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)18 IFile (org.eclipse.core.resources.IFile)12 Status (org.eclipse.sapphire.modeling.Status)9 Ignore (org.junit.Ignore)6 IBundleProject (com.liferay.ide.core.IBundleProject)5 NewLiferayComponentOp (com.liferay.ide.project.core.modules.NewLiferayComponentOp)5 PropertyKey (com.liferay.ide.project.core.modules.PropertyKey)3 SearchFilesVisitor (com.liferay.ide.project.core.util.SearchFilesVisitor)3 IPath (org.eclipse.core.runtime.IPath)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 File (java.io.File)2 URL (java.net.URL)2 ILiferayProjectImporter (com.liferay.ide.core.ILiferayProjectImporter)1 IProjectBuilder (com.liferay.ide.project.core.IProjectBuilder)1 ProjectName (com.liferay.ide.project.core.model.ProjectName)1 NewLiferayWorkspaceOp (com.liferay.ide.project.core.workspace.NewLiferayWorkspaceOp)1 ArrayList (java.util.ArrayList)1