[OLINGO-659] Small dependency enhancement
This commit is contained in:
parent
7ec7168b1a
commit
7df31c58c3
|
@ -41,6 +41,10 @@
|
|||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
|
|
|
@ -38,22 +38,13 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-all</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -143,6 +143,10 @@
|
|||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
<packaging>war</packaging>
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.olingo</groupId>
|
||||
<artifactId>odata-samples</artifactId>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<parent>
|
||||
<groupId>org.apache.olingo</groupId>
|
||||
<artifactId>odata-samples</artifactId>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -77,6 +77,10 @@
|
|||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
|
|
Loading…
Reference in New Issue