[OLINGO-936] clean-up
Signed-off-by: Christian Amend <christian.amend@sap.com>
This commit is contained in:
parent
80d046b31c
commit
20a00704d8
|
@ -69,8 +69,6 @@ import org.apache.olingo.client.api.domain.ClientObjectFactory;
|
|||
import org.apache.olingo.client.api.domain.ClientPrimitiveValue;
|
||||
import org.apache.olingo.client.api.domain.ClientProperty;
|
||||
import org.apache.olingo.client.api.domain.ClientServiceDocument;
|
||||
import org.apache.olingo.client.api.domain.ClientSingleton;
|
||||
import org.apache.olingo.client.api.domain.ClientValuable;
|
||||
import org.apache.olingo.client.api.domain.ClientValue;
|
||||
import org.apache.olingo.client.api.edm.xml.Reference;
|
||||
import org.apache.olingo.client.api.edm.xml.XMLMetadata;
|
||||
|
@ -88,7 +86,6 @@ import org.apache.olingo.commons.api.ex.ODataError;
|
|||
import org.apache.olingo.commons.api.format.ContentType;
|
||||
import org.apache.olingo.commons.api.http.HttpHeader;
|
||||
import org.apache.olingo.commons.api.http.HttpStatusCode;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
|
@ -35,8 +35,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
|||
import org.apache.olingo.commons.api.format.ContentType;
|
||||
import org.apache.olingo.commons.api.http.HttpHeader;
|
||||
import org.apache.olingo.commons.api.http.HttpStatusCode;
|
||||
import static org.apache.olingo.fit.tecsvc.client.AbstractTecSvcITCase.SERVICE_NAMESPACE;
|
||||
import static org.apache.olingo.fit.tecsvc.client.AbstractTecSvcITCase.SERVICE_URI;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
|
|
@ -70,7 +70,6 @@ public class BasicStreamITCase extends AbstractBaseTestITCase {
|
|||
assertEquals(ContentType.APPLICATION_XML, ContentType.create(connection.getHeaderField(HttpHeader.CONTENT_TYPE)));
|
||||
|
||||
final String content = IOUtils.toString(connection.getInputStream());
|
||||
System.out.println(content);
|
||||
assertTrue(content.contains("<m:element>Streamed-Employee1@company.example</m:element>" +
|
||||
"<m:element>Streamed-Employee2@company.example</m:element>" +
|
||||
"<m:element>Streamed-Employee3@company.example</m:element>"));
|
||||
|
|
|
@ -30,7 +30,6 @@ import java.util.Set;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.olingo.client.api.data.ResWrap;
|
||||
import org.apache.olingo.client.api.serialization.ODataDeserializer;
|
||||
|
|
|
@ -29,7 +29,14 @@ import org.apache.olingo.server.api.uri.UriResource;
|
|||
import org.apache.olingo.server.api.uri.UriResourceLambdaAll;
|
||||
import org.apache.olingo.server.api.uri.UriResourceLambdaAny;
|
||||
import org.apache.olingo.server.api.uri.UriResourcePartTyped;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.*;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitor;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.Literal;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.Member;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.UnaryOperatorKind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -683,7 +683,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
|
|||
throws IOException, SerializerException{
|
||||
json.writeStartObject();
|
||||
String derivedName = property.getType();
|
||||
final EdmComplexType resolvedType = resolveComplexType(metadata, (EdmComplexType) type, derivedName);
|
||||
final EdmComplexType resolvedType = resolveComplexType(metadata, type, derivedName);
|
||||
if (!isODataMetadataNone && !resolvedType.equals(type) || isODataMetadataFull) {
|
||||
json.writeStringField(Constants.JSON_TYPE, "#" + property.getType());
|
||||
}
|
||||
|
|
|
@ -1307,7 +1307,7 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
|
|||
|| invalidCharacterReplacement == null || isUniCode == null || !isUniCode) {
|
||||
return value;
|
||||
}
|
||||
String s = (String) value;
|
||||
String s = value;
|
||||
StringBuilder result = null;
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
char c = s.charAt(i);
|
||||
|
|
|
@ -624,22 +624,20 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
|
|||
private void addTo(String name, Object data, List<Property> properties) {
|
||||
int pos = 0;
|
||||
for (Property property : properties) {
|
||||
if(property.isComplex()) {
|
||||
final List<ComplexValue> cvs;
|
||||
if(property.isCollection()) {
|
||||
cvs = (List<ComplexValue>) property.asCollection();
|
||||
} else {
|
||||
cvs = Collections.singletonList(property.asComplex());
|
||||
}
|
||||
if (property.isComplex()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final List<ComplexValue> cvs = property.isCollection() ?
|
||||
(List<ComplexValue>) property.asCollection() :
|
||||
Collections.singletonList(property.asComplex());
|
||||
for (ComplexValue cv : cvs) {
|
||||
final List<Property> value = cv.getValue();
|
||||
if(value != null) {
|
||||
if (value != null) {
|
||||
addTo(name, data, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(name.equals(property.getName())) {
|
||||
if (name.equals(property.getName())) {
|
||||
properties.remove(pos);
|
||||
final String old = property.getValue().toString();
|
||||
String newValue = (old == null ? "": old) + data.toString();
|
||||
|
|
|
@ -38,7 +38,14 @@ import org.apache.olingo.server.api.uri.UriParameter;
|
|||
import org.apache.olingo.server.api.uri.UriResource;
|
||||
import org.apache.olingo.server.api.uri.UriResourceFunction;
|
||||
import org.apache.olingo.server.api.uri.UriResourceProperty;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.*;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitor;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.Literal;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.Member;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
|
||||
import org.apache.olingo.server.api.uri.queryoption.expression.UnaryOperatorKind;
|
||||
import org.apache.olingo.server.tecsvc.data.DataProvider;
|
||||
import org.apache.olingo.server.tecsvc.processor.queryoptions.expression.operand.TypedOperand;
|
||||
import org.apache.olingo.server.tecsvc.processor.queryoptions.expression.operand.UntypedOperand;
|
||||
|
|
Loading…
Reference in New Issue