http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java index d9147e5..35c789f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java @@ -6,9 +6,9 @@ * 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
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipOptionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipOptionImpl.java index 84549e4..aa63b87 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipOptionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipOptionImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipTokenOptionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipTokenOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipTokenOptionImpl.java index d440781..44b58e0 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipTokenOptionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipTokenOptionImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SystemQueryOptionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SystemQueryOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SystemQueryOptionImpl.java index ac27a59..c0f700f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SystemQueryOptionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SystemQueryOptionImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/TopOptionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/TopOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/TopOptionImpl.java index aa33120..c53c1ae 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/TopOptionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/TopOptionImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java index 09af93f..9489d0d 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java index a28f92c..c5a9fc9 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java index 8f7df3a..90530f4 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java index c9cc707..e64a363 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java index 8198204..0bf09fd 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java index 1dd9fa7..bd93440 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java index 5f6162f..307e17c 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java index 7104a9f..bd982cd 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java index f5f6f06..549db33 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java index 796191f..4268d08 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java index 01af75d..2d8f842 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java @@ -6,9 +6,9 @@ * 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 @@ -54,13 +54,12 @@ public class UriValidationException extends ODataLibraryException { /** parameter: unallowed kind before $value */ UNALLOWED_KIND_BEFORE_VALUE, /** parameter: unallowed kind before $count */ - UNALLOWED_KIND_BEFORE_COUNT, + UNALLOWED_KIND_BEFORE_COUNT, /** parameter: unallowed resource path */ UNALLOWED_RESOURCE_PATH, /** parameter: missing parameter name */ MISSING_PARAMETER; - @Override public String getKey() { return name(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java index f840e8e..9ffe696 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java @@ -6,9 +6,9 @@ * 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 @@ -223,14 +223,14 @@ public class UriValidator { private RowIndexForUriType rowIndexForResourceKind(final UriInfo uriInfo) throws UriValidationException { RowIndexForUriType idx; - + final int nonComposableFunctionIndex = getIndexOfLastNonComposableFunction(uriInfo); - if(nonComposableFunctionIndex != -1 && (uriInfo.getUriResourceParts().size() - 1) > nonComposableFunctionIndex) { - throw new UriValidationException("Non composable functions followed by further resource parts are not allowed", - UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH, + if (nonComposableFunctionIndex != -1 && (uriInfo.getUriResourceParts().size() - 1) > nonComposableFunctionIndex) { + throw new UriValidationException("Non composable functions followed by further resource parts are not allowed", + UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH, uriInfo.getUriResourceParts().get(nonComposableFunctionIndex + 1).getSegmentValue()); } - + int lastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 1; UriResource lastPathSegment = uriInfo.getUriResourceParts().get(lastPathSegmentIndex); @@ -249,7 +249,7 @@ public class UriValidator { idx = rowIndexForEntitySet(lastPathSegment); break; case function: - if(nonComposableFunctionIndex == -1) { + if (nonComposableFunctionIndex == -1) { idx = rowIndexForFunction(lastPathSegment); } else { idx = RowIndexForUriType.none; @@ -279,17 +279,17 @@ public class UriValidator { } private int getIndexOfLastNonComposableFunction(final UriInfo uriInfo) { - for(int i = 0; i < uriInfo.getUriResourceParts().size(); i++) { + for (int i = 0; i < uriInfo.getUriResourceParts().size(); i++) { final UriResource resourcePath = uriInfo.getUriResourceParts().get(i); - - if(resourcePath instanceof UriResourceFunction) { + + if (resourcePath instanceof UriResourceFunction) { final UriResourceFunction resourceFuntion = (UriResourceFunction) resourcePath; - if(!resourceFuntion.getFunction().isComposable()) { + if (!resourceFuntion.getFunction().isComposable()) { return i; } } } - + return -1; } @@ -312,9 +312,9 @@ public class UriValidator { final EdmFunctionImport functionImport = uriFunction.getFunctionImport(); final EdmFunction function = functionImport == null ? uriFunction.getFunction() : functionImport.getUnboundFunctions().get(0); - idx = function.getReturnType().getType().getKind() == EdmTypeKind.ENTITY ? - RowIndexForUriType.mediaStream : RowIndexForUriType.propertyPrimitiveValue; - break; + idx = function.getReturnType().getType().getKind() == EdmTypeKind.ENTITY ? + RowIndexForUriType.mediaStream : RowIndexForUriType.propertyPrimitiveValue; + break; default: throw new UriValidationException("Unexpected kind in path segment before $value: " + secondLastPathSegment.getKind(), UriValidationException.MessageKeys.UNALLOWED_KIND_BEFORE_VALUE, @@ -355,11 +355,10 @@ public class UriValidator { UriResourceFunction urf = (UriResourceFunction) lastPathSegment; EdmReturnType rt = urf.getFunction().getReturnType(); - if(!urf.getFunction().isComposable()) { + if (!urf.getFunction().isComposable()) { return RowIndexForUriType.none; } - - + switch (rt.getType().getKind()) { case ENTITY: idx = rt.isCollection() && urf.getKeyPredicates().isEmpty() ? @@ -450,24 +449,24 @@ public class UriValidator { final EdmFunctionImport functionImport = uriFunction.getFunctionImport(); final EdmFunction function = functionImport == null ? uriFunction.getFunction() : functionImport.getUnboundFunctions().get(0); - final EdmType returnType = function.getReturnType().getType(); - switch (returnType.getKind()) { - case ENTITY: - idx = RowIndexForUriType.entitySetCount; - break; - case COMPLEX: - idx = RowIndexForUriType.propertyComplexCollectionCount; - break; - case PRIMITIVE: - case ENUM: - case DEFINITION: - idx = RowIndexForUriType.propertyPrimitiveCollectionCount; - break; - default: - throw new UriValidationException("Unsupported return type: " + returnType.getKind(), - UriValidationException.MessageKeys.UNSUPPORTED_FUNCTION_RETURN_TYPE, returnType.getKind().toString()); - } - break; + final EdmType returnType = function.getReturnType().getType(); + switch (returnType.getKind()) { + case ENTITY: + idx = RowIndexForUriType.entitySetCount; + break; + case COMPLEX: + idx = RowIndexForUriType.propertyComplexCollectionCount; + break; + case PRIMITIVE: + case ENUM: + case DEFINITION: + idx = RowIndexForUriType.propertyPrimitiveCollectionCount; + break; + default: + throw new UriValidationException("Unsupported return type: " + returnType.getKind(), + UriValidationException.MessageKeys.UNSUPPORTED_FUNCTION_RETURN_TYPE, returnType.getKind().toString()); + } + break; default: throw new UriValidationException("Illegal path part kind before $count: " + secondLastPathSegment.getKind(), UriValidationException.MessageKeys.UNALLOWED_KIND_BEFORE_COUNT, secondLastPathSegment.toString()); @@ -560,136 +559,136 @@ public class UriValidator { private void validateParameters(final UriInfo uriInfo) throws UriValidationException { for (UriResource pathSegment : uriInfo.getUriResourceParts()) { final boolean isFunction = pathSegment.getKind() == UriResourceKind.function; - - if(isFunction) { + + if (isFunction) { final UriResourceFunction functionPathSegement = (UriResourceFunction) pathSegment; final EdmFunction edmFuntion = functionPathSegement.getFunction(); - + final Map<String, UriParameter> parameters = new HashMap<String, UriParameter>(); - for(final UriParameter parameter : functionPathSegement.getParameters()) { + for (final UriParameter parameter : functionPathSegement.getParameters()) { parameters.put(parameter.getName(), parameter); } - + boolean firstParameter = true; - for(final String parameterName : edmFuntion.getParameterNames()) { + for (final String parameterName : edmFuntion.getParameterNames()) { final UriParameter parameter = parameters.get(parameterName); final boolean isNullable = edmFuntion.getParameter(parameterName).isNullable(); - - if(parameter != null) { + + if (parameter != null) { /** No alias, value explicit null */ - if(parameter.getText() == null + if (parameter.getText() == null && parameter.getAlias() == null && !isNullable) { - throw new UriValidationException("Missing non nullable parameter " + parameterName, + throw new UriValidationException("Missing non nullable parameter " + parameterName, UriValidationException.MessageKeys.MISSING_PARAMETER, parameterName); - } else if(parameter.getText() == null && parameter.getAlias() != null) { + } else if (parameter.getText() == null && parameter.getAlias() != null) { final String valueForAlias = uriInfo.getValueForAlias(parameter.getAlias()); /** Alias value is missing or explicit null **/ - if(valueForAlias == null && !isNullable) { - throw new UriValidationException("Missing non nullable parameter " + parameterName, + if (valueForAlias == null && !isNullable) { + throw new UriValidationException("Missing non nullable parameter " + parameterName, UriValidationException.MessageKeys.MISSING_PARAMETER, parameterName); } } - + parameters.remove(parameterName); - } else if(!isNullable && !(firstParameter && edmFuntion.isBound())) { + } else if (!isNullable && !(firstParameter && edmFuntion.isBound())) { // The first parameter of bound functions is implicit provided by the preceding path segment - throw new UriValidationException("Missing non nullable parameter " + parameterName, + throw new UriValidationException("Missing non nullable parameter " + parameterName, UriValidationException.MessageKeys.MISSING_PARAMETER, parameterName); } - + firstParameter = false; } - - if(!parameters.isEmpty()) { + + if (!parameters.isEmpty()) { final String parameterName = parameters.keySet().iterator().next(); - throw new UriValidationException("Unsupported parameter " + parameterName, + throw new UriValidationException("Unsupported parameter " + parameterName, UriValidationException.MessageKeys.UNSUPPORTED_PARAMETER, parameterName); } } } } - + private void validateKeyPredicates(final UriInfo uriInfo) throws UriValidationException { for (UriResource pathSegment : uriInfo.getUriResourceParts()) { final boolean isEntitySet = pathSegment.getKind() == UriResourceKind.entitySet; final boolean isEntityColFunction = isEntityColFunction(pathSegment); - + if (isEntitySet || pathSegment.getKind() == UriResourceKind.navigationProperty || isEntityColFunction) { final List<UriParameter> keyPredicates = isEntitySet ? ((UriResourceEntitySet) pathSegment).getKeyPredicates() : - isEntityColFunction ? ((UriResourceFunction) pathSegment).getKeyPredicates() - : ((UriResourceNavigation) pathSegment).getKeyPredicates(); - - if (keyPredicates != null) { + isEntityColFunction ? ((UriResourceFunction) pathSegment).getKeyPredicates() + : ((UriResourceNavigation) pathSegment).getKeyPredicates(); - final EdmEntityType entityType = isEntitySet ? - ((UriResourceEntitySet) pathSegment).getEntityType() : - isEntityColFunction ? (EdmEntityType) ((UriResourceFunction) pathSegment).getType() - : (EdmEntityType) ((UriResourceNavigation) pathSegment).getType(); - final List<String> keyPredicateNames = entityType.getKeyPredicateNames(); - Map<String, EdmKeyPropertyRef> edmKeys = new HashMap<String, EdmKeyPropertyRef>(); - for (EdmKeyPropertyRef key : entityType.getKeyPropertyRefs()) { - edmKeys.put(key.getName(), key); - final String alias = key.getAlias(); - if (alias != null) { - edmKeys.put(alias, key); - } - } - - for (UriParameter keyPredicate : keyPredicates) { - final String name = keyPredicate.getName(); - final String alias = keyPredicate.getAlias(); - - if (keyPredicate.getReferencedProperty() == null) { - final String value = alias == null ? - keyPredicate.getText() : - uriInfo.getValueForAlias(alias); - - EdmKeyPropertyRef edmKey = edmKeys.get(name); - if (edmKey == null) { - if (keyPredicateNames.contains(name)) { - throw new UriValidationException("Double key property: " + name, - UriValidationException.MessageKeys.DOUBLE_KEY_PROPERTY, name); - } else { - throw new UriValidationException("Unknown key property: " + name, - UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name); - } - } + if (keyPredicates != null) { - final EdmProperty property = edmKey.getProperty(); - final EdmPrimitiveType edmPrimitiveType = (EdmPrimitiveType) property.getType(); - try { - if (!edmPrimitiveType.validate(edmPrimitiveType.fromUriLiteral(value), - property.isNullable(), property.getMaxLength(), - property.getPrecision(), property.getScale(), property.isUnicode())) { - throw new UriValidationException("PrimitiveTypeException", - UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name); - } - } catch (EdmPrimitiveTypeException e) { - throw new UriValidationException("PrimitiveTypeException", e, - UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name); + final EdmEntityType entityType = isEntitySet ? + ((UriResourceEntitySet) pathSegment).getEntityType() : + isEntityColFunction ? (EdmEntityType) ((UriResourceFunction) pathSegment).getType() + : (EdmEntityType) ((UriResourceNavigation) pathSegment).getType(); + final List<String> keyPredicateNames = entityType.getKeyPredicateNames(); + Map<String, EdmKeyPropertyRef> edmKeys = new HashMap<String, EdmKeyPropertyRef>(); + for (EdmKeyPropertyRef key : entityType.getKeyPropertyRefs()) { + edmKeys.put(key.getName(), key); + final String alias = key.getAlias(); + if (alias != null) { + edmKeys.put(alias, key); + } + } + + for (UriParameter keyPredicate : keyPredicates) { + final String name = keyPredicate.getName(); + final String alias = keyPredicate.getAlias(); + + if (keyPredicate.getReferencedProperty() == null) { + final String value = alias == null ? + keyPredicate.getText() : + uriInfo.getValueForAlias(alias); + + EdmKeyPropertyRef edmKey = edmKeys.get(name); + if (edmKey == null) { + if (keyPredicateNames.contains(name)) { + throw new UriValidationException("Double key property: " + name, + UriValidationException.MessageKeys.DOUBLE_KEY_PROPERTY, name); + } else { + throw new UriValidationException("Unknown key property: " + name, + UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name); + } + } + + final EdmProperty property = edmKey.getProperty(); + final EdmPrimitiveType edmPrimitiveType = (EdmPrimitiveType) property.getType(); + try { + if (!edmPrimitiveType.validate(edmPrimitiveType.fromUriLiteral(value), + property.isNullable(), property.getMaxLength(), + property.getPrecision(), property.getScale(), property.isUnicode())) { + throw new UriValidationException("PrimitiveTypeException", + UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name); + } + } catch (EdmPrimitiveTypeException e) { + throw new UriValidationException("PrimitiveTypeException", e, + UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name); + } + } + + edmKeys.remove(name); + edmKeys.remove(alias); + } } - } - - edmKeys.remove(name); - edmKeys.remove(alias); - } - } } } } private boolean isEntityColFunction(final UriResource pathSegment) { - if(pathSegment.getKind() == UriResourceKind.function) { + if (pathSegment.getKind() == UriResourceKind.function) { final UriResourceFunction resourceFunction = (UriResourceFunction) pathSegment; final EdmReturnType returnType = resourceFunction.getFunction().getReturnType(); - + return returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY; } else { return false; } } - + private void validatePropertyOperations(final UriInfo uriInfo, final HttpMethod method) throws UriValidationException { final List<UriResource> parts = uriInfo.getUriResourceParts(); @@ -697,9 +696,9 @@ public class UriValidator { final UriResource previous = parts.size() > 1 ? parts.get(parts.size() - 2) : null; if (last != null && (last.getKind() == UriResourceKind.primitiveProperty - || last.getKind() == UriResourceKind.complexProperty - || (last.getKind() == UriResourceKind.value - && previous != null && previous.getKind() == UriResourceKind.primitiveProperty))) { + || last.getKind() == UriResourceKind.complexProperty + || (last.getKind() == UriResourceKind.value + && previous != null && previous.getKind() == UriResourceKind.primitiveProperty))) { final EdmProperty property = ((UriResourceProperty) (last.getKind() == UriResourceKind.value ? previous : last)).getProperty(); if (method == HttpMethod.PATCH && property.isCollection()) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java index 999a20c..ce0abe7 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java @@ -6,9 +6,9 @@ * 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 @@ -77,7 +77,7 @@ public class ContentNegotiatorTest { { ACCEPT_CASE_MIN_UTF8_IEEE754, null, ACCEPT_CASE_MIN_UTF8_IEEE754, null }, { ACCEPT_CASE_MIN_IEEE754, ACCEPT_CASE_MIN_IEEE754, ACCEPT_CASE_MIN , null }, { ACCEPT_CASE_XML, "xml", null, null }, - { ACCEPT_CASE_XML, null, ACCEPT_CASE_XML, null } + { ACCEPT_CASE_XML, null, ACCEPT_CASE_XML, null } }; String[][] casesMetadata = { @@ -191,7 +191,7 @@ public class ContentNegotiatorTest { } final CustomContentTypeSupport customContentTypeSupport = useCase[3] == null ? null : - createCustomContentTypeSupport(useCase[3]); + createCustomContentTypeSupport(useCase[3]); final ContentType requestedContentType = ContentNegotiator.doContentNegotiation( formatOption, request, customContentTypeSupport, representationType); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/ExceptionHelperTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/ExceptionHelperTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/ExceptionHelperTest.java index b3d59da..c4eb24c 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/ExceptionHelperTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/ExceptionHelperTest.java @@ -6,9 +6,9 @@ * 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 @@ -22,8 +22,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import org.apache.olingo.commons.api.http.HttpStatusCode; -import org.apache.olingo.server.api.ODataLibraryException.MessageKey; import org.apache.olingo.server.api.ODataLibraryException; +import org.apache.olingo.server.api.ODataLibraryException.MessageKey; import org.apache.olingo.server.api.ODataServerError; import org.apache.olingo.server.api.deserializer.DeserializerException; import org.apache.olingo.server.api.etag.PreconditionException; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java index 1fcef84..1a66609 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java @@ -6,9 +6,9 @@ * 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 @@ -26,8 +26,8 @@ import static org.mockito.Mockito.when; import javax.servlet.http.HttpServletRequest; import org.apache.olingo.commons.api.http.HttpMethod; -import org.apache.olingo.server.api.ODataRequest; import org.apache.olingo.server.api.ODataLibraryException; +import org.apache.olingo.server.api.ODataRequest; import org.junit.Test; public class ODataHttpHandlerImplTest { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataImplTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataImplTest.java index 3954a5a..c289b93 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataImplTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/TranslatedExceptionSubclassesTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/TranslatedExceptionSubclassesTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/TranslatedExceptionSubclassesTest.java index 2df68aa..ce7c4c0 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/TranslatedExceptionSubclassesTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/TranslatedExceptionSubclassesTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java index 8b49bd2..8b5513e 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/AbstractDebugTabTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/AbstractDebugTabTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/AbstractDebugTabTest.java index 13a690f..95a3ba1 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/AbstractDebugTabTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/AbstractDebugTabTest.java @@ -6,9 +6,9 @@ * 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 @@ -26,14 +26,14 @@ import com.fasterxml.jackson.core.JsonGenerator; public abstract class AbstractDebugTabTest { - protected String createHtml(DebugTab tab) throws IOException { + protected String createHtml(final DebugTab tab) throws IOException { StringWriter writer = new StringWriter(); tab.appendHtml(writer); writer.flush(); return writer.toString(); } - protected String createJson(DebugTab tab) throws IOException { + protected String createJson(final DebugTab tab) throws IOException { StringWriter writer = new StringWriter(); JsonGenerator gen = new JsonFactory().createGenerator(writer); tab.appendJson(gen); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabBodyTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabBodyTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabBodyTest.java index 16f0e15..088e398 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabBodyTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabBodyTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabRequestTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabRequestTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabRequestTest.java index 24732ba..3ae565c 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabRequestTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabRequestTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabResponseTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabResponseTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabResponseTest.java index 8ca5306..b268545 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabResponseTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabResponseTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabServerTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabServerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabServerTest.java index fa54c3d..53a5693 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabServerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabServerTest.java @@ -6,9 +6,9 @@ * 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 @@ -64,7 +64,7 @@ public class DebugTabServerTest extends AbstractDebugTabTest { assertTrue(html.contains("<tr><td class=\"name\">key2</td><td class=\"value\">value2</td></tr>")); assertTrue(html.endsWith("</table>\n")); } - + @Test public void twoParametersWithNull() throws Exception { Map<String, String> env = new LinkedHashMap<String, String>(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java index 3d994a9..280ff38 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java @@ -6,9 +6,9 @@ * 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 @@ -49,7 +49,7 @@ public class ServerCoreDebuggerTest { DebugSupport processor = mock(DebugSupport.class); when(processor.isUserAuthorized()).thenReturn(true); when(processor.createDebugResponse(anyString(), any(DebugInformation.class))) - .thenThrow(new ODataRuntimeException("Test")); + .thenThrow(new ODataRuntimeException("Test")); debugger.setDebugSupportProcessor(processor); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerTest.java index e1d129f..77be67f 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReaderTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReaderTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReaderTest.java index 9861b7f..ea202db 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReaderTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReaderTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommonTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommonTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommonTest.java index 137c89a..276c5b2 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommonTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommonTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java index 008fdbe..059b32f 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java @@ -6,9 +6,9 @@ * 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 @@ -474,30 +474,30 @@ public class BatchRequestParserTest { + CRLF + CRLF + "--batch_8194-cf13-1f56--"; - + List<BatchRequestPart> requests = parse(batch); assertEquals(HttpMethod.POST, requests.get(0).getRequests().get(0).getMethod()); assertEquals("/Employees", requests.get(0).getRequests().get(0).getRawODataPath()); assertEquals("{ \"Name\": \"Foo\" }", IOUtils.toString(requests.get(0).getRequests().get(0).getBody())); - + requests = parse(batch); assertEquals(HttpMethod.DELETE, requests.get(1).getRequests().get(0).getMethod()); assertEquals("/Employees('1')", requests.get(1).getRequests().get(0).getRawODataPath()); - + requests = parse(batch); assertEquals(HttpMethod.PATCH, requests.get(2).getRequests().get(0).getMethod()); assertEquals("{ \"Name\": \"Foo\" }", IOUtils.toString(requests.get(0).getRequests().get(0).getBody())); assertEquals("/Employees('1')", requests.get(2).getRequests().get(0).getRawODataPath()); - + requests = parse(batch); assertEquals(HttpMethod.PUT, requests.get(3).getRequests().get(0).getMethod()); assertEquals("{ \"Name\": \"Foo\" }", IOUtils.toString(requests.get(0).getRequests().get(0).getBody())); assertEquals("/Employees('1')", requests.get(3).getRequests().get(0).getRawODataPath()); - + requests = parse(batch); assertEquals(HttpMethod.GET, requests.get(4).getRequests().get(0).getMethod()); assertEquals("/Employees('1')", requests.get(4).getRequests().get(0).getRawODataPath()); - + } @Test http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HeaderTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HeaderTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HeaderTest.java index e808cb1..f87ffca 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HeaderTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HeaderTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java index 1d3bb1f..eb87baa 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java index 8160165..419ab80 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagHelperTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagHelperTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagHelperTest.java index e992a5c..58a8457 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagHelperTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagHelperTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagParserTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagParserTest.java index 3e68af6..06a432b 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagParserTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagParserTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/prefer/PreferencesTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/prefer/PreferencesTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/prefer/PreferencesTest.java index b0e8d74..9f4a45e 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/prefer/PreferencesTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/prefer/PreferencesTest.java @@ -6,9 +6,9 @@ * 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 @@ -53,8 +53,8 @@ public class PreferencesTest { public void all() { final Preferences preferences = new PreferencesImpl(Collections.singleton( "odata.allow-entityreferences, odata.callback;url=\"callbackURI\"," - + "odata.continue-on-error, odata.include-annotations=\"*\", odata.maxpagesize=42," - + "odata.track-changes, return=representation, respond-async, wait=12345")); + + "odata.continue-on-error, odata.include-annotations=\"*\", odata.maxpagesize=42," + + "odata.track-changes, return=representation, respond-async, wait=12345")); assertTrue(preferences.hasAllowEntityReferences()); assertEquals(URI.create("callbackURI"), preferences.getCallback()); assertNotNull(preferences.getPreference("odata.callback")); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializerTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializerTest.java index d70de62..1095fb3 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializerTest.java @@ -6,9 +6,9 @@ * 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 @@ -18,6 +18,11 @@ */ package org.apache.olingo.server.core.serializer; +import static org.junit.Assert.assertEquals; + +import java.io.InputStream; +import java.util.Random; + import org.apache.commons.io.IOUtils; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.http.HttpHeader; @@ -25,11 +30,6 @@ import org.apache.olingo.commons.api.http.HttpStatusCode; import org.apache.olingo.server.api.ODataResponse; import org.junit.Test; -import java.io.InputStream; -import java.util.Random; - -import static org.junit.Assert.assertEquals; - public class AsyncResponseSerializerTest { private static final String CRLF = "\r\n"; @@ -70,11 +70,11 @@ public class AsyncResponseSerializerTest { + testData, result); } - private String testData(int amount) { + private String testData(final int amount) { StringBuilder result = new StringBuilder(); Random r = new Random(); for (int i = 0; i < amount; i++) { - result.append((char)(r.nextInt(26) + 'a')); + result.append((char) (r.nextInt(26) + 'a')); } return result.toString(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/BatchResponseSerializerTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/BatchResponseSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/BatchResponseSerializerTest.java index b57340d..1f0d7a3 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/BatchResponseSerializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/BatchResponseSerializerTest.java @@ -6,9 +6,9 @@ * 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 @@ -106,7 +106,7 @@ public class BatchResponseSerializerTest { ODataResponse response = new ODataResponse(); response.setStatusCode(HttpStatusCode.OK.getStatusCode()); response.setHeader(HttpHeader.CONTENT_TYPE, - ContentType.APPLICATION_JSON.toContentTypeString() + "; charset=UTF-8"); + ContentType.APPLICATION_JSON.toContentTypeString() + "; charset=UTF-8"); response.setContent(IOUtils.toInputStream("Wälter Winter" + CRLF)); List<ODataResponse> responses = new ArrayList<ODataResponse>(1); @@ -124,7 +124,7 @@ public class BatchResponseSerializerTest { final InputStream content = serializer.serialize(parts, BOUNDARY); assertNotNull(content); final BatchLineReader reader = - new BatchLineReader(content); + new BatchLineReader(content); final List<String> body = reader.toList(); reader.close(); @@ -233,8 +233,8 @@ public class BatchResponseSerializerTest { changeSetResponse.setStatusCode(HttpStatusCode.NO_CONTENT.getStatusCode()); changeSetResponse.setHeader(HttpHeader.CONTENT_ID, "1"); -// byte[] umlauts = "äüö".getBytes(CS_UTF_8); -// changeSetResponse.setHeader("Custom-Header", new String(umlauts, CS_UTF_8)); + // byte[] umlauts = "äüö".getBytes(CS_UTF_8); + // changeSetResponse.setHeader("Custom-Header", new String(umlauts, CS_UTF_8)); changeSetResponse.setHeader("Custom-Header", "äüö"); responses = new ArrayList<ODataResponse>(1); responses.add(changeSetResponse); @@ -251,7 +251,7 @@ public class BatchResponseSerializerTest { assertEquals(25, body.size()); // TODO: check: with latest change in BatchResponseSerializer is not possible // to set header values with UTF-8 (only iso-8859-1) -// assertEquals("Custom-Header: äüö" + CRLF, body.get(19)); + // assertEquals("Custom-Header: äüö" + CRLF, body.get(19)); assertEquals("Custom-Header: äüö" + CRLF, body.get(19)); } @@ -261,7 +261,7 @@ public class BatchResponseSerializerTest { ODataResponse response = new ODataResponse(); response.setStatusCode(HttpStatusCode.OK.getStatusCode()); response.setHeader(HttpHeader.CONTENT_TYPE, - ContentType.APPLICATION_JSON.toContentTypeString() + "; charset=iso-8859-1"); + ContentType.APPLICATION_JSON.toContentTypeString() + "; charset=iso-8859-1"); byte[] payload = ("Wälter Winter" + CRLF).getBytes("iso-8859-1"); response.setContent(new ByteArrayInputStream(payload)); @@ -280,7 +280,7 @@ public class BatchResponseSerializerTest { final InputStream content = serializer.serialize(parts, BOUNDARY); assertNotNull(content); final BatchLineReader reader = - new BatchLineReader(content); + new BatchLineReader(content); final List<String> body = reader.toList(); reader.close(); @@ -419,7 +419,7 @@ public class BatchResponseSerializerTest { assertNotNull(content); final BatchLineReader reader = - new BatchLineReader(content); + new BatchLineReader(content); final List<String> body = reader.toList(); reader.close(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerTest.java index 21c7677..a0586e3 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerTest.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java index febd3eb..c0e2121 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java @@ -6,9 +6,9 @@ * 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 @@ -111,8 +111,8 @@ public class ServerErrorSerializerTest { public void verifiedWithJacksonParser() throws Exception { ODataServerError error = new ODataServerError().setCode("Code").setMessage("Message").setTarget("Target") - .setDetails(Collections.singletonList( - new ODataErrorDetail().setCode("detailCode").setMessage("detailMessage").setTarget("detailTarget"))); + .setDetails(Collections.singletonList( + new ODataErrorDetail().setCode("detailCode").setMessage("detailMessage").setTarget("detailTarget"))); InputStream stream = ser.error(error).getContent(); JsonNode tree = new ObjectMapper().readTree(stream); assertNotNull(tree); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBufferTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBufferTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBufferTest.java index b5c28bc..e6d45c2 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBufferTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBufferTest.java @@ -6,9 +6,9 @@ * 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 @@ -159,7 +159,6 @@ public class CircleStreamBufferTest { assertEquals(testData, result); } - @Test public void testSimpleWriteMoreThenDefaultBufferSize() throws Exception { CircleStreamBuffer csb = new CircleStreamBuffer(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java index ee53bc3..3928985 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java @@ -6,9 +6,9 @@ * 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
