Author: darran.lofthouse(a)jboss.com
Date: 2009-06-19 12:36:27 -0400 (Fri, 19 Jun 2009)
New Revision: 10206
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/common/soap/jbpapp2127.xml
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java
Log:
[JBPAPP-2127] Add support for Node.getTextContent.
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2009-06-19
13:17:56 UTC (rev 10205)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2009-06-19
16:36:27 UTC (rev 10206)
@@ -607,8 +607,7 @@
public String getTextContent() throws DOMException
{
- // FIXME getTextContent
- throw new NotImplementedException("getTextContent");
+ return domNode.getTextContent();
}
public Object getUserData(String key)
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java 2009-06-19
13:17:56 UTC (rev 10205)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/common/soap/SOAPElementTestCase.java 2009-06-19
16:36:27 UTC (rev 10206)
@@ -123,7 +123,39 @@
}
assertEquals("Strawberry Apple Banana Orange Raspberry ",
sb.toString());
}
+
+ // JBPAPP-2127
+ public void testGetTextContent() throws Exception
+ {
+ InputStream is = new
File("resources/common/soap/jbpapp2127.xml").toURL().openStream();
+ MessageFactory messageFactory = MessageFactory.newInstance();
+ SOAPMessage soapMessage = messageFactory.createMessage(null, is);
+ NodeList nl = soapMessage.getSOAPBody().getChildNodes();
+ SOAPElement echo = null;
+ for (int i = 0; i < nl.getLength() && echo == null; i++)
+ {
+ Object current = nl.item(i);
+ if (current instanceof SOAPElement)
+ {
+ echo = (SOAPElement)current;
+ }
+ }
+ nl = echo.getChildNodes();
+ SOAPElement arg0 = null;
+ for (int i = 0; i < nl.getLength() && arg0 == null; i++)
+ {
+ Object current = nl.item(i);
+ if (current instanceof SOAPElement)
+ {
+ arg0 = (SOAPElement)current;
+ }
+ }
+ String value = arg0.getTextContent();
+
+ assertEquals("Expected value", "123", value);
+ }
+
//
http://jira.jboss.com/jira/browse/JBWS-773
public void testGetNamespaceURI() throws Exception
{
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java 2009-06-19
13:17:56 UTC (rev 10205)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java 2009-06-19
16:36:27 UTC (rev 10206)
@@ -55,7 +55,8 @@
private String badMsgString =
"<soapenv:Envelope
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:jbw='http://ws.jboss.org/jbws2682'>" +
- " <soapenv:Header/>" + " <soapenv:Body>" +
+ " <soapenv:Header/>" +
+ " <soapenv:Body>" +
" <jbw:echo>" +
" <arg0>1-1</arg0>" +
" </jbw:echo>" +
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/common/soap/jbpapp2127.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/common/soap/jbpapp2127.xml
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/common/soap/jbpapp2127.xml 2009-06-19
16:36:27 UTC (rev 10206)
@@ -0,0 +1,8 @@
+<soapenv:Envelope
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:jbw='http://ws.jboss.org/jbpapp2127'>
+ <soapenv:Header/>
+ <soapenv:Body>
+ <jbw:echo>
+ <arg0>123</arg0>
+ </jbw:echo>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Property changes on:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/common/soap/jbpapp2127.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF