Search in sources :

Example 1 with BooleanAttributeAccessor

use of org.apache.axiom.ts.soap.BooleanAttributeAccessor in project webservices-axiom by apache.

the class TestSetBooleanAttribute method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
    BooleanAttributeAccessor accessor = attribute.getAdapter(BooleanAttributeAccessor.class);
    accessor.setValue(soapHeaderBlock, value);
    assertEquals(value, accessor.getValue(soapHeaderBlock));
    Iterator<OMAttribute> it = soapHeaderBlock.getAllAttributes();
    assertTrue(it.hasNext());
    OMAttribute att = it.next();
    OMNamespace ns = att.getNamespace();
    assertEquals(spec.getEnvelopeNamespaceURI(), ns.getNamespaceURI());
    assertEquals(attribute.getName(spec), att.getLocalName());
    assertEquals(spec.getCanonicalRepresentation(value), att.getAttributeValue());
    assertFalse(it.hasNext());
}
Also used : OMNamespace(org.apache.axiom.om.OMNamespace) BooleanAttributeAccessor(org.apache.axiom.ts.soap.BooleanAttributeAccessor) SOAPHeaderBlock(org.apache.axiom.soap.SOAPHeaderBlock) OMAttribute(org.apache.axiom.om.OMAttribute)

Aggregations

OMAttribute (org.apache.axiom.om.OMAttribute)1 OMNamespace (org.apache.axiom.om.OMNamespace)1 SOAPHeaderBlock (org.apache.axiom.soap.SOAPHeaderBlock)1 BooleanAttributeAccessor (org.apache.axiom.ts.soap.BooleanAttributeAccessor)1