use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testDisplayNameDefaultValue.
@Test
public void testDisplayNameDefaultValue() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("display-name-default-value");
final DefaultValueService dvs = op.getDisplayName().service(DefaultValueService.class);
final String exceptedDisplayName = "Test Display Name Default Value";
op.setProjectName("test display name default value");
assertEquals(exceptedDisplayName, op.getDisplayName().content());
assertEquals(exceptedDisplayName, dvs.value());
op.setProjectName("Test-Display-Name-Default-Value");
assertEquals(exceptedDisplayName, op.getDisplayName().content());
assertEquals(exceptedDisplayName, dvs.value());
op.setProjectName("Test_Display_Name_Default_Value");
assertEquals(exceptedDisplayName, op.getDisplayName().content());
assertEquals(exceptedDisplayName, dvs.value());
op.setProjectName("test-Display_name Default-value");
assertEquals(exceptedDisplayName, op.getDisplayName().content());
assertEquals(exceptedDisplayName, dvs.value());
final String projectName = "test-display_name default value";
final String[] suffixs = { "-portlet", "-hook", "-theme", "-layouttpl", "-ext" };
for (String suffix : suffixs) {
op.setProjectName(projectName + suffix);
assertEquals(exceptedDisplayName, op.getDisplayName().content());
assertEquals(exceptedDisplayName, dvs.value());
}
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testNewHookAntProject.
@Test
public void testNewHookAntProject() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("test-hook-project-sdk");
op.setPluginType(PluginType.hook);
final IProject hookProject = createAntProject(op);
final IFolder webappRoot = LiferayCore.create(IWebProject.class, hookProject).getDefaultDocrootFolder();
assertNotNull(webappRoot);
final IFile hookXml = webappRoot.getFile("WEB-INF/liferay-hook.xml");
assertEquals(true, hookXml.exists());
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testNewSDKProjects.
@Test
public void testNewSDKProjects() throws Exception {
if (shouldSkipBundleTests())
return;
createAntProject(newProjectOp("test-name-1"));
createAntProject(newProjectOp("Test With Spaces"));
createAntProject(newProjectOp("test_name_1"));
createAntProject(newProjectOp("-portlet-portlet"));
createAntProject(newProjectOp("-portlet-hook"));
final NewLiferayPluginProjectOp op = newProjectOp("-hook-hook");
op.setPluginType(PluginType.hook);
createAntProject(op);
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testLocationListener.
protected void testLocationListener() throws Exception {
final NewLiferayPluginProjectOp op = newProjectOp("location-listener");
op.setProjectProvider("ant");
op.setUseDefaultLocation(false);
final String projectNameWithoutSuffix = "project-name-without-suffix";
final String locationWithoutSuffix = "location-without-suffix";
op.setPluginType("portlet");
final String suffix = "-portlet";
// Both of project name and location are without type suffix.
op.setProjectName(projectNameWithoutSuffix);
op.setLocation(locationWithoutSuffix);
assertEquals(locationWithoutSuffix + "/" + projectNameWithoutSuffix + suffix, op.getLocation().content().toString());
// Location does't have a type suffix, project name has one.
op.setProjectName(projectNameWithoutSuffix + suffix);
op.setLocation(locationWithoutSuffix);
assertEquals(locationWithoutSuffix, op.getLocation().content().toString());
// Location has a type suffix.
op.setLocation(locationWithoutSuffix + suffix);
assertEquals(locationWithoutSuffix + suffix, op.getLocation().content().toString());
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayPluginProjectOpBase method testNewExtAntProject.
@Test
@Ignore
public void testNewExtAntProject() throws Exception {
if (shouldSkipBundleTests())
return;
final NewLiferayPluginProjectOp op = newProjectOp("ext");
op.setPluginType(PluginType.ext);
IProject extProject = null;
try {
extProject = createAntProject(op);
} catch (Throwable e) {
}
assertNotNull(extProject);
final IFolder defaultDocroot = LiferayCore.create(IWebProject.class, extProject).getDefaultDocrootFolder();
assertNotNull(defaultDocroot);
final IFile extFile = defaultDocroot.getFile("WEB-INF/liferay-portlet-ext.xml");
assertEquals(true, extFile.exists());
}
Aggregations