Author: jim.ma
Date: 2012-09-21 08:47:11 -0400 (Fri, 21 Sep 2012)
New Revision: 16751
Added:
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/wsa-version-mismatch.xml
Modified:
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/Test119XTestCase.java
Log:
Add wsi bp Test1193
Modified:
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/Test119XTestCase.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/Test119XTestCase.java 2012-09-21
07:34:27 UTC (rev 16750)
+++
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/Test119XTestCase.java 2012-09-21
12:47:11 UTC (rev 16751)
@@ -120,7 +120,7 @@
//To mustunderstand
InputStream msgIns =
getClass().getResourceAsStream("./wsa-to-mustunderstand.xml");
String msg = new String(IOUtils.readBytesFromStream(msgIns));
- msg = msg.replaceAll("$PORT", "80");
+ msg = msg.replaceAll("$PORT", "9090");
ByteArrayInputStream bout = new ByteArrayInputStream(msg.getBytes());
@@ -138,7 +138,7 @@
//fault to must understand
msgIns =
getClass().getResourceAsStream("./wsa-faultto-mustunderstand.xml");
msg = new String(IOUtils.readBytesFromStream(msgIns));
- msg = msg.replaceAll("$PORT", "80");
+ msg = msg.replaceAll("$PORT", "9090");
bout = new ByteArrayInputStream(msg.getBytes());
@@ -155,7 +155,7 @@
msgIns =
getClass().getResourceAsStream("./wsa-faultto-mustunderstand.xml");
msg = new String(IOUtils.readBytesFromStream(msgIns));
- msg = msg.replaceAll("$PORT", "80");
+ msg = msg.replaceAll("$PORT", "9090");
bout = new ByteArrayInputStream(msg.getBytes());
@@ -172,7 +172,7 @@
msgIns =
getClass().getResourceAsStream("./wsa-replyto-mustunderstand.xml");
msg = new String(IOUtils.readBytesFromStream(msgIns));
- msg = msg.replaceAll("$PORT", "80");
+ msg = msg.replaceAll("$PORT", "9090");
bout = new ByteArrayInputStream(msg.getBytes());
@@ -188,7 +188,7 @@
}
msgIns =
getClass().getResourceAsStream("./wsa-msgid-mustunderstand.xml");
msg = new String(IOUtils.readBytesFromStream(msgIns));
- msg = msg.replaceAll("$PORT", "80");
+ msg = msg.replaceAll("$PORT", "9090");
bout = new ByteArrayInputStream(msg.getBytes());
@@ -204,5 +204,45 @@
}
}
+ public void testVersionMisMatch() throws Exception
+ {
+ //test1194-version mismatch
+ // construct proxy
+ URL url = new URL("http://localhost:9090/jaxws-bp12test1190/Test1190");
+ HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
+ InputStream msgIns =
getClass().getResourceAsStream("./wsa-version-mismatch.xml");
+ String msg = new String(IOUtils.readBytesFromStream(msgIns));
+ httpConn.setRequestProperty("Content-Length",
String.valueOf(msg.length()));
+ httpConn.setRequestProperty("Content-Type", "text/xml;
charset=utf-8");
+ httpConn.setRequestProperty("SOAPAction", "test");
+ httpConn.setRequestMethod("POST");
+ httpConn.setDoOutput(true);
+ httpConn.setDoInput(true);
+
+ OutputStream out = httpConn.getOutputStream();
+ out.write(msg.getBytes());
+ out.close();
+
+ if (httpConn.getResponseCode() >= 500)
+ {
+ InputStreamReader isr = new InputStreamReader(httpConn.getErrorStream());
+ BufferedReader in = new BufferedReader(isr);
+
+ String inputLine;
+
+ StringBuffer buffer = new StringBuffer();
+ while ((inputLine = in.readLine()) != null)
+ buffer.append(inputLine);
+
+ in.close();
+ assertTrue("Expected version mismatch error",
buffer.toString().contains("soap:VersionMismatch"));
+
+ }
+ else
+ {
+ fail("Expected version mismatch error");
+ }
+
+ }
}
\ No newline at end of file
Added:
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/wsa-version-mismatch.xml
===================================================================
---
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/wsa-version-mismatch.xml
(rev 0)
+++
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/wsa-version-mismatch.xml 2012-09-21
12:47:11 UTC (rev 16751)
@@ -0,0 +1,13 @@
+<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelopesss/">
+ <soap:Header>
+ <Action
xmlns="http://www.w3.org/2005/08/addressing">http://example....
+ </Action>
+ <To
xmlns="http://www.w3.org/2005/08/addressing">http://localhos...
+ <ReplyTo
xmlns="http://www.w3.org/2005/08/addressing">
+ <
Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
+ </ReplyTo>
+ </soap:Header>
+ <soap:Body>
+ <echoIn1
xmlns="http://example.org/echo">input string</echoIn1>
+ </soap:Body>
+</soap:Envelope>
\ No newline at end of file