use of com.liferay.ide.core.IWebProject in project liferay-ide by liferay.
the class JSFPortletProjectTests method testUpdateLiferayPortletFileDTDVersion.
@Test
public void testUpdateLiferayPortletFileDTDVersion() throws Exception {
NewLiferayPluginProjectOp op = NewLiferayPluginProjectOp.TYPE.instantiate();
op.setProjectName("test-update-liferay-portlet-file");
op.setProjectProvider("maven");
op.setPortletFramework("jsf-2.x");
op.setPortletFrameworkAdvanced("jsf");
NewLiferayProfile profile = op.getNewLiferayProfiles().insert();
profile.setLiferayVersion("6.1.0");
profile.setId("test-bundle");
profile.setRuntimeName("6.1.0");
profile.setProfileLocation(ProfileLocation.projectPom);
op.setActiveProfilesValue("test-bundle");
final IProject newProject = base.createProject(op);
assertNotNull(newProject);
IWebProject webProject = LiferayCore.create(IWebProject.class, newProject);
final IFile descriptorFile = webProject.getDescriptorFile("liferay-portlet.xml");
assertNotNull(descriptorFile);
assertTrue(descriptorFile.exists());
String contents = CoreUtil.readStreamToString(descriptorFile.getContents());
assertTrue(contents.contains("PUBLIC \"-//Liferay//DTD Portlet Application 6.1.0//EN\""));
assertTrue(contents.contains("http://www.liferay.com/dtd/liferay-portlet-app_6_1_0.dtd"));
}
Aggregations