You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by pl...@apache.org on 2015/04/03 15:21:37 UTC
incubator-tamaya git commit: Added test with non-latin charaters.
Repository: incubator-tamaya
Updated Branches:
refs/heads/master 7731f2e95 -> 4eb7b55c3
Added test with non-latin charaters.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/4eb7b55c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/4eb7b55c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/4eb7b55c
Branch: refs/heads/master
Commit: 4eb7b55c37bab5b43d6b8006580cf430369bd151
Parents: 7731f2e
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Fri Apr 3 15:21:18 2015 +0200
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Fri Apr 3 15:21:18 2015 +0200
----------------------------------------------------------------------
.../tamaya/json/CommonJSONTestCaseCollection.java | 15 +++++++++++++++
.../src/test/resources/configs/valid/cyrillic.json | 4 ++++
2 files changed, 19 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4eb7b55c/modules/json/src/test/java/org/apache/tamaya/json/CommonJSONTestCaseCollection.java
----------------------------------------------------------------------
diff --git a/modules/json/src/test/java/org/apache/tamaya/json/CommonJSONTestCaseCollection.java b/modules/json/src/test/java/org/apache/tamaya/json/CommonJSONTestCaseCollection.java
index eb06529..8283e7c 100644
--- a/modules/json/src/test/java/org/apache/tamaya/json/CommonJSONTestCaseCollection.java
+++ b/modules/json/src/test/java/org/apache/tamaya/json/CommonJSONTestCaseCollection.java
@@ -41,6 +41,21 @@ public abstract class CommonJSONTestCaseCollection {
abstract PropertySource getPropertiesFrom(URL source) throws Exception;
@Test
+ public void canReadNonLatinCharacters() throws Exception {
+ URL configURL = JSONPropertySourceTest.class
+ .getResource("/configs/valid/cyrillic.json");
+
+ assertThat(configURL, Matchers.notNullValue());
+
+ PropertySource propertySource = getPropertiesFrom(configURL);
+
+ assertThat(propertySource.get("name"), Matchers.notNullValue());
+ assertThat(propertySource.get("name"), equalTo("\u041e\u043b\u0438\u0432\u0435\u0440"));
+ assertThat(propertySource.get("\u0444\u0430\u043c\u0438\u043b\u0438\u044f"), Matchers.notNullValue());
+ assertThat(propertySource.get("\u0444\u0430\u043c\u0438\u043b\u0438\u044f"), Matchers.equalTo("Fischer"));
+ }
+
+ @Test
public void canReadNestedStringOnlyJSONConfigFile() throws Exception {
URL configURL = JSONPropertySourceTest.class
.getResource("/configs/valid/simple-nested-string-only-config-1.json");
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4eb7b55c/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
new file mode 100644
index 0000000..878eee0
--- /dev/null
+++ b/modules/json/src/test/resources/configs/valid/cyrillic.json
@@ -0,0 +1,4 @@
+{
+ "name" : "Оливер",
+ "фамилия" : "Fischer"
+}
\ No newline at end of file