FileDocCategorySizeDatePackage
TestNSStack.javaAPI DocApache Axis 1.43396Sat Apr 22 18:57:26 BST 2006test.utils

TestNSStack

public class TestNSStack extends test.AxisTestBase

Fields Summary
String
prefix
String
suffix
String
m1
String
m2
Constructors Summary
public TestNSStack(String name)

        super(name);
    
Methods Summary
public static voidmain(java.lang.String[] args)

        TestNSStack test = new TestNSStack("TestNSStack");
        test.testNSStack1();
        test.testNSStack2();
    
protected voidsetUp()

        AxisProperties.setProperty(AxisEngine.PROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION,"false");
    
public static junit.framework.Testsuite()

        return new TestSuite(TestNSStack.class);
    
protected voidtearDown()

        AxisProperties.setProperty(AxisEngine.PROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION,"true");
    
public voidtestNSStack1()


        
    
        String msg = prefix+m1+suffix;
        StringReader strReader = new StringReader(msg);
        DeserializationContext dser = new DeserializationContext(
                new InputSource(strReader), null,
                org.apache.axis.Message.REQUEST);
        dser.parse();
        org.apache.axis.message.SOAPEnvelope env = dser.getEnvelope();
        String xml = env.toString();
        boolean oldIgnore = XMLUnit.getIgnoreWhitespace();
        XMLUnit.setIgnoreWhitespace(true);
        try {
            assertXMLIdentical("NSStack invalidated XML canonicalization",
                    new Diff(msg, xml), true);
        } finally {
            XMLUnit.setIgnoreWhitespace(oldIgnore);
        }
    
public voidtestNSStack2()

        String msg = prefix+m2+suffix;
        StringReader strReader = new StringReader(msg);
        DeserializationContext dser = new DeserializationContext(
                new InputSource(strReader), null,
                org.apache.axis.Message.REQUEST);
        dser.parse();
        org.apache.axis.message.SOAPEnvelope env = dser.getEnvelope();
        String xml = env.toString();
        boolean oldIgnore = XMLUnit.getIgnoreWhitespace();
        XMLUnit.setIgnoreWhitespace(true);
        try {
            assertXMLIdentical("NSStack invalidated XML canonicalization",
                    new Diff(msg, xml), true);
        } finally {
            XMLUnit.setIgnoreWhitespace(oldIgnore);
        }