Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
52047e1c
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看板
提交
52047e1c
编写于
7月 05, 2013
作者:
W
wetmore
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8019341: Update CookieHttpsClientTest to use the newer framework.
Reviewed-by: xuelei, smarks, michaelm
上级
584871d5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
129 addition
and
53 deletion
+129
-53
test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHttpsClientTest.java
...tocol/https/HttpsURLConnection/CookieHttpsClientTest.java
+78
-26
test/sun/security/ssl/templates/SSLEngineTemplate.java
test/sun/security/ssl/templates/SSLEngineTemplate.java
+4
-4
test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java
...un/security/ssl/templates/SSLSocketSSLEngineTemplate.java
+13
-2
test/sun/security/ssl/templates/SSLSocketTemplate.java
test/sun/security/ssl/templates/SSLSocketTemplate.java
+34
-21
未找到文件。
test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHttpsClientTest.java
浏览文件 @
52047e1c
/*
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012,
2013,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -21,15 +21,14 @@
...
@@ -21,15 +21,14 @@
* questions.
* questions.
*/
*/
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
/*
/*
* @test
* @test
* @bug 7129083
* @bug 7129083
* @summary Cookiemanager does not store cookies if url is read
* @summary Cookiemanager does not store cookies if url is read
* before setting cookiemanager
* before setting cookiemanager
*
* SunJSSE does not support dynamic system properties, no way to re-use
* system properties in samevm/agentvm mode.
*
* @run main/othervm CookieHttpsClientTest
* @run main/othervm CookieHttpsClientTest
*/
*/
...
@@ -186,10 +185,10 @@ public class CookieHttpsClientTest {
...
@@ -186,10 +185,10 @@ public class CookieHttpsClientTest {
public
static
void
main
(
String
args
[])
throws
Exception
{
public
static
void
main
(
String
args
[])
throws
Exception
{
String
keyFilename
=
String
keyFilename
=
System
.
getProperty
(
"test.src"
,
".
/
"
)
+
"/"
+
pathToStores
+
System
.
getProperty
(
"test.src"
,
"."
)
+
"/"
+
pathToStores
+
"/"
+
keyStoreFile
;
"/"
+
keyStoreFile
;
String
trustFilename
=
String
trustFilename
=
System
.
getProperty
(
"test.src"
,
".
/
"
)
+
"/"
+
pathToStores
+
System
.
getProperty
(
"test.src"
,
"."
)
+
"/"
+
pathToStores
+
"/"
+
trustStoreFile
;
"/"
+
trustStoreFile
;
System
.
setProperty
(
"javax.net.ssl.keyStore"
,
keyFilename
);
System
.
setProperty
(
"javax.net.ssl.keyStore"
,
keyFilename
);
...
@@ -205,40 +204,83 @@ public class CookieHttpsClientTest {
...
@@ -205,40 +204,83 @@ public class CookieHttpsClientTest {
Thread
clientThread
=
null
;
Thread
clientThread
=
null
;
Thread
serverThread
=
null
;
Thread
serverThread
=
null
;
/*
/*
* Primary constructor, used to drive remainder of the test.
* Primary constructor, used to drive remainder of the test.
*
*
* Fork off the other side, then do your work.
* Fork off the other side, then do your work.
*/
*/
CookieHttpsClientTest
()
throws
Exception
{
CookieHttpsClientTest
()
throws
Exception
{
if
(
separateServerThread
)
{
Exception
startException
=
null
;
startServer
(
true
);
try
{
startClient
(
false
);
if
(
separateServerThread
)
{
}
else
{
startServer
(
true
);
startClient
(
true
);
startClient
(
false
);
startServer
(
false
);
}
else
{
startClient
(
true
);
startServer
(
false
);
}
}
catch
(
Exception
e
)
{
startException
=
e
;
}
}
/*
/*
* Wait for other side to close down.
* Wait for other side to close down.
*/
*/
if
(
separateServerThread
)
{
if
(
separateServerThread
)
{
serverThread
.
join
();
if
(
serverThread
!=
null
)
{
serverThread
.
join
();
}
}
else
{
}
else
{
clientThread
.
join
();
if
(
clientThread
!=
null
)
{
clientThread
.
join
();
}
}
}
/*
/*
* When we get here, the test is pretty much over.
* When we get here, the test is pretty much over.
*
* Which side threw the error?
* If the main thread excepted, that propagates back
*/
* immediately. If the other thread threw an exception, we
Exception
local
;
* should report back.
Exception
remote
;
if
(
separateServerThread
)
{
remote
=
serverException
;
local
=
clientException
;
}
else
{
remote
=
clientException
;
local
=
serverException
;
}
Exception
exception
=
null
;
/*
* 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
)
if
(
exception
!=
null
)
{
throw
serverException
;
if
(
exception
!=
startException
)
{
if
(
clientException
!=
null
)
exception
.
addSuppressed
(
startException
);
throw
clientException
;
}
throw
exception
;
}
// Fall-through: no exception to throw!
}
}
void
startServer
(
boolean
newThread
)
throws
Exception
{
void
startServer
(
boolean
newThread
)
throws
Exception
{
...
@@ -261,7 +303,13 @@ public class CookieHttpsClientTest {
...
@@ -261,7 +303,13 @@ public class CookieHttpsClientTest {
};
};
serverThread
.
start
();
serverThread
.
start
();
}
else
{
}
else
{
doServerSide
();
try
{
doServerSide
();
}
catch
(
Exception
e
)
{
serverException
=
e
;
}
finally
{
serverReady
=
true
;
}
}
}
}
}
...
@@ -277,12 +325,16 @@ public class CookieHttpsClientTest {
...
@@ -277,12 +325,16 @@ public class CookieHttpsClientTest {
*/
*/
System
.
err
.
println
(
"Client died..."
);
System
.
err
.
println
(
"Client died..."
);
clientException
=
e
;
clientException
=
e
;
}
}
}
}
};
};
clientThread
.
start
();
clientThread
.
start
();
}
else
{
}
else
{
doClientSide
();
try
{
doClientSide
();
}
catch
(
Exception
e
)
{
clientException
=
e
;
}
}
}
}
}
}
}
test/sun/security/ssl/templates/SSLEngineTemplate.java
浏览文件 @
52047e1c
/*
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
3
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -21,14 +21,14 @@
...
@@ -21,14 +21,14 @@
* questions.
* questions.
*/
*/
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
/*
/*
* @test
* @test
* @bug 1234567
* @bug 1234567
* @summary SSLEngine has not yet caused Solaris kernel to panic
* @summary SSLEngine has not yet caused Solaris kernel to panic
* @run main/othervm SSLEngineTemplate
* @run main/othervm SSLEngineTemplate
*
* SunJSSE does not support dynamic system properties, no way to re-use
* system properties in samevm/agentvm mode.
*/
*/
/**
/**
...
...
test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java
浏览文件 @
52047e1c
...
@@ -309,14 +309,25 @@ public class SSLSocketSSLEngineTemplate {
...
@@ -309,14 +309,25 @@ public class SSLSocketSSLEngineTemplate {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
serverException
=
e
;
serverException
=
e
;
}
finally
{
}
finally
{
socket
.
close
();
if
(
socket
!=
null
)
{
socket
.
close
();
}
// Wait for the client to join up with us.
// Wait for the client to join up with us.
thread
.
join
();
if
(
thread
!=
null
)
{
thread
.
join
();
}
if
(
serverException
!=
null
)
{
if
(
serverException
!=
null
)
{
if
(
clientException
!=
null
)
{
serverException
.
initCause
(
clientException
);
}
throw
serverException
;
throw
serverException
;
}
}
if
(
clientException
!=
null
)
{
if
(
clientException
!=
null
)
{
if
(
serverException
!=
null
)
{
clientException
.
initCause
(
serverException
);
}
throw
clientException
;
throw
clientException
;
}
}
}
}
...
...
test/sun/security/ssl/templates/SSLSocketTemplate.java
浏览文件 @
52047e1c
/*
/*
* 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.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -21,14 +21,14 @@
...
@@ -21,14 +21,14 @@
* questions.
* questions.
*/
*/
// SunJSSE does not support dynamic system properties, no way to re-use
// system properties in samevm/agentvm mode.
/*
/*
* @test
* @test
* @bug 1234567
* @bug 1234567
* @summary Use this template to help speed your client/server tests.
* @summary Use this template to help speed your client/server tests.
* @run main/othervm SSLSocketTemplate
* @run main/othervm SSLSocketTemplate
*
* SunJSSE does not support dynamic system properties, no way to re-use
* system properties in samevm/agentvm mode.
* @author Brad Wetmore
* @author Brad Wetmore
*/
*/
...
@@ -180,6 +180,7 @@ public class SSLSocketTemplate {
...
@@ -180,6 +180,7 @@ public class SSLSocketTemplate {
* Fork off the other side, then do your work.
* Fork off the other side, then do your work.
*/
*/
SSLSocketTemplate
()
throws
Exception
{
SSLSocketTemplate
()
throws
Exception
{
Exception
startException
=
null
;
try
{
try
{
if
(
separateServerThread
)
{
if
(
separateServerThread
)
{
startServer
(
true
);
startServer
(
true
);
...
@@ -189,16 +190,20 @@ public class SSLSocketTemplate {
...
@@ -189,16 +190,20 @@ public class SSLSocketTemplate {
startServer
(
false
);
startServer
(
false
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// swallow for now. Show later
startException
=
e
;
}
}
/*
/*
* Wait for other side to close down.
* Wait for other side to close down.
*/
*/
if
(
separateServerThread
)
{
if
(
separateServerThread
)
{
serverThread
.
join
();
if
(
serverThread
!=
null
)
{
serverThread
.
join
();
}
}
else
{
}
else
{
clientThread
.
join
();
if
(
clientThread
!=
null
)
{
clientThread
.
join
();
}
}
}
/*
/*
...
@@ -207,36 +212,44 @@ public class SSLSocketTemplate {
...
@@ -207,36 +212,44 @@ public class SSLSocketTemplate {
*/
*/
Exception
local
;
Exception
local
;
Exception
remote
;
Exception
remote
;
String
whichRemote
;
if
(
separateServerThread
)
{
if
(
separateServerThread
)
{
remote
=
serverException
;
remote
=
serverException
;
local
=
clientException
;
local
=
clientException
;
whichRemote
=
"server"
;
}
else
{
}
else
{
remote
=
clientException
;
remote
=
clientException
;
local
=
serverException
;
local
=
serverException
;
whichRemote
=
"client"
;
}
}
Exception
exception
=
null
;
/*
/*
* If both failed, return the curthread's exception, but also
* Check various exception conditions.
* print the remote side Exception
*/
*/
if
((
local
!=
null
)
&&
(
remote
!=
null
))
{
if
((
local
!=
null
)
&&
(
remote
!=
null
))
{
System
.
out
.
println
(
whichRemote
+
" also threw:"
);
// If both failed, return the curthread's exception.
remote
.
printStackTrace
();
local
.
initCause
(
remote
);
System
.
out
.
println
();
exception
=
local
;
throw
local
;
}
else
if
(
local
!=
null
)
{
exception
=
local
;
}
else
if
(
remote
!=
null
)
{
exception
=
remote
;
}
else
if
(
startException
!=
null
)
{
exception
=
startException
;
}
}
if
(
remote
!=
null
)
{
/*
throw
remote
;
* If there was an exception *AND* a startException,
* output it.
*/
if
(
exception
!=
null
)
{
if
(
exception
!=
startException
)
{
exception
.
addSuppressed
(
startException
);
}
throw
exception
;
}
}
if
(
local
!=
null
)
{
// Fall-through: no exception to throw!
throw
local
;
}
}
}
void
startServer
(
boolean
newThread
)
throws
Exception
{
void
startServer
(
boolean
newThread
)
throws
Exception
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录