olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chanda...@apache.org
Subject [2/2] olingo-odata2 git commit: [OLINGO-483] and [OLINGO-505] Patch Applied and Unit Test corrected for supporting expand with multiple entities via navigation.
Date Sat, 06 Dec 2014 09:03:57 GMT
[OLINGO-483] and [OLINGO-505] Patch Applied and Unit Test corrected for
supporting expand with multiple entities via navigation.


Signed-off-by: Chandan V A <chandan.v.a@sap.com>

Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/8730ca5b
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/8730ca5b
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/8730ca5b

Branch: refs/heads/master
Commit: 8730ca5b2e2e30eac966f0966208fa77de402620
Parents: 599fbc3
Author: Chandan V A <chandan.v.a@sap.com>
Authored: Sat Dec 6 14:33:37 2014 +0530
Committer: Chandan V A <chandan.v.a@sap.com>
Committed: Sat Dec 6 14:33:37 2014 +0530

----------------------------------------------------------------------
 .../odata2/jpa/processor/core/callback/JPAExpandCallBack.java | 2 +-
 .../jpa/processor/core/access/data/JPAExpandCallBackTest.java | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8730ca5b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/callback/JPAExpandCallBack.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/callback/JPAExpandCallBack.java
b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/callback/JPAExpandCallBack.java
index 861a399..0ebc5eb 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/callback/JPAExpandCallBack.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/callback/JPAExpandCallBack.java
@@ -81,7 +81,7 @@ public class JPAExpandCallBack implements OnWriteFeedContent, OnWriteEntryConten
       if (navigationLinks.size() > 0) {
         currentNavPropertyList = new ArrayList<EdmNavigationProperty>();
         List<EdmNavigationProperty> nextNavProperty =
-                getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context.getNavigationProperty());
+            getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context.getNavigationProperty());
         if (nextNavProperty != null) {
           currentNavPropertyList.addAll(nextNavProperty);
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8730ca5b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAExpandCallBackTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAExpandCallBackTest.java
b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAExpandCallBackTest.java
index 5b0147c..5c8700a 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAExpandCallBackTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAExpandCallBackTest.java
@@ -112,13 +112,14 @@ public class JPAExpandCallBackTest {
 
   }
 
+  @SuppressWarnings("unchecked")
   @Test
   public void testGetNextNavigationProperty() {
     JPAExpandCallBack callBack = getJPAExpandCallBackObject();
     List<ArrayList<NavigationPropertySegment>> expandList = EdmMockUtil.getExpandList();
     ArrayList<NavigationPropertySegment> expands = expandList.get(0);
     expands.add(EdmMockUtil.mockThirdNavigationPropertySegment());
-    EdmNavigationProperty result = null;
+    List<EdmNavigationProperty> result = null;
     try {
       Field field = callBack.getClass().getDeclaredField("expandList");
       field.setAccessible(true);
@@ -127,8 +128,8 @@ public class JPAExpandCallBackTest {
       Object[] actualParams = { EdmMockUtil.mockSourceEdmEntityType(), EdmMockUtil.mockNavigationProperty()
};
       Method method = callBack.getClass().getDeclaredMethod("getNextNavigationProperty",
formalParams);
       method.setAccessible(true);
-      result = (EdmNavigationProperty) method.invoke(callBack, actualParams);
-      assertEquals("MaterialDetails", result.getName());
+      result = (List<EdmNavigationProperty>) method.invoke(callBack, actualParams);
+      assertEquals("MaterialDetails", result.get(0).getName());
 
     } catch (SecurityException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);


Mime
View raw message