Search in sources :

Example 46 with IWebProject

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"));
}
Also used : IFile(org.eclipse.core.resources.IFile) IWebProject(com.liferay.ide.core.IWebProject) NewLiferayProfile(com.liferay.ide.project.core.model.NewLiferayProfile) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Aggregations

IWebProject (com.liferay.ide.core.IWebProject)46 IFolder (org.eclipse.core.resources.IFolder)31 IFile (org.eclipse.core.resources.IFile)27 IProject (org.eclipse.core.resources.IProject)25 IPath (org.eclipse.core.runtime.IPath)24 Path (org.eclipse.core.runtime.Path)20 CoreException (org.eclipse.core.runtime.CoreException)15 IResource (org.eclipse.core.resources.IResource)10 IStatus (org.eclipse.core.runtime.IStatus)6 NewLiferayPluginProjectOp (com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)5 IOException (java.io.IOException)5 Test (org.junit.Test)5 SDK (com.liferay.ide.sdk.core.SDK)4 Path (org.eclipse.sapphire.modeling.Path)4 CustomJspDir (com.liferay.ide.hook.core.model.CustomJspDir)3 InputStream (java.io.InputStream)3 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 HookDescriptorHelper (com.liferay.ide.hook.core.dd.HookDescriptorHelper)2 Hook (com.liferay.ide.hook.core.model.Hook)2 File (java.io.File)2