cziegeler closed pull request #8: Unit tests for reading multiline repoinit 
sections
URL: https://github.com/apache/sling-whiteboard/pull/8
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/featuremodel/feature-support/src/test/java/org/apache/sling/feature/support/json/FeatureJSONReaderTest.java
 
b/featuremodel/feature-support/src/test/java/org/apache/sling/feature/support/json/FeatureJSONReaderTest.java
index 238d50d..28674a0 100644
--- 
a/featuremodel/feature-support/src/test/java/org/apache/sling/feature/support/json/FeatureJSONReaderTest.java
+++ 
b/featuremodel/feature-support/src/test/java/org/apache/sling/feature/support/json/FeatureJSONReaderTest.java
@@ -17,6 +17,8 @@
 package org.apache.sling.feature.support.json;
 
 import org.apache.sling.feature.Configuration;
+import org.apache.sling.feature.Extension;
+import org.apache.sling.feature.Extensions;
 import org.apache.sling.feature.Feature;
 import org.junit.Test;
 import org.osgi.resource.Capability;
@@ -53,4 +55,19 @@
 
     }
 
+    @Test public void testReadRepoInitExtension() throws Exception {
+        Feature feature = U.readFeature("repoinit");
+        Extensions extensions = feature.getExtensions();
+        assertEquals(1, extensions.size());
+        Extension ext = extensions.iterator().next();
+        assertEquals("some repo init\ntext", ext.getText());
+    }
+
+    @Test public void testReadRepoInitExtensionArray() throws Exception {
+        Feature feature = U.readFeature("repoinit2");
+        Extensions extensions = feature.getExtensions();
+        assertEquals(1, extensions.size());
+        Extension ext = extensions.iterator().next();
+        assertEquals("some repo init\ntext\n", ext.getText());
+    }
 }
diff --git 
a/featuremodel/feature-support/src/test/resources/features/repoinit.json 
b/featuremodel/feature-support/src/test/resources/features/repoinit.json
new file mode 100644
index 0000000..2177702
--- /dev/null
+++ b/featuremodel/feature-support/src/test/resources/features/repoinit.json
@@ -0,0 +1,4 @@
+{
+    "id": "test/repoinit/1.0.0",
+    "repoinit:TEXT|false": "some repo init\ntext"
+}
diff --git 
a/featuremodel/feature-support/src/test/resources/features/repoinit2.json 
b/featuremodel/feature-support/src/test/resources/features/repoinit2.json
new file mode 100644
index 0000000..beef986
--- /dev/null
+++ b/featuremodel/feature-support/src/test/resources/features/repoinit2.json
@@ -0,0 +1,7 @@
+{
+    "id": "test/repoinit2/1.0.0",
+    "repoinit:TEXT|false": [
+        "some repo init",
+        "text"
+    ]
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to