You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2013/07/31 10:13:01 UTC
[16/22] eliminate checkstyle warnings
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1e5280b7/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/TestUtil.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/TestUtil.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/TestUtil.java
index f238a99..a30d1b3 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/TestUtil.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/access/data/TestUtil.java
@@ -27,8 +27,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.easymock.EasyMock;
-
import org.apache.olingo.odata2.api.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.edm.EdmEntityType;
import org.apache.olingo.odata2.api.edm.EdmException;
@@ -45,17 +43,16 @@ import org.apache.olingo.odata2.api.uri.ExpandSelectTreeNode;
import org.apache.olingo.odata2.api.uri.NavigationPropertySegment;
import org.apache.olingo.odata2.processor.core.jpa.common.ODataJPATestConstants;
import org.apache.olingo.odata2.processor.core.jpa.cud.SalesOrderLineItem;
+import org.easymock.EasyMock;
public class TestUtil {
public static ExpandSelectTreeNode mockExpandSelectTreeNode() {
- ExpandSelectTreeNode nextExpandNode = EasyMock
- .createMock(ExpandSelectTreeNode.class);
+ ExpandSelectTreeNode nextExpandNode = EasyMock.createMock(ExpandSelectTreeNode.class);
Map<String, ExpandSelectTreeNode> nextLink = null;
EasyMock.expect(nextExpandNode.getLinks()).andStubReturn(nextLink);
EasyMock.replay(nextExpandNode);
- ExpandSelectTreeNode expandNode = EasyMock
- .createMock(ExpandSelectTreeNode.class);
+ ExpandSelectTreeNode expandNode = EasyMock.createMock(ExpandSelectTreeNode.class);
Map<String, ExpandSelectTreeNode> links = new HashMap<String, ExpandSelectTreeNode>();
links.put("SalesOrderLineItemDetails", nextExpandNode);
EasyMock.expect(expandNode.getLinks()).andStubReturn(links);
@@ -64,8 +61,7 @@ public class TestUtil {
}
public static ExpandSelectTreeNode mockCurrentExpandSelectTreeNode() {
- ExpandSelectTreeNode expandNode = EasyMock
- .createMock(ExpandSelectTreeNode.class);
+ ExpandSelectTreeNode expandNode = EasyMock.createMock(ExpandSelectTreeNode.class);
Map<String, ExpandSelectTreeNode> links = new HashMap<String, ExpandSelectTreeNode>();
EasyMock.expect(expandNode.getLinks()).andStubReturn(links);
EasyMock.replay(expandNode);
@@ -86,15 +82,13 @@ public class TestUtil {
try {
selfLink = new URI("SalesOrders(2L)/SalesOrderLineItemDetails");
writeContext.setSelfLink(selfLink);
- writeContext
- .setCurrentExpandSelectTreeNode(mockCurrentExpandSelectTreeNode());
+ writeContext.setCurrentExpandSelectTreeNode(mockCurrentExpandSelectTreeNode());
writeContext.setNavigationProperty(mockNavigationProperty());
writeContext.setSourceEntitySet(mockSourceEntitySet());
writeContext.setEntryData(getFeedData());
} catch (URISyntaxException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
return writeContext;
@@ -102,8 +96,7 @@ public class TestUtil {
public static WriteEntryCallbackContext getWriteEntryCallBackContext() {
WriteEntryCallbackContext writeContext = new WriteEntryCallbackContext();
- writeContext
- .setCurrentExpandSelectTreeNode(mockCurrentExpandSelectTreeNode());
+ writeContext.setCurrentExpandSelectTreeNode(mockCurrentExpandSelectTreeNode());
writeContext.setNavigationProperty(mockNavigationProperty());
writeContext.setSourceEntitySet(mockSourceEntitySet());
writeContext.setEntryData(getEntryData());
@@ -113,11 +106,9 @@ public class TestUtil {
private static EdmEntitySet mockSourceEntitySet() {
EdmEntitySet entitySet = EasyMock.createMock(EdmEntitySet.class);
try {
- EasyMock.expect(entitySet.getEntityType()).andStubReturn(
- mockSourceEdmEntityType());
+ EasyMock.expect(entitySet.getEntityType()).andStubReturn(mockSourceEdmEntityType());
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(entitySet);
return entitySet;
@@ -132,27 +123,19 @@ public class TestUtil {
propertyNames.add("description");
navigationPropertyNames.add("SalesOrderLineItemDetails");
try {
- EasyMock.expect(mapping.getInternalName()).andStubReturn(
- "SalesOrderHeader");
+ EasyMock.expect(mapping.getInternalName()).andStubReturn("SalesOrderHeader");
EasyMock.replay(mapping);
- EasyMock.expect(entityType.getName()).andStubReturn(
- "SalesOrderHeader");
+ EasyMock.expect(entityType.getName()).andStubReturn("SalesOrderHeader");
EasyMock.expect(entityType.getMapping()).andStubReturn(mapping);
- EasyMock.expect(entityType.getNavigationPropertyNames())
- .andStubReturn(navigationPropertyNames);
- EasyMock.expect(entityType.getProperty("SalesOrderLineItemDetails"))
- .andStubReturn(mockNavigationProperty());
+ EasyMock.expect(entityType.getNavigationPropertyNames()).andStubReturn(navigationPropertyNames);
+ EasyMock.expect(entityType.getProperty("SalesOrderLineItemDetails")).andStubReturn(mockNavigationProperty());
EdmProperty property1 = mockEdmPropertyOfSource1();
- EasyMock.expect(entityType.getProperty("id")).andStubReturn(
- property1);
- EasyMock.expect(entityType.getProperty("description"))
- .andStubReturn(mockEdmPropertyOfSource2());
- EasyMock.expect(entityType.getPropertyNames()).andStubReturn(
- propertyNames);
+ EasyMock.expect(entityType.getProperty("id")).andStubReturn(property1);
+ EasyMock.expect(entityType.getProperty("description")).andStubReturn(mockEdmPropertyOfSource2());
+ EasyMock.expect(entityType.getPropertyNames()).andStubReturn(propertyNames);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(entityType);
return entityType;
@@ -171,8 +154,7 @@ public class TestUtil {
EasyMock.expect(edmProperty.getType()).andStubReturn(type);
EasyMock.expect(edmProperty.getMapping()).andStubReturn(mapping);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(edmProperty);
return edmProperty;
@@ -191,8 +173,7 @@ public class TestUtil {
EasyMock.expect(edmProperty.getType()).andStubReturn(type);
EasyMock.expect(edmProperty.getMapping()).andStubReturn(mapping);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(edmProperty);
return edmProperty;
@@ -218,46 +199,33 @@ public class TestUtil {
}
private static NavigationPropertySegment mockNavigationPropertySegment() {
- NavigationPropertySegment navigationPropSegment = EasyMock
- .createMock(NavigationPropertySegment.class);
- EasyMock.expect(navigationPropSegment.getNavigationProperty())
- .andStubReturn(mockNavigationProperty());
- EasyMock.expect(navigationPropSegment.getTargetEntitySet())
- .andStubReturn(mockTargetEntitySet());
+ NavigationPropertySegment navigationPropSegment = EasyMock.createMock(NavigationPropertySegment.class);
+ EasyMock.expect(navigationPropSegment.getNavigationProperty()).andStubReturn(mockNavigationProperty());
+ EasyMock.expect(navigationPropSegment.getTargetEntitySet()).andStubReturn(mockTargetEntitySet());
EasyMock.replay(navigationPropSegment);
return navigationPropSegment;
}
- public static NavigationPropertySegment mockThirdNavigationPropertySegment()
- {
- NavigationPropertySegment navigationPropSegment = EasyMock
- .createMock(NavigationPropertySegment.class);
- EasyMock.expect(navigationPropSegment.getNavigationProperty())
- .andStubReturn(mockSecondNavigationProperty());
- EasyMock.expect(navigationPropSegment.getTargetEntitySet())
- .andStubReturn(mockThirdEntitySet());
+ public static NavigationPropertySegment mockThirdNavigationPropertySegment() {
+ NavigationPropertySegment navigationPropSegment = EasyMock.createMock(NavigationPropertySegment.class);
+ EasyMock.expect(navigationPropSegment.getNavigationProperty()).andStubReturn(mockSecondNavigationProperty());
+ EasyMock.expect(navigationPropSegment.getTargetEntitySet()).andStubReturn(mockThirdEntitySet());
EasyMock.replay(navigationPropSegment);
return navigationPropSegment;
}
public static EdmNavigationProperty mockSecondNavigationProperty() {
- EdmNavigationProperty navigationProperty = EasyMock
- .createMock(EdmNavigationProperty.class);
+ EdmNavigationProperty navigationProperty = EasyMock.createMock(EdmNavigationProperty.class);
EdmMapping mapping = EasyMock.createMock(EdmMapping.class);
- EasyMock.expect(mapping.getInternalName()).andStubReturn(
- "materials");
+ EasyMock.expect(mapping.getInternalName()).andStubReturn("materials");
EasyMock.replay(mapping);
try {
- EasyMock.expect(navigationProperty.getMultiplicity())
- .andStubReturn(EdmMultiplicity.ONE);
- EasyMock.expect(navigationProperty.getMapping()).andStubReturn(
- mapping);
- EasyMock.expect(navigationProperty.getName()).andStubReturn(
- "MaterialDetails");
+ EasyMock.expect(navigationProperty.getMultiplicity()).andStubReturn(EdmMultiplicity.ONE);
+ EasyMock.expect(navigationProperty.getMapping()).andStubReturn(mapping);
+ EasyMock.expect(navigationProperty.getName()).andStubReturn("MaterialDetails");
EasyMock.expect(navigationProperty.getFromRole()).andStubReturn("SalesOrderLineItem");
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(navigationProperty);
return navigationProperty;
@@ -266,11 +234,9 @@ public class TestUtil {
public static EdmEntitySet mockTargetEntitySet() {
EdmEntitySet entitySet = EasyMock.createMock(EdmEntitySet.class);
try {
- EasyMock.expect(entitySet.getEntityType()).andStubReturn(
- mockTargetEdmEntityType());
+ EasyMock.expect(entitySet.getEntityType()).andStubReturn(mockTargetEdmEntityType());
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(entitySet);
return entitySet;
@@ -279,11 +245,9 @@ public class TestUtil {
public static EdmEntitySet mockThirdEntitySet() {
EdmEntitySet entitySet = EasyMock.createMock(EdmEntitySet.class);
try {
- EasyMock.expect(entitySet.getEntityType()).andStubReturn(
- mockThirdEdmEntityType());
+ EasyMock.expect(entitySet.getEntityType()).andStubReturn(mockThirdEdmEntityType());
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(entitySet);
return entitySet;
@@ -297,21 +261,16 @@ public class TestUtil {
List<String> propertyNames = new ArrayList<String>();
propertyNames.add("price");
try {
- EasyMock.expect(mapping.getInternalName()).andStubReturn(
- "Material");
+ EasyMock.expect(mapping.getInternalName()).andStubReturn("Material");
EasyMock.replay(mapping);
- EasyMock.expect(entityType.getName()).andStubReturn(
- "Material");
+ EasyMock.expect(entityType.getName()).andStubReturn("Material");
EasyMock.expect(entityType.getMapping()).andStubReturn(mapping);
EdmProperty property = mockEdmPropertyOfTarget();
- EasyMock.expect(entityType.getProperty("price")).andStubReturn(
- property);
- EasyMock.expect(entityType.getPropertyNames()).andStubReturn(
- propertyNames);
+ EasyMock.expect(entityType.getProperty("price")).andStubReturn(property);
+ EasyMock.expect(entityType.getPropertyNames()).andStubReturn(propertyNames);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(entityType);
return entityType;
@@ -324,21 +283,16 @@ public class TestUtil {
List<String> propertyNames = new ArrayList<String>();
propertyNames.add("price");
try {
- EasyMock.expect(mapping.getInternalName()).andStubReturn(
- "SalesOrderLineItem");
+ EasyMock.expect(mapping.getInternalName()).andStubReturn("SalesOrderLineItem");
EasyMock.replay(mapping);
- EasyMock.expect(entityType.getName()).andStubReturn(
- "SalesOrderLineItem");
+ EasyMock.expect(entityType.getName()).andStubReturn("SalesOrderLineItem");
EasyMock.expect(entityType.getMapping()).andStubReturn(mapping);
EdmProperty property = mockEdmPropertyOfTarget();
- EasyMock.expect(entityType.getProperty("price")).andStubReturn(
- property);
- EasyMock.expect(entityType.getPropertyNames()).andStubReturn(
- propertyNames);
+ EasyMock.expect(entityType.getProperty("price")).andStubReturn(property);
+ EasyMock.expect(entityType.getPropertyNames()).andStubReturn(propertyNames);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(entityType);
return entityType;
@@ -358,31 +312,24 @@ public class TestUtil {
EasyMock.expect(edmProperty.getType()).andStubReturn(type);
EasyMock.expect(edmProperty.getMapping()).andStubReturn(mapping);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(edmProperty);
return edmProperty;
}
public static EdmNavigationProperty mockNavigationProperty() {
- EdmNavigationProperty navigationProperty = EasyMock
- .createMock(EdmNavigationProperty.class);
+ EdmNavigationProperty navigationProperty = EasyMock.createMock(EdmNavigationProperty.class);
EdmMapping mapping = EasyMock.createMock(EdmMapping.class);
- EasyMock.expect(mapping.getInternalName()).andStubReturn(
- "salesOrderLineItems");
+ EasyMock.expect(mapping.getInternalName()).andStubReturn("salesOrderLineItems");
EasyMock.replay(mapping);
try {
- EasyMock.expect(navigationProperty.getMultiplicity())
- .andStubReturn(EdmMultiplicity.MANY);
- EasyMock.expect(navigationProperty.getMapping()).andStubReturn(
- mapping);
- EasyMock.expect(navigationProperty.getName()).andStubReturn(
- "SalesOrderLineItemDetails");
+ EasyMock.expect(navigationProperty.getMultiplicity()).andStubReturn(EdmMultiplicity.MANY);
+ EasyMock.expect(navigationProperty.getMapping()).andStubReturn(mapping);
+ EasyMock.expect(navigationProperty.getName()).andStubReturn("SalesOrderLineItemDetails");
EasyMock.expect(navigationProperty.getFromRole()).andStubReturn("SalesOrderHeader");
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(navigationProperty);
return navigationProperty;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1e5280b7/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 e9b89dd..c8f1410 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
@@ -26,11 +26,10 @@ import static org.junit.Assert.assertTrue;
import java.io.InputStream;
+import org.apache.olingo.odata2.processor.core.jpa.mock.ODataJPAContextMock;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.apache.olingo.odata2.processor.core.jpa.mock.ODataJPAContextMock;
-
public class JPAEdmMappingModelServiceTest extends JPAEdmMappingModelService {
private static JPAEdmMappingModelServiceTest objJPAEdmMappingModelServiceTest;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1e5280b7/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 d94a192..b82ad5b 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
@@ -21,9 +21,6 @@ package org.apache.olingo.odata2.processor.core.jpa.access.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import org.easymock.EasyMock;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.edm.provider.ComplexProperty;
import org.apache.olingo.odata2.processor.api.jpa.model.JPAEdmComplexPropertyView;
import org.apache.olingo.odata2.processor.api.jpa.model.JPAEdmEntityTypeView;
@@ -31,6 +28,8 @@ import org.apache.olingo.odata2.processor.api.jpa.model.JPAEdmPropertyView;
import org.apache.olingo.odata2.processor.core.jpa.ODataJPAContextImpl;
import org.apache.olingo.odata2.processor.core.jpa.mock.model.JPAAttributeMock;
import org.apache.olingo.odata2.processor.core.jpa.mock.model.JPAEntityTypeMock;
+import org.easymock.EasyMock;
+import org.junit.Test;
public class JPAEdmNameBuilderTest {
@@ -60,8 +59,7 @@ public class JPAEdmNameBuilderTest {
}
@SuppressWarnings("hiding")
- class JAttribute<Object, String> extends JPAAttributeMock<Object, java.lang.String>
- {
+ class JAttribute<Object, String> extends JPAAttributeMock<Object, java.lang.String> {
@Override
public java.lang.String getName() {
@@ -75,8 +73,7 @@ public class JPAEdmNameBuilderTest {
}
- class JEntityType<Object> extends JPAEntityTypeMock<Object>
- {
+ class JEntityType<Object> extends JPAEntityTypeMock<Object> {
@Override
public java.lang.String getName() {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1e5280b7/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 7d0e9b1..27e4e6e 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
@@ -24,11 +24,10 @@ import static org.junit.Assert.fail;
import java.math.BigDecimal;
import java.util.UUID;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
import org.apache.olingo.odata2.processor.api.jpa.exception.ODataJPAModelException;
import org.apache.olingo.odata2.processor.core.jpa.common.ODataJPATestConstants;
+import org.junit.Test;
public class JPATypeConvertorTest {
@@ -59,30 +58,19 @@ public class JPATypeConvertorTest {
UUID uUID = new UUID(0, 0);
try {
- edmSimpleKindTypeString = JPATypeConvertor
- .convertToEdmSimpleType(str.getClass(), null);
- edmSimpleKindTypeByteArr = JPATypeConvertor
- .convertToEdmSimpleType(byteArr.getClass(), null);
- edmSimpleKindTypeLong = JPATypeConvertor
- .convertToEdmSimpleType(longObj.getClass(), null);
- edmSimpleKindTypeShort = JPATypeConvertor
- .convertToEdmSimpleType(shortObj.getClass(), null);
- edmSimpleKindTypeInteger = JPATypeConvertor
- .convertToEdmSimpleType(integerObj.getClass(), null);
- edmSimpleKindTypeDouble = JPATypeConvertor
- .convertToEdmSimpleType(doubleObj.getClass(), null);
- edmSimpleKindTypeFloat = JPATypeConvertor
- .convertToEdmSimpleType(floatObj.getClass(), null);
- edmSimpleKindTypeBigDecimal = JPATypeConvertor
- .convertToEdmSimpleType(bigDecimalObj.getClass(), null);
- edmSimpleKindTypeByte = JPATypeConvertor
- .convertToEdmSimpleType(byteObj.getClass(), null);
- edmSimpleKindTypeBoolean = JPATypeConvertor
- .convertToEdmSimpleType(booleanObj.getClass(), null);
+ edmSimpleKindTypeString = JPATypeConvertor.convertToEdmSimpleType(str.getClass(), null);
+ edmSimpleKindTypeByteArr = JPATypeConvertor.convertToEdmSimpleType(byteArr.getClass(), null);
+ edmSimpleKindTypeLong = JPATypeConvertor.convertToEdmSimpleType(longObj.getClass(), null);
+ edmSimpleKindTypeShort = JPATypeConvertor.convertToEdmSimpleType(shortObj.getClass(), null);
+ edmSimpleKindTypeInteger = JPATypeConvertor.convertToEdmSimpleType(integerObj.getClass(), null);
+ edmSimpleKindTypeDouble = JPATypeConvertor.convertToEdmSimpleType(doubleObj.getClass(), null);
+ edmSimpleKindTypeFloat = JPATypeConvertor.convertToEdmSimpleType(floatObj.getClass(), null);
+ edmSimpleKindTypeBigDecimal = JPATypeConvertor.convertToEdmSimpleType(bigDecimalObj.getClass(), null);
+ edmSimpleKindTypeByte = JPATypeConvertor.convertToEdmSimpleType(byteObj.getClass(), null);
+ edmSimpleKindTypeBoolean = JPATypeConvertor.convertToEdmSimpleType(booleanObj.getClass(), null);
/*edmSimpleKindTypeDate = JPATypeConvertor
.convertToEdmSimpleType(dateObj.getClass(),null);*/
- edmSimpleKindTypeUUID = JPATypeConvertor
- .convertToEdmSimpleType(uUID.getClass(), null);
+ edmSimpleKindTypeUUID = JPATypeConvertor.convertToEdmSimpleType(uUID.getClass(), null);
} catch (ODataJPAModelException 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/1e5280b7/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPACreateRequestTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPACreateRequestTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPACreateRequestTest.java
index 8e75313..8357df5 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPACreateRequestTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPACreateRequestTest.java
@@ -31,8 +31,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.edm.EdmStructuralType;
import org.apache.olingo.odata2.api.ep.entry.ODataEntry;
@@ -45,6 +43,7 @@ import org.apache.olingo.odata2.core.ep.feed.ODataFeedImpl;
import org.apache.olingo.odata2.core.uri.ExpandSelectTreeNodeImpl;
import org.apache.olingo.odata2.processor.api.jpa.exception.ODataJPARuntimeException;
import org.apache.olingo.odata2.processor.core.jpa.common.ODataJPATestConstants;
+import org.junit.Test;
public class JPACreateRequestTest {
@@ -59,34 +58,28 @@ public class JPACreateRequestTest {
if (e.isCausedByMessageException()) {
assertTrue(true);
} else {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
}
@Test
- public void testGetSetterName()
- {
+ public void testGetSetterName() {
JPACreateRequest createRequest = new JPACreateRequest();
Method method = getMethodForTesting("getSetterName", createRequest);
- if (method != null)
- {
+ if (method != null) {
method.setAccessible(true);
Object[] actualParams = { "salesOrderItems" };
try {
String result = (String) method.invoke(createRequest, actualParams);
assertEquals("setSalesOrderItems", result);
} catch (IllegalArgumentException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (IllegalAccessException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (InvocationTargetException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
@@ -100,8 +93,7 @@ public class JPACreateRequestTest {
try {
result = createRequest.parse2JPAEntityValueMap(JPATestUtil.getJPAEntity(), edmEntityType, JPATestUtil.getPropertyValueMap(), "SalesOrderHeader");
} catch (ODataJPARuntimeException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
assertNotNull(result);
assertEquals(((SalesOrderHeader) result).getId(), 1);
@@ -109,12 +101,10 @@ public class JPACreateRequestTest {
}
@Test
- public void testCreateInlinedEntities()
- {
+ public void testCreateInlinedEntities() {
JPACreateRequest createRequest = new JPACreateRequest(JPATestUtil.mockMetaModel());
Method method = getMethodForTesting("createInlinedEntities", createRequest);
- if (method != null)
- {
+ if (method != null) {
method.setAccessible(true);
EdmEntitySet edmEntitySet = JPATestUtil.mockSourceEdmEntitySet();
ODataEntryImpl odataEntry = createODataEntry();
@@ -124,14 +114,11 @@ public class JPACreateRequestTest {
method.invoke(createRequest, actualParams);
} catch (IllegalArgumentException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (IllegalAccessException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (InvocationTargetException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
@@ -139,12 +126,10 @@ public class JPACreateRequestTest {
}
@Test
- public void testGetSettersForNavigationProperties()
- {
+ public void testGetSettersForNavigationProperties() {
JPACreateRequest createRequest = new JPACreateRequest();
Method method = getMethodForTesting("getSettersForNavigationProperties", createRequest);
- if (method != null)
- {
+ if (method != null) {
method.setAccessible(true);
Map<String, Class<?>> relatedClassMap = new HashMap<String, Class<?>>();
relatedClassMap.put("salesOrderLineItems", SalesOrderLineItem.class);
@@ -154,27 +139,22 @@ public class JPACreateRequestTest {
List<HashMap<?, ?>> result = (List<HashMap<?, ?>>) method.invoke(createRequest, actualParams);
assertEquals(2, result.size());
} catch (IllegalArgumentException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (IllegalAccessException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (InvocationTargetException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
}
@Test
- public void testSetNavigationProperties()
- {
+ public void testSetNavigationProperties() {
JPACreateRequest createRequest = new JPACreateRequest();
Method method = getMethodForTesting("setNavigationProperties", createRequest);
- if (method != null)
- {
+ if (method != null) {
method.setAccessible(true);
Map<String, Class<?>> relatedClassMap = new HashMap<String, Class<?>>();
relatedClassMap.put("salesOrderLineItems", SalesOrderLineItem.class);
@@ -190,21 +170,17 @@ public class JPACreateRequestTest {
// If no exception is thrown then we assert true
assertTrue(true);
} catch (IllegalArgumentException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (IllegalAccessException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (InvocationTargetException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
}
@Test
- public void testPopulateEmbeddableKey()
- {
+ public void testPopulateEmbeddableKey() {
JPACreateRequest createRequest = new JPACreateRequest();
Method method = getMethodForTesting("populateEmbeddableKey", createRequest);
if (method != null) {
@@ -231,24 +207,19 @@ public class JPACreateRequestTest {
field.set(createRequest, jpaEmbeddableObjectKeyMap);
method.invoke(createRequest, actualParams);
} catch (IllegalArgumentException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (IllegalAccessException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (InvocationTargetException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (SecurityException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
}
@Test
- public void testPopulateEmbeddableKeyInvocationIssue()
- {
+ public void testPopulateEmbeddableKeyInvocationIssue() {
JPACreateRequest createRequest = new JPACreateRequest();
Method method = getMethodForTesting("populateEmbeddableKey", createRequest);
if (method != null) {
@@ -276,23 +247,19 @@ public class JPACreateRequestTest {
field.set(createRequest, jpaEmbeddableObjectKeyMap);
method.invoke(createRequest, actualParams);
} catch (IllegalArgumentException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (IllegalAccessException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (InvocationTargetException e) {
assertTrue(true);
} catch (SecurityException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
}
@Test
- public void testPopulateEmbeddableKeyNoSuchMethod()
- {
+ public void testPopulateEmbeddableKeyNoSuchMethod() {
JPACreateRequest createRequest = new JPACreateRequest();
Method method = getMethodForTesting("populateEmbeddableKey", createRequest);
if (method != null) {
@@ -319,16 +286,13 @@ public class JPACreateRequestTest {
field.set(createRequest, jpaEmbeddableObjectKeyMap);
method.invoke(createRequest, actualParams);
} catch (IllegalArgumentException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (IllegalAccessException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (InvocationTargetException e) {
assertTrue(true);
} catch (SecurityException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
}
@@ -359,12 +323,10 @@ public class JPACreateRequestTest {
return odataEntry;
}
- private Method getMethodForTesting(final String methodName, final Object object)
- {
+ private Method getMethodForTesting(final String methodName, final Object object) {
Method method = null;
for (Method m : object.getClass().getDeclaredMethods()) {
- if (m.getName().equals(methodName))
- {
+ if (m.getName().equals(methodName)) {
method = m;
break;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1e5280b7/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPATestUtil.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPATestUtil.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPATestUtil.java
index 586363b..bee5b79 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPATestUtil.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPATestUtil.java
@@ -39,8 +39,6 @@ import javax.persistence.metamodel.SetAttribute;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.Type;
-import org.easymock.EasyMock;
-
import org.apache.olingo.odata2.api.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.edm.EdmEntityType;
import org.apache.olingo.odata2.api.edm.EdmException;
@@ -56,11 +54,11 @@ import org.apache.olingo.odata2.api.uri.info.PostUriInfo;
import org.apache.olingo.odata2.api.uri.info.PutMergePatchUriInfo;
import org.apache.olingo.odata2.processor.core.jpa.common.ODataJPATestConstants;
import org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmMappingImpl;
+import org.easymock.EasyMock;
public class JPATestUtil {
- public static EdmStructuralType getEdmStructuralType()
- {
+ public static EdmStructuralType getEdmStructuralType() {
EdmStructuralType edmType = EasyMock.createMock(EdmStructuralType.class);
try {
List<String> propertyNames = new ArrayList<String>();
@@ -75,15 +73,13 @@ public class JPATestUtil {
EasyMock.expect(edmType.getProperty("description")).andStubReturn(edmProperty2);
EasyMock.expect(edmType.getMapping()).andStubReturn(edmMapping);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(edmType);
return edmType;
}
- public static Map<String, Object> getPropertyValueMap()
- {
+ public static Map<String, Object> getPropertyValueMap() {
Map<String, Object> propertyValueMap = new HashMap<String, Object>();
propertyValueMap.put("id", 1);
return propertyValueMap;
@@ -112,15 +108,13 @@ public class JPATestUtil {
EasyMock.expect(entitySet.getEntityType()).andStubReturn(mockEdmEntityType(navigationProperty));
EasyMock.expect(entitySet.getRelatedEntitySet(navigationProperty)).andStubReturn(getSIEntitySet());
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(entitySet);
return entitySet;
}
- public static Object getJPAEntity()
- {
+ public static Object getJPAEntity() {
SalesOrderHeader sHead = new SalesOrderHeader(1, "laptop");
SalesOrderLineItem sItem = new SalesOrderLineItem(23);
List<SalesOrderLineItem> sItems = new ArrayList<SalesOrderLineItem>();
@@ -155,8 +149,7 @@ public class JPATestUtil {
EasyMock.expect(entityType.getPropertyNames()).andStubReturn(propertyNames);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(entityType);
return entityType;
@@ -165,11 +158,9 @@ public class JPATestUtil {
private static EdmEntitySet getSIEntitySet() {
EdmEntitySet entitySet = EasyMock.createMock(EdmEntitySet.class);
try {
- EasyMock.expect(entitySet.getEntityType()).andStubReturn(
- mockTargetEdmEntityType());
+ EasyMock.expect(entitySet.getEntityType()).andStubReturn(mockTargetEdmEntityType());
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(entitySet);
return entitySet;
@@ -183,21 +174,16 @@ public class JPATestUtil {
List<String> propertyNames = new ArrayList<String>();
propertyNames.add("price");
try {
- EasyMock.expect(mapping.getInternalName()).andStubReturn(
- "SalesOrderLineItem");
+ EasyMock.expect(mapping.getInternalName()).andStubReturn("SalesOrderLineItem");
EasyMock.replay(mapping);
- EasyMock.expect(entityType.getName()).andStubReturn(
- "SalesOrderLineItem");
+ EasyMock.expect(entityType.getName()).andStubReturn("SalesOrderLineItem");
EasyMock.expect(entityType.getMapping()).andStubReturn(mapping);
EdmProperty property = mockEdmPropertyOfTarget();
- EasyMock.expect(entityType.getProperty("price")).andStubReturn(
- property);
- EasyMock.expect(entityType.getPropertyNames()).andStubReturn(
- propertyNames);
+ EasyMock.expect(entityType.getProperty("price")).andStubReturn(property);
+ EasyMock.expect(entityType.getPropertyNames()).andStubReturn(propertyNames);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(entityType);
return entityType;
@@ -217,8 +203,7 @@ public class JPATestUtil {
EasyMock.expect(edmProperty.getType()).andStubReturn(type);
EasyMock.expect(edmProperty.getMapping()).andStubReturn(mapping);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(edmProperty);
return edmProperty;
@@ -234,8 +219,7 @@ public class JPATestUtil {
EasyMock.expect(navigationProperty.getMapping()).andStubReturn(mapping);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(navigationProperty);
return navigationProperty;
@@ -243,8 +227,7 @@ public class JPATestUtil {
//EdmNavigationPropertyImplProv navigationPropertyImplProv = new EdmNavigationPropertyImplProv(edm, property)
}
- public static Metamodel mockMetaModel()
- {
+ public static Metamodel mockMetaModel() {
Set<EntityType<?>> jpaEntities = new HashSet<EntityType<?>>();
jpaEntities.add(new JPATestUtil.DemoEntityType());
Metamodel metaModel = EasyMock.createMock(Metamodel.class);
@@ -269,8 +252,7 @@ public class JPATestUtil {
EasyMock.expect(edmProperty.getType()).andStubReturn(edmType);
EasyMock.expect(edmProperty.getMapping()).andStubReturn(edmMapping);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(edmProperty);
return edmProperty;
@@ -286,8 +268,7 @@ public class JPATestUtil {
EasyMock.expect(edmProperty.getType()).andStubReturn(edmType);
EasyMock.expect(edmProperty.getMapping()).andStubReturn(edmMapping);
} catch (EdmException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
EasyMock.replay(edmProperty);
return edmProperty;
@@ -318,30 +299,25 @@ public class JPATestUtil {
}
- static class DemoEntityType implements EntityType<SalesOrderHeader>
- {
+ static class DemoEntityType implements EntityType<SalesOrderHeader> {
@Override
- public <Y> SingularAttribute<? super org.apache.olingo.odata2.processor.core.jpa.cud.SalesOrderHeader, Y> getId(
- final Class<Y> type) {
+ public <Y> SingularAttribute<? super org.apache.olingo.odata2.processor.core.jpa.cud.SalesOrderHeader, Y> getId(final Class<Y> type) {
return null;
}
@Override
- public <Y> SingularAttribute<org.apache.olingo.odata2.processor.core.jpa.cud.SalesOrderHeader, Y> getDeclaredId(
- final Class<Y> type) {
+ public <Y> SingularAttribute<org.apache.olingo.odata2.processor.core.jpa.cud.SalesOrderHeader, Y> getDeclaredId(final Class<Y> type) {
return null;
}
@Override
- public <Y> SingularAttribute<? super SalesOrderHeader, Y> getVersion(
- final Class<Y> type) {
+ public <Y> SingularAttribute<? super SalesOrderHeader, Y> getVersion(final Class<Y> type) {
return null;
}
@Override
- public <Y> SingularAttribute<SalesOrderHeader, Y> getDeclaredVersion(
- final Class<Y> type) {
+ public <Y> SingularAttribute<SalesOrderHeader, Y> getDeclaredVersion(final Class<Y> type) {
return null;
}
@@ -381,14 +357,12 @@ public class JPATestUtil {
}
@Override
- public <Y> SingularAttribute<? super SalesOrderHeader, Y> getSingularAttribute(
- final String name, final Class<Y> type) {
+ public <Y> SingularAttribute<? super SalesOrderHeader, Y> getSingularAttribute(final String name, final Class<Y> type) {
return null;
}
@Override
- public <Y> SingularAttribute<SalesOrderHeader, Y> getDeclaredSingularAttribute(
- final String name, final Class<Y> type) {
+ public <Y> SingularAttribute<SalesOrderHeader, Y> getDeclaredSingularAttribute(final String name, final Class<Y> type) {
return null;
}
@@ -403,50 +377,42 @@ public class JPATestUtil {
}
@Override
- public <E> CollectionAttribute<? super SalesOrderHeader, E> getCollection(
- final String name, final Class<E> elementType) {
+ public <E> CollectionAttribute<? super SalesOrderHeader, E> getCollection(final String name, final Class<E> elementType) {
return null;
}
@Override
- public <E> CollectionAttribute<SalesOrderHeader, E> getDeclaredCollection(
- final String name, final Class<E> elementType) {
+ public <E> CollectionAttribute<SalesOrderHeader, E> getDeclaredCollection(final String name, final Class<E> elementType) {
return null;
}
@Override
- public <E> SetAttribute<? super SalesOrderHeader, E> getSet(
- final String name, final Class<E> elementType) {
+ public <E> SetAttribute<? super SalesOrderHeader, E> getSet(final String name, final Class<E> elementType) {
return null;
}
@Override
- public <E> SetAttribute<SalesOrderHeader, E> getDeclaredSet(
- final String name, final Class<E> elementType) {
+ public <E> SetAttribute<SalesOrderHeader, E> getDeclaredSet(final String name, final Class<E> elementType) {
return null;
}
@Override
- public <E> ListAttribute<? super SalesOrderHeader, E> getList(
- final String name, final Class<E> elementType) {
+ public <E> ListAttribute<? super SalesOrderHeader, E> getList(final String name, final Class<E> elementType) {
return null;
}
@Override
- public <E> ListAttribute<SalesOrderHeader, E> getDeclaredList(
- final String name, final Class<E> elementType) {
+ public <E> ListAttribute<SalesOrderHeader, E> getDeclaredList(final String name, final Class<E> elementType) {
return null;
}
@Override
- public <K, V> MapAttribute<? super SalesOrderHeader, K, V> getMap(
- final String name, final Class<K> keyType, final Class<V> valueType) {
+ public <K, V> MapAttribute<? super SalesOrderHeader, K, V> getMap(final String name, final Class<K> keyType, final Class<V> valueType) {
return null;
}
@Override
- public <K, V> MapAttribute<SalesOrderHeader, K, V> getDeclaredMap(
- final String name, final Class<K> keyType, final Class<V> valueType) {
+ public <K, V> MapAttribute<SalesOrderHeader, K, V> getDeclaredMap(final String name, final Class<K> keyType, final Class<V> valueType) {
return null;
}
@@ -471,26 +437,22 @@ public class JPATestUtil {
}
@Override
- public SingularAttribute<? super SalesOrderHeader, ?> getSingularAttribute(
- final String name) {
+ public SingularAttribute<? super SalesOrderHeader, ?> getSingularAttribute(final String name) {
return null;
}
@Override
- public SingularAttribute<SalesOrderHeader, ?> getDeclaredSingularAttribute(
- final String name) {
+ public SingularAttribute<SalesOrderHeader, ?> getDeclaredSingularAttribute(final String name) {
return null;
}
@Override
- public CollectionAttribute<? super SalesOrderHeader, ?> getCollection(
- final String name) {
+ public CollectionAttribute<? super SalesOrderHeader, ?> getCollection(final String name) {
return null;
}
@Override
- public CollectionAttribute<SalesOrderHeader, ?> getDeclaredCollection(
- final String name) {
+ public CollectionAttribute<SalesOrderHeader, ?> getDeclaredCollection(final String name) {
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1e5280b7/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPAUpdateRequestTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPAUpdateRequestTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPAUpdateRequestTest.java
index 0238664..e7cd778 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPAUpdateRequestTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/JPAUpdateRequestTest.java
@@ -25,13 +25,12 @@ import static org.junit.Assert.fail;
import java.util.Map;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.edm.EdmEntityType;
import org.apache.olingo.odata2.api.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.uri.info.PutMergePatchUriInfo;
import org.apache.olingo.odata2.processor.api.jpa.exception.ODataJPARuntimeException;
import org.apache.olingo.odata2.processor.core.jpa.common.ODataJPATestConstants;
+import org.junit.Test;
public class JPAUpdateRequestTest {
@@ -46,8 +45,7 @@ public class JPAUpdateRequestTest {
if (e.isCausedByMessageException()) {
assertTrue(true);
} else {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
@@ -66,8 +64,7 @@ public class JPAUpdateRequestTest {
assertEquals("desktop", ((SalesOrderHeader) result).getDescription());
assertEquals(1, ((SalesOrderHeader) result).getId());
} catch (ODataJPARuntimeException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
assertNotNull(result);
assertEquals(((SalesOrderHeader) result).getId(), 1);
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1e5280b7/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/SalesOrderHeader.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/SalesOrderHeader.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/SalesOrderHeader.java
index 858db9e..55b408c 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/SalesOrderHeader.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/cud/SalesOrderHeader.java
@@ -26,8 +26,7 @@ public class SalesOrderHeader {
private int id;
private String description;
- public SalesOrderHeader()
- {}
+ public SalesOrderHeader() {}
public SalesOrderHeader(final int id, final String description) {
super();
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1e5280b7/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/edm/ODataJPAEdmProviderNegativeTest.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/edm/ODataJPAEdmProviderNegativeTest.java b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/edm/ODataJPAEdmProviderNegativeTest.java
index 7bfe54e..71363f4 100644
--- a/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/edm/ODataJPAEdmProviderNegativeTest.java
+++ b/jpa-core/src/test/java/org/apache/olingo/odata2/processor/core/jpa/edm/ODataJPAEdmProviderNegativeTest.java
@@ -26,9 +26,6 @@ import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.edm.FullQualifiedName;
import org.apache.olingo.odata2.api.edm.provider.Association;
import org.apache.olingo.odata2.api.edm.provider.EntityContainer;
@@ -38,6 +35,8 @@ import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.processor.core.jpa.common.ODataJPATestConstants;
import org.apache.olingo.odata2.processor.core.jpa.mock.ODataJPAContextMock;
import org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmModel;
+import org.junit.BeforeClass;
+import org.junit.Test;
public class ODataJPAEdmProviderNegativeTest {
@@ -61,17 +60,13 @@ public class ODataJPAEdmProviderNegativeTest {
field.setAccessible(true);
field.set(edmProvider, new JPAEdmModel(null, null));
} catch (IllegalArgumentException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (IllegalAccessException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (NoSuchFieldException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (SecurityException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
@@ -80,36 +75,30 @@ public class ODataJPAEdmProviderNegativeTest {
public void testNullGetEntityContainerInfo() {
EntityContainerInfo entityContainer = null;
try {
- entityContainer = edmProvider
- .getEntityContainerInfo("salesorderprocessingContainer");
+ entityContainer = edmProvider.getEntityContainerInfo("salesorderprocessingContainer");
} catch (ODataException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
assertNull(entityContainer);
}
@Test
public void testNullGetEntityType() {
- FullQualifiedName entityTypeName = new FullQualifiedName(
- "salesorderprocessing", "SalesOrderHeader");
+ FullQualifiedName entityTypeName = new FullQualifiedName("salesorderprocessing", "SalesOrderHeader");
try {
assertNull(edmProvider.getEntityType(entityTypeName));
} catch (ODataException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
@Test
public void testNullGetComplexType() {
- FullQualifiedName complexTypeName = new FullQualifiedName(
- "salesorderprocessing", "Address");
+ FullQualifiedName complexTypeName = new FullQualifiedName("salesorderprocessing", "Address");
try {
assertNull(edmProvider.getComplexType(complexTypeName));
} catch (ODataException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
@@ -117,11 +106,9 @@ public class ODataJPAEdmProviderNegativeTest {
public void testGetAssociationFullQualifiedName() {
Association association = null;
try {
- association = edmProvider.getAssociation(new FullQualifiedName(
- "salesorderprocessing", "SalesOrderHeader_SalesOrderItem"));
+ association = edmProvider.getAssociation(new FullQualifiedName("salesorderprocessing", "SalesOrderHeader_SalesOrderItem"));
} catch (ODataException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
assertNull(association);
}
@@ -129,25 +116,18 @@ public class ODataJPAEdmProviderNegativeTest {
@Test
public void testGetEntitySet() {
try {
- assertNull(edmProvider.getEntitySet(
- "salesorderprocessingContainer", "SalesOrderHeaders"));
+ assertNull(edmProvider.getEntitySet("salesorderprocessingContainer", "SalesOrderHeaders"));
} catch (ODataException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
@Test
public void testGetAssociationSet() {
try {
- assertNull(edmProvider.getAssociationSet(
- "salesorderprocessingContainer", new FullQualifiedName(
- "salesorderprocessing",
- "SalesOrderHeader_SalesOrderItem"),
- "SalesOrderHeaders", "SalesOrderHeader"));
+ assertNull(edmProvider.getAssociationSet("salesorderprocessingContainer", new FullQualifiedName("salesorderprocessing", "SalesOrderHeader_SalesOrderItem"), "SalesOrderHeaders", "SalesOrderHeader"));
} catch (ODataException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
@@ -156,16 +136,13 @@ public class ODataJPAEdmProviderNegativeTest {
public void testNullGetFunctionImport() {
try {
- assertNull(edmProvider.getFunctionImport(
- "salesorderprocessingContainer",
- "SalesOrder_FunctionImport1"));
+ assertNull(edmProvider.getFunctionImport("salesorderprocessingContainer", "SalesOrder_FunctionImport1"));
} catch (ODataException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
-
+
@Test
public void testNullGetFunctionImport2() {
@@ -184,25 +161,18 @@ public class ODataJPAEdmProviderNegativeTest {
schemas.add(schema); //Empty Schema
field.set(provider, schemas);
} catch (IllegalArgumentException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (IllegalAccessException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (NoSuchFieldException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (SecurityException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
- assertNull(provider.getFunctionImport(
- "salesorderprocessingContainer",
- "SalesOrder_FunctionImport1"));
+ assertNull(provider.getFunctionImport("salesorderprocessingContainer", "SalesOrder_FunctionImport1"));
} catch (ODataException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}
@@ -212,8 +182,7 @@ public class ODataJPAEdmProviderNegativeTest {
try {
assertNotNull(edmProvider.getSchemas());
} catch (ODataException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
- + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+ fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
}