You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:58:43 UTC
[sling-org-apache-sling-provisioning-model] 02/05: SLING-5914 - add
tests that demonstrate the current behavior
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.provisioning.model-1.5.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-provisioning-model.git
commit 636f38774dd4a8665a12c6ebcaa26a705d385cf5
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jul 29 08:07:45 2016 +0000
SLING-5914 - add tests that demonstrate the current behavior
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/support/provisioning-model@1754482 13f79535-47bb-0310-9956-ffa450edef68
---
.../apache/sling/provisioning/model/io/IOTest.java | 13 ++++++++++-
src/test/resources/configadmin.txt | 27 ++++++++++++++++++++--
2 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/src/test/java/org/apache/sling/provisioning/model/io/IOTest.java b/src/test/java/org/apache/sling/provisioning/model/io/IOTest.java
index 6a7395a..a217e90 100644
--- a/src/test/java/org/apache/sling/provisioning/model/io/IOTest.java
+++ b/src/test/java/org/apache/sling/provisioning/model/io/IOTest.java
@@ -93,7 +93,7 @@ public class IOTest {
configs.add(c);
}
- assertEquals(4, configs.size());
+ assertEquals(5, configs.size());
final Configuration cfgA = configs.get(0);
assertEquals("org.apache.test.A", cfgA.getPid());
@@ -119,6 +119,17 @@ public class IOTest {
assertEquals("org.apache.test.D", cfgD.getPid());
assertEquals("Here is\na multiline\nstring", cfgD.getProperties().get("textA"));
assertEquals("Another one\nusing\nescaped newlines", cfgD.getProperties().get("textB"));
+
+ final Configuration cfgE = configs.get(4);
+ assertEquals("org.apache.test.E", cfgE.getPid());
+ assertNull(cfgE.getFactoryPid());
+ assertEquals(4, cfgE.getProperties().size());
+
+ // TODO values will need to change once SLING-5914 is fixed
+ assertEquals(6.0995758E-316, cfgE.getProperties().get("doubleValue"));
+ assertEquals(6.461264E-31f, cfgE.getProperties().get("floatValue"));
+ assertArrayEquals(new Double[] { 1.598088874E-315d, 2.09215452E-315d }, (Double[]) cfgE.getProperties().get("doubles"));
+ assertArrayEquals(new Float[] { 3.7971794E-20f, 1.4675382E-16f }, (Float[]) cfgE.getProperties().get("floats"));
}
@Test public void testAddition() throws Exception {
diff --git a/src/test/resources/configadmin.txt b/src/test/resources/configadmin.txt
index 9c9d6f6..690a5d3 100644
--- a/src/test/resources/configadmin.txt
+++ b/src/test/resources/configadmin.txt
@@ -32,7 +32,7 @@ org.apache.test.B
"two",
"three"
]
- name="B"
+ name="B"
org.apache.test.C
array=I[
@@ -46,4 +46,27 @@ org.apache.test.D
textA="Here is
a multiline
string"
- textB="Another one\nusing\nescaped newlines"
\ No newline at end of file
+ textB="Another one\nusing\nescaped newlines"
+
+# TODO SLING-5914 this is the input format that's
+# specified by the provisioning model, fails with
+# NumberFormatException if activated
+#org.apache.test.E
+# doubleValue=D"5.5"
+# floatValue=F"1.0"
+# doubles=D["0.0", "3.0"]
+# floats=F[
+# "-1.0",
+# "1.0"
+# ]
+
+# TODO deactivate this once
+# the previous variant works
+org.apache.test.E
+ doubleValue=D"123456789"
+ floatValue=F"223456789"
+ doubles=D["323456789", "423456789"]
+ floats=F[
+ "523456789",
+ "623456789"
+ ]
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.