use of org.eclipse.sapphire.services.ValidationService in project liferay-ide by liferay.
the class NewLiferayPluginProjectMavenTests method testPortletFrameworkValidation.
@Test
@Ignore
public void testPortletFrameworkValidation() throws Exception {
if (shouldSkipBundleTests())
return;
NewLiferayPluginProjectOp op = newProjectOp("test-portlet-framework-validation");
op.setPluginType("portlet");
final ValidationService vs = op.getPortletFramework().service(ValidationService.class);
assertEquals(true, vs.validation().ok());
final SDK newSDK = createNewSDK();
newSDK.setVersion("6.0.0");
final IPortletFramework jsf = ProjectCore.getPortletFramework("jsf");
op.setProjectProvider("ant");
op.setPortletFramework("jsf");
assertEquals("Selected portlet framework requires SDK version at least " + jsf.getRequiredSDKVersion(), vs.validation().message());
// Value is not excepted.
/*
* assertEquals( "Selected portlet framework requires SDK version at least " + jsf.getRequiredSDKVersion(),
* op.getPortletFramework().validation().message() );
*/
}
use of org.eclipse.sapphire.services.ValidationService in project liferay-ide by liferay.
the class NewLiferayPluginProjectMavenTests method testParentFolderLocationValidation.
@Test
public void testParentFolderLocationValidation() throws Exception {
File parentFolder = CoreUtil.getWorkspaceRoot().getLocation().append("test-parent-folder-location-validation-service").toFile();
if (!parentFolder.exists()) {
parentFolder.mkdir();
}
File pomFile = new File("projects/validations/location/pom.xml");
FileUtil.copyFileToDir(pomFile, parentFolder);
final NewLiferayPluginProjectOp op = NewLiferayPluginProjectOp.TYPE.instantiate();
op.setProjectName("test-parent-folder-location-validation-service");
final ValidationService vs = op.getLocation().service(ValidationService.class);
op.setProjectProvider("maven");
op.setPluginType("portlet");
op.setUseDefaultLocation(false);
op.setLocation(parentFolder.getAbsolutePath());
String projectName = op.getProjectName().content();
String expected = "The project name \"" + projectName + "\" can't be the same as the parent.";
assertEquals(expected, vs.validation().message());
assertEquals(expected, op.getLocation().validation().message());
}
use of org.eclipse.sapphire.services.ValidationService in project liferay-ide by liferay.
the class NewLiferayPluginProjectMavenTests method testGroupIdValidation.
@Test
public void testGroupIdValidation() throws Exception {
final NewLiferayPluginProjectOp op = newProjectOp("test-group-id-validation");
op.setProjectProvider("maven");
final ValidationService vs = op.getGroupId().service(ValidationService.class);
op.setGroupId(".com.liferay.test");
final String expected = "A package name cannot start or end with a dot";
assertEquals(expected, vs.validation().message());
assertEquals(expected, op.getGroupId().validation().message());
op.setGroupId("com.life*ray.test");
final String expected2 = "'life*ray' is not a valid Java identifier";
assertEquals(expected2, vs.validation().message());
assertEquals(expected2, op.getGroupId().validation().message());
}
Aggregations