@Test
public void serializeWithValueEncoding() throws IOException, XpathException, SAXException, XMLStreamException,
FactoryConfigurationError, ODataException {
photoData.put("Type", "< Ö >");
AtomEntityProvider ser = createAtomEntityProvider();
ODataResponse response =
ser.writeEntry(MockFacade.getMockEdm().getEntityContainer("Container2").getEntitySet("Photos"), photoData,
DEFAULT_PROPERTIES);
String xmlString = verifyResponse(response);
assertXpathExists("/a:entry", xmlString);
assertXpathEvaluatesTo(BASE_URI.toASCIIString(), "/a:entry/@xml:base", xmlString);
assertXpathExists("/a:entry/a:id", xmlString);
assertXpathEvaluatesTo(BASE_URI.toASCIIString() + "Container2.Photos(Id=1,Type='%3C%20%C3%96%20%3E')",
"/a:entry/a:id/text()", xmlString);
assertXpathEvaluatesTo("Container2.Photos(Id=1,Type='%3C%20%C3%96%20%3E')", "/a:entry/a:link/@href", xmlString);
}
AtomEntryProducerTest.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:olingo-odata2
作者:
评论列表
文章目录