Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
a9e1e8b1
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看板
提交
a9e1e8b1
编写于
8月 21, 2013
作者:
X
xuelei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8022228: Intermittent test failures in sun/security/ssl/javax/net/ssl/NewAPIs
Reviewed-by: weijun
上级
5a9bd4fb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
174 addition
and
67 deletion
+174
-67
test/sun/security/ssl/javax/net/ssl/NewAPIs/SessionCacheSizeTests.java
...rity/ssl/javax/net/ssl/NewAPIs/SessionCacheSizeTests.java
+88
-34
test/sun/security/ssl/javax/net/ssl/NewAPIs/SessionTimeOutTests.java
...curity/ssl/javax/net/ssl/NewAPIs/SessionTimeOutTests.java
+85
-32
test/sun/security/ssl/templates/SSLSocketTemplate.java
test/sun/security/ssl/templates/SSLSocketTemplate.java
+1
-1
未找到文件。
test/sun/security/ssl/javax/net/ssl/NewAPIs/SessionCacheSizeTests.java
浏览文件 @
a9e1e8b1
/*
* Copyright (c) 2001, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 201
3
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -21,14 +21,16 @@
* questions.
*/
//
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
//
/*
* @test
* @bug 4366807
* @summary Need new APIs to get/set session timeout and session cache size.
* @run main/othervm SessionCacheSizeTests
*
* SunJSSE does not support dynamic system properties, no way to re-use
* system properties in samevm/agentvm mode.
*/
import
java.io.*
;
...
...
@@ -113,7 +115,9 @@ public class SessionCacheSizeTests {
/*
* Signal Client, we're ready for his connect.
*/
serverReady
=
true
;
if
(
createdPorts
==
serverPorts
.
length
)
{
serverReady
=
true
;
}
int
read
=
0
;
int
nConnections
=
0
;
/*
...
...
@@ -310,7 +314,6 @@ public class SessionCacheSizeTests {
* Fork off the other side, then do your work.
*/
SessionCacheSizeTests
()
throws
Exception
{
/*
* create the SSLServerSocket and SSLSocket factories
*/
...
...
@@ -323,46 +326,87 @@ public class SessionCacheSizeTests {
int
serverConns
=
MAX_ACTIVE_CONNECTIONS
/
(
serverPorts
.
length
);
int
remainingConns
=
MAX_ACTIVE_CONNECTIONS
%
(
serverPorts
.
length
);
if
(
separateServerThread
)
{
for
(
int
i
=
0
;
i
<
serverPorts
.
length
;
i
++)
{
Exception
startException
=
null
;
try
{
if
(
separateServerThread
)
{
for
(
int
i
=
0
;
i
<
serverPorts
.
length
;
i
++)
{
// distribute remaining connections among the
// available ports
if
(
i
<
remainingConns
)
startServer
(
serverPorts
[
i
],
(
serverConns
+
1
),
true
);
else
startServer
(
serverPorts
[
i
],
serverConns
,
true
);
}
startClient
(
false
);
}
else
{
startClient
(
true
);
for
(
int
i
=
0
;
i
<
serverPorts
.
length
;
i
++)
{
if
(
i
<
remainingConns
)
startServer
(
serverPorts
[
i
],
(
serverConns
+
1
),
false
);
else
startServer
(
serverPorts
[
i
],
serverConns
,
false
);
}
}
}
catch
(
Exception
e
)
{
startException
=
e
;
}
// distribute remaining connections among the available ports
if
(
i
<
remainingConns
)
startServer
(
serverPorts
[
i
],
(
serverConns
+
1
),
true
);
else
startServer
(
serverPorts
[
i
],
serverConns
,
true
);
/*
* Wait for other side to close down.
*/
if
(
separateServerThread
)
{
if
(
serverThread
!=
null
)
{
serverThread
.
join
();
}
startClient
(
false
);
}
else
{
startClient
(
true
);
for
(
int
i
=
0
;
i
<
serverPorts
.
length
;
i
++)
{
if
(
i
<
remainingConns
)
startServer
(
serverPorts
[
i
],
(
serverConns
+
1
),
false
);
else
startServer
(
serverPorts
[
i
],
serverConns
,
false
);
if
(
clientThread
!=
null
)
{
clientThread
.
join
();
}
}
/*
* W
ait for other side to close down
.
* W
hen we get here, the test is pretty much over
.
*/
Exception
local
;
Exception
remote
;
if
(
separateServerThread
)
{
serverThread
.
join
();
remote
=
serverException
;
local
=
clientException
;
}
else
{
clientThread
.
join
();
remote
=
clientException
;
local
=
serverException
;
}
Exception
exception
=
null
;
/*
* When we get here, the test is pretty much over.
*
* If the main thread excepted, that propagates back
* immediately. If the other thread threw an exception, we
* should report back.
* Check various exception conditions.
*/
if
(
serverException
!=
null
)
throw
serverException
;
if
(
clientException
!=
null
)
throw
clientException
;
if
((
local
!=
null
)
&&
(
remote
!=
null
))
{
// If both failed, return the curthread's exception.
local
.
initCause
(
remote
);
exception
=
local
;
}
else
if
(
local
!=
null
)
{
exception
=
local
;
}
else
if
(
remote
!=
null
)
{
exception
=
remote
;
}
else
if
(
startException
!=
null
)
{
exception
=
startException
;
}
/*
* If there was an exception *AND* a startException,
* output it.
*/
if
(
exception
!=
null
)
{
if
(
exception
!=
startException
&&
startException
!=
null
)
{
exception
.
addSuppressed
(
startException
);
}
throw
exception
;
}
// Fall-through: no exception to throw!
}
void
startServer
(
final
int
port
,
final
int
nConns
,
...
...
@@ -387,7 +431,13 @@ public class SessionCacheSizeTests {
};
serverThread
.
start
();
}
else
{
doServerSide
(
port
,
nConns
);
try
{
doServerSide
(
port
,
nConns
);
}
catch
(
Exception
e
)
{
serverException
=
e
;
}
finally
{
serverReady
=
true
;
}
}
}
...
...
@@ -409,7 +459,11 @@ public class SessionCacheSizeTests {
};
clientThread
.
start
();
}
else
{
doClientSide
();
try
{
doClientSide
();
}
catch
(
Exception
e
)
{
clientException
=
e
;
}
}
}
}
test/sun/security/ssl/javax/net/ssl/NewAPIs/SessionTimeOutTests.java
浏览文件 @
a9e1e8b1
/*
* Copyright (c) 2001, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 201
3
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -21,14 +21,14 @@
* questions.
*/
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
/*
* @test
* @bug 4366807
* @summary Need new APIs to get/set session timeout and session cache size.
* @run main/othervm SessionTimeOutTests
*
* SunJSSE does not support dynamic system properties, no way to re-use
* system properties in samevm/agentvm mode.
*/
import
java.io.*
;
...
...
@@ -263,7 +263,7 @@ public class SessionTimeOutTests {
for
(
int
i
=
0
;
i
<
nConnections
;
i
++)
{
sslSockets
[
i
].
close
();
}
System
.
out
.
println
(
"----------------------------------------"
System
.
out
.
println
(
"----------------------------------------"
+
"-----------------------"
);
System
.
out
.
println
(
"Session timeout test passed"
);
}
...
...
@@ -348,45 +348,88 @@ public class SessionTimeOutTests {
int
serverConns
=
MAX_ACTIVE_CONNECTIONS
/
(
serverPorts
.
length
);
int
remainingConns
=
MAX_ACTIVE_CONNECTIONS
%
(
serverPorts
.
length
);
Exception
startException
=
null
;
try
{
if
(
separateServerThread
)
{
for
(
int
i
=
0
;
i
<
serverPorts
.
length
;
i
++)
{
// distribute remaining connections among the
// vailable ports
if
(
i
<
remainingConns
)
startServer
(
serverPorts
[
i
],
(
serverConns
+
1
),
true
);
else
startServer
(
serverPorts
[
i
],
serverConns
,
true
);
}
startClient
(
false
);
}
else
{
startClient
(
true
);
for
(
int
i
=
0
;
i
<
serverPorts
.
length
;
i
++)
{
if
(
i
<
remainingConns
)
startServer
(
serverPorts
[
i
],
(
serverConns
+
1
),
false
);
else
startServer
(
serverPorts
[
i
],
serverConns
,
false
);
}
}
}
catch
(
Exception
e
)
{
startException
=
e
;
}
/*
* Wait for other side to close down.
*/
if
(
separateServerThread
)
{
for
(
int
i
=
0
;
i
<
serverPorts
.
length
;
i
++)
{
// distribute remaining connections among the available ports
if
(
i
<
remainingConns
)
startServer
(
serverPorts
[
i
],
(
serverConns
+
1
),
true
);
else
startServer
(
serverPorts
[
i
],
serverConns
,
true
);
if
(
serverThread
!=
null
)
{
serverThread
.
join
();
}
startClient
(
false
);
}
else
{
startClient
(
true
);
for
(
int
i
=
0
;
i
<
serverPorts
.
length
;
i
++)
{
if
(
i
<
remainingConns
)
startServer
(
serverPorts
[
i
],
(
serverConns
+
1
),
false
);
else
startServer
(
serverPorts
[
i
],
serverConns
,
false
);
if
(
clientThread
!=
null
)
{
clientThread
.
join
();
}
}
/*
* Wait for other side to close down.
* When we get here, the test is pretty much over.
* Which side threw the error?
*/
Exception
local
;
Exception
remote
;
if
(
separateServerThread
)
{
serverThread
.
join
();
remote
=
serverException
;
local
=
clientException
;
}
else
{
clientThread
.
join
();
remote
=
clientException
;
local
=
serverException
;
}
Exception
exception
=
null
;
/*
* When we get here, the test is pretty much over.
*
* If the main thread excepted, that propagates back
* immediately. If the other thread threw an exception, we
* should report back.
* Check various exception conditions.
*/
if
((
local
!=
null
)
&&
(
remote
!=
null
))
{
// If both failed, return the curthread's exception.
local
.
initCause
(
remote
);
exception
=
local
;
}
else
if
(
local
!=
null
)
{
exception
=
local
;
}
else
if
(
remote
!=
null
)
{
exception
=
remote
;
}
else
if
(
startException
!=
null
)
{
exception
=
startException
;
}
/*
* If there was an exception *AND* a startException,
* output it.
*/
if
(
serverException
!=
null
)
throw
serverException
;
if
(
clientException
!=
null
)
throw
clientException
;
if
(
exception
!=
null
)
{
if
(
exception
!=
startException
&&
startException
!=
null
)
{
exception
.
addSuppressed
(
startException
);
}
throw
exception
;
}
// Fall-through: no exception to throw!
}
void
startServer
(
final
int
port
,
final
int
nConns
,
...
...
@@ -411,7 +454,13 @@ public class SessionTimeOutTests {
};
serverThread
.
start
();
}
else
{
doServerSide
(
port
,
nConns
);
try
{
doServerSide
(
port
,
nConns
);
}
catch
(
Exception
e
)
{
serverException
=
e
;
}
finally
{
serverReady
=
0
;
}
}
}
...
...
@@ -433,7 +482,11 @@ public class SessionTimeOutTests {
};
clientThread
.
start
();
}
else
{
doClientSide
();
try
{
doClientSide
();
}
catch
(
Exception
e
)
{
clientException
=
e
;
}
}
}
}
test/sun/security/ssl/templates/SSLSocketTemplate.java
浏览文件 @
a9e1e8b1
...
...
@@ -243,7 +243,7 @@ public class SSLSocketTemplate {
* output it.
*/
if
(
exception
!=
null
)
{
if
(
exception
!=
startException
)
{
if
(
exception
!=
startException
&&
startException
!=
null
)
{
exception
.
addSuppressed
(
startException
);
}
throw
exception
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录