コード例 #1
0
  public void testValidNamespaceAttributes() {
    EncryptionProperty encProp = (EncryptionProperty) target;

    QName attribName = new QName(XMLConstants.XML_NS, "lang", XMLConstants.XML_PREFIX);
    encProp.getUnknownAttributes().put(attribName, "en-US");

    assertValidationPass(
        "EncryptionProperty contained an attribute from the XML namespace, should have passed validation");
  }
コード例 #2
0
  public void testInvalidNamespaceAttributes() {
    EncryptionProperty encProp = (EncryptionProperty) target;

    QName attribName = new QName("urn:namespace:foo", "FooAttrib", "foo");
    encProp.getUnknownAttributes().put(attribName, "foobar");

    assertValidationFail(
        "EncryptionProperty contained an attribute with an invalid namespace, should have failed validation");
  }
コード例 #3
0
  public void testInvalidNamespaceChildren() {
    EncryptionProperty encProp = (EncryptionProperty) target;

    SimpleXMLObjectBuilder sxoBuilder = new SimpleXMLObjectBuilder();
    SimpleXMLObject sxo =
        sxoBuilder.buildObject(XMLConstants.XMLENC_NS, "Foo", XMLConstants.XMLENC_PREFIX);

    encProp.getUnknownXMLObjects().add(sxo);

    assertValidationFail(
        "EncryptionProperty contained a child with an invalid namespace, should have failed validation");
  }
コード例 #4
0
  public void testMissingChildren() {
    EncryptionProperty encProp = (EncryptionProperty) target;

    encProp.getUnknownXMLObjects().clear();
    assertValidationFail("EncryptionProperty child list was empty, should have failed validation");
  }
コード例 #5
0
  protected void populateRequiredData() {
    super.populateRequiredData();
    EncryptionProperty encProp = (EncryptionProperty) target;

    encProp.getUnknownXMLObjects().add(buildXMLObject(simpleXMLObjectQName));
  }