use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOp625Tests method testNewWebAntProjectValidation.
@Test
public void testNewWebAntProjectValidation() throws Exception {
if (shouldSkipBundleTests())
return;
final String projectName = "test-web-project-sdk";
final NewLiferayPluginProjectOp op = newProjectOp(projectName);
op.setPluginType(PluginType.web);
op.setSdkLocation(PathBridge.create(getLiferayPluginsSdkDir()));
assertEquals("The selected Plugins SDK does not support creating new web type plugins. Please configure version 7.0 or greater.", op.getSdkLocation().validation().message());
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOp7sp3Tests method testNewLayoutAntProject.
@Override
@Test
public void testNewLayoutAntProject() throws Exception {
String projectName = "test-layouttpl-project-sdk";
NewLiferayPluginProjectOp op = newProjectOp(projectName);
op.setPluginType(PluginType.layouttpl);
IProject layouttplProject = createAntProject(op);
IFolder webappRoot = LiferayCore.create(IWebProject.class, layouttplProject).getDefaultDocrootFolder();
assertNotNull(webappRoot);
IFile layoutXml = webappRoot.getFile("WEB-INF/liferay-layout-templates.xml");
assertEquals(true, layoutXml.exists());
IFile wapTpl = webappRoot.getFile("test_layouttpl_project_sdk_7.0.2.wap.tpl");
assertFalse(wapTpl.exists());
IDataModel model = DataModelFactory.createDataModel(new NewLayoutTplDataModelProvider());
model.setProperty(INewLayoutTplDataModelProperties.LAYOUT_TEMPLATE_ID, "newtemplate");
model.setProperty(INewLayoutTplDataModelProperties.LAYOUT_TEMPLATE_NAME, "New Template");
model.setProperty(INewLayoutTplDataModelProperties.LAYOUT_THUMBNAIL_FILE, "/newtemplate.png");
model.setProperty(INewLayoutTplDataModelProperties.LAYOUT_WAP_TEMPLATE_FILE, "/newtemplate.wap.tpl");
model.setProperty(INewLayoutTplDataModelProperties.LAYOUT_TEMPLATE_FILE, "/newtemplate.tpl");
LayoutTplDescriptorHelper layoutHelper = new LayoutTplDescriptorHelper(layouttplProject);
layoutHelper.addNewLayoutTemplate(model);
String contents = CoreUtil.readStreamToString(layoutXml.getContents(true));
assertFalse(contents.contains("<wap-template-path>"));
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testPortletFrameworkPossibleValues.
@Test
public void testPortletFrameworkPossibleValues() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("test-portlet-framework-possible-values");
op.setProjectProvider("ant");
op.setPluginType("portlet");
final Set<String> acturalFrameworks = op.getPortletFramework().service(PossibleValuesService.class).values();
assertNotNull(acturalFrameworks);
Set<String> exceptedFrameworks = new HashSet<String>();
exceptedFrameworks.add("mvc");
exceptedFrameworks.add("jsf-2.x");
exceptedFrameworks.add("vaadin");
exceptedFrameworks.add("spring_mvc");
assertNotNull(exceptedFrameworks);
assertEquals(true, exceptedFrameworks.containsAll(acturalFrameworks));
assertEquals(true, acturalFrameworks.containsAll(exceptedFrameworks));
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testNewPortletAntProject.
@Test
public void testNewPortletAntProject() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("portlet-without-servicexml");
op.setPluginType(PluginType.portlet);
final IProject portletProject = createAntProject(op);
final IFolder webappRoot = LiferayCore.create(IWebProject.class, portletProject).getDefaultDocrootFolder();
assertNotNull(webappRoot);
final IFile serviceXml = webappRoot.getFile("WEB-INF/service.xml");
assertEquals(false, serviceXml.exists());
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testPortletFrameworkAdvancedPossibleValues.
@Test
public void testPortletFrameworkAdvancedPossibleValues() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("test-portlet-framework-advanced-possible-values");
final Set<String> acturalFrameworks = op.getPortletFrameworkAdvanced().service(PossibleValuesService.class).values();
assertNotNull(acturalFrameworks);
Set<String> exceptedFrameworks = new HashSet<String>();
exceptedFrameworks.add("jsf");
exceptedFrameworks.add("icefaces");
exceptedFrameworks.add("liferay_faces_alloy");
exceptedFrameworks.add("primefaces");
exceptedFrameworks.add("richfaces");
assertNotNull(exceptedFrameworks);
assertEquals(true, exceptedFrameworks.containsAll(acturalFrameworks));
assertEquals(true, acturalFrameworks.containsAll(exceptedFrameworks));
}
Aggregations