Search in sources :

Example 26 with NewLiferayModuleProjectOp

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

the class MavenModuleProjectTests method testNewLiferayModuleProjectNoGradleFiles.

@Test
public void testNewLiferayModuleProjectNoGradleFiles() throws Exception {
    NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
    op.setProjectName("test-servicebuilder-no-gradlefiles");
    op.setProjectTemplateName("service-builder");
    op.setProjectProvider("maven-module");
    Status exStatus = NewLiferayModuleProjectOpMethods.execute(op, ProgressMonitorBridge.create(new NullProgressMonitor()));
    assertEquals("OK", exStatus.message());
    IProject parentProject = CoreUtil.getProject(op.getProjectName().content());
    parentProject.open(new NullProgressMonitor());
    IFile gradleFile = parentProject.getFile("build.gradle");
    IFile settingsFile = parentProject.getFile("settings.gradle");
    assertFalse(gradleFile.exists());
    assertFalse(settingsFile.exists());
    IProject apiProject = CoreUtil.getProject(op.getProjectName().content() + "-api");
    apiProject.open(new NullProgressMonitor());
    gradleFile = apiProject.getFile("build.gradle");
    settingsFile = apiProject.getFile("settings.gradle");
    assertFalse(gradleFile.exists());
    assertFalse(settingsFile.exists());
    IProject serviceProject = CoreUtil.getProject(op.getProjectName().content() + "-service");
    serviceProject.open(new NullProgressMonitor());
    gradleFile = serviceProject.getFile("build.gradle");
    settingsFile = serviceProject.getFile("settings.gradle");
    assertFalse(gradleFile.exists());
    assertFalse(settingsFile.exists());
}
Also used : Status(org.eclipse.sapphire.modeling.Status) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IFile(org.eclipse.core.resources.IFile) NewLiferayModuleProjectOp(com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Example 27 with NewLiferayModuleProjectOp

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

the class MavenModuleProjectTests method testNewLiferayMavenModuleMVCPortletProjectWithDashes.

@Test
public void testNewLiferayMavenModuleMVCPortletProjectWithDashes() throws Exception {
    NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
    op.setProjectName("foo-bar");
    op.setProjectProvider("maven-module");
    op.setComponentName("FooBar");
    op.setPackageName("foo.bar");
    IProject project = create(op);
    assertTrue(project.getFile("src/main/java/foo/bar/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 28 with NewLiferayModuleProjectOp

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

the class MavenModuleProjectTests method testProjectTemplateApi.

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

Example 29 with NewLiferayModuleProjectOp

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

the class MavenModuleProjectTests method testProjectTemplateNpmMetaljsPortlet.

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

Example 30 with NewLiferayModuleProjectOp

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

the class MavenModuleProjectTests method testProjectTemplatePortlet.

@Test
public void testProjectTemplatePortlet() throws Exception {
    NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
    op.setProjectName("portlet-test");
    op.setProjectProvider("maven-module");
    op.setProjectTemplateName("portlet");
    createAndBuild(op);
}
Also used : NewLiferayModuleProjectOp(com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp) 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