コード例 #1
0
  public void testRestrictAgainstObjectImpliesInferInheritanceHeirarchy() {

    String xml = "<?xml version=\"1.0\"?><inspection-result />";

    XmlInspectorConfig config = new XmlInspectorConfig();
    config.setRestrictAgainstObject(new JavaBeanPropertyStyle());
    config.setInferInheritanceHierarchy(true);
    config.setInputStream(new ByteArrayInputStream(xml.getBytes()));

    try {
      mInspector = new XmlInspector(config);
    } catch (InspectorException e) {
      assertEquals(
          "When using restrictAgainstObject, inferInheritanceHierarchy is implied", e.getMessage());
    }
  }