• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java XpathException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.custommonkey.xmlunit.exceptions.XpathException的典型用法代码示例。如果您正苦于以下问题:Java XpathException类的具体用法?Java XpathException怎么用?Java XpathException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XpathException类属于org.custommonkey.xmlunit.exceptions包,在下文中一共展示了XpathException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: removeIgnoredBranches

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
public Document removeIgnoredBranches(Document document) {
	for (String branch : getIgnoredBranches()) {
        XpathEngine simpleXpathEngine = XMLUnit.newXpathEngine();
        
        NodeList nodeList;
		try {
			nodeList = simpleXpathEngine.getMatchingNodes(branch, document);
			for (int i = 0; i < nodeList.getLength(); i++) {
				Node parentNode = nodeList.item(i).getParentNode();
				parentNode.removeChild(nodeList.item(i));
			}
		} catch (XpathException e) {
			e.printStackTrace(); // FIXME : remove printStackTrace()
		}
	}
	return document;
}
 
开发者ID:fastconnect,项目名称:tibco-fcunit,代码行数:18,代码来源:FCDiff.java


示例2: testEntityType

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
@Test
public void testEntityType() throws XpathException, IOException, SAXException {

  EdmEntityType.Builder productBuilder = EdmEntityType.newBuilder();
  productBuilder = productBuilder.setName("Product").setOpenType(OPENTYPE_TRUE).addKeys("ProductId");
  EdmSchema.Builder schema = EdmSchema.newBuilder().setNamespace(SCHEMA);
  schema.addEntityTypes(productBuilder);

  EdmDataServices.Builder serviceBuilder = EdmDataServices.newBuilder().addSchemas(schema);
  EdmDataServices edmService = serviceBuilder.build();

  StringWriter writer = new StringWriter();
  EdmxFormatWriter.write(edmService, writer);
  String xml2 = writer.toString();

  assertThat(xml2, containsString("<EntityType OpenType=\"true\" Name=\"Product\">"));
  Document inDocument = XMLUnit.buildControlDocument(xml2);

  assertXpathExists("//edm:Schema/edm:EntityType/@OpenType", xml2);
}
 
开发者ID:teiid,项目名称:oreva,代码行数:21,代码来源:EdmxFormatWriterTest.java


示例3: testContainer

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
@Test
public void testContainer() throws XpathException, IOException, SAXException {
  EdmEntityContainer.Builder entityContainer2 = EdmEntityContainer.newBuilder()
      .setName("Container2")
      .setExtendz("Container")
      .setLazyLoadingEnabled(true);

  schema.addEntityContainers(container, entityContainer2);

  EdmDataServices.Builder builder = EdmDataServices.newBuilder().addSchemas(schema);
  EdmDataServices edmService = builder.build();
  StringWriter writer = new StringWriter();
  EdmxFormatWriter.write(edmService, writer);
  String xml = writer.toString();

  assertThat(xml, containsString("Extends=\"Container\""));
  assertThat(xml, containsString("LazyLoadingEnabled=\"true\""));

  assertXpathExists("//edm:Schema/edm:EntityContainer/@Extends", xml);
  assertXpathExists("//edm:Schema/edm:EntityContainer/@annotation:LazyLoadingEnabled", xml);

}
 
开发者ID:teiid,项目名称:oreva,代码行数:23,代码来源:EdmxFormatWriterTest.java


示例4: testForAnnotation

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
@Test
public void testForAnnotation() throws XpathException, IOException, SAXException {
  String xml = createXML();
  assertXpathExists("//edm:EntityType/edm:Property/myns:mySubproperty", xml);
  assertXpathExists("//edm:EntityType/edm:NavigationProperty/myns:MyNavigation", xml);
  assertXpathExists("//edm:EntityType/mynamespace:MyEntityTypeProperty/mynamespace:MySubProperty", xml);
  assertXpathExists("//edm:ComplexType/myns:MyComplexTypeProperty", xml);
  assertXpathExists("//edm:Association/mynamespace:MyAssociation", xml);
  assertXpathExists("//edm:Association/edm:End/myns:MyAssociationEnd", xml);
  assertXpathExists("//edm:EntityContainer/myns:MyEntitySet", xml);
  assertXpathExists("//edm:EntityContainer/edm:EntitySet/myns:MySubSet", xml);
  assertXpathExists("//edm:EntityContainer/edm:AssociationSet/mynamespace:MyAssociationSet", xml);
  assertXpathExists("//edm:EntityContainer/edm:AssociationSet/edm:End/myns:MyEndElement", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport/myns:MyFunctionImport", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport/edm:Parameter/myns:MyAnnotation", xml);
  assertXpathExists("//edm:Schema/myns:MyContainer", xml);
  assertXpathExists("//edm:Schema/mynamespace:AnnotElement/mynamespace:testing", xml);
  assertXpathExists("//edm:Schema/mynamespace:AnnotElement/mynamespace:another", xml);
  assertXpathExists("//edm:Schema/mynamespace:AnnotElement/mynamespace:another/mynamespace:yetanother", xml);
  assertXpathExists("//edm:Schema/mynamespace:AnnotElement/mynamespace:another/@mynamespace:foo", xml);
}
 
开发者ID:teiid,项目名称:oreva,代码行数:22,代码来源:EdmxFormatWriterTest.java


示例5: testFunctionImports

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
@Test
public void testFunctionImports() throws XpathException, IOException, SAXException {
  String xml = createXML();

  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='ProductSearch' and @m:HttpMethod='GET']", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='ProductSearch' and not(@IsBindable)]", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='ProductSearch' and not(@IsSideEffecting)]", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='ProductSearch' and not(@m:IsAlwaysBindable)]", xml);
  
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='PerformAction' and @IsBindable='true']", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='PerformAction' and @IsSideEffecting='true']", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='PerformAction' and @m:IsAlwaysBindable='false']", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='PerformAction' and not(@m:HttpMethod)]", xml);

  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='CalculateStuff' and @IsBindable='true']", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='CalculateStuff' and @IsSideEffecting='false']", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='CalculateStuff' and @m:IsAlwaysBindable='false']", xml);
  assertXpathExists("//edm:EntityContainer/edm:FunctionImport[@Name='CalculateStuff' and not(@m:HttpMethod)]", xml);

}
 
开发者ID:teiid,项目名称:oreva,代码行数:21,代码来源:EdmxFormatWriterTest.java


示例6: testMethodNotFound

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
@Test
public void testMethodNotFound() throws XpathException, IOException, SAXException {
  for (FormatType format : ServiceOperationsTest.formats) {
    String uri = endpointUri + "MethodNotAllowed" + "?" + this.formatQuery(format);

    ResponseData responseData;

    responseData = this.rtFacade.putWebResource(uri, null, null, null);
    assertEquals(format.toString(), 404, responseData.getStatusCode());

    responseData = this.rtFacade.deleteWebResource(uri, null, null, null);
    assertEquals(format.toString(), 404, responseData.getStatusCode());

    responseData = this.rtFacade.postWebResource(uri, null, null, null);
    assertEquals(format.toString(), 404, responseData.getStatusCode());

    responseData = this.rtFacade.getWebResource(uri, null, null, null);
    assertEquals(format.toString(), 404, responseData.getStatusCode());

    responseData = this.rtFacade.patchWebResource(uri, null, null, null);
    assertEquals(format.toString(), 404, responseData.getStatusCode());

    responseData = this.rtFacade.mergeWebResource(uri, null, null, null);
    assertEquals(format.toString(), 404, responseData.getStatusCode());
  }
}
 
开发者ID:teiid,项目名称:oreva,代码行数:27,代码来源:ServiceOperationsTest.java


示例7: validateXmlServiceDocument

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
private void validateXmlServiceDocument(final String payload) throws IOException, SAXException, XpathException {
  assertXpathExists("/app:service", payload);
  assertXpathExists("/app:service/app:workspace", payload);
  assertXpathExists("/app:service/app:workspace/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Employees\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Employees\"]/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Teams\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Teams\"]/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Rooms\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Rooms\"]/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Managers\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Managers\"]/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Buildings\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Buildings\"]/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Photos\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Photos\"]/atom:title", payload);
}
 
开发者ID:mibo,项目名称:janos,代码行数:18,代码来源:ServiceXmlTest.java


示例8: verifySingleProperties

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
private void verifySingleProperties(final String xmlString, final boolean employeeName, final boolean age,
    final boolean entryDate, final boolean imageUrl) throws IOException, SAXException, XpathException {
  if (employeeName) {
    assertXpathExists("/a:entry/m:properties/d:EmployeeName", xmlString);
  } else {
    assertXpathNotExists("/a:entry/m:properties/d:EmployeeName", xmlString);
  }
  if (age) {
    assertXpathExists("/a:entry/m:properties/d:Age", xmlString);
  } else {
    assertXpathNotExists("/a:entry/m:properties/d:Age", xmlString);
  }
  if (entryDate) {
    assertXpathExists("/a:entry/m:properties/d:EntryDate", xmlString);
  } else {
    assertXpathNotExists("/a:entry/m:properties/d:EntryDate", xmlString);
  }
  if (imageUrl) {
    assertXpathExists("/a:entry/m:properties/d:ImageUrl", xmlString);
  } else {
    assertXpathNotExists("/a:entry/m:properties/d:ImageUrl", xmlString);
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:24,代码来源:XmlSelectProducerTest.java


示例9: verifyKeyProperties

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
private void verifyKeyProperties(final String xmlString, final boolean employeeId, final boolean managerId,
    final boolean roomId, final boolean teamId) throws IOException, SAXException, XpathException {
  if (employeeId) {
    assertXpathExists("/a:entry/m:properties/d:EmployeeId", xmlString);
  } else {
    assertXpathNotExists("/a:entry/m:properties/d:EmployeeId", xmlString);
  }
  if (managerId) {
    assertXpathExists("/a:entry/m:properties/d:ManagerId", xmlString);
  } else {
    assertXpathNotExists("/a:entry/m:properties/d:ManagerId", xmlString);
  }
  if (roomId) {
    assertXpathExists("/a:entry/m:properties/d:RoomId", xmlString);
  } else {
    assertXpathNotExists("/a:entry/m:properties/d:RoomId", xmlString);
  }
  if (teamId) {
    assertXpathExists("/a:entry/m:properties/d:TeamId", xmlString);
  } else {
    assertXpathNotExists("/a:entry/m:properties/d:TeamId", xmlString);
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:24,代码来源:XmlSelectProducerTest.java


示例10: verifyNavigationProperties

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
private void verifyNavigationProperties(final String xmlString, final boolean neManager, final boolean neRoom,
    final boolean neTeam) throws IOException, SAXException, XpathException {
  if (neManager) {
    assertXpathExists("/a:entry/a:link[@href=\"Employees('1')/ne_Manager\" and @title='ne_Manager']", xmlString);
  } else {
    assertXpathNotExists("/a:entry/a:link[@href=\"Employees('1')/ne_Manager\" and @title='ne_Manager']", xmlString);
  }
  if (neRoom) {
    assertXpathExists("/a:entry/a:link[@href=\"Employees('1')/ne_Room\" and @title='ne_Room']", xmlString);
  } else {
    assertXpathNotExists("/a:entry/a:link[@href=\"Employees('1')/ne_Room\" and @title='ne_Room']", xmlString);
  }
  if (neTeam) {
    assertXpathExists("/a:entry/a:link[@href=\"Employees('1')/ne_Team\" and @title='ne_Team']", xmlString);
  } else {
    assertXpathNotExists("/a:entry/a:link[@href=\"Employees('1')/ne_Team\" and @title='ne_Team']", xmlString);
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:19,代码来源:XmlSelectProducerTest.java


示例11: verifyEmployees

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
private void verifyEmployees(final String path, final String xmlString) throws XpathException, IOException,
SAXException {
assertXpathExists(path, xmlString);
assertXpathExists(path + "/m:inline", xmlString);

assertXpathExists(path + "/m:inline/a:feed[@xml:base='" + BASE_URI + "']", xmlString);
assertXpathExists(path + "/m:inline/a:feed/a:entry", xmlString);
assertXpathExists(path + "/m:inline/a:feed/a:entry/a:id", xmlString);
assertXpathExists(path + "/m:inline/a:feed/a:entry/a:title", xmlString);
assertXpathExists(path + "/m:inline/a:feed/a:entry/a:updated", xmlString);

assertXpathExists(path + "/m:inline/a:feed/a:entry/a:category", xmlString);
assertXpathExists(path + "/m:inline/a:feed/a:entry/a:link", xmlString);

assertXpathExists(path + "/m:inline/a:feed/a:entry/a:content", xmlString);
assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties", xmlString);
assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:EmployeeId", xmlString);
assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:EmployeeName", xmlString);
assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:RoomId", xmlString);

assertXpathExists("/a:entry/a:content/m:properties/d:Id", xmlString);
assertXpathExists("/a:entry/a:content/m:properties/d:Name", xmlString);
assertXpathExists("/a:entry/a:content/m:properties/d:Seats", xmlString);

}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:26,代码来源:AtomFeedProducerTest.java


示例12: serializeEmployeeWithNullSyndicationTitleProperty

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
/**
 * Test serialization of empty syndication title property. EmployeeName is set to NULL after the update (which is
 * allowed because EmployeeName has default Nullable behavior which is true).
 * Write of an empty atom title tag is allowed within RFC4287 (http://tools.ietf.org/html/rfc4287#section-4.2.14).
 */
@Test
public void serializeEmployeeWithNullSyndicationTitleProperty() throws IOException, XpathException, SAXException,
    XMLStreamException, FactoryConfigurationError, ODataException {
  AtomEntityProvider ser = createAtomEntityProvider();
  EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(BASE_URI).build();
  employeeData.put("EmployeeName", null);
  ODataResponse response =
      ser.writeEntry(MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Employees"), employeeData,
          properties);
  String xmlString = verifyResponse(response);

  assertXpathExists("/a:entry/a:title", xmlString);
  assertXpathEvaluatesTo("", "/a:entry/a:title", xmlString);

  assertXpathExists("/a:entry", xmlString);
  assertXpathEvaluatesTo(BASE_URI.toASCIIString(), "/a:entry/@xml:base", xmlString);

  assertXpathExists("/a:entry/a:content", xmlString);
  assertXpathEvaluatesTo("Employees('1')/$value", "/a:entry/a:content/@src", xmlString);
  assertXpathExists("/a:entry/m:properties", xmlString);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:27,代码来源:AtomEntryProducerTest.java


示例13: serializeEmployeeAndCheckOrderOfPropertyTags

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
@Test
public void serializeEmployeeAndCheckOrderOfPropertyTags() throws IOException, XpathException, SAXException,
    XMLStreamException, FactoryConfigurationError, ODataException {
  AtomEntityProvider ser = createAtomEntityProvider();
  EntityProviderWriteProperties properties =
      EntityProviderWriteProperties.serviceRoot(BASE_URI).build();
  EdmEntitySet employeeEntitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Employees");
  ODataResponse response = ser.writeEntry(employeeEntitySet, employeeData, properties);
  String xmlString = verifyResponse(response);

  // log.debug(xmlString);

  assertXpathExists("/a:entry", xmlString);
  assertXpathExists("/a:entry/a:content", xmlString);
  // verify properties
  assertXpathExists("/a:entry/m:properties", xmlString);
  assertXpathEvaluatesTo("9", "count(/a:entry/m:properties/*)", xmlString);

  // verify order of tags
  List<String> expectedPropertyNamesFromEdm = employeeEntitySet.getEntityType().getPropertyNames();
  verifyTagOrdering(xmlString, expectedPropertyNamesFromEdm.toArray(new String[0]));
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:23,代码来源:AtomEntryProducerTest.java


示例14: serializeAtomEntry

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
@Test
public void serializeAtomEntry() throws IOException, XpathException, SAXException, XMLStreamException,
    FactoryConfigurationError, ODataException {
  final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(BASE_URI).build();
  AtomEntityProvider ser = createAtomEntityProvider();
  ODataResponse response =
      ser.writeEntry(MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms"), roomData, properties);
  String xmlString = verifyResponse(response);

  assertXpathExists("/a:entry", xmlString);
  assertXpathEvaluatesTo(BASE_URI.toASCIIString(), "/a:entry/@xml:base", xmlString);

  assertXpathExists("/a:entry/a:content", xmlString);
  assertXpathEvaluatesTo(ContentType.APPLICATION_XML.toString(), "/a:entry/a:content/@type", xmlString);

  assertXpathExists("/a:entry/a:content/m:properties", xmlString);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:18,代码来源:AtomEntryProducerTest.java


示例15: serializeWithValueEncoding

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
@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);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:19,代码来源:AtomEntryProducerTest.java


示例16: serializeETagEncoding

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
@Test
public void serializeETagEncoding() throws IOException, XpathException, SAXException, XMLStreamException,
    FactoryConfigurationError, ODataException {
  Edm edm = MockFacade.getMockEdm();
  EdmTyped roomIdProperty = edm.getEntityType("RefScenario", "Room").getProperty("Id");
  EdmFacets facets = mock(EdmFacets.class);
  when(facets.getConcurrencyMode()).thenReturn(EdmConcurrencyMode.Fixed);
  when(facets.getMaxLength()).thenReturn(3);
  when(((EdmProperty) roomIdProperty).getFacets()).thenReturn(facets);

  roomData.put("Id", "<\">");
  AtomEntityProvider ser = createAtomEntityProvider();
  ODataResponse response =
      ser.writeEntry(edm.getDefaultEntityContainer().getEntitySet("Rooms"), roomData, DEFAULT_PROPERTIES);

  assertNotNull(response);
  assertNotNull(response.getEntity());
  assertNull("EntityProvider should not set content header", response.getContentHeader());
  assertEquals("W/\"<\">.3\"", response.getETag());

  String xmlString = StringHelper.inputStreamToString((InputStream) response.getEntity());

  assertXpathExists("/a:entry", xmlString);
  assertXpathExists("/a:entry/@m:etag", xmlString);
  assertXpathEvaluatesTo("W/\"<\">.3\"", "/a:entry/@m:etag", xmlString);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:27,代码来源:AtomEntryProducerTest.java


示例17: verifyEmployees

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
private void verifyEmployees(final String path, final String xmlString) throws XpathException, IOException,
    SAXException {
  assertXpathExists(path, xmlString);
  assertXpathExists(path + "/m:inline", xmlString);

  assertXpathExists(path + "/m:inline/a:feed[@xml:base='" + inlineBaseUri.toString() + "']", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/a:id", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/a:title", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/a:updated", xmlString);

  assertXpathExists(path + "/m:inline/a:feed/a:entry/a:category", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/a:link", xmlString);

  assertXpathExists(path + "/m:inline/a:feed/a:entry/a:content", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:EmployeeId", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:EmployeeName", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:ManagerId", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:TeamId", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:RoomId", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:Location", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:Age", xmlString);
  assertXpathExists(path + "/m:inline/a:feed/a:entry/m:properties/d:ImageUrl", xmlString);

}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:27,代码来源:XmlExpandProducerTest.java


示例18: verifyRoom

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
private void verifyRoom(final String path, final String xmlString) throws XpathException, IOException, SAXException {
  assertXpathExists(path, xmlString);
  assertXpathExists(path + "/m:inline", xmlString);

  assertXpathExists(path + "/m:inline/a:entry", xmlString);
  assertXpathExists(path + "/m:inline/a:entry[@xml:base='" + inlineBaseUri.toString() + "']", xmlString);
  assertXpathExists(path + "/m:inline/a:entry/a:id", xmlString);
  assertXpathExists(path + "/m:inline/a:entry/a:title", xmlString);
  assertXpathExists(path + "/m:inline/a:entry/a:updated", xmlString);

  assertXpathExists(path + "/m:inline/a:entry/a:category", xmlString);
  assertXpathExists(path + "/m:inline/a:entry/a:link", xmlString);

  assertXpathExists(path + "/m:inline/a:entry/a:content", xmlString);
  assertXpathExists(path + "/m:inline/a:entry/a:content/m:properties", xmlString);
  assertXpathExists(path + "/m:inline/a:entry/a:content/m:properties/d:Id", xmlString);
  assertXpathExists(path + "/m:inline/a:entry/a:content/m:properties/d:Name", xmlString);
  assertXpathExists(path + "/m:inline/a:entry/a:content/m:properties/d:Seats", xmlString);
  assertXpathExists(path + "/m:inline/a:entry/a:content/m:properties/d:Version", xmlString);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:21,代码来源:XmlExpandProducerTest.java


示例19: validateXmlServiceDocument

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
private void validateXmlServiceDocument(final String payload) throws IOException, SAXException, XpathException {
  assertXpathExists("/app:service", payload);
  assertXpathExists("/app:service/app:workspace", payload);
  assertXpathExists("/app:service/app:workspace/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Employees\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Employees\"]/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Teams\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Teams\"]/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Rooms\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Rooms\"]/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Managers\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Managers\"]/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Buildings\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Buildings\"]/atom:title", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Container2.Photos\"]", payload);
  assertXpathExists("/app:service/app:workspace/app:collection[@href=\"Container2.Photos\"]/atom:title", payload);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:18,代码来源:ServiceXmlTest.java


示例20: assertXpathEquality

import org.custommonkey.xmlunit.exceptions.XpathException; //导入依赖的package包/类
/**
 * Assert that the node lists of two Xpaths in two documents are
 * equal or not.
 * @param controlXpath
 * @param testXpath
 * @param controlDocument
 * @param testDocument
 * @param equal whether the values should be equal.
 * @see XpathEngine
 */
private static void assertXpathEquality(String controlXpath,
                                        Document controlDocument,
                                        String testXpath,
                                        Document testDocument,
                                        boolean equal)
    throws XpathException {
    XpathEngine xpath = XMLUnit.newXpathEngine();
    Diff diff = new Diff(asXpathResultDocument(XMLUnit.newControlParser(),
                                               xpath.getMatchingNodes(controlXpath,
                                                                      controlDocument)),
                         asXpathResultDocument(XMLUnit.newTestParser(),
                                               xpath.getMatchingNodes(testXpath,
                                                                      testDocument)));
    assertXMLEqual(diff, equal);
}
 
开发者ID:xmlunit,项目名称:xmlunit,代码行数:26,代码来源:XMLAssert.java



注:本文中的org.custommonkey.xmlunit.exceptions.XpathException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EtcdKeysResponse类代码示例发布时间:2022-05-22
下一篇:
Java States类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap