use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.
the class MavenModuleProjectTests method testThemeProjectPluginDetection.
@Test
public void testThemeProjectPluginDetection() throws Exception {
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
op.setProjectName("maven-theme-test");
op.setProjectProvider("maven-module");
op.setProjectTemplateName("theme");
op.execute(ProgressMonitorBridge.create(new NullProgressMonitor()));
IProject project = CoreUtil.getProject("maven-theme-test");
assertNotNull(project);
IBundleProject bundleProject = LiferayCore.create(IBundleProject.class, project);
assertNotNull(bundleProject);
}
use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.
the class MavenModuleProjectTests method testProjectTemplateFormField.
@Test
public void testProjectTemplateFormField() throws Exception {
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
op.setProjectName("form-field-test");
op.setProjectProvider("maven-module");
op.setProjectTemplateName("form-field");
createAndBuild(op);
}
use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.
the class NewLiferayComponentOpTests method testNewLiferayComponentActionCommandPortlet.
@Test
public void testNewLiferayComponentActionCommandPortlet() throws Exception {
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
op.setProjectName("action-command-test");
op.setProjectTemplateName("activator");
op.setProjectProvider("gradle-module");
Status modulePorjectStatus = NewLiferayModuleProjectOpMethods.execute(op, ProgressMonitorBridge.create(new NullProgressMonitor()));
assertTrue(modulePorjectStatus.ok());
IProject modProject = CoreUtil.getProject(op.getProjectName().content());
modProject.open(new NullProgressMonitor());
NewLiferayComponentOp cop = NewLiferayComponentOp.TYPE.instantiate();
cop.setProjectName(op.getProjectName().content());
cop.setComponentClassTemplateName("PortletActionCommand");
Status status = NewLiferayComponentOpMethods.execute(cop, ProgressMonitorBridge.create(new NullProgressMonitor()));
assertEquals(Status.createOkStatus(), status);
IFile javaFile = modProject.getFile("/src/main/java/action/command/test/ActionCommandTestActionCommand.java");
assertTrue(javaFile.exists());
String javaFileContent = FileUtil.readContents(javaFile.getLocation().toFile(), true);
assertTrue(javaFileContent.contains("javax.portlet.name=action_command_test_ActionCommandTestPortlet"));
assertTrue(javaFileContent.contains("mvc.command.name=greet"));
IFile initFile = modProject.getFile("/src/main/resources/META-INF/resources/actioncommandtestportletactioncommand/init.ftl");
assertTrue(initFile.exists());
IFile viewFile = modProject.getFile("/src/main/resources/META-INF/resources/actioncommandtestportletactioncommand/view.ftl");
assertTrue(viewFile.exists());
}
use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.
the class NewLiferayComponentOpTests method testNewLiferayComponentProjectValidation.
@Test
public void testNewLiferayComponentProjectValidation() throws Exception {
deleteAllWorkspaceProjects();
NewLiferayComponentOp cop = NewLiferayComponentOp.TYPE.instantiate();
Status projectValidationStatus = cop.getProjectName().validation();
assertEquals("No suitable Liferay module project.", projectValidationStatus.message());
NewLiferayModuleProjectOp pop = NewLiferayModuleProjectOp.TYPE.instantiate();
pop.setProjectName("testProjectValidation");
pop.setProjectTemplateName("portlet");
pop.setProjectProvider("gradle-module");
Status moduleProjectStatus = NewLiferayModuleProjectOpMethods.execute(pop, ProgressMonitorBridge.create(new NullProgressMonitor()));
assertTrue(moduleProjectStatus.ok());
IProject modProject = CoreUtil.getProject(pop.getProjectName().content());
modProject.open(new NullProgressMonitor());
IFile bndFile = modProject.getFile("bnd.bnd");
bndFile.delete(true, true, new NullProgressMonitor());
cop.setProjectName(pop.getProjectName().content());
projectValidationStatus = cop.getProjectName().validation();
assertEquals("Can't find bnd.bnd file in the project.", projectValidationStatus.message());
}
use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.
the class NewLiferayModuleProjectOpTests method testNewLiferayModuleProjectDefaultValueServiceDots.
@Test
@Ignore
public void testNewLiferayModuleProjectDefaultValueServiceDots() throws Exception {
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
op.setProjectName("my.test.project");
op.setProjectTemplateName("portlet");
assertEquals("MyTestProject", op.getComponentName().content(true));
}
Aggregations