super(metaFactory, spec);
}
protected void runTest() throws Throwable {
SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
SOAPHeader header = soapFactory.createSOAPHeader(envelope);
OMNamespace ns1 = soapFactory.createOMNamespace("urn:ns1", "ns1");
OMNamespace ns2 = soapFactory.createOMNamespace("urn:ns2", "ns2");
String myRole = "urn:myRole";
String otherRole ="urn:otherRole";
SOAPHeaderBlock headerBlock1 = header.addHeaderBlock("header1", ns1);
headerBlock1.setRole(myRole);
SOAPHeaderBlock headerBlock2 = header.addHeaderBlock("header2", ns2);
headerBlock2.setRole(myRole);
SOAPHeaderBlock headerBlock3 = header.addHeaderBlock("header3", ns1);
headerBlock3.setRole(myRole);
SOAPHeaderBlock headerBlock4 = header.addHeaderBlock("header4", ns1);
headerBlock4.setRole(otherRole);
Iterator it = header.getHeadersToProcess(new MyRolePlayer(false, new String[] { myRole }), ns1.getNamespaceURI());
assertTrue(it.hasNext());
assertSame(headerBlock1, it.next());
assertTrue(it.hasNext());
assertSame(headerBlock3, it.next());
assertFalse(it.hasNext());