You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2015/08/25 14:02:53 UTC

[1/2] incubator-tamaya git commit: TAMAYA-92: Removed dep on Jackson.

Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 8cdd25c24 -> 80995f40c


TAMAYA-92: Removed dep on Jackson.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/171b92d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/171b92d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/171b92d5

Branch: refs/heads/master
Commit: 171b92d5277bc5e044f6d370d90e255f7e009357
Parents: 8cdd25c
Author: anatole <an...@apache.org>
Authored: Tue Aug 25 14:01:49 2015 +0200
Committer: anatole <an...@apache.org>
Committed: Tue Aug 25 14:01:49 2015 +0200

----------------------------------------------------------------------
 modules/json/pom.xml                            | 15 +++---
 .../java/org/apache/tamaya/json/JSONFormat.java | 36 ++++++++++----
 .../apache/tamaya/json/JSONPropertySource.java  | 33 ++++++++++---
 .../org/apache/tamaya/json/JSONVisitor.java     | 51 ++++++++++++--------
 .../tamaya/json/JSONPropertySourceTest.java     | 10 ++++
 .../test/resources/configs/invalid/array.json   | 18 +++++++
 .../resources/configs/invalid/empty-file.json   | 18 +++++++
 .../configs/invalid/only-opening-bracket.json   | 19 ++++++++
 .../resources/configs/invalid/with-array.json   | 18 +++++++
 .../test/resources/configs/valid/cyrillic.json  | 18 +++++++
 .../configs/valid/empty-object-config.json      | 18 +++++++
 .../valid/simple-flat-string-only-config.json   | 18 +++++++
 .../simple-nested-string-only-config-1.json     | 30 +++++++++---
 .../simple-nested-string-only-config-2.json     | 18 +++++++
 .../configs/valid/with-explicit-priority.json   | 25 +++++++++-
 15 files changed, 291 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/pom.xml
----------------------------------------------------------------------
diff --git a/modules/json/pom.xml b/modules/json/pom.xml
index c789f47..c79f389 100644
--- a/modules/json/pom.xml
+++ b/modules/json/pom.xml
@@ -61,19 +61,16 @@ under the License.
             <version>${project.version}</version>
         </dependency>
 
-
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-        </dependency>
         <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-core</artifactId>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-json_1.0_spec</artifactId>
         </dependency>
+
         <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-annotations</artifactId>
+            <groupId>org.apache.johnzon</groupId>
+             <artifactId>johnzon-core</artifactId>
         </dependency>
+
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/main/java/org/apache/tamaya/json/JSONFormat.java
----------------------------------------------------------------------
diff --git a/modules/json/src/main/java/org/apache/tamaya/json/JSONFormat.java b/modules/json/src/main/java/org/apache/tamaya/json/JSONFormat.java
index cdacf41..fe781f3 100644
--- a/modules/json/src/main/java/org/apache/tamaya/json/JSONFormat.java
+++ b/modules/json/src/main/java/org/apache/tamaya/json/JSONFormat.java
@@ -18,20 +18,24 @@
  */
 package org.apache.tamaya.json;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.tamaya.ConfigException;
 import org.apache.tamaya.format.ConfigurationData;
 import org.apache.tamaya.format.ConfigurationDataBuilder;
 import org.apache.tamaya.format.ConfigurationFormat;
 
-import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.nio.charset.Charset;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.Objects;
 
+import javax.json.Json;
+import javax.json.JsonException;
+import javax.json.JsonObject;
+import javax.json.JsonReader;
+import javax.json.JsonReaderFactory;
+
 /**
  * Implementation of the {@link org.apache.tamaya.format.ConfigurationFormat}
  * able to read configuration properties represented in JSON
@@ -39,6 +43,19 @@ import java.util.Objects;
  * @see <a href="http://www.json.org">JSON format specification</a>
  */
 public class JSONFormat implements ConfigurationFormat {
+    /** Property that make Johnzon accept commentc. */
+    public static final String JOHNZON_SUPPORTS_COMMENTS_PROP = "org.apache.johnzon.supports-comments";
+    /** The reader factory used. */
+    private JsonReaderFactory readerFactory;
+
+    /**
+     * Constructor, itniaitlizing zhe JSON reader factory.
+     */
+    public JSONFormat(){
+        Map<String, Object> config = new HashMap<String, Object>();
+        config.put(JOHNZON_SUPPORTS_COMMENTS_PROP, true);
+        this.readerFactory = Json.createReaderFactory(config);
+    }
 
     @Override
     public String getName() {
@@ -54,16 +71,15 @@ public class JSONFormat implements ConfigurationFormat {
     public ConfigurationData readConfiguration(String resource, InputStream inputStream) {
 
         try {
-            ObjectMapper mapper = new ObjectMapper();
-            JsonNode root = mapper.readTree(inputStream);
+            final JsonReader reader = this.readerFactory.createReader(inputStream, Charset.forName("UTF-8"));
+            JsonObject root = reader.readObject();
             HashMap<String, String> values = new HashMap<>();
-            JSONVisitor visitor = new JSONVisitor((ObjectNode) root, values);
+            JSONVisitor visitor = new JSONVisitor(root, values);
             visitor.run();
-
             return ConfigurationDataBuilder.of(resource, this).addProperties(values)
                                            .build();
-        } catch (IOException e) {
-            throw new ConfigException("Failed to read data from " + resource);
+        } catch (JsonException e) {
+            throw new ConfigException("Failed to read data from " + resource, e);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/main/java/org/apache/tamaya/json/JSONPropertySource.java
----------------------------------------------------------------------
diff --git a/modules/json/src/main/java/org/apache/tamaya/json/JSONPropertySource.java b/modules/json/src/main/java/org/apache/tamaya/json/JSONPropertySource.java
index c207de0..256f8e8 100644
--- a/modules/json/src/main/java/org/apache/tamaya/json/JSONPropertySource.java
+++ b/modules/json/src/main/java/org/apache/tamaya/json/JSONPropertySource.java
@@ -18,14 +18,12 @@
  */
 package org.apache.tamaya.json;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.tamaya.ConfigException;
 import org.apache.tamaya.spi.PropertySource;
 
 import java.io.InputStream;
 import java.net.URL;
+import java.nio.charset.Charset;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -33,18 +31,35 @@ import java.util.Objects;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javax.json.Json;
+import javax.json.JsonObject;
+import javax.json.JsonReaderFactory;
+import javax.json.JsonStructure;
+
 import static java.lang.String.format;
 
 /**
  * Property source based on a JSON file.
  */
 public class JSONPropertySource implements PropertySource {
+    /** Constant for enabling comments in Johnzon. */
+    public static final String JOHNZON_SUPPORTS_COMMENTS_PROP = "org.apache.johnzon.supports-comments";
+
     /** The underlying resource. */
     private URL urlResource;
     /** The values read. */
     private Map<String, String> values;
     /** The evaluated ordinal. */
     private int ordinal;
+    /** The JSON reader factory used. */
+    private JsonReaderFactory readerFactory = initReaderFactory();
+
+    /** Initializes the factory to be used for creating readers. */
+    private JsonReaderFactory initReaderFactory() {
+        Map<String, Object> config = new HashMap<String, Object>();
+        config.put(JOHNZON_SUPPORTS_COMMENTS_PROP, true);
+       return Json.createReaderFactory(config);
+    }
 
     /**
      * Constructor, hereby using 0 as the default ordinal.
@@ -66,6 +81,9 @@ public class JSONPropertySource implements PropertySource {
         if (this.values.containsKey(TAMAYA_ORDINAL)) {
             this.ordinal = Integer.parseInt(this.values.get(TAMAYA_ORDINAL));
         }
+        Map<String, Object> config = new HashMap<String, Object>();
+        config.put(JOHNZON_SUPPORTS_COMMENTS_PROP, true);
+        this.readerFactory = Json.createReaderFactory(config);
     }
 
 
@@ -103,16 +121,15 @@ public class JSONPropertySource implements PropertySource {
      */
     protected Map<String, String> readConfig(URL urlResource) {
         try (InputStream is = urlResource.openStream()) {
-            ObjectMapper mapper = new ObjectMapper();
-            JsonNode root = mapper.readTree(is);
+            JsonStructure root = this.readerFactory.createReader(is, Charset.forName("UTF-8")).read();
 
-            // @todo Add test for this. Oliver B. Fischer, 5. Jan. 2015
-            if (!(root instanceof ObjectNode)) {
+            // Test added. H. Saly, 15. Aug. 2015
+            if (!(root instanceof JsonObject)) {
                 throw new ConfigException("Currently only JSON objects are supported");
             }
 
             Map<String, String> values = new HashMap<>();
-            JSONVisitor visitor = new JSONVisitor((ObjectNode) root, values);
+            JSONVisitor visitor = new JSONVisitor((JsonObject)root, values);
             visitor.run();
             return values;
         }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/main/java/org/apache/tamaya/json/JSONVisitor.java
----------------------------------------------------------------------
diff --git a/modules/json/src/main/java/org/apache/tamaya/json/JSONVisitor.java b/modules/json/src/main/java/org/apache/tamaya/json/JSONVisitor.java
index bfa7260..6d70a3b 100644
--- a/modules/json/src/main/java/org/apache/tamaya/json/JSONVisitor.java
+++ b/modules/json/src/main/java/org/apache/tamaya/json/JSONVisitor.java
@@ -18,22 +18,24 @@
  */
 package org.apache.tamaya.json;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.fasterxml.jackson.databind.node.ValueNode;
 import org.apache.tamaya.ConfigException;
 
 import java.util.*;
 
+import javax.json.JsonArray;
+import javax.json.JsonObject;
+import javax.json.JsonString;
+import javax.json.JsonStructure;
+import javax.json.JsonValue;
+
 /**
  * Visitor implementation to read a JSON formatted input source.
  */
-public class JSONVisitor {
-    private final ObjectNode rootNode;
+class JSONVisitor {
+    private final JsonObject rootNode;
     private final Map<String, String> targetStore;
 
-    public JSONVisitor(ObjectNode startNode, Map<String, String> target) {
+    JSONVisitor(JsonObject startNode, Map<String, String> target) {
         rootNode = startNode;
         targetStore = target;
     }
@@ -46,17 +48,28 @@ public class JSONVisitor {
 
         if (goOn) {
             do {
-                Map.Entry<String, JsonNode> current = stack.peek().nextElement();
+                Map.Entry<String, JsonValue> current = stack.peek().nextElement();
 
-                if (current.getValue() instanceof ValueNode) {
+                if (!(current.getValue() instanceof JsonStructure)) {
                     String key = stack.peek().getNSPrefix() + current.getKey();
-                    String value = current.getValue().asText();
+                    String value = null;
+                    JsonValue jsonValue = current.getValue();
+                    switch(jsonValue.getValueType()) {
+                        case NULL: value = null; break;
+                        case FALSE: value = Boolean.FALSE.toString(); break;
+                        case TRUE: Boolean.TRUE.toString(); break;
+                        case NUMBER: value = jsonValue.toString(); break;
+                        case STRING: value = ((JsonString) jsonValue).getString(); break;
+                        default:
+                            throw new ConfigException("Internal failure while processing JSON document.");
+                    }
+                    
                     targetStore.put(key, value);
-                } else if (current.getValue() instanceof ObjectNode) {
+                } else if (current.getValue() instanceof JsonObject) {
                     String key = stack.peek().getNSPrefix() + current.getKey();
-                    ObjectNode node = (ObjectNode) current.getValue();
+                    JsonObject node = (JsonObject) current.getValue();
                     stack.push(new VisitingContext(node, key));
-                } else if (current.getValue() instanceof ArrayNode) {
+                } else if (current.getValue() instanceof JsonArray) {
                     throw new ConfigException("Arrays are not supported at the moment.");
                 } else {
                     throw new ConfigException("Internal failure while processing JSON document.");
@@ -77,20 +90,20 @@ public class JSONVisitor {
      */
     private static class VisitingContext {
         private String namespace;
-        private final ObjectNode node;
-        private final Iterator<Map.Entry<String, JsonNode>> elements;
+        private final JsonObject node;
+        private final Iterator<Map.Entry<String, JsonValue>> elements;
 
-        public VisitingContext(ObjectNode node) {
+        public VisitingContext(JsonObject node) {
             this(node, "");
         }
 
-        public VisitingContext(ObjectNode rootNode, String currentNamespace) {
+        public VisitingContext(JsonObject rootNode, String currentNamespace) {
             namespace = currentNamespace;
             node = rootNode;
-            elements = node.fields();
+            elements = node.entrySet().iterator();
         }
 
-        public Map.Entry<String, JsonNode> nextElement() {
+        public Map.Entry<String, JsonValue> nextElement() {
             return elements.next();
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/java/org/apache/tamaya/json/JSONPropertySourceTest.java
----------------------------------------------------------------------
diff --git a/modules/json/src/test/java/org/apache/tamaya/json/JSONPropertySourceTest.java b/modules/json/src/test/java/org/apache/tamaya/json/JSONPropertySourceTest.java
index 84dea2a..2353eaa 100644
--- a/modules/json/src/test/java/org/apache/tamaya/json/JSONPropertySourceTest.java
+++ b/modules/json/src/test/java/org/apache/tamaya/json/JSONPropertySourceTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tamaya.json;
 
+import org.apache.tamaya.ConfigException;
 import org.apache.tamaya.spi.PropertySource;
 import org.hamcrest.CoreMatchers;
 import org.junit.Test;
@@ -38,6 +39,15 @@ public class JSONPropertySourceTest extends CommonJSONTestCaseCollection {
         JSONPropertySource source = new JSONPropertySource(configURL, 4);
         assertEquals(source.get(PropertySource.TAMAYA_ORDINAL), "16784");
     }
+    
+    @Test(expected=ConfigException.class)
+    public void testDoNotAcceptJsonArrays() throws Exception {
+        URL configURL = JSONPropertySourceTest.class.getResource("/configs/invalid/array.json");
+
+        assertThat(configURL, CoreMatchers.notNullValue());
+
+        new JSONPropertySource(configURL);
+    }
 
     @Override
     PropertySource getPropertiesFrom(URL source) throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/resources/configs/invalid/array.json
----------------------------------------------------------------------
diff --git a/modules/json/src/test/resources/configs/invalid/array.json b/modules/json/src/test/resources/configs/invalid/array.json
index c44dc44..0c2058a 100644
--- a/modules/json/src/test/resources/configs/invalid/array.json
+++ b/modules/json/src/test/resources/configs/invalid/array.json
@@ -1,3 +1,21 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
 [
 
 ]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/resources/configs/invalid/empty-file.json
----------------------------------------------------------------------
diff --git a/modules/json/src/test/resources/configs/invalid/empty-file.json b/modules/json/src/test/resources/configs/invalid/empty-file.json
index e69de29..f396085 100644
--- a/modules/json/src/test/resources/configs/invalid/empty-file.json
+++ b/modules/json/src/test/resources/configs/invalid/empty-file.json
@@ -0,0 +1,18 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/resources/configs/invalid/only-opening-bracket.json
----------------------------------------------------------------------
diff --git a/modules/json/src/test/resources/configs/invalid/only-opening-bracket.json b/modules/json/src/test/resources/configs/invalid/only-opening-bracket.json
index e69de29..b936f69 100644
--- a/modules/json/src/test/resources/configs/invalid/only-opening-bracket.json
+++ b/modules/json/src/test/resources/configs/invalid/only-opening-bracket.json
@@ -0,0 +1,19 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+{
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/resources/configs/invalid/with-array.json
----------------------------------------------------------------------
diff --git a/modules/json/src/test/resources/configs/invalid/with-array.json b/modules/json/src/test/resources/configs/invalid/with-array.json
index d80a114..e623e49 100644
--- a/modules/json/src/test/resources/configs/invalid/with-array.json
+++ b/modules/json/src/test/resources/configs/invalid/with-array.json
@@ -1,3 +1,21 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
 {
   "a" : "A",
   "b" : {

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/resources/configs/valid/cyrillic.json
----------------------------------------------------------------------
diff --git a/modules/json/src/test/resources/configs/valid/cyrillic.json b/modules/json/src/test/resources/configs/valid/cyrillic.json
index 878eee0..b9f07b8 100644
--- a/modules/json/src/test/resources/configs/valid/cyrillic.json
+++ b/modules/json/src/test/resources/configs/valid/cyrillic.json
@@ -1,3 +1,21 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
 {
   "name" : "Оливер",
   "фамилия" : "Fischer"

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/resources/configs/valid/empty-object-config.json
----------------------------------------------------------------------
diff --git a/modules/json/src/test/resources/configs/valid/empty-object-config.json b/modules/json/src/test/resources/configs/valid/empty-object-config.json
index 7a73a41..103c28d 100644
--- a/modules/json/src/test/resources/configs/valid/empty-object-config.json
+++ b/modules/json/src/test/resources/configs/valid/empty-object-config.json
@@ -1,2 +1,20 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
 {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/resources/configs/valid/simple-flat-string-only-config.json
----------------------------------------------------------------------
diff --git a/modules/json/src/test/resources/configs/valid/simple-flat-string-only-config.json b/modules/json/src/test/resources/configs/valid/simple-flat-string-only-config.json
index c8ea179..02e2cd8 100644
--- a/modules/json/src/test/resources/configs/valid/simple-flat-string-only-config.json
+++ b/modules/json/src/test/resources/configs/valid/simple-flat-string-only-config.json
@@ -1,3 +1,21 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
 {
   "a" : "A",
   "b" : "B",

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/resources/configs/valid/simple-nested-string-only-config-1.json
----------------------------------------------------------------------
diff --git a/modules/json/src/test/resources/configs/valid/simple-nested-string-only-config-1.json b/modules/json/src/test/resources/configs/valid/simple-nested-string-only-config-1.json
index 89df957..fb2c4fe 100644
--- a/modules/json/src/test/resources/configs/valid/simple-nested-string-only-config-1.json
+++ b/modules/json/src/test/resources/configs/valid/simple-nested-string-only-config-1.json
@@ -1,9 +1,27 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
 {
-  "a" : "A",
-  "b" : "B",
-  "c" : "C",
-  "d" : {
-    "o" : "O",
-    "p" : "P"
+  "a": "A",
+  "b": "B",
+  "c": "C",
+  "d": {
+    "o": "O",
+    "p": "P"
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/resources/configs/valid/simple-nested-string-only-config-2.json
----------------------------------------------------------------------
diff --git a/modules/json/src/test/resources/configs/valid/simple-nested-string-only-config-2.json b/modules/json/src/test/resources/configs/valid/simple-nested-string-only-config-2.json
index c275153..b037174 100644
--- a/modules/json/src/test/resources/configs/valid/simple-nested-string-only-config-2.json
+++ b/modules/json/src/test/resources/configs/valid/simple-nested-string-only-config-2.json
@@ -1,3 +1,21 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
 {
   "a" : "A",
   "b" : {

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/171b92d5/modules/json/src/test/resources/configs/valid/with-explicit-priority.json
----------------------------------------------------------------------
diff --git a/modules/json/src/test/resources/configs/valid/with-explicit-priority.json b/modules/json/src/test/resources/configs/valid/with-explicit-priority.json
index 9e34151..ed7acc2 100644
--- a/modules/json/src/test/resources/configs/valid/with-explicit-priority.json
+++ b/modules/json/src/test/resources/configs/valid/with-explicit-priority.json
@@ -1,4 +1,25 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
 {
+  /*
+   some useful comment here
+   */
   "tamaya.ordinal" : 16784,
-  "a" : "A"
-}
\ No newline at end of file
+  "a" : "A" // another comment
+}


[2/2] incubator-tamaya git commit: TAMAYA-92: Removed dep on Jackson.

Posted by an...@apache.org.
TAMAYA-92: Removed dep on Jackson.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/80995f40
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/80995f40
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/80995f40

Branch: refs/heads/master
Commit: 80995f40cc7e88aa22f347a1d30d7caa73f05ca7
Parents: 171b92d
Author: anatole <an...@apache.org>
Authored: Tue Aug 25 14:02:38 2015 +0200
Committer: anatole <an...@apache.org>
Committed: Tue Aug 25 14:02:38 2015 +0200

----------------------------------------------------------------------
 pom.xml | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/80995f40/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 990ac55..11ba8b7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -54,7 +54,8 @@ under the License.
         <maven.javadoc.skip>false</maven.javadoc.skip>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <jackson.version>2.5.1</jackson.version>
+        <json.spec.version>1.0-alpha-1</json.spec.version>
+        <johnzon.version>0.9-incubating</johnzon.version>
         <junit.version>4.12</junit.version>
 
         <!-- Dependency and plugin relate version properties go here -->
@@ -301,20 +302,17 @@ under the License.
             </dependency>
 
             <dependency>
-                <groupId>com.fasterxml.jackson.core</groupId>
-                <artifactId>jackson-databind</artifactId>
-                <version>${jackson.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.fasterxml.jackson.core</groupId>
-                <artifactId>jackson-core</artifactId>
-                <version>${jackson.version}</version>
+                <groupId>org.apache.geronimo.specs</groupId>
+                <artifactId>geronimo-json_1.0_spec</artifactId>
+                <version>${json.spec.version}</version>
             </dependency>
+
             <dependency>
-                <groupId>com.fasterxml.jackson.core</groupId>
-                <artifactId>jackson-annotations</artifactId>
-                <version>${jackson.version}</version>
+                <groupId>org.apache.johnzon</groupId>
+                <artifactId>johnzon-core</artifactId>
+                <version>${johnzon.version}</version>
             </dependency>
+
         </dependencies>
     </dependencyManagement>