FileDocCategorySizeDatePackage
TestString3.javaAPI DocApache Axis 1.42832Sat Apr 22 18:57:26 BST 2006test.encoding

TestString3

public class TestString3 extends TestCase
line feed normalization and character reference processing

Fields Summary
public static final String
myNS
static String
xml1
static String
xml2
Constructors Summary
public TestString3(String name)

    
       
        super(name);
    
Methods Summary
private voidruntest(java.lang.String value, java.lang.String expected)


            
        MessageContext msgContext = new MessageContext(new AxisServer());
        String requestEncoding = "UTF-8";
        msgContext.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, requestEncoding);

        String xml = xml1 + value + xml2;
        ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());

        DeserializationContext dser = new DeserializationContext(
            new InputSource(bais), msgContext, org.apache.axis.Message.REQUEST);
        dser.parse();
        
        org.apache.axis.message.SOAPEnvelope env = dser.getEnvelope();
        RPCElement rpcElem = (RPCElement)env.getFirstBody();
        RPCParam output = rpcElem.getParam("testParam");
        assertNotNull("No <testParam> param", output);

        String nodeValue = (String) output.getObjectValue();
        assertNotNull("No node value for testParam param", nodeValue);
        assertEquals(expected, nodeValue);
    
public voidtestEntitizedCR()

        runtest("
Hello
World
", "\rHello\rWorld\r");
    
public voidtestEntitizedCRLF()

        runtest("
Hello
World
", "\r\nHello\r\nWorld\r\n");
    
public voidtestPlainCR()

        runtest("\rHello\rWorld\r", "\nHello\nWorld\n");
    
public voidtestPlainCRLF()

        runtest("\r\nHello\r\nWorld\r\n", "\nHello\nWorld\n");