You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2016/08/24 20:49:02 UTC

[6/7] olingo-odata2 git commit: [OLINGO-994] Fixed empty content tag

[OLINGO-994] Fixed empty content tag


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

Branch: refs/heads/OLINGO-JPA-Fixes
Commit: 6bc60b47f61d8c52d3430c15d5f4d4bc77a45b7a
Parents: 8d90a16
Author: mibo <mi...@apache.org>
Authored: Wed Aug 24 21:41:14 2016 +0200
Committer: mibo <mi...@apache.org>
Committed: Wed Aug 24 21:41:14 2016 +0200

----------------------------------------------------------------------
 .../olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java   | 3 +--
 .../olingo/odata2/core/ep/producer/AtomEntryProducerTest.java     | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/6bc60b47/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java
index 6250739..1c82a38 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java
@@ -406,10 +406,9 @@ public class AtomEntryEntityProducer {
         mediaResourceMimeType = ContentType.APPLICATION_OCTET_STREAM.toString();
       }
 
-      writer.writeStartElement(FormatXml.ATOM_CONTENT);
+      writer.writeEmptyElement(FormatXml.ATOM_CONTENT);
       writer.writeAttribute(FormatXml.ATOM_TYPE, mediaResourceMimeType);
       writer.writeAttribute(FormatXml.ATOM_SRC, self);
-      writer.writeEndElement();
     } catch (XMLStreamException e) {
       throw new EntityProviderProducerException(EntityProviderException.COMMON, e);
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/6bc60b47/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
index c6b712d..29ce3af 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
@@ -602,6 +602,7 @@ public class AtomEntryProducerTest extends AbstractProviderTest {
     assertXpathEvaluatesTo(BASE_URI.toASCIIString(), "/a:entry/@xml:base", xmlString);
 
     assertXpathExists("/a:entry/a:content", xmlString);
+    assertXpathEvaluatesTo("", "/a:entry/a:content", xmlString);
     assertXpathEvaluatesTo(ContentType.APPLICATION_OCTET_STREAM.toString(), "/a:entry/a:content/@type", xmlString);
     assertXpathEvaluatesTo("Employees('1')/$value", "/a:entry/a:content/@src", xmlString);
     assertXpathExists("/a:entry/m:properties", xmlString);