From e0b787e3dd71ad9bc50f56e7f6bec564b2c3b4cf Mon Sep 17 00:00:00 2001 From: Christian Amend Date: Thu, 24 Jul 2014 10:35:17 +0200 Subject: [PATCH] [OLINGO-348] Rename test bundle to avoid name clash with root bundle --- .../apache/olingo/server/api/TranslatedExceptionsTest.java | 7 ++++--- .../test/resources/{i18n.properties => i18n_en.properties} | 0 .../core/serializer/json/ODataJsonSerializerTest.java | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) rename lib/server-api/src/test/resources/{i18n.properties => i18n_en.properties} (100%) 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 55514fedb..88f6db4a1 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()); } } diff --git a/lib/server-api/src/test/resources/i18n.properties b/lib/server-api/src/test/resources/i18n_en.properties similarity index 100% rename from lib/server-api/src/test/resources/i18n.properties rename to lib/server-api/src/test/resources/i18n_en.properties 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 b9ac7d9ba..91f0428c8 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")); } }