@Test public void validationOfUnknownPropertyInlineNamespaceSuccess() throws Exception { String roomWithValidNamespaces = "<?xml version='1.0' encoding='UTF-8'?>" + "<entry xmlns=\"http: + " xmlns:m=\"http: + " xmlns:d=\"http: + " xml:base=\"http: + " m:etag=\"W/&quot;1&quot;\">" + "" + " <id>http: + " <title type=\"text\">Room 1</title>" + " <updated>2013-01-11T13:50:50.541+01:00</updated>" + " <content type=\"application/xml\">" + " <m:properties>" + " <d:Id>1</d:Id>" + " <more:somePropertyToBeIgnored " + "xmlns:more=\"http: + " <d:Seats>11</d:Seats>" + " <d:Name>Room 42</d:Name>" + " <d:Version>4711</d:Version>" + " </m:properties>" + " </content>" + "</entry>"; EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms"); InputStream reqContent = createContentAsStream(roomWithValidNamespaces); EntityStream stream = new EntityStream(); stream.setContent(reqContent); stream.setReadProperties(DeserializerProperties.init().build()); XmlEntityDeserializer xec = new XmlEntityDeserializer(); ODataEntry result = xec.readEntry(entitySet, stream); assertNotNull(result); }
public ODataEntry readEntry(final EdmEntitySet entitySet, final EntityStream entity) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(entity.getContent()); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); return new XmlEntryDeserializer().readEntry(reader, eia, entity.getReadProperties(), false); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED. addContent(e.getClass() .getSimpleName()), e); } } } } }
XmlEntityDeserializer { public ODataEntry readEntry(final EdmEntitySet entitySet, final EntityStream entity) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(entity.getContent()); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); return new XmlEntryDeserializer().readEntry(reader, eia, entity.getReadProperties(), false); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED. addContent(e.getClass() .getSimpleName()), e); } } } } } }
XmlEntityDeserializer { public ODataEntry readEntry(final EdmEntitySet entitySet, final EntityStream entity) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(entity.getContent()); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); return new XmlEntryDeserializer().readEntry(reader, eia, entity.getReadProperties(), false); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED. addContent(e.getClass() .getSimpleName()), e); } } } } } XmlEntityDeserializer(); }
XmlEntityDeserializer { public ODataEntry readEntry(final EdmEntitySet entitySet, final EntityStream entity) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(entity.getContent()); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); return new XmlEntryDeserializer().readEntry(reader, eia, entity.getReadProperties(), false); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED. addContent(e.getClass() .getSimpleName()), e); } } } } } XmlEntityDeserializer(); ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final EntityStream entity); ODataEntry readEntry(final EdmEntitySet entitySet, final EntityStream entity); Object readCollection(final EntityPropertyInfo info, EntityStream entityStream); Map<String, Object> readProperty(final EntityPropertyInfo propertyInfo, final EntityStream entityStream); }
XmlEntityDeserializer { public ODataEntry readEntry(final EdmEntitySet entitySet, final EntityStream entity) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(entity.getContent()); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); return new XmlEntryDeserializer().readEntry(reader, eia, entity.getReadProperties(), false); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED. addContent(e.getClass() .getSimpleName()), e); } } } } } XmlEntityDeserializer(); ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final EntityStream entity); ODataEntry readEntry(final EdmEntitySet entitySet, final EntityStream entity); Object readCollection(final EntityPropertyInfo info, EntityStream entityStream); Map<String, Object> readProperty(final EntityPropertyInfo propertyInfo, final EntityStream entityStream);  }