<commit_before>package com.sap.core.odata.processor.jpa.access.data;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.easymock.EasyMock;
import org.junit.Test;

import com.sap.core.odata.api.edm.EdmException;
import com.sap.core.odata.api.edm.EdmFacets;
import com.sap.core.odata.api.edm.EdmLiteralKind;
import com.sap.core.odata.api.edm.EdmProperty;
import com.sap.core.odata.api.edm.EdmSimpleType;
import com.sap.core.odata.api.edm.EdmSimpleTypeKind;
import com.sap.core.odata.api.edm.EdmTypeKind;
import com.sap.core.odata.api.exception.ODataException;
import com.sap.core.odata.api.uri.KeyPredicate;
import com.sap.core.odata.api.uri.expression.BinaryExpression;
import com.sap.core.odata.api.uri.expression.BinaryOperator;
import com.sap.core.odata.api.uri.expression.CommonExpression;
import com.sap.core.odata.api.uri.expression.ExpressionKind;
import com.sap.core.odata.api.uri.expression.FilterExpression;
import com.sap.core.odata.api.uri.expression.LiteralExpression;
import com.sap.core.odata.api.uri.expression.MemberExpression;
import com.sap.core.odata.api.uri.expression.OrderByExpression;
import com.sap.core.odata.api.uri.expression.OrderExpression;
import com.sap.core.odata.api.uri.expression.PropertyExpression;
import com.sap.core.odata.api.uri.expression.SortOrder;
import com.sap.core.odata.api.uri.expression.UnaryExpression;
import com.sap.core.odata.api.uri.expression.UnaryOperator;
import com.sap.core.odata.processor.jpa.api.jpql.JPQLStatement.Operator;
import com.sap.core.odata.processor.jpa.exception.ODataJPARuntimeException;

public class ODataExpressionParserTest {
	private static final String TABLE_ALIAS = "gwt1";	//$NON-NLS-1$
	
	@Test
	public void testParseWhereExpression() throws ODataException {
		
		String parsedStr = "";		
		
		// Simple Binary query - 
		parsedStr = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpressionMockedObj(BinaryOperator.EQ, ExpressionKind.PROPERTY, "SalesOrder", "1234"), TABLE_ALIAS);
		assertEquals(getAliasedProperty("SalesOrder")+ " = 1234", parsedStr);
		
		// complex query - 
		parsedStr = "";
		
		CommonExpression exp1 = getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, "SalesOrder", "1234");
		CommonExpression exp2 = getBinaryExpressionMockedObj(BinaryOperator.NE, ExpressionKind.PROPERTY, "SalesABC", "XYZ");

		parsedStr = parsedStr.concat(ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.AND, exp2), TABLE_ALIAS));
		assertEquals(getAliasedProperty("SalesOrder")+ " >= 1234 AND "+getAliasedProperty("SalesABC")+ " <> XYZ", parsedStr);
	}
	
	@Test
	public void testMoreThanOneBinaryExpression() throws ODataException {
		// complex query - 
		String parsedStr = "";
		CommonExpression exp1 = getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, "SalesOrder", "1234");
		CommonExpression exp2 = getBinaryExpressionMockedObj(BinaryOperator.NE, ExpressionKind.PROPERTY, "SalesABC", "XYZ");

		parsedStr = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.AND, exp2),TABLE_ALIAS);
		assertEquals(getAliasedProperty("SalesOrder")+ " >= 1234 AND "+getAliasedProperty("SalesABC")+ " <> XYZ", parsedStr);
		
		parsedStr = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.OR, exp2), TABLE_ALIAS);
		assertEquals(getAliasedProperty("SalesOrder")+ " >= 1234 OR "+getAliasedProperty("SalesABC")+ " <> XYZ", parsedStr);
	}
	
	@Test
	public void testParseFilterExpression() throws ODataException {
		assertEquals(getAliasedProperty("SalesOrder"), 
				ODataExpressionParser.parseToJPAWhereExpression(getFilterExpressionMockedObj(ExpressionKind.PROPERTY, "SalesOrder"),TABLE_ALIAS));
	}
	
	@Test
	public void testAllBinaryOperators() throws ODataException { //Test for all Binary Operators 
		// complex query - 
		String parsedStr1 = "";
		String parsedStr2 = "";
		
		CommonExpression exp1 = getBinaryExpressionMockedObj(BinaryOperator.LT, ExpressionKind.PROPERTY, "SalesOrder", "1234");
		CommonExpression exp2 = getBinaryExpressionMockedObj(BinaryOperator.LE, ExpressionKind.PROPERTY, "SalesABC", "XYZ");
		
		parsedStr1 = ODataExpressionParser.parseToJPAWhereExpression((BinaryExpression) getBinaryExpression(exp1, BinaryOperator.AND, exp2),TABLE_ALIAS);
		assertEquals(getAliasedProperty("SalesOrder")+ " < 1234 AND "+getAliasedProperty("SalesABC")+ " <= XYZ", parsedStr1);
		
		CommonExpression exp3 = getBinaryExpressionMockedObj(BinaryOperator.GT, ExpressionKind.PROPERTY, "LineItems", "2345");
		CommonExpression exp4 = getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, "SalesOrder", "Amazon");

		parsedStr2 = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp3, BinaryOperator.AND, exp4), TABLE_ALIAS);
		
		assertEquals(getAliasedProperty("LineItems")+ " > 2345 AND "+getAliasedProperty("SalesOrder")+ " >= Amazon", parsedStr2);
	}
	
	@Test
	public void testParseMemberExpression() throws ODataException {
		assertEquals(getAliasedProperty("Address")+"."+ "city"+" = "+"\'City_3\'", ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(getMemberExpressionMockedObj("Address", "city"), 
				BinaryOperator.EQ, getLiteralExpressionMockedObj("\'City_3\'")),TABLE_ALIAS));
		
	}
	
	@Test
	public void testParseUnaryExpression() throws ODataException {
		
		UnaryExpression unaryExpression = getUnaryExpressionMockedObj(getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, "deliveryStatus"), 
				com.sap.core.odata.api.uri.expression.UnaryOperator.NOT);
		assertEquals(Operator.NOT+"("+getAliasedProperty("deliveryStatus")+")", ODataExpressionParser.parseToJPAWhereExpression(unaryExpression, TABLE_ALIAS));
		
	}
	

	private UnaryExpression getUnaryExpressionMockedObj(CommonExpression operand, UnaryOperator unaryOperator) {
		UnaryExpression unaryExpression = EasyMock.createMock(UnaryExpression.class);
		EasyMock.expect(unaryExpression.getKind()).andReturn(ExpressionKind.UNARY).times(10);
		EasyMock.expect(unaryExpression.getOperand()).andReturn(operand).times(10);
		EasyMock.expect(unaryExpression.getOperator()).andReturn(unaryOperator).times(10);
		
		EasyMock.replay(unaryExpression);
		return unaryExpression;
	}

	private CommonExpression getMemberExpressionMockedObj(String pathUriLiteral, String propertyUriLiteral) {
		MemberExpression memberExpression = EasyMock.createMock(MemberExpression.class);
		EasyMock.expect(memberExpression.getPath()).andReturn(getPropertyExpressionPath(pathUriLiteral)).times(10);
		EasyMock.expect(memberExpression.getProperty()).andReturn(getPropertyExpressionPath(propertyUriLiteral)).times(10);
		EasyMock.expect(memberExpression.getKind()).andReturn(ExpressionKind.MEMBER).times(10);
		
		EasyMock.replay(memberExpression);
		return memberExpression;
	}

	private CommonExpression getPropertyExpressionPath(String uriLiteral) {
		PropertyExpression 	propertyExpression = EasyMock.createMock(PropertyExpression.class);
		EasyMock.expect(propertyExpression.getUriLiteral()).andReturn(uriLiteral).times(10);
		
		EasyMock.replay(propertyExpression);
		return propertyExpression;
	}

	@Test
	public void testParseOrderByExpression() throws EdmException, ODataJPARuntimeException {
		//fail("Not yet implemented");
		HashMap<String, String> orderByMap = ODataExpressionParser.parseToJPAOrderByExpression(getOrderByExpressionMockedObj(), TABLE_ALIAS);
		
		String orderByDirection = orderByMap.get(TABLE_ALIAS+"."+"Name 0");
		assertEquals("DESC", orderByDirection);
		
	}

	private String getAliasedProperty(String property){
		return TABLE_ALIAS+"."+property;
	}
	
	private LiteralExpression getLiteralExpressionMockedObj(String uriLiteral) throws EdmException{
		LiteralExpression rightOperandLiteralExpresion = EasyMock.createMock(LiteralExpression.class);
		EasyMock.expect(rightOperandLiteralExpresion.getKind()).andReturn(ExpressionKind.LITERAL).times(10);
		EasyMock.expect(rightOperandLiteralExpresion.getUriLiteral()).andReturn(uriLiteral).times(10);// "1234"
		EasyMock.expect(rightOperandLiteralExpresion.getEdmType()).andReturn(getEdmSimpleTypeMockedObj(uriLiteral)).times(10);
		EasyMock.replay(rightOperandLiteralExpresion);
		return rightOperandLiteralExpresion;
		
	}
	
	private EdmSimpleType getEdmSimpleTypeMockedObj(String value) throws EdmException{
		EdmSimpleType edmSimpleType = EasyMock.createMock(EdmSimpleType.class);
		EasyMock.expect(edmSimpleType.getName()).andReturn(value);
		EasyMock.expect(edmSimpleType.getKind()).andReturn(EdmTypeKind.SIMPLE).times(10);
		EasyMock.expect(edmSimpleType.valueOfString(value, EdmLiteralKind.URI, getEdmFacetsMockedObj())).andReturn(value).times(10);
		EasyMock.expect(edmSimpleType.valueOfString(value, EdmLiteralKind.URI, null)).andReturn(value).times(10);
		EasyMock.expect(edmSimpleType.valueToString(value, EdmLiteralKind.DEFAULT, getEdmFacetsMockedObj())).andReturn(value).times(10);
		EasyMock.expect(edmSimpleType.valueToString(value, EdmLiteralKind.DEFAULT, null)).andReturn(value).times(10);
		EasyMock.replay(edmSimpleType);
		return edmSimpleType;
	}
	
	private EdmFacets getEdmFacetsMockedObj(){
		EdmFacets facets = EasyMock.createMock(EdmFacets.class);
		
		EasyMock.replay(facets);
		return facets;
	}
	
	private PropertyExpression getPropertyExpressionMockedObj(ExpressionKind expKind, String propertyName){
		PropertyExpression  leftOperandPropertyExpresion  = EasyMock.createMock(PropertyExpression.class);
		EasyMock.expect(leftOperandPropertyExpresion.getKind()).andReturn(ExpressionKind.PROPERTY).times(10);
		EasyMock.expect(leftOperandPropertyExpresion.getPropertyName()).andReturn(propertyName).times(10);
		EasyMock.replay(leftOperandPropertyExpresion);
		return leftOperandPropertyExpresion;
	}
	
	private BinaryExpression getBinaryExpressionMockedObj(BinaryOperator operator, ExpressionKind leftOperandExpKind, String propertyName,  String literalStr) throws EdmException{
		BinaryExpression binaryExpression = EasyMock.createMock(BinaryExpression.class);
		EasyMock.expect(binaryExpression.getKind()).andReturn(ExpressionKind.BINARY).times(10);
		EasyMock.expect(binaryExpression.getLeftOperand()).andReturn(getPropertyExpressionMockedObj(leftOperandExpKind, propertyName)).times(10);
		EasyMock.expect(binaryExpression.getOperator()).andReturn(operator).times(10);
		EasyMock.expect(binaryExpression.getRightOperand()).andReturn(getLiteralExpressionMockedObj(literalStr)).times(10);<commit_msg>fixed compilation issue<commit_after>package com.sap.core.odata.processor.jpa.access.data;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.easymock.EasyMock;
import org.junit.Test;

import com.sap.core.odata.api.edm.EdmException;
import com.sap.core.odata.api.edm.EdmFacets;
import com.sap.core.odata.api.edm.EdmLiteralKind;
import com.sap.core.odata.api.edm.EdmProperty;
import com.sap.core.odata.api.edm.EdmSimpleType;
import com.sap.core.odata.api.edm.EdmSimpleTypeKind;
import com.sap.core.odata.api.edm.EdmTypeKind;
import com.sap.core.odata.api.exception.ODataException;
import com.sap.core.odata.api.uri.KeyPredicate;
import com.sap.core.odata.api.uri.expression.BinaryExpression;
import com.sap.core.odata.api.uri.expression.BinaryOperator;
import com.sap.core.odata.api.uri.expression.CommonExpression;
import com.sap.core.odata.api.uri.expression.ExpressionKind;
import com.sap.core.odata.api.uri.expression.FilterExpression;
import com.sap.core.odata.api.uri.expression.LiteralExpression;
import com.sap.core.odata.api.uri.expression.MemberExpression;
import com.sap.core.odata.api.uri.expression.OrderByExpression;
import com.sap.core.odata.api.uri.expression.OrderExpression;
import com.sap.core.odata.api.uri.expression.PropertyExpression;
import com.sap.core.odata.api.uri.expression.SortOrder;
import com.sap.core.odata.api.uri.expression.UnaryExpression;
import com.sap.core.odata.api.uri.expression.UnaryOperator;
import com.sap.core.odata.processor.jpa.api.jpql.JPQLStatement.Operator;
import com.sap.core.odata.processor.jpa.exception.ODataJPARuntimeException;

public class ODataExpressionParserTest {
	private static final String TABLE_ALIAS = "gwt1";	//$NON-NLS-1$
	
	@Test
	public void testParseWhereExpression() throws ODataException {
		
		String parsedStr = "";		
		
		// Simple Binary query - 
		parsedStr = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpressionMockedObj(BinaryOperator.EQ, ExpressionKind.PROPERTY, "SalesOrder", "1234"), TABLE_ALIAS);
		assertEquals(getAliasedProperty("SalesOrder")+ " = 1234", parsedStr);
		
		// complex query - 
		parsedStr = "";
		
		CommonExpression exp1 = getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, "SalesOrder", "1234");
		CommonExpression exp2 = getBinaryExpressionMockedObj(BinaryOperator.NE, ExpressionKind.PROPERTY, "SalesABC", "XYZ");

		parsedStr = parsedStr.concat(ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.AND, exp2), TABLE_ALIAS));
		assertEquals(getAliasedProperty("SalesOrder")+ " >= 1234 AND "+getAliasedProperty("SalesABC")+ " <> XYZ", parsedStr);
	}
	
	@Test
	public void testMoreThanOneBinaryExpression() throws ODataException {
		// complex query - 
		String parsedStr = "";
		CommonExpression exp1 = getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, "SalesOrder", "1234");
		CommonExpression exp2 = getBinaryExpressionMockedObj(BinaryOperator.NE, ExpressionKind.PROPERTY, "SalesABC", "XYZ");

		parsedStr = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.AND, exp2),TABLE_ALIAS);
		assertEquals(getAliasedProperty("SalesOrder")+ " >= 1234 AND "+getAliasedProperty("SalesABC")+ " <> XYZ", parsedStr);
		
		parsedStr = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.OR, exp2), TABLE_ALIAS);
		assertEquals(getAliasedProperty("SalesOrder")+ " >= 1234 OR "+getAliasedProperty("SalesABC")+ " <> XYZ", parsedStr);
	}
	
	@Test
	public void testParseFilterExpression() throws ODataException {
		assertEquals(getAliasedProperty("SalesOrder"), 
				ODataExpressionParser.parseToJPAWhereExpression(getFilterExpressionMockedObj(ExpressionKind.PROPERTY, "SalesOrder"),TABLE_ALIAS));
	}
	
	@Test
	public void testAllBinaryOperators() throws ODataException { //Test for all Binary Operators 
		// complex query - 
		String parsedStr1 = "";
		String parsedStr2 = "";
		
		CommonExpression exp1 = getBinaryExpressionMockedObj(BinaryOperator.LT, ExpressionKind.PROPERTY, "SalesOrder", "1234");
		CommonExpression exp2 = getBinaryExpressionMockedObj(BinaryOperator.LE, ExpressionKind.PROPERTY, "SalesABC", "XYZ");
		
		parsedStr1 = ODataExpressionParser.parseToJPAWhereExpression((BinaryExpression) getBinaryExpression(exp1, BinaryOperator.AND, exp2),TABLE_ALIAS);
		assertEquals(getAliasedProperty("SalesOrder")+ " < 1234 AND "+getAliasedProperty("SalesABC")+ " <= XYZ", parsedStr1);
		
		CommonExpression exp3 = getBinaryExpressionMockedObj(BinaryOperator.GT, ExpressionKind.PROPERTY, "LineItems", "2345");
		CommonExpression exp4 = getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, "SalesOrder", "Amazon");

		parsedStr2 = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp3, BinaryOperator.AND, exp4), TABLE_ALIAS);
		
		assertEquals(getAliasedProperty("LineItems")+ " > 2345 AND "+getAliasedProperty("SalesOrder")+ " >= Amazon", parsedStr2);
	}
	
	@Test
	public void testParseMemberExpression() throws ODataException {
		assertEquals(getAliasedProperty("Address")+"."+ "city"+" = "+"\'City_3\'", ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(getMemberExpressionMockedObj("Address", "city"), 
				BinaryOperator.EQ, getLiteralExpressionMockedObj("\'City_3\'")),TABLE_ALIAS));
		
	}
	
	@Test
	public void testParseUnaryExpression() throws ODataException {
		
		UnaryExpression unaryExpression = getUnaryExpressionMockedObj(getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, "deliveryStatus"), 
				com.sap.core.odata.api.uri.expression.UnaryOperator.NOT);
		assertEquals(Operator.NOT+"("+getAliasedProperty("deliveryStatus")+")", ODataExpressionParser.parseToJPAWhereExpression(unaryExpression, TABLE_ALIAS));
		
	}
	

	private UnaryExpression getUnaryExpressionMockedObj(CommonExpression operand, UnaryOperator unaryOperator) {
		UnaryExpression unaryExpression = EasyMock.createMock(UnaryExpression.class);
		EasyMock.expect(unaryExpression.getKind()).andReturn(ExpressionKind.UNARY).times(10);
		EasyMock.expect(unaryExpression.getOperand()).andReturn(operand).times(10);
		EasyMock.expect(unaryExpression.getOperator()).andReturn(unaryOperator).times(10);
		
		EasyMock.replay(unaryExpression);
		return unaryExpression;
	}

	private CommonExpression getMemberExpressionMockedObj(String pathUriLiteral, String propertyUriLiteral) {
		MemberExpression memberExpression = EasyMock.createMock(MemberExpression.class);
		EasyMock.expect(memberExpression.getPath()).andReturn(getPropertyExpressionPath(pathUriLiteral)).times(10);
		EasyMock.expect(memberExpression.getProperty()).andReturn(getPropertyExpressionPath(propertyUriLiteral)).times(10);
		EasyMock.expect(memberExpression.getKind()).andReturn(ExpressionKind.MEMBER).times(10);
		
		EasyMock.replay(memberExpression);
		return memberExpression;
	}

	private CommonExpression getPropertyExpressionPath(String uriLiteral) {
		PropertyExpression 	propertyExpression = EasyMock.createMock(PropertyExpression.class);
		EasyMock.expect(propertyExpression.getUriLiteral()).andReturn(uriLiteral).times(10);
		
		EasyMock.replay(propertyExpression);
		return propertyExpression;
	}

	@Test
	public void testParseOrderByExpression() throws EdmException, ODataJPARuntimeException {
		//fail("Not yet implemented");
		HashMap<String, String> orderByMap = ODataExpressionParser.parseToJPAOrderByExpression(getOrderByExpressionMockedObj(), TABLE_ALIAS);
		
		String orderByDirection = orderByMap.get(TABLE_ALIAS+"."+"Name 0");
		assertEquals("DESC", orderByDirection);
		
	}

	private String getAliasedProperty(String property){
		return TABLE_ALIAS+"."+property;
	}
	
	private LiteralExpression getLiteralExpressionMockedObj(String uriLiteral) throws EdmException{
		LiteralExpression rightOperandLiteralExpresion = EasyMock.createMock(LiteralExpression.class);
		EasyMock.expect(rightOperandLiteralExpresion.getKind()).andReturn(ExpressionKind.LITERAL).times(10);
		EasyMock.expect(rightOperandLiteralExpresion.getUriLiteral()).andReturn(uriLiteral).times(10);// "1234"
		EasyMock.expect(rightOperandLiteralExpresion.getEdmType()).andReturn(getEdmSimpleTypeMockedObj(uriLiteral)).times(10);
		EasyMock.replay(rightOperandLiteralExpresion);
		return rightOperandLiteralExpresion;
		
	}
	
	private EdmSimpleType getEdmSimpleTypeMockedObj(String value) throws EdmException{
		EdmSimpleType edmSimpleType = EasyMock.createMock(EdmSimpleType.class);
		EasyMock.expect(edmSimpleType.getName()).andReturn(value);
		EasyMock.expect(edmSimpleType.getKind()).andReturn(EdmTypeKind.SIMPLE).times(10);
		EasyMock.expect(edmSimpleType.valueOfString(value, EdmLiteralKind.URI, getEdmFacetsMockedObj(),null)).andReturn(value).times(10);
		EasyMock.expect(edmSimpleType.valueOfString(value, EdmLiteralKind.URI, null,null)).andReturn(value).times(10);
		EasyMock.expect(edmSimpleType.valueToString(value, EdmLiteralKind.DEFAULT, getEdmFacetsMockedObj())).andReturn(value).times(10);
		EasyMock.expect(edmSimpleType.valueToString(value, EdmLiteralKind.DEFAULT, null)).andReturn(value).times(10);
		EasyMock.replay(edmSimpleType);
		return edmSimpleType;
	}
	
	private EdmFacets getEdmFacetsMockedObj(){
		EdmFacets facets = EasyMock.createMock(EdmFacets.class);
		
		EasyMock.replay(facets);
		return facets;
	}
	
	private PropertyExpression getPropertyExpressionMockedObj(ExpressionKind expKind, String propertyName){
		PropertyExpression  leftOperandPropertyExpresion  = EasyMock.createMock(PropertyExpression.class);
		EasyMock.expect(leftOperandPropertyExpresion.getKind()).andReturn(ExpressionKind.PROPERTY).times(10);
		EasyMock.expect(leftOperandPropertyExpresion.getPropertyName()).andReturn(propertyName).times(10);
		EasyMock.replay(leftOperandPropertyExpresion);
		return leftOperandPropertyExpresion;
	}
	
	private BinaryExpression getBinaryExpressionMockedObj(BinaryOperator operator, ExpressionKind leftOperandExpKind, String propertyName,  String literalStr) throws EdmException{
		BinaryExpression binaryExpression = EasyMock.createMock(BinaryExpression.class);
		EasyMock.expect(binaryExpression.getKind()).andReturn(ExpressionKind.BINARY).times(10);
		EasyMock.expect(binaryExpression.getLeftOperand()).andReturn(getPropertyExpressionMockedObj(leftOperandExpKind, propertyName)).times(10);
		EasyMock.expect(binaryExpression.getOperator()).andReturn(operator).times(10);
		EasyMock.expect(binaryExpression.getRightOperand()).andReturn(getLiteralExpressionMockedObj(literalStr)).times(10);
{'fraction_non_alphanumeric': 0.11352474499433321, 'fraction_numerical': 0.011239138647525501, 'mean_word_length': 7.725587144622992, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1897302', 'n_tokens_mistral': 6800, 'n_tokens_neox': 6313, 'n_words': 835}