use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.
the class MavenModuleProjectTests method testProjectTemplateSpringMvcPortlet.
@Test
public void testProjectTemplateSpringMvcPortlet() throws Exception {
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
op.setProjectName("spring-mvc-portlet-test");
op.setProjectProvider("maven-module");
op.setProjectTemplateName("spring-mvc-portlet");
IProject project = createAndBuild(op);
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
assertTrue(project.getFile("target/spring-mvc-portlet-test-1.0.0.war").exists());
}
use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.
the class MavenModuleProjectTests method testNewLiferayModuleProjectNewProperties.
@Test
public void testNewLiferayModuleProjectNewProperties() throws Exception {
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
op.setProjectName("test-properties-in-portlet");
op.setProjectProvider("maven-module");
op.setProjectTemplateName("portlet");
op.setComponentName("Test");
PropertyKey pk = op.getPropertyKeys().insert();
pk.setName("property-test-key");
pk.setValue("property-test-value");
Status exStatus = NewLiferayModuleProjectOpMethods.execute(op, ProgressMonitorBridge.create(monitor));
assertEquals("OK", exStatus.message());
IProject modProject = CoreUtil.getProject(op.getProjectName().content());
modProject.open(new NullProgressMonitor());
SearchFilesVisitor sv = new SearchFilesVisitor();
List<IFile> searchFiles = sv.searchFiles(modProject, "TestPortlet.java");
IFile componentClassFile = searchFiles.get(0);
assertEquals(componentClassFile.exists(), true);
String actual = CoreUtil.readStreamToString(componentClassFile.getContents());
assertTrue(actual, actual.contains("\"property-test-key=property-test-value\""));
}
use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.
the class MavenModuleProjectTests method testProjectTemplateWarHook.
@Test
public void testProjectTemplateWarHook() throws Exception {
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
op.setProjectName("war-hook-test");
op.setProjectProvider("maven-module");
op.setProjectTemplateName("war-hook");
IProject project = createAndBuild(op);
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
assertTrue(project.getFile("target/war-hook-test-1.0.0.war").exists());
}
use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.
the class MavenModuleProjectTests method testProjectTemplateWarMvcPortlet.
@Test
public void testProjectTemplateWarMvcPortlet() throws Exception {
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
op.setProjectName("war-mvc-portlet-test");
op.setProjectProvider("maven-module");
op.setProjectTemplateName("war-mvc-portlet");
IProject project = createAndBuild(op);
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
assertTrue(project.getFile("target/war-mvc-portlet-test-1.0.0.war").exists());
}
use of com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp in project liferay-ide by liferay.
the class MavenModuleProjectTests method testProjectTemplateServiceWrapper.
@Test
public void testProjectTemplateServiceWrapper() throws Exception {
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();
op.setProjectName("service-wrapper-test");
op.setProjectProvider("maven-module");
op.setProjectTemplateName("service-wrapper");
op.setServiceName("com.liferay.portal.kernel.service.UserLocalServiceWrapper");
op.setComponentName("MyServiceWrapper");
createAndBuild(op);
}
Aggregations