Search in sources :

Example 1 with DefaultValueService

use of org.eclipse.sapphire.DefaultValueService 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());
    }
}
Also used : DefaultValueService(org.eclipse.sapphire.DefaultValueService) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp) Test(org.junit.Test)

Example 2 with DefaultValueService

use of org.eclipse.sapphire.DefaultValueService in project liferay-ide by liferay.

the class NewLiferayJSFModuleProjectOpTests method testNewLiferayJSFModuleProjectOpDefaultBuildType.

@Test
public void testNewLiferayJSFModuleProjectOpDefaultBuildType() throws Exception {
    NewLiferayJSFModuleProjectOp existedProjectop = NewLiferayJSFModuleProjectOp.TYPE.instantiate();
    existedProjectop.setProjectName("Test3");
    existedProjectop.setProjectProvider("gradle-jsf");
    existedProjectop.setTemplateName("primefaces");
    Status exStatus = NewLiferayJSFModuleProjectOpMethods.execute(existedProjectop, ProgressMonitorBridge.create(new NullProgressMonitor()));
    assertTrue(exStatus.ok());
    IProject existedProject = CoreUtil.getProject(existedProjectop.getProjectName().content());
    assertNotNull(existedProject);
    NewLiferayJSFModuleProjectOp newBuildTypeop = NewLiferayJSFModuleProjectOp.TYPE.instantiate();
    DefaultValueService buildTypeDefaultService = newBuildTypeop.getProjectProvider().service(DefaultValueService.class);
    assertEquals(buildTypeDefaultService.value(), "gradle-jsf");
}
Also used : Status(org.eclipse.sapphire.modeling.Status) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) DefaultValueService(org.eclipse.sapphire.DefaultValueService) NewLiferayJSFModuleProjectOp(com.liferay.ide.project.core.jsf.NewLiferayJSFModuleProjectOp) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Aggregations

DefaultValueService (org.eclipse.sapphire.DefaultValueService)2 Test (org.junit.Test)2 NewLiferayJSFModuleProjectOp (com.liferay.ide.project.core.jsf.NewLiferayJSFModuleProjectOp)1 NewLiferayPluginProjectOp (com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)1 IProject (org.eclipse.core.resources.IProject)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 Status (org.eclipse.sapphire.modeling.Status)1