1 16 package org.apache.axis2.om; 17 18 import org.apache.axis2.soap.SOAPHeader; 19 import org.apache.axis2.soap.SOAPHeaderBlock; 20 21 import java.util.Iterator ; 22 23 public class OMHeaderBlockTest extends OMTestCase { 24 SOAPHeader soapHeader; 25 SOAPHeaderBlock soapHeaderElement; 26 27 public OMHeaderBlockTest(String testName) { 28 super(testName); 29 } 30 31 protected void setUp() throws Exception { 32 super.setUp(); 33 soapHeader = soapEnvelope.getHeader(); 34 Iterator headerElementIter = soapHeader.examineAllHeaderBlocks(); 35 if (headerElementIter.hasNext()) { 36 soapHeaderElement = (SOAPHeaderBlock) headerElementIter.next(); 37 } 38 } 39 40 public void testSetAndGetActor() { 41 String newActorURI = "http://newActor.org"; 42 soapHeaderElement.setRole(newActorURI); 43 System.out.println("ActorURI = " + soapHeaderElement.getRole()); 44 assertTrue("Actor was not properly set", soapHeaderElement.getRole().equalsIgnoreCase(newActorURI)); 45 } 46 47 public void testSetAndGetMustUnderstand() { 48 soapHeaderElement.setMustUnderstand(false); 49 assertTrue("MustUnderstand was not properly set", !soapHeaderElement.getMustUnderstand()); 50 } 51 52 public void testGetMustUnderstand() { 53 } 55 56 } 57 | Popular Tags |