1 16 package org.apache.axis2.om; 17 18 import org.apache.axis2.om.impl.llom.OMNamespaceImpl; 19 import org.apache.axis2.soap.SOAPHeader; 20 import org.apache.axis2.soap.SOAPHeaderBlock; 21 22 import java.util.Iterator ; 23 24 public class OMHeaderTest extends OMTestCase { 25 SOAPHeader soapHeader; 26 27 public OMHeaderTest(String testName) { 28 super(testName); 29 } 30 31 public static void main(String [] args) { 32 } 33 34 37 protected void setUp() throws Exception { 38 super.setUp(); 39 soapHeader = soapEnvelope.getHeader(); 40 } 41 42 public void testAddHeaderElement() { 43 String newElementName = "MyHeaderElement"; 44 SOAPHeaderBlock soapHeaderElement = soapHeader.addHeaderBlock(newElementName, new OMNamespaceImpl("http://opensource.lk", "lsf")); 45 assertTrue("Header Element added has different parent than it should have", soapHeaderElement.getParent() == soapHeader); 46 assertTrue("Header Element added has different localname than it was given", soapHeaderElement.getLocalName().equalsIgnoreCase(newElementName)); 47 } 48 49 public void testExamineHeaderElements() { 50 } 51 52 public void testExtractHeaderElements() { 53 } 55 56 public void testExamineMustUnderstandHeaderElements() { 57 } 59 60 public void testExamineAllHeaderElements() { 61 Iterator iterator = soapHeader.examineAllHeaderBlocks(); 62 int headerElementCount = 0; 63 while (iterator.hasNext()) { 64 iterator.next(); 65 headerElementCount++; 66 } 67 assertTrue("Number of header elements in the header differs from expected value of 3", headerElementCount == 3); 68 } 69 70 public void testExtractAllHeaderElements() { 71 } 73 74 } 75 | Popular Tags |