You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2014/07/24 10:37:06 UTC

git commit: [OLINGO-348] Rename test bundle to avoid name clash with root bundle

Repository: olingo-odata4
Updated Branches:
  refs/heads/master 327873253 -> e0b787e3d


[OLINGO-348] Rename test bundle to avoid name clash with root bundle


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/e0b787e3
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/e0b787e3
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/e0b787e3

Branch: refs/heads/master
Commit: e0b787e3dd71ad9bc50f56e7f6bec564b2c3b4cf
Parents: 3278732
Author: Christian Amend <ch...@apache.org>
Authored: Thu Jul 24 10:35:17 2014 +0200
Committer: Christian Amend <ch...@apache.org>
Committed: Thu Jul 24 10:35:17 2014 +0200

----------------------------------------------------------------------
 .../server/api/TranslatedExceptionsTest.java    |  7 +++---
 .../src/test/resources/i18n.properties          | 23 --------------------
 .../src/test/resources/i18n_en.properties       | 23 ++++++++++++++++++++
 .../json/ODataJsonSerializerTest.java           |  7 +++---
 4 files changed, 31 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/e0b787e3/lib/server-api/src/test/java/org/apache/olingo/server/api/TranslatedExceptionsTest.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/test/java/org/apache/olingo/server/api/TranslatedExceptionsTest.java b/lib/server-api/src/test/java/org/apache/olingo/server/api/TranslatedExceptionsTest.java
index 55514fe..88f6db4 100644
--- a/lib/server-api/src/test/java/org/apache/olingo/server/api/TranslatedExceptionsTest.java
+++ b/lib/server-api/src/test/java/org/apache/olingo/server/api/TranslatedExceptionsTest.java
@@ -130,11 +130,12 @@ public class TranslatedExceptionsTest {
 
   @Test
   public void keyForRootBundleButNotPresentInDerivedBundle() {
-    ODataTranslatedException exp = new ODataTranslatedException(DEV, ONEPARAM, "param1");
+    ODataTranslatedException exp =
+        new ODataTranslatedException(DEV, ODataTranslatedException.HTTP_METHOD_NOT_IMPLEMENTED, "param1");
     assertEquals(DEV, exp.getMessage());
-    
+
     ODataErrorMessage translatedMessage = exp.getTranslatedMessage(Locale.GERMAN);
     assertNotNull(translatedMessage);
-    assertEquals("Param1: param1", translatedMessage.getMessage());
+    assertEquals("Invalid http method given: 'param1'.", translatedMessage.getMessage());
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/e0b787e3/lib/server-api/src/test/resources/i18n.properties
----------------------------------------------------------------------
diff --git a/lib/server-api/src/test/resources/i18n.properties b/lib/server-api/src/test/resources/i18n.properties
deleted file mode 100644
index d57d8a6..0000000
--- a/lib/server-api/src/test/resources/i18n.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#-------------------------------------------------------------------------------
-# 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.
-#-------------------------------------------------------------------------------
-# Basic Apache Olingo exception messages
-#
-BASIC=Test Default
-ONEPARAM=Param1: %1$s
-TWOPARAM=Param1: %1$s Param2: %2$s
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/e0b787e3/lib/server-api/src/test/resources/i18n_en.properties
----------------------------------------------------------------------
diff --git a/lib/server-api/src/test/resources/i18n_en.properties b/lib/server-api/src/test/resources/i18n_en.properties
new file mode 100644
index 0000000..d57d8a6
--- /dev/null
+++ b/lib/server-api/src/test/resources/i18n_en.properties
@@ -0,0 +1,23 @@
+#-------------------------------------------------------------------------------
+# 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.
+#-------------------------------------------------------------------------------
+# Basic Apache Olingo exception messages
+#
+BASIC=Test Default
+ONEPARAM=Param1: %1$s
+TWOPARAM=Param1: %1$s Param2: %2$s
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/e0b787e3/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
index b9ac7d9..91f0428 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
@@ -38,6 +38,7 @@ import org.apache.olingo.server.api.serializer.ODataSerializer;
 import org.apache.olingo.server.api.serializer.ODataSerializerException;
 import org.apache.olingo.server.tecsvc.data.DataProvider;
 import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
+import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -117,9 +118,9 @@ public class ODataJsonSerializerTest {
       Assert.fail("Expected exception not thrown!");
     } catch (final ODataSerializerException e) {
       Assert.assertEquals(ODataSerializerException.WRONG_PROPERTY_VALUE, e.getMessageKey());
-      // final String message = e.getLocalizedMessage();
-      // Assert.assertThat(message, CoreMatchers.containsString("PropertyInt16"));
-      // Assert.assertThat(message, CoreMatchers.containsString("false"));
+       final String message = e.getLocalizedMessage();
+       Assert.assertThat(message, CoreMatchers.containsString("PropertyInt16"));
+       Assert.assertThat(message, CoreMatchers.containsString("false"));
     }
   }