From 2675f8fa01ffdc00057390f9e59bf8e0c198ad67 Mon Sep 17 00:00:00 2001 From: Ramesh Reddy Date: Mon, 23 May 2016 15:04:37 -0500 Subject: [PATCH] OLINGO-960: returning null on the missing alias value in query --- .../olingo/server/core/uri/parser/ExpressionParser.java | 3 +-- .../olingo/server/core/uri/parser/TestFullResourcePath.java | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java index c9f8b219f..23fd8a404 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java @@ -339,8 +339,7 @@ public class ExpressionParser { return new AliasImpl(name, ParserHelper.parseAliasValue(name, null, true, true, edm, referringType, aliases)); } else { - throw new UriValidationException("Alias '" + name + "' not found.", - UriValidationException.MessageKeys.MISSING_ALIAS, name); + return new AliasImpl(name, null); } } diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java index 8aa3172e1..d60e6c3cf 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java @@ -5846,11 +5846,11 @@ public class TestFullResourcePath { testUri.runEx("ESAllPrim(PropertyInt16=@p1)", "@p1='ewe") .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX); testFilter.runOnETKeyNavEx("PropertyInt16 gt @alias") - .isExValidation(UriValidationException.MessageKeys.MISSING_ALIAS); + .isInAliasToValueMap("@alias", null); testFilter.runOnETKeyNavEx("PropertyInt16 gt @alias&@alias=@alias") - .isExValidation(UriValidationException.MessageKeys.MISSING_ALIAS); + .isInAliasToValueMap("@alias", "@alias"); testFilter.runOnETKeyNavEx("@alias&@alias=@alias2&@alias2=true or @alias") - .isExValidation(UriValidationException.MessageKeys.MISSING_ALIAS); + .isInAliasToValueMap("@alias", "@alias2"); } @Test