@Test(expected = EntityProviderException.class) public void readEmployeesFeedWithInlineCountLetters() throws Exception { String content = readFile("feed_employees_full.xml").replace("<m:count>6</m:count>", "<m:count>AAA</m:count>"); assertNotNull(content); EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Employees"); InputStream reqContent = createContentAsStream(content); XmlEntityConsumer xec = new XmlEntityConsumer(); EntityProviderReadProperties consumerProperties = EntityProviderReadProperties.init() .mergeSemantic(false).build(); try { xec.readFeed(entitySet, reqContent, consumerProperties); } catch (EntityProviderException e) { assertEquals(EntityProviderException.INLINECOUNT_INVALID, e.getMessageReference()); throw e; } Assert.fail("Exception expected"); }
public ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia, final EntityProviderReadProperties readProperties) throws EntityProviderException { try { reader.require(XMLStreamConstants.START_DOCUMENT, null, null); reader.nextTag(); reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_FEED); Map<String, String> foundPrefix2NamespaceUri = extractNamespacesFromTag(reader); foundPrefix2NamespaceUri.putAll(readProperties.getValidatedPrefixNamespaceUris()); checkAllMandatoryNamespacesAvailable(foundPrefix2NamespaceUri); EntityProviderReadProperties entryReadProperties = EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build(); return readFeedData(reader, eia, entryReadProperties); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }
XmlFeedConsumer { public ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia, final EntityProviderReadProperties readProperties) throws EntityProviderException { try { reader.require(XMLStreamConstants.START_DOCUMENT, null, null); reader.nextTag(); reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_FEED); Map<String, String> foundPrefix2NamespaceUri = extractNamespacesFromTag(reader); foundPrefix2NamespaceUri.putAll(readProperties.getValidatedPrefixNamespaceUris()); checkAllMandatoryNamespacesAvailable(foundPrefix2NamespaceUri); EntityProviderReadProperties entryReadProperties = EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build(); return readFeedData(reader, eia, entryReadProperties); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } } }
XmlFeedConsumer { public ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia, final EntityProviderReadProperties readProperties) throws EntityProviderException { try { reader.require(XMLStreamConstants.START_DOCUMENT, null, null); reader.nextTag(); reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_FEED); Map<String, String> foundPrefix2NamespaceUri = extractNamespacesFromTag(reader); foundPrefix2NamespaceUri.putAll(readProperties.getValidatedPrefixNamespaceUris()); checkAllMandatoryNamespacesAvailable(foundPrefix2NamespaceUri); EntityProviderReadProperties entryReadProperties = EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build(); return readFeedData(reader, eia, entryReadProperties); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }  }
XmlFeedConsumer { public ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia, final EntityProviderReadProperties readProperties) throws EntityProviderException { try { reader.require(XMLStreamConstants.START_DOCUMENT, null, null); reader.nextTag(); reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_FEED); Map<String, String> foundPrefix2NamespaceUri = extractNamespacesFromTag(reader); foundPrefix2NamespaceUri.putAll(readProperties.getValidatedPrefixNamespaceUris()); checkAllMandatoryNamespacesAvailable(foundPrefix2NamespaceUri); EntityProviderReadProperties entryReadProperties = EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build(); return readFeedData(reader, eia, entryReadProperties); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }  ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia,
      final EntityProviderReadProperties readProperties); }
XmlFeedConsumer { public ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia, final EntityProviderReadProperties readProperties) throws EntityProviderException { try { reader.require(XMLStreamConstants.START_DOCUMENT, null, null); reader.nextTag(); reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_FEED); Map<String, String> foundPrefix2NamespaceUri = extractNamespacesFromTag(reader); foundPrefix2NamespaceUri.putAll(readProperties.getValidatedPrefixNamespaceUris()); checkAllMandatoryNamespacesAvailable(foundPrefix2NamespaceUri); EntityProviderReadProperties entryReadProperties = EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build(); return readFeedData(reader, eia, entryReadProperties); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }  ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia,
      final EntityProviderReadProperties readProperties);  }