Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
9ddee60f
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9ddee60f
编写于
12月 02, 2017
作者:
A
aefimov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8186441: Change of behavior in the getMessage () method of the SOAPMessageContextImpl class
Reviewed-by: lancea
上级
b71ba700
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
40 addition
and
2 deletion
+40
-2
test/javax/xml/ws/8159058/SaajEmptyNamespaceTest.java
test/javax/xml/ws/8159058/SaajEmptyNamespaceTest.java
+40
-2
未找到文件。
test/javax/xml/ws/8159058/SaajEmptyNamespaceTest.java
浏览文件 @
9ddee60f
...
...
@@ -23,7 +23,7 @@
/*
* @test
* @bug 8159058
* @bug 8159058
8186441
* @summary Test that empty default namespace declaration clears the
* default namespace value
* @compile -XDignore.symbol.file SaajEmptyNamespaceTest.java
...
...
@@ -58,6 +58,26 @@ import org.w3c.dom.Node;
public
class
SaajEmptyNamespaceTest
{
/*
* Test that SOAP reader doesn't move namespaces declarations to SOAP body element
* as reported in JDK-8186441
*/
@Test
public
void
testPreserveNamespacesPosition
()
throws
Exception
{
// Create SOAP message from XML string and process it with SAAJ reader
XMLStreamReader
envelope
=
XMLInputFactory
.
newFactory
().
createXMLStreamReader
(
new
StringReader
(
INPUT_SOAP_MESSAGE_2
));
StreamMessage
streamMessage
=
new
StreamMessage
(
SOAPVersion
.
SOAP_11
,
envelope
,
null
);
SAAJFactory
saajFact
=
new
SAAJFactory
();
SOAPMessage
soapMessage
=
saajFact
.
readAsSOAPMessage
(
SOAPVersion
.
SOAP_11
,
streamMessage
);
//Get SOAP body and convert it to string representation
SOAPBody
body
=
soapMessage
.
getSOAPBody
();
String
bodyAsString
=
nodeToText
(
body
);
Assert
.
assertEquals
(
bodyAsString
,
PRESERVE_NAMESPACES_EXPECTED_RESULT
);
}
/*
* Test that SOAP message with default namespace declaration that contains empty
* string is properly processed by SAAJ reader.
...
...
@@ -273,10 +293,28 @@ public class SaajEmptyNamespaceTest {
// Expected body content after SAAJ processing
private
static
String
EXPECTED_RESULT
=
"<SampleServiceRequest"
+
" xmlns=\"http://example.org/test\">"
+
" xmlns=\"http://example.org/test\""
+
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"
+
"<RequestParams xmlns=\"\">"
+
"<Param1>hogehoge</Param1>"
+
"<Param2>fugafuga</Param2>"
+
"</RequestParams>"
+
"</SampleServiceRequest>"
;
private
static
String
PRESERVE_NAMESPACES_EXPECTED_RESULT
=
"<s:Body xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+
"<Request xmlns=\"http://example.org/NS_1\">"
+
"<Item><Contact xmlns=\"http://example.org/NS_2\">Test_Contact</Contact>"
+
"</Item></Request></s:Body>"
;
private
static
String
INPUT_SOAP_MESSAGE_2
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+
"<s:Body>"
+
"<Request xmlns=\"http://example.org/NS_1\">"
+
"<Item>"
+
"<Contact xmlns=\"http://example.org/NS_2\">Test_Contact</Contact>"
+
"</Item>"
+
"</Request>"
+
"</s:Body>"
+
"</s:Envelope>"
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录