Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
cdd9bc91
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cdd9bc91
编写于
3月 04, 2018
作者:
X
xyin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8198931: remove java.xml.bind module dependency for com/sun/jndi tests
Reviewed-by: lancea
上级
a3351fb5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
43 addition
and
7 deletion
+43
-7
test/jdk/com/sun/jndi/dns/AttributeTests/GetAny.java
test/jdk/com/sun/jndi/dns/AttributeTests/GetAny.java
+1
-2
test/jdk/com/sun/jndi/dns/lib/DNSServer.java
test/jdk/com/sun/jndi/dns/lib/DNSServer.java
+40
-2
test/jdk/com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java
test/jdk/com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java
+2
-3
未找到文件。
test/jdk/com/sun/jndi/dns/AttributeTests/GetAny.java
浏览文件 @
cdd9bc91
...
...
@@ -26,8 +26,7 @@
* @bug 8195976
* @summary Tests that we can get the attributes of a DNS entry using special
* qualifiers.
* @modules java.xml.bind
* java.base/sun.security.util
* @modules java.base/sun.security.util
* @library ../lib/
* @build DNSTestUtils DNSServer DNSTracer
* @run main GetAny
...
...
test/jdk/com/sun/jndi/dns/lib/DNSServer.java
浏览文件 @
cdd9bc91
...
...
@@ -23,7 +23,6 @@
import
sun.security.util.HexDumpEncoder
;
import
javax.xml.bind.DatatypeConverter
;
import
java.io.IOException
;
import
java.net.DatagramPacket
;
import
java.net.DatagramSocket
;
...
...
@@ -196,7 +195,7 @@ public class DNSServer implements Runnable {
* Add an DNS encoding to the cache (by request message key).
*/
private
void
addToCache
(
String
hexString
)
{
byte
[]
encoding
=
DatatypeConverter
.
parseHexBinary
(
hexString
);
byte
[]
encoding
=
parseHexBinary
(
hexString
);
if
(
encoding
.
length
<
DNS_HEADER_SIZE
)
{
throw
new
RuntimeException
(
"Invalid DNS message : "
+
hexString
);
}
...
...
@@ -261,4 +260,43 @@ public class DNSServer implements Runnable {
return
payload
;
}
public
static
byte
[]
parseHexBinary
(
String
s
)
{
final
int
len
=
s
.
length
();
// "111" is not a valid hex encoding.
if
(
len
%
2
!=
0
)
{
throw
new
IllegalArgumentException
(
"hexBinary needs to be even-length: "
+
s
);
}
byte
[]
out
=
new
byte
[
len
/
2
];
for
(
int
i
=
0
;
i
<
len
;
i
+=
2
)
{
int
h
=
hexToBin
(
s
.
charAt
(
i
));
int
l
=
hexToBin
(
s
.
charAt
(
i
+
1
));
if
(
h
==
-
1
||
l
==
-
1
)
{
throw
new
IllegalArgumentException
(
"contains illegal character for hexBinary: "
+
s
);
}
out
[
i
/
2
]
=
(
byte
)
(
h
*
16
+
l
);
}
return
out
;
}
private
static
int
hexToBin
(
char
ch
)
{
if
(
'0'
<=
ch
&&
ch
<=
'9'
)
{
return
ch
-
'0'
;
}
if
(
'A'
<=
ch
&&
ch
<=
'F'
)
{
return
ch
-
'A'
+
10
;
}
if
(
'a'
<=
ch
&&
ch
<=
'f'
)
{
return
ch
-
'a'
+
10
;
}
return
-
1
;
}
}
test/jdk/com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java
浏览文件 @
cdd9bc91
...
...
@@ -26,11 +26,10 @@
* @bug 8196770
* @summary Verify capability to add a new entry to the directory using the
* ADD operation.
* @modules java.xml.bind
* java.naming/com.sun.jndi.ldap
* @modules java.naming/com.sun.jndi.ldap
* @library ../../lib/ /javax/naming/module/src/test/test/
* @build LDAPServer LDAPTestUtils
* @run main AddNewEntry
* @run main
/othervm
AddNewEntry
*/
import
javax.naming.NamingEnumeration
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录