Build failed in Jenkins: olingo-odata2-quality #835

2019-06-11 Thread Apache Jenkins Server
See 


Changes:

[archana.rai] [OLINGO-1365]Child entities not serialized if parent has no 
property

[archana.rai] [ODATA-2] JPA silent exit on update

--
[...truncated 165.35 KB...]
Audit done.

[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ 
olingo-odata2-annotation-processor ---
[INFO] Installing 

 to 
/home/jenkins/.m2/repository/org/apache/olingo/olingo-odata2-annotation-processor/2.0.12-SNAPSHOT/olingo-odata2-annotation-processor-2.0.12-SNAPSHOT.pom
[INFO] 
[INFO] --< org.apache.olingo:olingo-odata2-annotation-processor-api >--
[INFO] Building olingo-odata2-annotation-processor-api 2.0.12-SNAPSHOT  [18/31]
[INFO] [ jar ]-
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
olingo-odata2-annotation-processor-api ---
[INFO] Deleting 

[INFO] 
[INFO] --- buildnumber-maven-plugin:1.2:create (default) @ 
olingo-odata2-annotation-processor-api ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ 
olingo-odata2-annotation-processor-api ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
olingo-odata2-annotation-processor-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 

[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ 
olingo-odata2-annotation-processor-api ---
[INFO] Compiling 2 source files to 

[INFO] 
[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) @ 
olingo-odata2-annotation-processor-api ---
[WARNING] Manifest 
org.apache.olingo:olingo-odata2-annotation-processor-api:jar:2.0.12-SNAPSHOT : 
Superfluous export-package instructions: 
[org.apache.olingo.odata2.annotation.processor.api.*]
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
olingo-odata2-annotation-processor-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 

[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ 
olingo-odata2-annotation-processor-api ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ 
olingo-odata2-annotation-processor-api ---
[INFO] 
[INFO] --- apache-rat-plugin:0.9:rat (rat-check) @ 
olingo-odata2-annotation-processor-api ---
[INFO] 51 implicit excludes (use -debug for more details).
[INFO] Exclude: **/MANIFEST.MF
[INFO] Exclude: .gitignore
[INFO] Exclude: .git/**
[INFO] Exclude: bin/**
[INFO] Exclude: **/*.project
[INFO] Exclude: **/*.classpath
[INFO] Exclude: **/*.json
[INFO] Exclude: **/*.batch
[INFO] Exclude: **/NOTICE
[INFO] Exclude: **/DEPENDENCIES
[INFO] Exclude: **/goal.txt
[INFO] Exclude: **/target/**
[INFO] Exclude: **/*.iml
[INFO] Exclude: .repository/**
[INFO] 3 resources included (use -debug for more details)
[INFO] 
[INFO] --- apache-rat-plugin:0.9:check (rat-check) @ 
olingo-odata2-annotation-processor-api ---
[INFO] 51 implicit excludes (use -debug for more details).
[INFO] Exclude: **/MANIFEST.MF
[INFO] Exclude: .gitignore
[INFO] Exclude: .git/**
[INFO] Exclude: bin/**
[INFO] Exclude: **/*.project
[INFO] Exclude: **/*.classpath
[INFO] Exclude: **/*.json
[INFO] Exclude: **/*.batch
[INFO] Exclude: **/NOTICE
[INFO] Exclude: **/DEPENDENCIES
[INFO] Exclude: **/goal.txt
[INFO] Exclude: **/target/**
[INFO] Exclude: **/*.iml
[INFO] Exclude: .repository/**
[INFO] 3 resources included (use -debug for more details)
[INFO] Rat check: Summary of files. Unapproved: 0 unknown: 0 generated: 0 
approved: 3 licence.
[INFO] 
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ 
olingo-odata2-annotation-processor-api ---
[INFO] Building jar: 

[INFO] 
[INFO] --- maven-site-plugin:3.2:attach-descriptor (attach-descriptor) @ 
olingo-odata2-annotation-processor-api ---
[INFO] 
[INFO] --- maven-source-plugin:2.2.1:jar-no-fork (attach-sources) @ 
olingo-odata2-annotation-processor-api ---
[INFO] Building jar: 


[olingo-odata2] branch master updated: [ODATA-2] JPA silent exit on update

2019-06-11 Thread archanarai
This is an automated email from the ASF dual-hosted git repository.

archanarai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/olingo-odata2.git


The following commit(s) were added to refs/heads/master by this push:
 new 73fe4e8  [ODATA-2] JPA silent exit on update
73fe4e8 is described below

commit 73fe4e82a3fbb27b2eced12c02bd0a4f16650633
Author: Archana Rai 
AuthorDate: Wed Jun 12 11:23:54 2019 +0530

[ODATA-2] JPA silent exit on update
---
 .../olingo/odata2/jpa/processor/core/access/data/JPALink.java | 8 
 1 file changed, 8 insertions(+)

diff --git 
a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALink.java
 
b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALink.java
index 3ee599b..c8a4394 100644
--- 
a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALink.java
+++ 
b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALink.java
@@ -196,6 +196,10 @@ public class JPALink {
   targetJPAEntities.add(targetJPAEntity);
 }
   }
+  if (targetJPAEntity == null){
+throw 
ODataJPARuntimeException.throwException(ODataJPARuntimeException.RESOURCE_X_NOT_FOUND
+.addContent(navPropertyName), null);
+  }
   if (!targetJPAEntities.isEmpty()) {
 linkJPAEntities(targetJPAEntities, sourceJPAEntity, navProperty);
   }
@@ -306,6 +310,10 @@ public class JPALink {
   }
 
   targetJPAEntity = jpaProcessor.process((GetEntityUriInfo) getUriInfo);
+  if (targetJPAEntity == null){
+throw 
ODataJPARuntimeException.throwException(ODataJPARuntimeException.RESOURCE_X_NOT_FOUND
+.addContent(navigationProperty.getName()), null);
+  }
   if (targetJPAEntity != null && sourceJPAEntity == null) {
 int index = 
context.getODataContext().getPathInfo().getODataSegments().size() - 2;
 getUriInfo = parser.parseURISegment(0, index);



[olingo-odata2] branch master updated: [OLINGO-1365]Child entities not serialized if parent has no property

2019-06-11 Thread archanarai
This is an automated email from the ASF dual-hosted git repository.

archanarai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/olingo-odata2.git


The following commit(s) were added to refs/heads/master by this push:
 new 156e167  [OLINGO-1365]Child entities not serialized if parent has no 
property
156e167 is described below

commit 156e167c9de4238dee75f8c82995463aa5ee84f3
Author: Archana Rai 
AuthorDate: Wed Jun 12 10:50:58 2019 +0530

[OLINGO-1365]Child entities not serialized if parent has no property
---
 .../ep/serializer/JsonEntryEntitySerializer.java   | 12 +++---
 .../serializer/JsonEntryEntitySerializerTest.java  | 45 ++
 2 files changed, 52 insertions(+), 5 deletions(-)

diff --git 
a/odata2-lib/odata-client-core/src/main/java/org/apache/olingo/odata2/client/core/ep/serializer/JsonEntryEntitySerializer.java
 
b/odata2-lib/odata-client-core/src/main/java/org/apache/olingo/odata2/client/core/ep/serializer/JsonEntryEntitySerializer.java
index b727538..fec92c8 100644
--- 
a/odata2-lib/odata-client-core/src/main/java/org/apache/olingo/odata2/client/core/ep/serializer/JsonEntryEntitySerializer.java
+++ 
b/odata2-lib/odata-client-core/src/main/java/org/apache/olingo/odata2/client/core/ep/serializer/JsonEntryEntitySerializer.java
@@ -92,7 +92,7 @@ public class JsonEntryEntitySerializer {
   } 
   writeProperties(entityInfo, data.getProperties(), type, 
containsMetadata);
 
-  writeNavigationProperties(writer, entityInfo, data.getNavigations(), 
type);
+  writeNavigationProperties(writer, entityInfo, data.getNavigations(), 
type, data.getProperties().isEmpty());
   jsonStreamWriter.endObject();
   
   writer.flush();
@@ -107,7 +107,7 @@ public class JsonEntryEntitySerializer {
 
   private void writeNavigationProperties(final Writer writer, final 
EntityInfoAggregator entityInfo,
   final Map data,
-  final EdmEntityType type) throws EdmException, EntityProviderException, 
IOException {
+  final EdmEntityType type, boolean emptyData) throws EdmException, 
EntityProviderException, IOException {
 for (final String navigationPropertyName : 
type.getNavigationPropertyNames()) {
   if (data.containsKey(navigationPropertyName)) {
 if (data.get(navigationPropertyName) == null) {
@@ -115,7 +115,10 @@ public class JsonEntryEntitySerializer {
 }
 if (data.get(navigationPropertyName) instanceof Entity || 
 data.get(navigationPropertyName) instanceof EntityCollection) {
-  jsonStreamWriter.separator();
+  if( !emptyData){
+jsonStreamWriter.separator();
+  }
+  emptyData=false;
   jsonStreamWriter.name(navigationPropertyName);
   writeExpandedNavigationProperty(writer, entityInfo, data, type, 
navigationPropertyName);
 } else if (data.get(navigationPropertyName) instanceof Map){
@@ -157,8 +160,7 @@ public class JsonEntryEntitySerializer {
   if(inlineData == null){
 throw new EntityProviderException(EntityProviderException.NULL_VALUE);
   }
-  if (inlineData != null && inlineData.getProperties() != null && 
-  !inlineData.getProperties().isEmpty()) {
+  if (inlineData != null && inlineData.getProperties() != null) {
 final EntitySerializerProperties inlineProperties = 
inlineData.getWriteProperties() == null ?
 EntitySerializerProperties.
 serviceRoot(properties.getServiceRoot()).build() : 
inlineData.getWriteProperties();
diff --git 
a/odata2-lib/odata-client-core/src/test/java/org/apache/olingo/odata2/client/core/ep/serializer/JsonEntryEntitySerializerTest.java
 
b/odata2-lib/odata-client-core/src/test/java/org/apache/olingo/odata2/client/core/ep/serializer/JsonEntryEntitySerializerTest.java
index e3e06f0..69524a4 100644
--- 
a/odata2-lib/odata-client-core/src/test/java/org/apache/olingo/odata2/client/core/ep/serializer/JsonEntryEntitySerializerTest.java
+++ 
b/odata2-lib/odata-client-core/src/test/java/org/apache/olingo/odata2/client/core/ep/serializer/JsonEntryEntitySerializerTest.java
@@ -739,6 +739,51 @@ public class JsonEntryEntitySerializerTest extends 
BaseTest {
 assertNotNull(json);
 
assertEquals("{\"Id\":\"1\",\"Version\":1,\"nr_Building\":{\"Id\":\"1\",\"Name\":\"Building1\"}}",
 json);
   }
+  
+  @Test
+  public void unbalancedPropertyEntryWithMultipleInlineEntry() throws 
Exception {
+final EdmEntitySet entitySet = 
MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
+Entity roomData = new Entity();
+roomData.addProperty("Id", "1");
+roomData.addProperty("Version", 1);
+
+Entity nrBuildingData = new Entity();
+EntityCollection roomsCollection = new EntityCollection();
+Entity nbRoomData = new Entity();
+nbRoomData.addProperty("Id", "1");
+nbRoomData.addProperty("Version", 1);
+roomsCollection.addEntity(nbRoomData);
+nrBuildingData.addNavigation("nb