TestString3public 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 void | runtest(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 void | testEntitizedCR()
runtest("
Hello
World
", "\rHello\rWorld\r");
| public void | testEntitizedCRLF()
runtest("
Hello
World
", "\r\nHello\r\nWorld\r\n");
| public void | testPlainCR()
runtest("\rHello\rWorld\r", "\nHello\nWorld\n");
| public void | testPlainCRLF()
runtest("\r\nHello\r\nWorld\r\n", "\nHello\nWorld\n");
|
|