@Test(expected = UriParserSemanticException.class) public void testPropertyPathExpWithoutType() throws Exception { final String entitySetName = "ESName"; final String keyPropertyName = "a"; EdmProperty keyProperty = mockProperty(keyPropertyName, OData.newInstance().createPrimitiveTypeInstance(EdmPrimitiveTypeKind.String)); EdmKeyPropertyRef keyPropertyRef = mockKeyPropertyRef(keyPropertyName, keyProperty); EdmEntityType entityType = mockEntityType(keyPropertyName, keyPropertyRef); Mockito.when(entityType.getPropertyNames()).thenReturn(Collections.singletonList(keyPropertyName)); Mockito.when(entityType.getProperty(keyPropertyName)).thenReturn(keyProperty); EdmEntitySet entitySet = mockEntitySet(entitySetName, entityType); EdmEntityContainer container = mockContainer(entitySetName, entitySet); Edm mockedEdm = Mockito.mock(Edm.class); Mockito.when(mockedEdm.getEntityContainer()).thenReturn(container); UriTokenizer tokenizer = new UriTokenizer("a eq \'abc\'"); new ExpressionParser(mockedEdm, odata).parse(tokenizer, null, null, null); }
public Expression parse(UriTokenizer tokenizer, final EdmType referringType, final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { this.tokenizer = tokenizer; this.referringType = referringType; this.crossjoinEntitySetNames = crossjoinEntitySetNames; this.aliases = aliases; final Expression expression = parseExpression(); checkNoCollection(expression); return expression; }
ExpressionParser { public Expression parse(UriTokenizer tokenizer, final EdmType referringType, final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { this.tokenizer = tokenizer; this.referringType = referringType; this.crossjoinEntitySetNames = crossjoinEntitySetNames; this.aliases = aliases; final Expression expression = parseExpression(); checkNoCollection(expression); return expression; } }
ExpressionParser { public Expression parse(UriTokenizer tokenizer, final EdmType referringType, final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { this.tokenizer = tokenizer; this.referringType = referringType; this.crossjoinEntitySetNames = crossjoinEntitySetNames; this.aliases = aliases; final Expression expression = parseExpression(); checkNoCollection(expression); return expression; } ExpressionParser(final Edm edm, final OData odata); }
ExpressionParser { public Expression parse(UriTokenizer tokenizer, final EdmType referringType, final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { this.tokenizer = tokenizer; this.referringType = referringType; this.crossjoinEntitySetNames = crossjoinEntitySetNames; this.aliases = aliases; final Expression expression = parseExpression(); checkNoCollection(expression); return expression; } ExpressionParser(final Edm edm, final OData odata); Expression parse(UriTokenizer tokenizer, final EdmType referringType,
      final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases); }
ExpressionParser { public Expression parse(UriTokenizer tokenizer, final EdmType referringType, final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { this.tokenizer = tokenizer; this.referringType = referringType; this.crossjoinEntitySetNames = crossjoinEntitySetNames; this.aliases = aliases; final Expression expression = parseExpression(); checkNoCollection(expression); return expression; } ExpressionParser(final Edm edm, final OData odata); Expression parse(UriTokenizer tokenizer, final EdmType referringType,
      final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases);  }