Search in sources :

Example 11 with Property

use of org.kie.workbench.common.screens.datamodeller.model.persistence.Property in project kie-wb-common by kiegroup.

the class PersistenceDescriptorValidatorTest method testValidatePropertyWithMissingValue.

@Test
public void testValidatePropertyWithMissingValue() {
    // add a property with no name
    descriptor.getPersistenceUnit().addProperty(new Property("someName", null));
    List<ValidationMessage> result = validator.validate(path, descriptor);
    ValidationMessage expectedMessage;
    // validation for the property with missing value should fail.
    expectedMessage = PersistenceDescriptorValidationMessages.newWarningMessage(PersistenceDescriptorValidationMessages.PROPERTY_VALUE_EMPTY_ID, MessageFormat.format(PersistenceDescriptorValidationMessages.PROPERTY_VALUE_EMPTY, "someName"), "someName");
    assertTrue(result.contains(expectedMessage));
}
Also used : ValidationMessage(org.guvnor.common.services.shared.validation.model.ValidationMessage) Property(org.kie.workbench.common.screens.datamodeller.model.persistence.Property) Test(org.junit.Test)

Aggregations

Property (org.kie.workbench.common.screens.datamodeller.model.persistence.Property)11 Test (org.junit.Test)4 PersistenceDescriptorModel (org.kie.workbench.common.screens.datamodeller.model.persistence.PersistenceDescriptorModel)3 PersistenceUnitModel (org.kie.workbench.common.screens.datamodeller.model.persistence.PersistenceUnitModel)3 ArrayList (java.util.ArrayList)2 ValidationMessage (org.guvnor.common.services.shared.validation.model.ValidationMessage)2 Element (org.w3c.dom.Element)2 PersistencePresenter (org.kie.workbench.common.screens.library.client.settings.persistence.PersistencePresenter)1 KieModule (org.kie.workbench.common.services.shared.project.KieModule)1 NodeList (org.w3c.dom.NodeList)1