diff --git a/src/test/java/org/appng/application/manager/business/PlatformPropertiesTest.java b/src/test/java/org/appng/application/manager/business/PlatformPropertiesTest.java index f5f5109..4986da0 100644 --- a/src/test/java/org/appng/application/manager/business/PlatformPropertiesTest.java +++ b/src/test/java/org/appng/application/manager/business/PlatformPropertiesTest.java @@ -29,6 +29,7 @@ import org.appng.api.support.CallableDataSource; import org.appng.application.manager.form.PropertyForm; import org.appng.core.domain.PropertyImpl; +import org.appng.testsupport.validation.WritingXmlValidator; import org.appng.xml.platform.FieldDef; import org.junit.Assert; import org.junit.FixMethodOrder; @@ -40,6 +41,10 @@ public class PlatformPropertiesTest extends AbstractTest { private static final String PROPERTY_EVENT = "propertyEvent"; + static { + WritingXmlValidator.writeXml = false; + } + @Test public void testCreate() throws ProcessingException, IOException { PropertyForm form = new PropertyForm(new PropertyImpl("testproperty", "5")); @@ -61,6 +66,36 @@ public void testCreateStringOrClob() throws ProcessingException, IOException { assertError(fp.getField("property.clob"), "Please set the value or the multiline value."); } + @Test + public void testCreateBoolean() throws ProcessingException, IOException { + PropertyImpl booleanProp = new PropertyImpl("booleanProp", null); + booleanProp.setDescription("this is bool, man!"); + PropertyForm form = new PropertyForm(booleanProp); + form.getProperty().setDefaultString("true"); + CallableAction action = getCreateAction().getCallableAction(form); + action.perform(); + + CallableDataSource dataSource = getDataSource("property").withParam("id", "platform.booleanProp") + .getCallableDataSource(); + dataSource.perform("test"); + validate(dataSource.getDatasource()); + } + + @Test + public void testCreateMultiline() throws ProcessingException, IOException { + PropertyImpl multilineProp = new PropertyImpl("multilineProp", null); + multilineProp.setDescription("Toto - Hold the line"); + PropertyForm form = new PropertyForm(multilineProp); + form.getProperty().setClob("Hold the line,\nlove isn't always on time,\noh oh oh"); + CallableAction action = getCreateAction().getCallableAction(form); + action.perform(); + + CallableDataSource dataSource = getDataSource("property").withParam("id", "platform.multilineProp") + .getCallableDataSource(); + dataSource.perform("test"); + validate(dataSource.getDatasource()); + } + private void assertError(FieldDef field, String message) { String actual = field.getMessages().getMessageList().get(0).getContent(); Assert.assertEquals(message, actual); diff --git a/src/test/resources/xml/PlatformPropertiesTest-testCreateBoolean.xml b/src/test/resources/xml/PlatformPropertiesTest-testCreateBoolean.xml new file mode 100644 index 0000000..b81565b --- /dev/null +++ b/src/test/resources/xml/PlatformPropertiesTest-testCreateBoolean.xml @@ -0,0 +1,37 @@ + + + + property + + platform.booleanProp + + + + + + + + BOOLEAN + + + true + + + true + + + this is bool, man! + + + + diff --git a/src/test/resources/xml/PlatformPropertiesTest-testCreateMultiline.xml b/src/test/resources/xml/PlatformPropertiesTest-testCreateMultiline.xml new file mode 100644 index 0000000..8103ebc --- /dev/null +++ b/src/test/resources/xml/PlatformPropertiesTest-testCreateMultiline.xml @@ -0,0 +1,39 @@ + + + + property + + platform.multilineProp + + + + + + + + MULTILINE + + + Hold the line, + love isn't always on time, + oh oh oh + + + + + + Toto - Hold the line + + + + diff --git a/src/test/resources/xml/PlatformPropertiesTest-testShowAll.xml b/src/test/resources/xml/PlatformPropertiesTest-testShowAll.xml index 7de4ac5..7037e63 100644 --- a/src/test/resources/xml/PlatformPropertiesTest-testShowAll.xml +++ b/src/test/resources/xml/PlatformPropertiesTest-testShowAll.xml @@ -68,7 +68,7 @@ + firstchunk="0" lastchunk="0" hits="4"> anotherproperty @@ -98,6 +98,66 @@ + + + booleanProp + + + true + + + this is bool, man! + + + false + led_orange + + + + + edit + + + + delete + Do you really want to delete the property + "booleanProp"? + + + + + + multilineProp + + + Hold the line, + love isn't always on time, + oh oh oh + + + Toto - Hold the line + + + true + led_green + + + + + edit + + + + delete + Do you really want to delete the property + "multilineProp"? + + + testproperty diff --git a/src/test/resources/xml/PlatformPropertiesTest-testShowOne.xml b/src/test/resources/xml/PlatformPropertiesTest-testShowOne.xml index 60d4fa7..1dd53ee 100644 --- a/src/test/resources/xml/PlatformPropertiesTest-testShowOne.xml +++ b/src/test/resources/xml/PlatformPropertiesTest-testShowOne.xml @@ -7,7 +7,7 @@