You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2013/09/20 15:34:16 UTC
[54/59] [abbrv] cleanup jpa core
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataExpressionParserTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataExpressionParserTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataExpressionParserTest.java
index 6ae7e68..390c7fe 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataExpressionParserTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataExpressionParserTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa;
@@ -48,7 +48,6 @@ import org.apache.olingo.odata2.api.uri.expression.PropertyExpression;
import org.apache.olingo.odata2.api.uri.expression.UnaryExpression;
import org.apache.olingo.odata2.api.uri.expression.UnaryOperator;
import org.apache.olingo.odata2.processor.api.jpa.exception.ODataJPARuntimeException;
-import org.apache.olingo.odata2.processor.core.jpa.ODataExpressionParser;
import org.apache.olingo.odata2.processor.core.jpa.common.ODataJPATestConstants;
import org.easymock.EasyMock;
import org.junit.Test;
@@ -66,12 +65,16 @@ public class ODataExpressionParserTest {
private static final String EXPECTED_STR_9 = "gwt1.BuyerAddress, gwt1.BuyerName, gwt1.BuyerId";
private static final String EXPECTED_STR_10 = "gwt1.SalesOrder";
private static final String EXPECTED_STR_11 = "NOT(gwt1.deliveryStatus)";
- private static final String EXPECTED_STR_12 = "(CASE WHEN (gwt1.currencyCode LIKE '%Ru%') THEN TRUE ELSE FALSE END) = true";
+ private static final String EXPECTED_STR_12 =
+ "(CASE WHEN (gwt1.currencyCode LIKE '%Ru%') THEN TRUE ELSE FALSE END) = true";
private static final String EXPECTED_STR_13 = "SUBSTRING(gwt1.currencyCode, 1 + 1 , 2) = 'NR'";
private static final String EXPECTED_STR_14 = "LOWER(gwt1.currencyCode) = 'inr rupees'";
- private static final String EXPECTED_STR_15 = "(CASE WHEN (LOWER(gwt1.currencyCode) LIKE '%nr rupees%') THEN TRUE ELSE FALSE END) = true";
- private static final String EXPECTED_STR_16 = "(CASE WHEN (gwt1.currencyCode LIKE '%INR%') THEN TRUE ELSE FALSE END) = true";
- private static final String EXPECTED_STR_17 = "(CASE WHEN (LOWER(gwt1.currencyCode) LIKE '%nr rupees%') THEN TRUE ELSE FALSE END) = true";
+ private static final String EXPECTED_STR_15 =
+ "(CASE WHEN (LOWER(gwt1.currencyCode) LIKE '%nr rupees%') THEN TRUE ELSE FALSE END) = true";
+ private static final String EXPECTED_STR_16 =
+ "(CASE WHEN (gwt1.currencyCode LIKE '%INR%') THEN TRUE ELSE FALSE END) = true";
+ private static final String EXPECTED_STR_17 =
+ "(CASE WHEN (LOWER(gwt1.currencyCode) LIKE '%nr rupees%') THEN TRUE ELSE FALSE END) = true";
private static final String ADDRESS = "Address";
private static final String CITY = "city";
@@ -95,15 +98,21 @@ public class ODataExpressionParserTest {
try {
String parsedStr = ODataJPATestConstants.EMPTY_STRING;
// Simple Binary query -
- parsedStr = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpressionMockedObj(BinaryOperator.EQ, ExpressionKind.PROPERTY, SALES_ORDER, SAMPLE_DATA_1), TABLE_ALIAS);
+ parsedStr =
+ ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpressionMockedObj(BinaryOperator.EQ,
+ ExpressionKind.PROPERTY, SALES_ORDER, SAMPLE_DATA_1), TABLE_ALIAS);
assertEquals(EXPECTED_STR_1, parsedStr);
// complex query -
parsedStr = ODataJPATestConstants.EMPTY_STRING;
- CommonExpression exp1 = getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, SALES_ORDER, SAMPLE_DATA_1);
- CommonExpression exp2 = getBinaryExpressionMockedObj(BinaryOperator.NE, ExpressionKind.PROPERTY, SALES_ABC, SAMPLE_DATA_XYZ);
- parsedStr = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.AND, exp2), TABLE_ALIAS);
+ CommonExpression exp1 =
+ getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, SALES_ORDER, SAMPLE_DATA_1);
+ CommonExpression exp2 =
+ getBinaryExpressionMockedObj(BinaryOperator.NE, ExpressionKind.PROPERTY, SALES_ABC, SAMPLE_DATA_XYZ);
+ parsedStr =
+ ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.AND, exp2),
+ TABLE_ALIAS);
assertEquals(EXPECTED_STR_2, parsedStr);
} catch (EdmException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
@@ -116,12 +125,18 @@ public class ODataExpressionParserTest {
public void testMoreThanOneBinaryExpression() {
// complex query -
String parsedStr = ODataJPATestConstants.EMPTY_STRING;
- CommonExpression exp1 = getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, SALES_ORDER, SAMPLE_DATA_1);
- CommonExpression exp2 = getBinaryExpressionMockedObj(BinaryOperator.NE, ExpressionKind.PROPERTY, SALES_ABC, SAMPLE_DATA_XYZ);
+ CommonExpression exp1 =
+ getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, SALES_ORDER, SAMPLE_DATA_1);
+ CommonExpression exp2 =
+ getBinaryExpressionMockedObj(BinaryOperator.NE, ExpressionKind.PROPERTY, SALES_ABC, SAMPLE_DATA_XYZ);
try {
- parsedStr = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.AND, exp2), TABLE_ALIAS);
+ parsedStr =
+ ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.AND, exp2),
+ TABLE_ALIAS);
assertEquals(EXPECTED_STR_2, parsedStr);
- parsedStr = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.OR, exp2), TABLE_ALIAS);
+ parsedStr =
+ ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp1, BinaryOperator.OR, exp2),
+ TABLE_ALIAS);
} catch (ODataException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
@@ -131,7 +146,8 @@ public class ODataExpressionParserTest {
@Test
public void testParseFilterExpression() {
try {
- assertEquals(EXPECTED_STR_10, ODataExpressionParser.parseToJPAWhereExpression(getFilterExpressionMockedObj(ExpressionKind.PROPERTY, SALES_ORDER), TABLE_ALIAS));
+ assertEquals(EXPECTED_STR_10, ODataExpressionParser.parseToJPAWhereExpression(getFilterExpressionMockedObj(
+ ExpressionKind.PROPERTY, SALES_ORDER), TABLE_ALIAS));
} catch (ODataException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
@@ -143,17 +159,26 @@ public class ODataExpressionParserTest {
String parsedStr1 = ODataJPATestConstants.EMPTY_STRING;
String parsedStr2 = ODataJPATestConstants.EMPTY_STRING;
- CommonExpression exp1 = getBinaryExpressionMockedObj(BinaryOperator.LT, ExpressionKind.PROPERTY, SALES_ORDER, SAMPLE_DATA_1);
- CommonExpression exp2 = getBinaryExpressionMockedObj(BinaryOperator.LE, ExpressionKind.PROPERTY, SALES_ABC, SAMPLE_DATA_XYZ);
+ CommonExpression exp1 =
+ getBinaryExpressionMockedObj(BinaryOperator.LT, ExpressionKind.PROPERTY, SALES_ORDER, SAMPLE_DATA_1);
+ CommonExpression exp2 =
+ getBinaryExpressionMockedObj(BinaryOperator.LE, ExpressionKind.PROPERTY, SALES_ABC, SAMPLE_DATA_XYZ);
try {
- parsedStr1 = ODataExpressionParser.parseToJPAWhereExpression((BinaryExpression) getBinaryExpression(exp1, BinaryOperator.AND, exp2), TABLE_ALIAS);
+ parsedStr1 =
+ ODataExpressionParser.parseToJPAWhereExpression((BinaryExpression) getBinaryExpression(exp1,
+ BinaryOperator.AND, exp2), TABLE_ALIAS);
assertEquals(EXPECTED_STR_4, parsedStr1);
- CommonExpression exp3 = getBinaryExpressionMockedObj(BinaryOperator.GT, ExpressionKind.PROPERTY, SAMPLE_DATA_LINE_ITEMS, SAMPLE_DATA_2);
- CommonExpression exp4 = getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, SALES_ORDER, SAMPLE_DATA_AMAZON);
+ CommonExpression exp3 =
+ getBinaryExpressionMockedObj(BinaryOperator.GT, ExpressionKind.PROPERTY, SAMPLE_DATA_LINE_ITEMS,
+ SAMPLE_DATA_2);
+ CommonExpression exp4 =
+ getBinaryExpressionMockedObj(BinaryOperator.GE, ExpressionKind.PROPERTY, SALES_ORDER, SAMPLE_DATA_AMAZON);
- parsedStr2 = ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp3, BinaryOperator.AND, exp4), TABLE_ALIAS);
+ parsedStr2 =
+ ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(exp3, BinaryOperator.AND, exp4),
+ TABLE_ALIAS);
} catch (ODataException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
@@ -164,8 +189,12 @@ public class ODataExpressionParserTest {
@Test
public void testParseMemberExpression() {
try {
- assertEquals(EXPECTED_STR_6, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(getMemberExpressionMockedObj(ADDRESS, CITY), BinaryOperator.EQ, getLiteralExpressionMockedObj(SAMPLE_DATA_CITY_3)), TABLE_ALIAS));
- assertEquals(EXPECTED_STR_7, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(getMultipleMemberExpressionMockedObj(ADDRESS, CITY, AREA), BinaryOperator.EQ, getLiteralExpressionMockedObj(SAMPLE_DATA_BTM)), TABLE_ALIAS));
+ assertEquals(EXPECTED_STR_6, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(
+ getMemberExpressionMockedObj(ADDRESS, CITY), BinaryOperator.EQ,
+ getLiteralExpressionMockedObj(SAMPLE_DATA_CITY_3)), TABLE_ALIAS));
+ assertEquals(EXPECTED_STR_7, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(
+ getMultipleMemberExpressionMockedObj(ADDRESS, CITY, AREA), BinaryOperator.EQ,
+ getLiteralExpressionMockedObj(SAMPLE_DATA_BTM)), TABLE_ALIAS));
} catch (ODataException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
@@ -174,38 +203,52 @@ public class ODataExpressionParserTest {
@Test
public void testParseMethodExpression() {
try {
- assertEquals(EXPECTED_STR_12, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(getMethodExpressionMockedObj(MethodOperator.SUBSTRINGOF, "'Ru'", "currencyCode", null, 2), BinaryOperator.EQ, getLiteralExpressionMockedObj("true")), TABLE_ALIAS));
- assertEquals(EXPECTED_STR_13, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(getMethodExpressionMockedObj(MethodOperator.SUBSTRING, "currencyCode", "1", "2", 3), BinaryOperator.EQ, getLiteralExpressionMockedObj("'NR'")), TABLE_ALIAS));
- assertEquals(EXPECTED_STR_14, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(getMethodExpressionMockedObj(MethodOperator.TOLOWER, "currencyCode", null, null, 1), BinaryOperator.EQ, getLiteralExpressionMockedObj("'inr rupees'")), TABLE_ALIAS));
- assertEquals(EXPECTED_STR_15, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(getMultipleMethodExpressionMockedObj(MethodOperator.SUBSTRINGOF, "'nr rupees'", MethodOperator.TOLOWER, "currencyCode", 2, 1), BinaryOperator.EQ, getLiteralExpressionMockedObj("true")), TABLE_ALIAS));
- assertEquals(EXPECTED_STR_16, ODataExpressionParser.parseToJPAWhereExpression(getFilterExpressionForFunctionsMockedObj(MethodOperator.SUBSTRINGOF, "'INR'", null, "currencyCode", 2, null)
- /*getBinaryExpression(
- getMemberExpressionMockedObj(ADDRESS,
- CITY),
- BinaryOperator.EQ,
- getLiteralExpressionMockedObj(SAMPLE_DATA_CITY_3))*/, TABLE_ALIAS));
- assertEquals(EXPECTED_STR_17, ODataExpressionParser.parseToJPAWhereExpression(getFilterExpressionForFunctionsMockedObj(MethodOperator.SUBSTRINGOF, "'nr rupees'", MethodOperator.TOLOWER, "currencyCode", 2, 1)
- /*getBinaryExpression(
- getMemberExpressionMockedObj(ADDRESS,
- CITY),
- BinaryOperator.EQ,
- getLiteralExpressionMockedObj(SAMPLE_DATA_CITY_3))*/, TABLE_ALIAS));
+ assertEquals(EXPECTED_STR_12, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(
+ getMethodExpressionMockedObj(MethodOperator.SUBSTRINGOF, "'Ru'", "currencyCode", null, 2), BinaryOperator.EQ,
+ getLiteralExpressionMockedObj("true")), TABLE_ALIAS));
+ assertEquals(EXPECTED_STR_13, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(
+ getMethodExpressionMockedObj(MethodOperator.SUBSTRING, "currencyCode", "1", "2", 3), BinaryOperator.EQ,
+ getLiteralExpressionMockedObj("'NR'")), TABLE_ALIAS));
+ assertEquals(EXPECTED_STR_14, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(
+ getMethodExpressionMockedObj(MethodOperator.TOLOWER, "currencyCode", null, null, 1), BinaryOperator.EQ,
+ getLiteralExpressionMockedObj("'inr rupees'")), TABLE_ALIAS));
+ assertEquals(EXPECTED_STR_15, ODataExpressionParser.parseToJPAWhereExpression(getBinaryExpression(
+ getMultipleMethodExpressionMockedObj(MethodOperator.SUBSTRINGOF, "'nr rupees'", MethodOperator.TOLOWER,
+ "currencyCode", 2, 1), BinaryOperator.EQ, getLiteralExpressionMockedObj("true")), TABLE_ALIAS));
+ assertEquals(EXPECTED_STR_16, ODataExpressionParser.parseToJPAWhereExpression(
+ getFilterExpressionForFunctionsMockedObj(MethodOperator.SUBSTRINGOF, "'INR'", null, "currencyCode", 2, null)
+ /*
+ * getBinaryExpression(
+ * getMemberExpressionMockedObj(ADDRESS,
+ * CITY),
+ * BinaryOperator.EQ,
+ * getLiteralExpressionMockedObj(SAMPLE_DATA_CITY_3))
+ */, TABLE_ALIAS));
+ assertEquals(EXPECTED_STR_17, ODataExpressionParser.parseToJPAWhereExpression(
+ getFilterExpressionForFunctionsMockedObj(MethodOperator.SUBSTRINGOF, "'nr rupees'", MethodOperator.TOLOWER,
+ "currencyCode", 2, 1)
+ /*
+ * getBinaryExpression(
+ * getMemberExpressionMockedObj(ADDRESS,
+ * CITY),
+ * BinaryOperator.EQ,
+ * getLiteralExpressionMockedObj(SAMPLE_DATA_CITY_3))
+ */, TABLE_ALIAS));
} catch (ODataException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
- private CommonExpression getMethodExpressionMockedObj(final MethodOperator methodOperator, final String firstName, final String secondName, final String thirdName, final Integer parameterCount) {
+ private CommonExpression getMethodExpressionMockedObj(final MethodOperator methodOperator, final String firstName,
+ final String secondName, final String thirdName, final Integer parameterCount) {
List<CommonExpression> parameters = new ArrayList<CommonExpression>();
if (methodOperator == MethodOperator.SUBSTRINGOF) {
parameters.add(getLiteralExpressionMockedObj(firstName));
parameters.add(getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, secondName));
- }
-
- else if (methodOperator == MethodOperator.SUBSTRING) {
+ } else if (methodOperator == MethodOperator.SUBSTRING) {
parameters.add(getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, firstName));
parameters.add(getLiteralExpressionMockedObj(secondName));
parameters.add(getLiteralExpressionMockedObj(thirdName));
@@ -224,9 +267,11 @@ public class ODataExpressionParserTest {
return methodExpression;
}
- private CommonExpression getMultipleMethodExpressionMockedObj(final MethodOperator methodOperator1, final String firstName, final MethodOperator methodOperator2, final String secondName, final Integer parameterCount1, final Integer parameterCount2) {
+ private CommonExpression getMultipleMethodExpressionMockedObj(final MethodOperator methodOperator1,
+ final String firstName, final MethodOperator methodOperator2, final String secondName,
+ final Integer parameterCount1, final Integer parameterCount2) {
- //complex query
+ // complex query
List<CommonExpression> parameters = new ArrayList<CommonExpression>();
parameters.add(getLiteralExpressionMockedObj(firstName));
@@ -243,12 +288,14 @@ public class ODataExpressionParserTest {
return methodExpression;
}
- private CommonExpression getMultipleMemberExpressionMockedObj(final String string1, final String string2, final String string3) {
+ private CommonExpression getMultipleMemberExpressionMockedObj(final String string1, final String string2,
+ final String string3) {
MemberExpression memberExpression = EasyMock.createMock(MemberExpression.class);
EasyMock.expect(memberExpression.getPath()).andStubReturn(getMemberExpressionMockedObj(string1, string2));
- EasyMock.expect(memberExpression.getProperty()).andStubReturn(getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, string3));
+ EasyMock.expect(memberExpression.getProperty()).andStubReturn(
+ getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, string3));
EasyMock.expect(memberExpression.getKind()).andStubReturn(ExpressionKind.MEMBER);
EasyMock.replay(memberExpression);
@@ -258,7 +305,9 @@ public class ODataExpressionParserTest {
@Test
public void testParseUnaryExpression() {
- UnaryExpression unaryExpression = getUnaryExpressionMockedObj(getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, "deliveryStatus"), org.apache.olingo.odata2.api.uri.expression.UnaryOperator.NOT);
+ UnaryExpression unaryExpression =
+ getUnaryExpressionMockedObj(getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, "deliveryStatus"),
+ org.apache.olingo.odata2.api.uri.expression.UnaryOperator.NOT);
try {
assertEquals(EXPECTED_STR_11, ODataExpressionParser.parseToJPAWhereExpression(unaryExpression, TABLE_ALIAS));
} catch (ODataException e) {
@@ -267,7 +316,8 @@ public class ODataExpressionParserTest {
}
- private UnaryExpression getUnaryExpressionMockedObj(final CommonExpression operand, final UnaryOperator unaryOperator) {
+ private UnaryExpression
+ getUnaryExpressionMockedObj(final CommonExpression operand, final UnaryOperator unaryOperator) {
UnaryExpression unaryExpression = EasyMock.createMock(UnaryExpression.class);
EasyMock.expect(unaryExpression.getKind()).andStubReturn(ExpressionKind.UNARY);
EasyMock.expect(unaryExpression.getOperand()).andStubReturn(operand);
@@ -279,8 +329,10 @@ public class ODataExpressionParserTest {
private CommonExpression getMemberExpressionMockedObj(final String pathUriLiteral, final String propertyUriLiteral) {
MemberExpression memberExpression = EasyMock.createMock(MemberExpression.class);
- EasyMock.expect(memberExpression.getPath()).andStubReturn(getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, pathUriLiteral));
- EasyMock.expect(memberExpression.getProperty()).andStubReturn(getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, propertyUriLiteral));
+ EasyMock.expect(memberExpression.getPath()).andStubReturn(
+ getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, pathUriLiteral));
+ EasyMock.expect(memberExpression.getProperty()).andStubReturn(
+ getPropertyExpressionMockedObj(ExpressionKind.PROPERTY, propertyUriLiteral));
EasyMock.expect(memberExpression.getKind()).andStubReturn(ExpressionKind.MEMBER);
EasyMock.replay(memberExpression);
@@ -302,9 +354,11 @@ public class ODataExpressionParserTest {
try {
EasyMock.expect(edmSimpleType.getName()).andReturn(value);
EasyMock.expect(edmSimpleType.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
- EasyMock.expect(edmSimpleType.valueOfString(value, EdmLiteralKind.URI, getEdmFacetsMockedObj(), null)).andStubReturn(value);
+ EasyMock.expect(edmSimpleType.valueOfString(value, EdmLiteralKind.URI, getEdmFacetsMockedObj(), null))
+ .andStubReturn(value);
EasyMock.expect(edmSimpleType.valueOfString(value, EdmLiteralKind.URI, null, null)).andStubReturn(value);
- EasyMock.expect(edmSimpleType.valueToString(value, EdmLiteralKind.DEFAULT, getEdmFacetsMockedObj())).andStubReturn(value);
+ EasyMock.expect(edmSimpleType.valueToString(value, EdmLiteralKind.DEFAULT, getEdmFacetsMockedObj()))
+ .andStubReturn(value);
EasyMock.expect(edmSimpleType.valueToString(value, EdmLiteralKind.DEFAULT, null)).andStubReturn(value);
} catch (EdmException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
@@ -348,10 +402,12 @@ public class ODataExpressionParserTest {
return mockedEdmMapping;
}
- private BinaryExpression getBinaryExpressionMockedObj(final BinaryOperator operator, final ExpressionKind leftOperandExpKind, final String propertyName, final String literalStr) {
+ private BinaryExpression getBinaryExpressionMockedObj(final BinaryOperator operator,
+ final ExpressionKind leftOperandExpKind, final String propertyName, final String literalStr) {
BinaryExpression binaryExpression = EasyMock.createMock(BinaryExpression.class);
EasyMock.expect(binaryExpression.getKind()).andStubReturn(ExpressionKind.BINARY);
- EasyMock.expect(binaryExpression.getLeftOperand()).andStubReturn(getPropertyExpressionMockedObj(leftOperandExpKind, propertyName));
+ EasyMock.expect(binaryExpression.getLeftOperand()).andStubReturn(
+ getPropertyExpressionMockedObj(leftOperandExpKind, propertyName));
EasyMock.expect(binaryExpression.getOperator()).andStubReturn(operator);
EasyMock.expect(binaryExpression.getRightOperand()).andStubReturn(getLiteralExpressionMockedObj(literalStr));
@@ -359,30 +415,38 @@ public class ODataExpressionParserTest {
return binaryExpression;
}
- private FilterExpression getFilterExpressionMockedObj(final ExpressionKind leftOperandExpKind, final String propertyName) {
+ private FilterExpression getFilterExpressionMockedObj(final ExpressionKind leftOperandExpKind,
+ final String propertyName) {
FilterExpression filterExpression = EasyMock.createMock(FilterExpression.class);
EasyMock.expect(filterExpression.getKind()).andStubReturn(ExpressionKind.FILTER);
- EasyMock.expect(filterExpression.getExpression()).andStubReturn(getPropertyExpressionMockedObj(leftOperandExpKind, propertyName));
+ EasyMock.expect(filterExpression.getExpression()).andStubReturn(
+ getPropertyExpressionMockedObj(leftOperandExpKind, propertyName));
EasyMock.replay(filterExpression);
return filterExpression;
}
- private FilterExpression getFilterExpressionForFunctionsMockedObj(final MethodOperator methodOperator1, final String firstName, final MethodOperator methodOperator2, final String secondName, final Integer parameterCount1, final Integer parameterCount2) {
- //default value handling of SUBSTRINGOF
+ private FilterExpression getFilterExpressionForFunctionsMockedObj(final MethodOperator methodOperator1,
+ final String firstName, final MethodOperator methodOperator2, final String secondName,
+ final Integer parameterCount1, final Integer parameterCount2) {
+ // default value handling of SUBSTRINGOF
FilterExpression filterExpression = EasyMock.createMock(FilterExpression.class);
EasyMock.expect(filterExpression.getKind()).andStubReturn(ExpressionKind.FILTER);
if ((methodOperator2 != null) && (parameterCount2 != null)) {
- EasyMock.expect(filterExpression.getExpression()).andStubReturn(getMultipleMethodExpressionMockedObj(methodOperator1, firstName, methodOperator2, secondName, parameterCount1, parameterCount2));
+ EasyMock.expect(filterExpression.getExpression()).andStubReturn(
+ getMultipleMethodExpressionMockedObj(methodOperator1, firstName, methodOperator2, secondName,
+ parameterCount1, parameterCount2));
} else {
- EasyMock.expect(filterExpression.getExpression()).andStubReturn(getMethodExpressionMockedObj(methodOperator1, firstName, secondName, null, parameterCount1));
+ EasyMock.expect(filterExpression.getExpression()).andStubReturn(
+ getMethodExpressionMockedObj(methodOperator1, firstName, secondName, null, parameterCount1));
}
EasyMock.replay(filterExpression);
return filterExpression;
}
- private CommonExpression getBinaryExpression(final CommonExpression leftOperand, final BinaryOperator operator, final CommonExpression rightOperand) {
+ private CommonExpression getBinaryExpression(final CommonExpression leftOperand, final BinaryOperator operator,
+ final CommonExpression rightOperand) {
BinaryExpression binaryExpression = EasyMock.createMock(BinaryExpression.class);
EasyMock.expect(binaryExpression.getKind()).andStubReturn(ExpressionKind.BINARY);
EasyMock.expect(binaryExpression.getLeftOperand()).andStubReturn(leftOperand);
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAContextImplTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAContextImplTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAContextImplTest.java
index 656d861..10e65c0 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAContextImplTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAContextImplTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAProcessorDefaultTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAProcessorDefaultTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAProcessorDefaultTest.java
index baa2570..af20194 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAProcessorDefaultTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAProcessorDefaultTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa;
@@ -101,7 +101,7 @@ public class ODataJPAProcessorDefaultTest extends JPAEdmTestModelView {
Assert.assertNotNull(objODataJPAProcessorDefault.readEntity(getEntityView, HttpContentType.APPLICATION_XML));
} catch (ODataJPAModelException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
- } catch (ODataJPARuntimeException e1) {//Expected
+ } catch (ODataJPARuntimeException e1) {// Expected
assertTrue(true);
} catch (ODataException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
@@ -112,13 +112,14 @@ public class ODataJPAProcessorDefaultTest extends JPAEdmTestModelView {
@Test
public void testcountEntitySet() {
try {
- ODataResponse countEntitySet = objODataJPAProcessorDefault.countEntitySet(getEntitySetCountUriInfo(), HttpContentType.APPLICATION_XML);
+ ODataResponse countEntitySet =
+ objODataJPAProcessorDefault.countEntitySet(getEntitySetCountUriInfo(), HttpContentType.APPLICATION_XML);
Assert.assertNotNull(countEntitySet);
Object entity = countEntitySet.getEntity();
Assert.assertNotNull(entity);
-
+
byte[] b = new byte[2];
- ((ByteArrayInputStream)entity).read(b);
+ ((ByteArrayInputStream) entity).read(b);
Assert.assertEquals("11", new String(b, Charset.forName("utf-8")));
} catch (ODataException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
@@ -130,8 +131,10 @@ public class ODataJPAProcessorDefaultTest extends JPAEdmTestModelView {
@Test
public void testExistsEntity() {
try {
- Assert.assertNotNull(objODataJPAProcessorDefault.existsEntity(getEntityCountCountUriInfo(), HttpContentType.APPLICATION_XML));
- Assert.assertNull("ContentType MUST NOT set by entity provider", objODataJPAProcessorDefault.existsEntity(getEntityCountCountUriInfo(), HttpContentType.APPLICATION_XML).getHeader(STR_CONTENT_TYPE));
+ Assert.assertNotNull(objODataJPAProcessorDefault.existsEntity(getEntityCountCountUriInfo(),
+ HttpContentType.APPLICATION_XML));
+ Assert.assertNull("ContentType MUST NOT set by entity provider", objODataJPAProcessorDefault.existsEntity(
+ getEntityCountCountUriInfo(), HttpContentType.APPLICATION_XML).getHeader(STR_CONTENT_TYPE));
} catch (ODataException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (Exception e) {
@@ -142,7 +145,8 @@ public class ODataJPAProcessorDefaultTest extends JPAEdmTestModelView {
@Test
public void testDeleteEntity() {
try {
- Assert.assertNotNull(objODataJPAProcessorDefault.deleteEntity(getDeletetUriInfo(), HttpContentType.APPLICATION_XML));
+ Assert.assertNotNull(objODataJPAProcessorDefault.deleteEntity(getDeletetUriInfo(),
+ HttpContentType.APPLICATION_XML));
} catch (ODataException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
@@ -151,18 +155,20 @@ public class ODataJPAProcessorDefaultTest extends JPAEdmTestModelView {
@Test
public void testCreateEntity() {
try {
- Assert.assertNotNull(objODataJPAProcessorDefault.createEntity(getPostUriInfo(), getMockedInputStreamContent(), HttpContentType.APPLICATION_XML, HttpContentType.APPLICATION_XML));
+ Assert.assertNotNull(objODataJPAProcessorDefault.createEntity(getPostUriInfo(), getMockedInputStreamContent(),
+ HttpContentType.APPLICATION_XML, HttpContentType.APPLICATION_XML));
} catch (ODataException e) {
- Assert.assertTrue(true); //Expected TODO - need to revisit
+ Assert.assertTrue(true); // Expected TODO - need to revisit
}
}
@Test
public void testUpdateEntity() {
try {
- Assert.assertNotNull(objODataJPAProcessorDefault.updateEntity(getPutUriInfo(), getMockedInputStreamContent(), HttpContentType.APPLICATION_XML, false, HttpContentType.APPLICATION_XML));
+ Assert.assertNotNull(objODataJPAProcessorDefault.updateEntity(getPutUriInfo(), getMockedInputStreamContent(),
+ HttpContentType.APPLICATION_XML, false, HttpContentType.APPLICATION_XML));
} catch (ODataException e) {
- Assert.assertTrue(true); //Expected TODO - need to revisit
+ Assert.assertTrue(true); // Expected TODO - need to revisit
}
}
@@ -179,7 +185,26 @@ public class ODataJPAProcessorDefaultTest extends JPAEdmTestModelView {
}
private String getEntityBody() {
- return "<entry xmlns=\"http://www.w3.org/2005/Atom\" xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\" xmlns:d=\"http://schemas.microsoft.com/ado/2007/08/dataservices\" xml:base=\"http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/SalesOrderProcessing.svc/\">" + "<content type=\"application/xml\">" + "<m:properties>" + "<d:ID>2</d:ID>" + "<d:CreationDate>2013-01-02T00:00:00</d:CreationDate>" + "<d:CurrencyCode>Code_555</d:CurrencyCode>" + "<d:BuyerAddressInfo m:type=\"SalesOrderProcessing.AddressInfo\">" + "<d:Street>Test_Street_Name_055</d:Street>" + "<d:Number>2</d:Number>" + "<d:Country>Test_Country_2</d:Country>" + "<d:City>Test_City_2</d:City>" + "</d:BuyerAddressInfo>" + "<d:GrossAmount>0.0</d:GrossAmount>" + "<d:BuyerId>2</d:BuyerId>" + "<d:DeliveryStatus>true</d:DeliveryStatus>" + "<d:BuyerName>buyerName_2</d:BuyerName>" + "<d:NetAmount>0.0</d:NetAmount>" + "</m:properties>" + "</content>" + "</entry>";
+ return "<entry xmlns=\"http://www.w3.org/2005/Atom\" " +
+ "xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\" " +
+ "xmlns:d=\"http://schemas.microsoft.com/ado/2007/08/dataservices\" " +
+ "xml:base=\"http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/SalesOrderProcessing.svc/\">"
+ + "<content type=\"application/xml\">"
+ + "<m:properties>"
+ + "<d:ID>2</d:ID>"
+ + "<d:CreationDate>2013-01-02T00:00:00</d:CreationDate>"
+ + "<d:CurrencyCode>Code_555</d:CurrencyCode>"
+ + "<d:BuyerAddressInfo m:type=\"SalesOrderProcessing.AddressInfo\">"
+ + "<d:Street>Test_Street_Name_055</d:Street>"
+ + "<d:Number>2</d:Number>"
+ + "<d:Country>Test_Country_2</d:Country>"
+ + "<d:City>Test_City_2</d:City>"
+ + "</d:BuyerAddressInfo>"
+ + "<d:GrossAmount>0.0</d:GrossAmount>"
+ + "<d:BuyerId>2</d:BuyerId>"
+ + "<d:DeliveryStatus>true</d:DeliveryStatus>"
+ + "<d:BuyerName>buyerName_2</d:BuyerName>"
+ + "<d:NetAmount>0.0</d:NetAmount>" + "</m:properties>" + "</content>" + "</entry>";
}
private GetEntitySetCountUriInfo getEntitySetCountUriInfo() {
@@ -261,7 +286,8 @@ public class ODataJPAProcessorDefaultTest extends JPAEdmTestModelView {
EasyMock.expect(edmEntityType.hasStream()).andStubReturn(false);
EasyMock.expect(edmEntityType.getNavigationPropertyNames()).andStubReturn(new ArrayList<String>());
EasyMock.expect(edmEntityType.getKeyPropertyNames()).andStubReturn(new ArrayList<String>());
- EasyMock.expect(edmEntityType.getMapping()).andStubReturn(getEdmMappingMockedObj(SALES_ORDER));// ID vs Salesorder ID
+ EasyMock.expect(edmEntityType.getMapping()).andStubReturn(getEdmMappingMockedObj(SALES_ORDER));// ID vs Salesorder
+ // ID
EasyMock.replay(edmEntityType);
} catch (EdmException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
@@ -317,9 +343,10 @@ public class ODataJPAProcessorDefaultTest extends JPAEdmTestModelView {
private EntityManager getLocalEntityManager() {
EntityManager em = EasyMock.createMock(EntityManager.class);
EasyMock.expect(em.createQuery("SELECT E1 FROM SalesOrderHeaders E1")).andStubReturn(getQuery());
- EasyMock.expect(em.createQuery("SELECT COUNT ( E1 ) FROM SalesOrderHeaders E1")).andStubReturn(getQueryForSelectCount());
+ EasyMock.expect(em.createQuery("SELECT COUNT ( E1 ) FROM SalesOrderHeaders E1")).andStubReturn(
+ getQueryForSelectCount());
EasyMock.expect(em.getEntityManagerFactory()).andStubReturn(mockEntityManagerFactory2());// For create
- EasyMock.expect(em.getTransaction()).andStubReturn(getLocalTransaction()); //For Delete
+ EasyMock.expect(em.getTransaction()).andStubReturn(getLocalTransaction()); // For Delete
Address obj = new Address();
em.remove(obj);// testing void method
em.flush();
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAResponseBuilderTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAResponseBuilderTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAResponseBuilderTest.java
index 66ad0c8..426f236 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAResponseBuilderTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/ODataJPAResponseBuilderTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa;
@@ -183,7 +183,8 @@ public class ODataJPAResponseBuilderTest extends JPAEdmTestModelView {
@Test
public void testBuildListOfTGetEntitySetUriInfoStringODataJPAContext() {
try {
- assertNotNull(ODataJPAResponseBuilder.build(getJPAEntities(), getResultsView(), "application/xml", getODataJPAContext()));
+ assertNotNull(ODataJPAResponseBuilder.build(getJPAEntities(), getResultsView(), "application/xml",
+ getODataJPAContext()));
} catch (ODataJPARuntimeException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
@@ -214,7 +215,8 @@ public class ODataJPAResponseBuilderTest extends JPAEdmTestModelView {
@Test
public void testBuildObjectGetEntityUriInfoStringODataJPAContext() throws ODataNotFoundException {
try {
- assertNotNull(ODataJPAResponseBuilder.build(new SalesOrderHeader(2, 10), getLocalGetURIInfo(), "application/xml", getODataJPAContext()));
+ assertNotNull(ODataJPAResponseBuilder.build(new SalesOrderHeader(2, 10), getLocalGetURIInfo(), "application/xml",
+ getODataJPAContext()));
} catch (ODataJPARuntimeException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityParserTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityParserTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityParserTest.java
index f41f510..c48bc0a 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityParserTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityParserTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa.access.data;
@@ -38,7 +38,6 @@ import org.apache.olingo.odata2.api.edm.EdmStructuralType;
import org.apache.olingo.odata2.api.edm.EdmType;
import org.apache.olingo.odata2.api.edm.EdmTypeKind;
import org.apache.olingo.odata2.processor.api.jpa.exception.ODataJPARuntimeException;
-import org.apache.olingo.odata2.processor.core.jpa.access.data.JPAEntityParser;
import org.apache.olingo.odata2.processor.core.jpa.common.ODataJPATestConstants;
import org.easymock.EasyMock;
import org.junit.Test;
@@ -429,7 +428,10 @@ public class JPAEntityParserTest {
getGetterName.setAccessible(true);
} catch (NoSuchMethodException e) {
- assertEquals("org.apache.olingo.odata2.processor.core.jpa.access.data.JPAEntityParser.getGetterName1(org.apache.olingo.odata2.api.edm.EdmProperty)", e.getMessage());
+ assertEquals(
+ "org.apache.olingo.odata2.processor.core.jpa.access.data.JPAEntityParser.getGetterName1" +
+ "(org.apache.olingo.odata2.api.edm.EdmProperty)",
+ e.getMessage());
} catch (SecurityException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
@@ -455,7 +457,8 @@ public class JPAEntityParserTest {
try {
EasyMock.expect(structuralType.getPropertyNames()).andStubThrow(new EdmException(null));
EasyMock.replay(structuralType);
- Method getGetters = resultParser.getClass().getDeclaredMethod("getGetters", Object.class, EdmStructuralType.class);
+ Method getGetters =
+ resultParser.getClass().getDeclaredMethod("getGetters", Object.class, EdmStructuralType.class);
getGetters.setAccessible(true);
try {
getGetters.invoke(resultParser, jpaEntity, structuralType);
@@ -467,7 +470,10 @@ public class JPAEntityParserTest {
assertTrue(true);
}
} catch (NoSuchMethodException e) {
- assertEquals("org.apache.olingo.odata2.processor.core.jpa.access.data.JPAEntityParser.getGetters(java.lang.Object, org.apache.olingo.odata2.api.edm.EdmStructuralType)", e.getMessage());
+ assertEquals(
+ "org.apache.olingo.odata2.processor.core.jpa.access.data.JPAEntityParser.getGetters(java.lang.Object, " +
+ "org.apache.olingo.odata2.api.edm.EdmStructuralType)",
+ e.getMessage());
} catch (SecurityException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (EdmException e) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityParserTestForStaticMethods.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityParserTestForStaticMethods.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityParserTestForStaticMethods.java
index 38e48f6..86514b4 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityParserTestForStaticMethods.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityParserTestForStaticMethods.java
@@ -1,32 +1,33 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa.access.data;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import java.lang.reflect.Method;
import org.apache.olingo.odata2.processor.api.jpa.exception.ODataJPARuntimeException;
import org.apache.olingo.odata2.processor.core.jpa.common.ODataJPATestConstants;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
public class JPAEntityParserTestForStaticMethods {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityTest.java
index 300cdf7..8fbbed9 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAEntityTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa.access.data;
@@ -157,7 +157,7 @@ public class JPAEntityTest {
+ ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
JPATypeMock jpaTypeMock = (JPATypeMock) jpaEntity.getJPAEntity();
- assertEquals(jpaTypeMock.getMInt(), 0);//Key should not be changed
+ assertEquals(jpaTypeMock.getMInt(), 0);// Key should not be changed
assertEquals(jpaTypeMock.getMString(), ODataEntryMockUtil.VALUE_MSTRING);
assertTrue(jpaTypeMock.getMDateTime().equals(ODataEntryMockUtil.VALUE_DATE_TIME));
}
@@ -180,7 +180,7 @@ public class JPAEntityTest {
+ ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
JPATypeMock jpaTypeMock = (JPATypeMock) jpaEntity.getJPAEntity();
- assertEquals(jpaTypeMock.getMInt(), 0);//Key should not be changed
+ assertEquals(jpaTypeMock.getMInt(), 0);// Key should not be changed
assertEquals(jpaTypeMock.getMString(), ODataEntryMockUtil.VALUE_MSTRING);
assertTrue(jpaTypeMock.getMDateTime().equals(ODataEntryMockUtil.VALUE_DATE_TIME));
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAExpandCallBackTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAExpandCallBackTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAExpandCallBackTest.java
index a3cf2de..021c353 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAExpandCallBackTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAExpandCallBackTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa.access.data;
@@ -92,7 +92,8 @@ public class JPAExpandCallBackTest {
public void testGetCallbacks() {
Map<String, ODataCallback> callBacks = null;
try {
- URI baseUri = new URI("http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/SalesOrderProcessing.svc/");
+ URI baseUri =
+ new URI("http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/SalesOrderProcessing.svc/");
ExpandSelectTreeNode expandSelectTreeNode = EdmMockUtil.mockExpandSelectTreeNode();
List<ArrayList<NavigationPropertySegment>> expandList = EdmMockUtil.getExpandList();
callBacks = JPAExpandCallBack.getCallbacks(baseUri, expandSelectTreeNode, expandList);
@@ -143,7 +144,8 @@ public class JPAExpandCallBackTest {
private JPAExpandCallBack getJPAExpandCallBackObject() {
Map<String, ODataCallback> callBacks = null;
try {
- URI baseUri = new URI("http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/SalesOrderProcessing.svc/");
+ URI baseUri =
+ new URI("http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/SalesOrderProcessing.svc/");
ExpandSelectTreeNode expandSelectTreeNode = EdmMockUtil.mockExpandSelectTreeNode();
List<ArrayList<NavigationPropertySegment>> expandList = EdmMockUtil.getExpandList();
callBacks = JPAExpandCallBack.getCallbacks(baseUri, expandSelectTreeNode, expandList);
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAFunctionContextTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAFunctionContextTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAFunctionContextTest.java
index 538a001..1b2d7b6 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAFunctionContextTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAFunctionContextTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa.access.data;
@@ -50,7 +50,8 @@ public class JPAFunctionContextTest {
JPAFunctionContext functionContext = null;
try {
if (VARIANT == 0) {
- functionContext = (JPAFunctionContext) JPAMethodContext.createBuilder(JPQLContextType.FUNCTION, getView()).build();
+ functionContext =
+ (JPAFunctionContext) JPAMethodContext.createBuilder(JPQLContextType.FUNCTION, getView()).build();
}
} catch (ODataJPAModelException e) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAProcessorImplTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAProcessorImplTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAProcessorImplTest.java
index 0f345fd..45f0528 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAProcessorImplTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAProcessorImplTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa.access.data;
@@ -66,13 +66,14 @@ import org.junit.Test;
public class JPAProcessorImplTest {
- // -------------------------------- Common Start ------------------------------------common in ODataJPAProcessorDefaultTest as well
+ // -------------------------------- Common Start ------------------------------------common in
+ // ODataJPAProcessorDefaultTest as well
private static final String STR_LOCAL_URI = "http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/";
private static final String SALESORDERPROCESSING_CONTAINER = "salesorderprocessingContainer";
private static final String SO_ID = "SoId";
private static final String SALES_ORDER = "SalesOrder";
private static final String SALES_ORDER_HEADERS = "SalesOrderHeaders";
- //-------------------------------- Common End ------------------------------------
+ // -------------------------------- Common End ------------------------------------
JPAProcessorImpl objJPAProcessorImpl;
@@ -138,7 +139,8 @@ public class JPAProcessorImplTest {
}
}
- // ---------------------------- Common Code Start ---------------- TODO - common in ODataJPAProcessorDefaultTest as well
+ // ---------------------------- Common Code Start ---------------- TODO - common in ODataJPAProcessorDefaultTest as
+ // well
private DeleteUriInfo getDeletetUriInfo() {
UriInfo objUriInfo = EasyMock.createMock(UriInfo.class);
@@ -179,7 +181,7 @@ public class JPAProcessorImplTest {
EasyMock.expect(objUriInfo.getSkip()).andStubReturn(getSkip());
EasyMock.expect(objUriInfo.getInlineCount()).andStubReturn(getInlineCount());
EasyMock.expect(objUriInfo.getFilter()).andStubReturn(getFilter());
- //EasyMock.expect(objUriInfo.getFunctionImport()).andStubReturn(getFunctionImport());
+ // EasyMock.expect(objUriInfo.getFunctionImport()).andStubReturn(getFunctionImport());
EasyMock.expect(objUriInfo.getFunctionImport()).andStubReturn(null);
EasyMock.replay(objUriInfo);
return objUriInfo;
@@ -235,7 +237,8 @@ public class JPAProcessorImplTest {
EasyMock.expect(edmEntityType.hasStream()).andStubReturn(false);
EasyMock.expect(edmEntityType.getNavigationPropertyNames()).andStubReturn(new ArrayList<String>());
EasyMock.expect(edmEntityType.getKeyPropertyNames()).andStubReturn(new ArrayList<String>());
- EasyMock.expect(edmEntityType.getMapping()).andStubReturn(getEdmMappingMockedObj(SALES_ORDER));// ID vs Salesorder ID
+ EasyMock.expect(edmEntityType.getMapping()).andStubReturn(getEdmMappingMockedObj(SALES_ORDER));// ID vs Salesorder
+ // ID
EasyMock.replay(edmEntityType);
} catch (EdmException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
@@ -284,8 +287,9 @@ public class JPAProcessorImplTest {
public EntityManager getLocalEntityManager() {
EntityManager em = EasyMock.createMock(EntityManager.class);
EasyMock.expect(em.createQuery("SELECT E1 FROM SalesOrderHeaders E1")).andStubReturn(getQuery());
- EasyMock.expect(em.createQuery("SELECT COUNT ( E1 ) FROM SalesOrderHeaders E1")).andStubReturn(getQueryForSelectCount());
- EasyMock.expect(em.getTransaction()).andStubReturn(getLocalTransaction()); //For Delete
+ EasyMock.expect(em.createQuery("SELECT COUNT ( E1 ) FROM SalesOrderHeaders E1")).andStubReturn(
+ getQueryForSelectCount());
+ EasyMock.expect(em.getTransaction()).andStubReturn(getLocalTransaction()); // For Delete
em.flush();
em.flush();
Address obj = new Address();
@@ -438,6 +442,6 @@ public class JPAProcessorImplTest {
return uri;
}
- //-------------------------------- Common End ------------------------------------
+ // -------------------------------- Common End ------------------------------------
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmMappingModelServiceTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmMappingModelServiceTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmMappingModelServiceTest.java
index c8f1410..76ea726 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmMappingModelServiceTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmMappingModelServiceTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa.access.model;
@@ -98,12 +98,14 @@ public class JPAEdmMappingModelServiceTest extends JPAEdmMappingModelService {
@Test
public void testMapJPAPersistenceUnit() {
- assertEquals(PERSISTENCE_UNIT_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPAPersistenceUnit(PERSISTENCE_UNIT_NAME_JPA));
+ assertEquals(PERSISTENCE_UNIT_NAME_EDM, objJPAEdmMappingModelServiceTest
+ .mapJPAPersistenceUnit(PERSISTENCE_UNIT_NAME_JPA));
}
@Test
public void testMapJPAPersistenceUnitNegative() {
- assertNull(objJPAEdmMappingModelServiceTest.mapJPAPersistenceUnit(PERSISTENCE_UNIT_NAME_EDM));// Wrong value to bring null
+ assertNull(objJPAEdmMappingModelServiceTest.mapJPAPersistenceUnit(PERSISTENCE_UNIT_NAME_EDM));// Wrong value to
+ // bring null
}
@Test
@@ -113,7 +115,8 @@ public class JPAEdmMappingModelServiceTest extends JPAEdmMappingModelService {
@Test
public void testMapJPAEntityTypeNegative() {
- assertNull(objJPAEdmMappingModelServiceTest.mapJPAEntityType(ENTITY_TYPE_NAME_JPA_WRONG));// Wrong value to bring null
+ assertNull(objJPAEdmMappingModelServiceTest.mapJPAEntityType(ENTITY_TYPE_NAME_JPA_WRONG));// Wrong value to bring
+ // null
}
@Test
@@ -123,27 +126,32 @@ public class JPAEdmMappingModelServiceTest extends JPAEdmMappingModelService {
@Test
public void testMapJPAEntitySetNegative() {
- assertNull(objJPAEdmMappingModelServiceTest.mapJPAEntitySet(ENTITY_TYPE_NAME_JPA_WRONG));// Wrong value to bring null
+ assertNull(objJPAEdmMappingModelServiceTest.mapJPAEntitySet(ENTITY_TYPE_NAME_JPA_WRONG));// Wrong value to bring
+ // null
}
@Test
public void testMapJPAAttribute() {
- assertEquals(ATTRIBUTE_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPAAttribute(ENTITY_TYPE_NAME_JPA, ATTRIBUTE_NAME_JPA));
+ assertEquals(ATTRIBUTE_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPAAttribute(ENTITY_TYPE_NAME_JPA,
+ ATTRIBUTE_NAME_JPA));
}
@Test
public void testMapJPAAttributeNegative() {
- assertNull(objJPAEdmMappingModelServiceTest.mapJPAAttribute(ENTITY_TYPE_NAME_JPA, ATTRIBUTE_NAME_JPA + "AA"));// Wrong value to bring null
+ // Wrong value to bring null
+ assertNull(objJPAEdmMappingModelServiceTest.mapJPAAttribute(ENTITY_TYPE_NAME_JPA, ATTRIBUTE_NAME_JPA + "AA"));
}
@Test
public void testMapJPARelationship() {
- assertEquals(RELATIONSHIP_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPARelationship(ENTITY_TYPE_NAME_JPA, RELATIONSHIP_NAME_JPA));
+ assertEquals(RELATIONSHIP_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPARelationship(ENTITY_TYPE_NAME_JPA,
+ RELATIONSHIP_NAME_JPA));
}
@Test
public void testMapJPARelationshipNegative() {
- assertNull(objJPAEdmMappingModelServiceTest.mapJPARelationship(ENTITY_TYPE_NAME_JPA, RELATIONSHIP_NAME_JPA_WRONG));// Wrong value to bring null
+ // Wrong value to bring null
+ assertNull(objJPAEdmMappingModelServiceTest.mapJPARelationship(ENTITY_TYPE_NAME_JPA, RELATIONSHIP_NAME_JPA_WRONG));
}
@Test
@@ -153,17 +161,20 @@ public class JPAEdmMappingModelServiceTest extends JPAEdmMappingModelService {
@Test
public void testMapJPAEmbeddableTypeNegative() {
- assertNull(objJPAEdmMappingModelServiceTest.mapJPAEmbeddableType(EMBEDDABLE_TYPE_NAME_JPA_WRONG));// Wrong value to bring null
+ assertNull(objJPAEdmMappingModelServiceTest.mapJPAEmbeddableType(EMBEDDABLE_TYPE_NAME_JPA_WRONG));// Wrong value to
+ // bring null
}
@Test
public void testMapJPAEmbeddableTypeAttribute() {
- assertEquals(EMBEDDABLE_ATTRIBUTE_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPAEmbeddableTypeAttribute(EMBEDDABLE_TYPE_NAME_JPA, EMBEDDABLE_ATTRIBUTE_NAME_JPA));
+ assertEquals(EMBEDDABLE_ATTRIBUTE_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPAEmbeddableTypeAttribute(
+ EMBEDDABLE_TYPE_NAME_JPA, EMBEDDABLE_ATTRIBUTE_NAME_JPA));
}
@Test
public void testMapJPAEmbeddableTypeAttributeNegative() {
- assertNull(objJPAEdmMappingModelServiceTest.mapJPAEmbeddableTypeAttribute(EMBEDDABLE_TYPE_NAME_JPA_WRONG, EMBEDDABLE_ATTRIBUTE_NAME_JPA));
+ assertNull(objJPAEdmMappingModelServiceTest.mapJPAEmbeddableTypeAttribute(EMBEDDABLE_TYPE_NAME_JPA_WRONG,
+ EMBEDDABLE_ATTRIBUTE_NAME_JPA));
}
@Test
@@ -173,7 +184,8 @@ public class JPAEdmMappingModelServiceTest extends JPAEdmMappingModelService {
@Test
public void testCheckExclusionOfJPAAttributeType() {
- assertTrue(!objJPAEdmMappingModelServiceTest.checkExclusionOfJPAAttributeType(ENTITY_TYPE_NAME_JPA, ATTRIBUTE_NAME_JPA));
+ assertTrue(!objJPAEdmMappingModelServiceTest.checkExclusionOfJPAAttributeType(ENTITY_TYPE_NAME_JPA,
+ ATTRIBUTE_NAME_JPA));
}
@Test
@@ -183,7 +195,8 @@ public class JPAEdmMappingModelServiceTest extends JPAEdmMappingModelService {
@Test
public void testCheckExclusionOfJPAEmbeddableAttributeType() {
- assertTrue(!objJPAEdmMappingModelServiceTest.checkExclusionOfJPAEmbeddableAttributeType(EMBEDDABLE_TYPE_NAME_JPA, EMBEDDABLE_ATTRIBUTE_NAME_JPA));
+ assertTrue(!objJPAEdmMappingModelServiceTest.checkExclusionOfJPAEmbeddableAttributeType(EMBEDDABLE_TYPE_NAME_JPA,
+ EMBEDDABLE_ATTRIBUTE_NAME_JPA));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmNameBuilderTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmNameBuilderTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmNameBuilderTest.java
index b82ad5b..f1e55e3 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmNameBuilderTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmNameBuilderTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa.access.model;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPATypeConvertorTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPATypeConvertorTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPATypeConvertorTest.java
index 27e4e6e..3a4057f 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPATypeConvertorTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPATypeConvertorTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa.access.model;
@@ -68,8 +68,10 @@ public class JPATypeConvertorTest {
edmSimpleKindTypeBigDecimal = JPATypeConvertor.convertToEdmSimpleType(bigDecimalObj.getClass(), null);
edmSimpleKindTypeByte = JPATypeConvertor.convertToEdmSimpleType(byteObj.getClass(), null);
edmSimpleKindTypeBoolean = JPATypeConvertor.convertToEdmSimpleType(booleanObj.getClass(), null);
- /*edmSimpleKindTypeDate = JPATypeConvertor
- .convertToEdmSimpleType(dateObj.getClass(),null);*/
+ /*
+ * edmSimpleKindTypeDate = JPATypeConvertor
+ * .convertToEdmSimpleType(dateObj.getClass(),null);
+ */
edmSimpleKindTypeUUID = JPATypeConvertor.convertToEdmSimpleType(uUID.getClass(), null);
} catch (ODataJPAModelException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
@@ -85,7 +87,7 @@ public class JPATypeConvertorTest {
assertEquals(EdmSimpleTypeKind.Decimal, edmSimpleKindTypeBigDecimal);
assertEquals(EdmSimpleTypeKind.Byte, edmSimpleKindTypeByte);
assertEquals(EdmSimpleTypeKind.Boolean, edmSimpleKindTypeBoolean);
- //assertEquals(EdmSimpleTypeKind.DateTime, edmSimpleKindTypeDate);
+ // assertEquals(EdmSimpleTypeKind.DateTime, edmSimpleKindTypeDate);
assertEquals(EdmSimpleTypeKind.Guid, edmSimpleKindTypeUUID);
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/common/ODataJPATestConstants.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/common/ODataJPATestConstants.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/common/ODataJPATestConstants.java
index 4d4b9e4..cd6caee 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/common/ODataJPATestConstants.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/common/ODataJPATestConstants.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * 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
+ * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.processor.core.jpa.common;