You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/09/02 13:49:52 UTC
[32/50] [abbrv] git commit: [OLINGO-372] Allow null for operators in
/ expressions
[OLINGO-372] Allow null for operators in / expressions
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/8e814509
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/8e814509
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/8e814509
Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 8e814509f488a1beaa60d652029258de8708c8cd
Parents: bebce0b
Author: Sven Kobler <sv...@sap.com>
Authored: Wed Jul 16 10:26:02 2014 +0200
Committer: Sven Kobler <sv...@sap.com>
Committed: Wed Jul 16 10:26:02 2014 +0200
----------------------------------------------------------------------
.../core/uri/expression/FilterParserImpl.java | 88 ++++++++-
.../uri/expression/ParameterSetCombination.java | 2 +-
.../uri/expression/TestAbapCompatibility.java | 187 +++++++++++++++++++
.../odata2/core/uri/expression/TestParser.java | 5 +-
4 files changed, 278 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8e814509/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/expression/FilterParserImpl.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/expression/FilterParserImpl.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/expression/FilterParserImpl.java
index e9f37b5..47be745 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/expression/FilterParserImpl.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/expression/FilterParserImpl.java
@@ -672,6 +672,7 @@ public class FilterParserImpl implements FilterParser {
EdmSimpleType datetimeoffset = EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.DateTimeOffset);
EdmSimpleType guid = EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.Guid);
EdmSimpleType binary = EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.Binary);
+ EdmSimpleType null_ = EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.Null);
// ---Memeber member access---
lAvailableBinaryOperators.put("/", new InfoBinaryOperator(BinaryOperator.PROPERTY_ACCESS, "Primary", 100,
@@ -686,8 +687,26 @@ public class FilterParserImpl implements FilterParser {
combination.add(new ParameterSet(int64, int64, int64));
combination.add(new ParameterSet(single, single, single));
combination.add(new ParameterSet(double_, double_, double_));
-
combination.add(new ParameterSet(decimal, decimal, decimal));
+
+ combination.add(new ParameterSet(sbyte, sbyte, null_));
+ combination.add(new ParameterSet(sbyte, null_, sbyte));
+ combination.add(new ParameterSet(byte_, byte_, null_));
+ combination.add(new ParameterSet(byte_, null_, byte_));
+
+ combination.add(new ParameterSet(int16, int16, null_));
+ combination.add(new ParameterSet(int16, null_, int16));
+ combination.add(new ParameterSet(int32, int32, null_));
+ combination.add(new ParameterSet(int32, null_, int32));
+ combination.add(new ParameterSet(int64, int64, null_));
+ combination.add(new ParameterSet(int64, null_, int64));
+
+ combination.add(new ParameterSet(single, single, null_));
+ combination.add(new ParameterSet(single, null_, single));
+ combination.add(new ParameterSet(double_, double_, null_));
+ combination.add(new ParameterSet(double_, null_, double_));
+ combination.add(new ParameterSet(decimal, decimal, null_));
+ combination.add(new ParameterSet(decimal, null_, decimal));
lAvailableBinaryOperators.put(BinaryOperator.MUL.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.MUL,
"Multiplicative", 60, combination));
@@ -706,6 +725,25 @@ public class FilterParserImpl implements FilterParser {
combination.add(new ParameterSet(single, single, single));
combination.add(new ParameterSet(double_, double_, double_));
combination.add(new ParameterSet(decimal, decimal, decimal));
+
+ combination.add(new ParameterSet(sbyte, sbyte, null_));
+ combination.add(new ParameterSet(sbyte, null_, sbyte));
+ combination.add(new ParameterSet(byte_, byte_, null_));
+ combination.add(new ParameterSet(byte_, null_, byte_));
+
+ combination.add(new ParameterSet(int16, int16, null_));
+ combination.add(new ParameterSet(int16, null_, int16));
+ combination.add(new ParameterSet(int32, int32, null_));
+ combination.add(new ParameterSet(int32, null_, int32));
+ combination.add(new ParameterSet(int64, int64, null_));
+ combination.add(new ParameterSet(int64, null_, int64));
+
+ combination.add(new ParameterSet(single, single, null_));
+ combination.add(new ParameterSet(single, null_, single));
+ combination.add(new ParameterSet(double_, double_, null_));
+ combination.add(new ParameterSet(double_, null_, double_));
+ combination.add(new ParameterSet(decimal, decimal, null_));
+ combination.add(new ParameterSet(decimal, null_, decimal));
lAvailableBinaryOperators.put(BinaryOperator.ADD.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.ADD,
"Additive", 50, combination));
@@ -728,6 +766,44 @@ public class FilterParserImpl implements FilterParser {
combination.add(new ParameterSet(boolean_, double_, double_));
combination.add(new ParameterSet(boolean_, decimal, decimal));
combination.add(new ParameterSet(boolean_, binary, binary));
+
+ combination.add(new ParameterSet(boolean_, string, null_));
+ combination.add(new ParameterSet(boolean_, null_, string));
+
+ combination.add(new ParameterSet(boolean_, time, null_));
+ combination.add(new ParameterSet(boolean_, null_, time));
+
+ combination.add(new ParameterSet(boolean_, datetime, null_));
+ combination.add(new ParameterSet(boolean_, null_, datetime));
+
+ combination.add(new ParameterSet(boolean_, datetimeoffset, null_));
+ combination.add(new ParameterSet(boolean_, null_, datetimeoffset));
+
+ combination.add(new ParameterSet(boolean_, guid, null_));
+ combination.add(new ParameterSet(boolean_, null_, guid));
+
+ combination.add(new ParameterSet(boolean_, sbyte, null_));
+ combination.add(new ParameterSet(boolean_, null_, sbyte));
+ combination.add(new ParameterSet(boolean_, byte_, null_));
+ combination.add(new ParameterSet(boolean_, null_, byte_));
+
+ combination.add(new ParameterSet(boolean_, int16, null_));
+ combination.add(new ParameterSet(boolean_, null_, int16));
+ combination.add(new ParameterSet(boolean_, int32, null_));
+ combination.add(new ParameterSet(boolean_, null_, int32));
+ combination.add(new ParameterSet(boolean_, int64, null_));
+ combination.add(new ParameterSet(boolean_, null_, int64));
+
+ combination.add(new ParameterSet(boolean_, single, null_));
+ combination.add(new ParameterSet(boolean_, null_, single));
+ combination.add(new ParameterSet(boolean_, double_, null_));
+ combination.add(new ParameterSet(boolean_, null_, double_));
+ combination.add(new ParameterSet(boolean_, decimal, null_));
+ combination.add(new ParameterSet(boolean_, null_, decimal));
+
+ combination.add(new ParameterSet(boolean_, binary, null_));
+ combination.add(new ParameterSet(boolean_, null_, binary));
+
lAvailableBinaryOperators.put(BinaryOperator.LT.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.LT,
"Relational", 40, combination));
@@ -757,6 +833,9 @@ public class FilterParserImpl implements FilterParser {
* combination.add(new ParameterSet(boolean_, decimal, decimal));
* combination.add(new ParameterSet(boolean_, binary, binary));
*/
+
+ combination.add(new ParameterSet(boolean_, boolean_, null_));
+ combination.add(new ParameterSet(boolean_, null_, boolean_));
lAvailableBinaryOperators.put(BinaryOperator.EQ.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.EQ,
"Equality", 30, combination));
@@ -766,6 +845,8 @@ public class FilterParserImpl implements FilterParser {
// "---Conditinal AND---
combination = new ParameterSetCombination.PSCflex();
combination.add(new ParameterSet(boolean_, boolean_, boolean_));
+ combination.add(new ParameterSet(boolean_, boolean_, null_));
+ combination.add(new ParameterSet(boolean_, null_, boolean_));
lAvailableBinaryOperators.put(BinaryOperator.AND.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.AND,
"Conditinal", 20, combination));
@@ -773,6 +854,8 @@ public class FilterParserImpl implements FilterParser {
// ---Conditinal OR---
combination = new ParameterSetCombination.PSCflex();
combination.add(new ParameterSet(boolean_, boolean_, boolean_));
+ combination.add(new ParameterSet(boolean_, boolean_, null_));
+ combination.add(new ParameterSet(boolean_, null_, boolean_));
lAvailableBinaryOperators.put(BinaryOperator.OR.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.OR,
"Conditinal", 10, combination));
@@ -900,6 +983,8 @@ public class FilterParserImpl implements FilterParser {
combination.add(new ParameterSet(single, single));
combination.add(new ParameterSet(double_, double_));
combination.add(new ParameterSet(decimal, decimal));
+ combination.add(new ParameterSet(null_, null_));
+
// minus
lAvailableUnaryOperators.put(UnaryOperator.MINUS.toUriLiteral(), new InfoUnaryOperator(UnaryOperator.MINUS,
@@ -908,6 +993,7 @@ public class FilterParserImpl implements FilterParser {
// not
combination = new ParameterSetCombination.PSCflex();
combination.add(new ParameterSet(boolean_, boolean_));
+ combination.add(new ParameterSet(null_, null_));
lAvailableUnaryOperators.put(UnaryOperator.NOT.toUriLiteral(), new InfoUnaryOperator(UnaryOperator.NOT, "not",
combination));
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8e814509/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/expression/ParameterSetCombination.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/expression/ParameterSetCombination.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/expression/ParameterSetCombination.java
index ecc94b0..f3446d3 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/expression/ParameterSetCombination.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/expression/ParameterSetCombination.java
@@ -89,7 +89,7 @@ public interface ParameterSetCombination {
}
}
- // first check for parameter combination with promotion
+ // second check for parameter combination with promotion
for (ParameterSet parameterSet : combinations) {
boolean s = parameterSet.equals(actualParameterTypes, true);
if (s) {
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8e814509/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/uri/expression/TestAbapCompatibility.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/uri/expression/TestAbapCompatibility.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/uri/expression/TestAbapCompatibility.java
index 4952a32..0b9c17c 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/uri/expression/TestAbapCompatibility.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/uri/expression/TestAbapCompatibility.java
@@ -18,6 +18,7 @@
******************************************************************************/
package org.apache.olingo.odata2.core.uri.expression;
+import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
import org.apache.olingo.odata2.core.edm.Bit;
import org.apache.olingo.odata2.core.edm.EdmBinary;
import org.apache.olingo.odata2.core.edm.EdmBoolean;
@@ -32,6 +33,7 @@ import org.apache.olingo.odata2.core.edm.EdmInt32;
import org.apache.olingo.odata2.core.edm.EdmInt64;
import org.apache.olingo.odata2.core.edm.EdmNull;
import org.apache.olingo.odata2.core.edm.EdmSByte;
+import org.apache.olingo.odata2.core.edm.EdmSimpleTypeFacadeImpl;
import org.apache.olingo.odata2.core.edm.EdmSingle;
import org.apache.olingo.odata2.core.edm.EdmString;
import org.apache.olingo.odata2.core.edm.EdmTime;
@@ -47,6 +49,191 @@ import org.junit.Test;
public class TestAbapCompatibility extends TestBase {
@Test
+ public void nullTests() {
+
+ // unary negate/not
+
+ GetPTF(" - null").aSerialized("{- null}").aEdmType(
+ EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.Null));
+ GetPTF("not null").aSerialized("{not null}").aEdmType(
+ EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.Null));
+
+ // binary add/sub
+ GetPTF("-1 add null").aSerialized("{-1 add null}").aEdmType(
+ EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.SByte));
+ GetPTF("null add -1").aSerialized("{null add -1}").aEdmType(
+ EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.SByte));
+
+ GetPTF("130 add null").aSerialized("{130 add null}").aEdmType(EdmByte.getInstance());
+ GetPTF("null add 130").aSerialized("{null add 130}").aEdmType(EdmByte.getInstance());
+
+ GetPTF("12345 add null").aSerialized("{12345 add null}").aEdmType(EdmInt16.getInstance());
+ GetPTF("null add 12345").aSerialized("{null add 12345}").aEdmType(EdmInt16.getInstance());
+
+ GetPTF("1234512345 add null").aSerialized("{1234512345 add null}").aEdmType(EdmInt32.getInstance());
+ GetPTF("null add 1234512345").aSerialized("{null add 1234512345}").aEdmType(EdmInt32.getInstance());
+
+ GetPTF("12345L add null").aSerialized("{12345L add null}").aEdmType(EdmInt64.getInstance());
+ GetPTF("null add 12345L").aSerialized("{null add 12345L}").aEdmType(EdmInt64.getInstance());
+
+ GetPTF("1.1F add null").aSerialized("{1.1F add null}").aEdmType(EdmSingle.getInstance());
+ GetPTF("null add 1.1F").aSerialized("{null add 1.1F}").aEdmType(EdmSingle.getInstance());
+
+ GetPTF("1.1D add null").aSerialized("{1.1D add null}").aEdmType(EdmDouble.getInstance());
+ GetPTF("null add 1.1D").aSerialized("{null add 1.1D}").aEdmType(EdmDouble.getInstance());
+
+ GetPTF("1.1M add null").aSerialized("{1.1M add null}").aEdmType(EdmDecimal.getInstance());
+ GetPTF("null add 1.1M").aSerialized("{null add 1.1M}").aEdmType(EdmDecimal.getInstance());
+
+ // binary mul/div/mod
+
+ GetPTF("-1 mul null").aSerialized("{-1 mul null}").aEdmType(
+ EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.SByte));
+ GetPTF("null mul -1").aSerialized("{null mul -1}").aEdmType(
+ EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.SByte));
+
+ GetPTF("130 mul null").aSerialized("{130 mul null}").aEdmType(EdmByte.getInstance());
+ GetPTF("null mul 130").aSerialized("{null mul 130}").aEdmType(EdmByte.getInstance());
+
+ GetPTF("12345 mul null").aSerialized("{12345 mul null}").aEdmType(EdmInt16.getInstance());
+ GetPTF("null mul 12345").aSerialized("{null mul 12345}").aEdmType(EdmInt16.getInstance());
+
+ GetPTF("1234512345 mul null").aSerialized("{1234512345 mul null}").aEdmType(EdmInt32.getInstance());
+ GetPTF("null mul 1234512345").aSerialized("{null mul 1234512345}").aEdmType(EdmInt32.getInstance());
+
+ GetPTF("12345L mul null").aSerialized("{12345L mul null}").aEdmType(EdmInt64.getInstance());
+ GetPTF("null mul 12345L").aSerialized("{null mul 12345L}").aEdmType(EdmInt64.getInstance());
+
+ GetPTF("1.1F mul null").aSerialized("{1.1F mul null}").aEdmType(EdmSingle.getInstance());
+ GetPTF("null mul 1.1F").aSerialized("{null mul 1.1F}").aEdmType(EdmSingle.getInstance());
+
+ GetPTF("1.1D mul null").aSerialized("{1.1D mul null}").aEdmType(EdmDouble.getInstance());
+ GetPTF("null mul 1.1D").aSerialized("{null mul 1.1D}").aEdmType(EdmDouble.getInstance());
+
+ GetPTF("1.1M mul null").aSerialized("{1.1M mul null}").aEdmType(EdmDecimal.getInstance());
+ GetPTF("null mul 1.1M").aSerialized("{null mul 1.1M}").aEdmType(EdmDecimal.getInstance());
+
+ // relational gt/ge/lt/le
+
+ GetPTF("'TEST' gt null").aSerialized("{'TEST' gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt 'TEST'").aSerialized("{null gt 'TEST'}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("time'PT19H02M01S' gt null")
+ .aSerialized("{time'PT19H02M01S' gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt time'PT19H02M01S'")
+ .aSerialized("{null gt time'PT19H02M01S'}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("datetime'2011-07-31T23:30:59' gt null")
+ .aSerialized("{datetime'2011-07-31T23:30:59' gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt datetime'2011-07-31T23:30:59'").aSerialized(
+ "{null gt datetime'2011-07-31T23:30:59'}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("datetimeoffset'2002-10-10T12:00:00-05:00' gt null")
+ .aSerialized("{datetimeoffset'2002-10-10T12:00:00-05:00' gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt datetimeoffset'2002-10-10T12:00:00-05:00'")
+ .aSerialized("{null gt datetimeoffset'2002-10-10T12:00:00-05:00'}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("guid'12345678-1234-1234-1234-123456789012' gt null")
+ .aSerialized("{guid'12345678-1234-1234-1234-123456789012' gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt guid'12345678-1234-1234-1234-123456789012'")
+ .aSerialized("{null gt guid'12345678-1234-1234-1234-123456789012'}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("-1 gt null").aSerialized("{-1 gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt -1").aSerialized("{null gt -1}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("130 gt null").aSerialized("{130 gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt 130").aSerialized("{null gt 130}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("12345 gt null").aSerialized("{12345 gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt 12345").aSerialized("{null gt 12345}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("1234512345 gt null").aSerialized("{1234512345 gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt 1234512345").aSerialized("{null gt 1234512345}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("12345L gt null").aSerialized("{12345L gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt 12345L").aSerialized("{null gt 12345L}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("1.1F gt null").aSerialized("{1.1F gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt 1.1F").aSerialized("{null gt 1.1F}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("1.1D gt null").aSerialized("{1.1D gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt 1.1D").aSerialized("{null gt 1.1D}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("1.1M gt null").aSerialized("{1.1M gt null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null gt 1.1M").aSerialized("{null gt 1.1M}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("X'1234567890ABCDEF' gt null").aSerialized("{X'1234567890ABCDEF' gt null}").aEdmType(
+ EdmBoolean.getInstance());
+ GetPTF("null gt X'1234567890ABCDEF'").aSerialized("{null gt X'1234567890ABCDEF'}").aEdmType(
+ EdmBoolean.getInstance());
+
+ // equlity eq/ne
+
+ GetPTF("'TEST' eq null").aSerialized("{'TEST' eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq 'TEST'").aSerialized("{null eq 'TEST'}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("time'PT19H02M01S' eq null").aSerialized("{time'PT19H02M01S' eq null}").aEdmType(
+ EdmBoolean.getInstance());
+ GetPTF("null eq time'PT19H02M01S'").aSerialized("{null eq time'PT19H02M01S'}").aEdmType(
+ EdmBoolean.getInstance());
+
+ GetPTF("datetime'2011-07-31T23:30:59' eq null").aSerialized(
+ "{datetime'2011-07-31T23:30:59' eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq datetime'2011-07-31T23:30:59'").aSerialized(
+ "{null eq datetime'2011-07-31T23:30:59'}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("datetimeoffset'2002-10-10T12:00:00-05:00' eq null").aSerialized(
+ "{datetimeoffset'2002-10-10T12:00:00-05:00' eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq datetimeoffset'2002-10-10T12:00:00-05:00'").aSerialized(
+ "{null eq datetimeoffset'2002-10-10T12:00:00-05:00'}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("guid'12345678-1234-1234-1234-123456789012' eq null").aSerialized(
+ "{guid'12345678-1234-1234-1234-123456789012' eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq guid'12345678-1234-1234-1234-123456789012'").aSerialized(
+ "{null eq guid'12345678-1234-1234-1234-123456789012'}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("-1 eq null").aSerialized("{-1 eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq -1").aSerialized("{null eq -1}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("130 eq null").aSerialized("{130 eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq 130").aSerialized("{null eq 130}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("12345 eq null").aSerialized("{12345 eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq 12345").aSerialized("{null eq 12345}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("1234512345 eq null").aSerialized("{1234512345 eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq 1234512345").aSerialized("{null eq 1234512345}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("12345L eq null").aSerialized("{12345L eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq 12345L").aSerialized("{null eq 12345L}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("1.1F eq null").aSerialized("{1.1F eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq 1.1F").aSerialized("{null eq 1.1F}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("1.1D eq null").aSerialized("{1.1D eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq 1.1D").aSerialized("{null eq 1.1D}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("1.1M eq null").aSerialized("{1.1M eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq 1.1M").aSerialized("{null eq 1.1M}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("X'1234567890ABCDEF' eq null").aSerialized("{X'1234567890ABCDEF' eq null}").aEdmType(
+ EdmBoolean.getInstance());
+ GetPTF("null eq X'1234567890ABCDEF'").aSerialized("{null eq X'1234567890ABCDEF'}").aEdmType(
+ EdmBoolean.getInstance());
+
+ GetPTF("true eq null").aSerialized("{true eq null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null eq true").aSerialized("{null eq true}").aEdmType(EdmBoolean.getInstance());
+
+ // logical and/or
+ GetPTF("true and null").aSerialized("{true and null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null and true").aSerialized("{null and true}").aEdmType(EdmBoolean.getInstance());
+
+ GetPTF("true or null").aSerialized("{true or null}").aEdmType(EdmBoolean.getInstance());
+ GetPTF("null or true").aSerialized("{null or true}").aEdmType(EdmBoolean.getInstance());
+
+ }
+
+ @Test
public void abapTestParameterPromotion() // copy of ABAP method test_parameter_promotion
{
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8e814509/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/uri/expression/TestParser.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/uri/expression/TestParser.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/uri/expression/TestParser.java
index fda21b3..ef73dc8 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/uri/expression/TestParser.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/uri/expression/TestParser.java
@@ -44,6 +44,7 @@ import org.apache.olingo.odata2.core.edm.EdmGuid;
import org.apache.olingo.odata2.core.edm.EdmInt16;
import org.apache.olingo.odata2.core.edm.EdmInt32;
import org.apache.olingo.odata2.core.edm.EdmInt64;
+import org.apache.olingo.odata2.core.edm.EdmNull;
import org.apache.olingo.odata2.core.edm.EdmSByte;
import org.apache.olingo.odata2.core.edm.EdmSingle;
import org.apache.olingo.odata2.core.edm.EdmString;
@@ -126,8 +127,8 @@ public class TestParser extends TestBase {
GetPTF("concat('a','b')").aEdmType(EdmString.getInstance());
GetPTF("concat('a','b','c')").aEdmType(EdmString.getInstance());
}
-
- @Test
+
+ @Test
public void testProperties() {
// GetPTF("sven").aSerialized("sven").aKind(ExpressionKind.PROPERTY);
GetPTF("sven1 add sven2").aSerialized("{sven1 add sven2}").aKind(ExpressionKind.BINARY).root().left().aKind(