diff --git a/lib/client-api/pom.xml b/lib/client-api/pom.xml index abd541536..74f2f06da 100644 --- a/lib/client-api/pom.xml +++ b/lib/client-api/pom.xml @@ -41,6 +41,10 @@ ${project.version} + + org.slf4j + slf4j-api + commons-io commons-io diff --git a/lib/commons-api/pom.xml b/lib/commons-api/pom.xml index dc71493d5..47a411ada 100644 --- a/lib/commons-api/pom.xml +++ b/lib/commons-api/pom.xml @@ -38,22 +38,13 @@ org.apache.commons commons-lang3 - - - org.slf4j - slf4j-api - + junit junit test - - org.mockito - mockito-all - test - diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTermImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTermImpl.java index 0f6071622..ec6223af2 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTermImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTermImpl.java @@ -30,12 +30,9 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; import org.apache.olingo.commons.api.edm.provider.CsdlTerm; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class EdmTermImpl extends AbstractEdmNamed implements EdmTerm { - private static final Logger LOG = LoggerFactory.getLogger(EdmTermImpl.class); private final CsdlTerm term; private final FullQualifiedName fqn; private final EdmTypeInfo typeInfo; @@ -92,7 +89,7 @@ public class EdmTermImpl extends AbstractEdmNamed implements EdmTerm { try { appliesToLocal.add(ClassUtils.getClass(EdmTerm.class.getPackage().getName() + ".Edm" + element)); } catch (ClassNotFoundException e) { - LOG.error("Could not load Edm class for {}", element, e); + throw new EdmException("Could not load Edm class for {} " + element, e); } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java index 86125cd29..013280aab 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java @@ -26,8 +26,6 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; import org.apache.olingo.commons.api.ODataException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Abstract superclass of all translatable server exceptions. @@ -35,7 +33,6 @@ import org.slf4j.LoggerFactory; public abstract class ODataLibraryException extends ODataException { private static final long serialVersionUID = -1210541002198287561L; - private static final Logger LOG = LoggerFactory.getLogger(ODataLibraryException.class); private static final Locale DEFAULT_LOCALE = Locale.ENGLISH; protected static final String DEFAULT_SERVER_BUNDLE_NAME = "server-core-exceptions-i18n"; @@ -109,7 +106,6 @@ public abstract class ODataLibraryException extends ODataException { try { return ResourceBundle.getBundle(getBundleName(), locale == null ? DEFAULT_LOCALE : locale); } catch (final MissingResourceException e) { - LOG.error(e.getMessage(), e); return null; } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugSupport.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugSupport.java index 7a94c4456..b3721e64a 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugSupport.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugSupport.java @@ -31,11 +31,19 @@ public interface DebugSupport { public static final String ODATA_DEBUG_HTML = "html"; public static final String ODATA_DEBUG_DOWNLOAD = "download"; - //TODO:JavaDoc + /** + * Initializes the debug support implementation. Is called before {@link #isUserAuthorized()} and + * {@link #createDebugResponse(String, DebugInformation)} + * @param odata + */ void init(OData odata); + /** + * This method is called to make sure that the user that requested the debug output is authorized to see this output. + * @return true if the current user is authorized + */ boolean isUserAuthorized(); - + /** * This method should create a debug response and deliver it back to the Olingo library. This method MUST NEVER throw * an exception. diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java index 376315acc..46c7d88e6 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java @@ -20,7 +20,6 @@ package org.apache.olingo.server.api.processor; import java.io.ByteArrayInputStream; import java.nio.charset.Charset; -import java.util.Locale; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.http.HttpHeader; diff --git a/lib/server-tecsvc/pom.xml b/lib/server-tecsvc/pom.xml index 5bb18ce97..655e756d1 100644 --- a/lib/server-tecsvc/pom.xml +++ b/lib/server-tecsvc/pom.xml @@ -143,6 +143,10 @@ runtime + + org.slf4j + slf4j-api + org.slf4j slf4j-simple diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlDeserializerTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlDeserializerTest.java index fb7e7ff22..ac24bad84 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlDeserializerTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlDeserializerTest.java @@ -29,7 +29,6 @@ import org.apache.olingo.commons.api.data.Entity; import org.apache.olingo.commons.api.data.Link; import org.apache.olingo.commons.api.data.Property; import org.apache.olingo.commons.api.edm.Edm; -import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; @@ -83,59 +82,59 @@ public class ODataXmlDeserializerTest { XMLUnit.setCompareUnmatched(false); } - private Object edmInt16(String value) throws EdmPrimitiveTypeException { + protected Object edmInt16(String value) throws EdmPrimitiveTypeException { return EdmInt16.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmInt16.getInstance().getDefaultType()); } - private Object edmInt32(String value) throws EdmPrimitiveTypeException { + protected Object edmInt32(String value) throws EdmPrimitiveTypeException { return EdmInt32.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmInt32.getInstance().getDefaultType()); } - private Object edmInt64(String value) throws EdmPrimitiveTypeException { + protected Object edmInt64(String value) throws EdmPrimitiveTypeException { return EdmInt64.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmInt64.getInstance().getDefaultType()); } - private Object edmSingle(String value) throws EdmPrimitiveTypeException { + protected Object edmSingle(String value) throws EdmPrimitiveTypeException { return EdmSingle.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmSingle.getInstance().getDefaultType()); } - private Object edmDouble(String value) throws EdmPrimitiveTypeException { + protected Object edmDouble(String value) throws EdmPrimitiveTypeException { return EdmDouble.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmDouble.getInstance().getDefaultType()); } - private Object edmSByte(String value) throws EdmPrimitiveTypeException { + protected Object edmSByte(String value) throws EdmPrimitiveTypeException { return EdmSByte.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmSByte.getInstance().getDefaultType()); } - private Object edmByte(String value) throws EdmPrimitiveTypeException { + protected Object edmByte(String value) throws EdmPrimitiveTypeException { return EdmByte.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmByte.getInstance().getDefaultType()); } - private Object edmDecimal(String value) throws EdmPrimitiveTypeException { + protected Object edmDecimal(String value) throws EdmPrimitiveTypeException { return EdmDecimal.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmDecimal.getInstance().getDefaultType()); } - private Object edmBinary(String value) throws EdmPrimitiveTypeException { + protected Object edmBinary(String value) throws EdmPrimitiveTypeException { return EdmBinary.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmBinary.getInstance().getDefaultType()); } - private Object edmDate(String value) throws EdmPrimitiveTypeException { + protected Object edmDate(String value) throws EdmPrimitiveTypeException { return EdmDate.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmDate.getInstance().getDefaultType()); } - private Object edmDateTimeOffset(String value) throws EdmPrimitiveTypeException { + protected Object edmDateTimeOffset(String value) throws EdmPrimitiveTypeException { return EdmDateTimeOffset.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmDateTimeOffset.getInstance().getDefaultType()); } - private Object edmDuration(String value) throws EdmPrimitiveTypeException { + protected Object edmDuration(String value) throws EdmPrimitiveTypeException { return EdmDuration.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmDuration.getInstance().getDefaultType()); } - private Object edmGUID(String value) throws EdmPrimitiveTypeException { + protected Object edmGUID(String value) throws EdmPrimitiveTypeException { return EdmGuid.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmGuid.getInstance().getDefaultType()); } - private Object edmTimeOfDay(String value) throws EdmPrimitiveTypeException { + protected Object edmTimeOfDay(String value) throws EdmPrimitiveTypeException { return EdmTimeOfDay.getInstance().valueOfString(value, true, 10, 10, 10, true, EdmTimeOfDay.getInstance().getDefaultType()); } @@ -344,6 +343,7 @@ public class ODataXmlDeserializerTest { return null; } + @SuppressWarnings("unchecked") @Test public void entityMixPrimCollComp() throws Exception { final EdmEntitySet edmEntitySet = entityContainer.getEntitySet("ESMixPrimCollComp"); @@ -567,6 +567,7 @@ public class ODataXmlDeserializerTest { Assert.assertEquals("Obere Str. 57", getCVProperty(cv, "Street").asPrimitive()); } + @SuppressWarnings("unchecked") @Test public void complexCollectionProperty() throws Exception { final EdmEntitySet edmEntitySet = entityContainer.getEntitySet("ESMixPrimCollComp"); diff --git a/samples/server/pom.xml b/samples/server/pom.xml index 03c5f254a..e4ae3b357 100644 --- a/samples/server/pom.xml +++ b/samples/server/pom.xml @@ -27,12 +27,12 @@ war ${project.artifactId} - - org.apache.olingo - odata-samples - 4.0.0-SNAPSHOT - .. - + + org.apache.olingo + odata-samples + 4.0.0-SNAPSHOT + .. + @@ -77,6 +77,10 @@ ${project.version} + + org.slf4j + slf4j-api + org.slf4j slf4j-simple