Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
5325a289
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5325a289
编写于
10月 30, 2011
作者:
C
Christoph Kutzinski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed/suppressed several compiler warnings
上级
b4788e69
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
3 deletion
+14
-3
test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
+14
-3
未找到文件。
test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
浏览文件 @
5325a289
...
...
@@ -66,6 +66,7 @@ import hudson.slaves.CommandLauncher;
import
hudson.slaves.ComputerConnector
;
import
hudson.slaves.ComputerListener
;
import
hudson.slaves.DumbSlave
;
import
hudson.slaves.NodeProperty
;
import
hudson.slaves.RetentionStrategy
;
import
hudson.tasks.Ant
;
import
hudson.tasks.Ant.AntInstallation
;
...
...
@@ -78,7 +79,6 @@ import hudson.tasks.Maven;
import
hudson.tasks.Maven.MavenInstallation
;
import
hudson.tasks.Publisher
;
import
hudson.tools.ToolProperty
;
import
hudson.util.IOException2
;
import
hudson.util.PersistedList
;
import
hudson.util.ReflectionUtils
;
import
hudson.util.StreamTaskListener
;
...
...
@@ -188,6 +188,7 @@ import com.gargoylesoftware.htmlunit.xml.XmlPage;
* @see <a href="http://wiki.jenkins-ci.org/display/JENKINS/Unit+Test">Wiki article about unit testing in Hudson</a>
* @author Kohsuke Kawaguchi
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
class
HudsonTestCase
extends
TestCase
implements
RootAction
{
/**
* Points to the same object as {@link #jenkins} does.
...
...
@@ -400,6 +401,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
}
}
@SuppressWarnings
(
"serial"
)
public
static
class
BreakException
extends
Exception
{}
public
String
getIconFileName
()
{
...
...
@@ -706,7 +708,8 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
public
DumbSlave
createSlave
(
String
nodeName
,
String
labels
,
EnvVars
env
)
throws
Exception
{
synchronized
(
hudson
)
{
DumbSlave
slave
=
new
DumbSlave
(
nodeName
,
"dummy"
,
createTmpDir
().
getPath
(),
"1"
,
Mode
.
NORMAL
,
labels
==
null
?
""
:
labels
,
createComputerLauncher
(
env
),
RetentionStrategy
.
NOOP
,
Collections
.
EMPTY_LIST
);
createTmpDir
().
getPath
(),
"1"
,
Mode
.
NORMAL
,
labels
==
null
?
""
:
labels
,
createComputerLauncher
(
env
),
RetentionStrategy
.
NOOP
,
Collections
.<
NodeProperty
<?>>
emptyList
());
hudson
.
addNode
(
slave
);
return
slave
;
}
...
...
@@ -757,6 +760,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
* Create a new slave on the local host and wait for it to come online
* before returning
*/
@SuppressWarnings
(
"deprecation"
)
public
DumbSlave
createOnlineSlave
(
Label
l
,
EnvVars
env
)
throws
Exception
{
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
ComputerListener
waiter
=
new
ComputerListener
()
{
...
...
@@ -833,6 +837,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
/**
* Performs a configuration round-trip testing for a builder.
*/
@SuppressWarnings
(
"unchecked"
)
protected
<
B
extends
Builder
>
B
configRoundtrip
(
B
before
)
throws
Exception
{
FreeStyleProject
p
=
createFreeStyleProject
();
p
.
getBuildersList
().
add
(
before
);
...
...
@@ -843,6 +848,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
/**
* Performs a configuration round-trip testing for a publisher.
*/
@SuppressWarnings
(
"unchecked"
)
protected
<
P
extends
Publisher
>
P
configRoundtrip
(
P
before
)
throws
Exception
{
FreeStyleProject
p
=
createFreeStyleProject
();
p
.
getPublishersList
().
add
(
before
);
...
...
@@ -850,6 +856,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
return
(
P
)
p
.
getPublishersList
().
get
(
before
.
getClass
());
}
@SuppressWarnings
(
"unchecked"
)
protected
<
C
extends
ComputerConnector
>
C
configRoundtrip
(
C
before
)
throws
Exception
{
computerConnectorTester
.
connector
=
before
;
submit
(
createWebClient
().
goTo
(
"self/computerConnectorTester/configure"
).
getFormByName
(
"config"
));
...
...
@@ -861,6 +868,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
return
u
;
}
@SuppressWarnings
(
"unchecked"
)
protected
<
N
extends
Node
>
N
configRoundtrip
(
N
node
)
throws
Exception
{
submit
(
createWebClient
().
goTo
(
"/computer/"
+
node
.
getNodeName
()
+
"/configure"
).
getFormByName
(
"config"
));
return
(
N
)
hudson
.
getNode
(
node
.
getNodeName
());
...
...
@@ -1542,6 +1550,8 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
* for accessing Hudson.
*/
public
class
WebClient
extends
com
.
gargoylesoftware
.
htmlunit
.
WebClient
{
private
static
final
long
serialVersionUID
=
5808915989048338267L
;
public
WebClient
()
{
// default is IE6, but this causes 'n.doScroll('left')' to fail in event-debug.js:1907 as HtmlUnit doesn't implement such a method,
// so trying something else, until we discover another problem.
...
...
@@ -1552,6 +1562,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
clients
.
add
(
this
);
// make ajax calls run as post-action for predictable behaviors that simplify debugging
setAjaxController
(
new
AjaxController
()
{
private
static
final
long
serialVersionUID
=
-
5844060943564822678L
;
public
boolean
processSynchron
(
HtmlPage
page
,
WebRequestSettings
settings
,
boolean
async
)
{
return
false
;
}
...
...
@@ -1725,7 +1736,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
* a website on the internet, there's nothing wrong with using this method.)
*/
@Override
public
Page
getPage
(
String
url
)
throws
IOException
,
FailingHttpStatusCodeException
{
public
<
P
extends
Page
>
P
getPage
(
String
url
)
throws
IOException
,
FailingHttpStatusCodeException
{
return
super
.
getPage
(
url
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录