Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
aa595459
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,发现更多精彩内容 >>
提交
aa595459
编写于
8月 05, 2014
作者:
J
Jesse Glick
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some more forgotten uses of AbstractBuild.
上级
99a94834
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
35 addition
and
17 deletion
+35
-17
core/src/main/java/hudson/tasks/junit/TestResult.java
core/src/main/java/hudson/tasks/junit/TestResult.java
+1
-1
core/src/main/java/hudson/tasks/junit/TestResultAction.java
core/src/main/java/hudson/tasks/junit/TestResultAction.java
+1
-1
core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java
...main/java/hudson/tasks/test/AbstractTestResultAction.java
+10
-10
core/src/main/java/hudson/tasks/test/SimpleCaseResult.java
core/src/main/java/hudson/tasks/test/SimpleCaseResult.java
+1
-1
core/src/main/java/hudson/util/ChartUtil.java
core/src/main/java/hudson/util/ChartUtil.java
+22
-4
未找到文件。
core/src/main/java/hudson/tasks/junit/TestResult.java
浏览文件 @
aa595459
...
...
@@ -296,7 +296,7 @@ public final class TestResult extends MetaTabulatedResult {
@Override
public
Run
<?,?>
getRun
()
{
return
(
parentAction
==
null
?
null
:
parentAction
.
owner
);
return
(
parentAction
==
null
?
null
:
parentAction
.
run
);
}
@Override
...
...
core/src/main/java/hudson/tasks/junit/TestResultAction.java
浏览文件 @
aa595459
...
...
@@ -117,7 +117,7 @@ public class TestResultAction extends AbstractTestResultAction<TestResultAction>
}
private
XmlFile
getDataFile
()
{
return
new
XmlFile
(
XSTREAM
,
new
File
(
owner
.
getRootDir
(),
"junitResult.xml"
));
return
new
XmlFile
(
XSTREAM
,
new
File
(
run
.
getRootDir
(),
"junitResult.xml"
));
}
public
synchronized
TestResult
getResult
()
{
...
...
core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java
浏览文件 @
aa595459
...
...
@@ -251,7 +251,7 @@ public abstract class AbstractTestResultAction<T extends AbstractTestResultActio
return
;
}
if
(
req
.
checkIfModified
(
owner
.
getTimestamp
(),
rsp
))
if
(
req
.
checkIfModified
(
run
.
getTimestamp
(),
rsp
))
return
;
ChartUtil
.
generateGraph
(
req
,
rsp
,
createChart
(
req
,
buildDataSet
(
req
)),
calcDefaultSize
());
...
...
@@ -261,7 +261,7 @@ public abstract class AbstractTestResultAction<T extends AbstractTestResultActio
* Generates a clickable map HTML for {@link #doGraph(StaplerRequest, StaplerResponse)}.
*/
public
void
doGraphMap
(
StaplerRequest
req
,
StaplerResponse
rsp
)
throws
IOException
{
if
(
req
.
checkIfModified
(
owner
.
getTimestamp
(),
rsp
))
if
(
req
.
checkIfModified
(
run
.
getTimestamp
(),
rsp
))
return
;
ChartUtil
.
generateClickableMap
(
req
,
rsp
,
createChart
(
req
,
buildDataSet
(
req
)),
calcDefaultSize
());
}
...
...
@@ -293,10 +293,10 @@ public abstract class AbstractTestResultAction<T extends AbstractTestResultActio
DataSetBuilder
<
String
,
NumberOnlyBuildLabel
>
dsb
=
new
DataSetBuilder
<
String
,
NumberOnlyBuildLabel
>();
for
(
AbstractTestResultAction
<?>
a
=
this
;
a
!=
null
;
a
=
a
.
getPreviousResult
(
AbstractTestResultAction
.
class
)
)
{
dsb
.
add
(
a
.
getFailCount
(),
"failed"
,
new
NumberOnlyBuildLabel
(
a
.
owner
));
dsb
.
add
(
a
.
getFailCount
(),
"failed"
,
new
NumberOnlyBuildLabel
(
a
.
run
));
if
(!
failureOnly
)
{
dsb
.
add
(
a
.
getSkipCount
(),
"skipped"
,
new
NumberOnlyBuildLabel
(
a
.
owner
));
dsb
.
add
(
a
.
getTotalCount
()-
a
.
getFailCount
()-
a
.
getSkipCount
(),
"total"
,
new
NumberOnlyBuildLabel
(
a
.
owner
));
dsb
.
add
(
a
.
getSkipCount
(),
"skipped"
,
new
NumberOnlyBuildLabel
(
a
.
run
));
dsb
.
add
(
a
.
getTotalCount
()-
a
.
getFailCount
()-
a
.
getSkipCount
(),
"total"
,
new
NumberOnlyBuildLabel
(
a
.
run
));
}
}
return
dsb
.
build
();
...
...
@@ -351,20 +351,20 @@ public abstract class AbstractTestResultAction<T extends AbstractTestResultActio
@Override
public
String
generateURL
(
CategoryDataset
dataset
,
int
row
,
int
column
)
{
NumberOnlyBuildLabel
label
=
(
NumberOnlyBuildLabel
)
dataset
.
getColumnKey
(
column
);
return
relPath
+
label
.
build
.
getNumber
()+
"/testReport/"
;
return
relPath
+
label
.
getRun
()
.
getNumber
()+
"/testReport/"
;
}
@Override
public
String
generateToolTip
(
CategoryDataset
dataset
,
int
row
,
int
column
)
{
NumberOnlyBuildLabel
label
=
(
NumberOnlyBuildLabel
)
dataset
.
getColumnKey
(
column
);
AbstractTestResultAction
a
=
label
.
build
.
getAction
(
AbstractTestResultAction
.
class
);
AbstractTestResultAction
a
=
label
.
getRun
()
.
getAction
(
AbstractTestResultAction
.
class
);
switch
(
row
)
{
case
0
:
return
String
.
valueOf
(
Messages
.
AbstractTestResultAction_fail
(
label
.
build
.
getDisplayName
(),
a
.
getFailCount
()));
return
String
.
valueOf
(
Messages
.
AbstractTestResultAction_fail
(
label
.
getRun
()
.
getDisplayName
(),
a
.
getFailCount
()));
case
1
:
return
String
.
valueOf
(
Messages
.
AbstractTestResultAction_skip
(
label
.
build
.
getDisplayName
(),
a
.
getSkipCount
()));
return
String
.
valueOf
(
Messages
.
AbstractTestResultAction_skip
(
label
.
getRun
()
.
getDisplayName
(),
a
.
getSkipCount
()));
default
:
return
String
.
valueOf
(
Messages
.
AbstractTestResultAction_test
(
label
.
build
.
getDisplayName
(),
a
.
getTotalCount
()));
return
String
.
valueOf
(
Messages
.
AbstractTestResultAction_test
(
label
.
getRun
()
.
getDisplayName
(),
a
.
getTotalCount
()));
}
}
};
...
...
core/src/main/java/hudson/tasks/test/SimpleCaseResult.java
浏览文件 @
aa595459
...
...
@@ -194,7 +194,7 @@ public class SimpleCaseResult extends TestResult {
LOGGER
.
warning
(
"in Trivial Test Result, parentAction is null, but getRun() called"
);
return
null
;
}
return
parentAction
.
owner
;
return
parentAction
.
run
;
}
@Override
...
...
core/src/main/java/hudson/util/ChartUtil.java
浏览文件 @
aa595459
...
...
@@ -24,6 +24,7 @@
package
hudson.util
;
import
hudson.model.AbstractBuild
;
import
hudson.model.Run
;
import
hudson.tasks.junit.History
;
import
org.jfree.chart.JFreeChart
;
import
org.jfree.chart.axis.NumberAxis
;
...
...
@@ -47,31 +48,48 @@ public class ChartUtil {
* Can be used as a graph label. Only displays numbers.
*/
public
static
final
class
NumberOnlyBuildLabel
implements
Comparable
<
NumberOnlyBuildLabel
>
{
private
final
Run
<?,?>
run
;
@Deprecated
public
final
AbstractBuild
build
;
/** @since TODO */
public
NumberOnlyBuildLabel
(
Run
<?,?>
run
)
{
this
.
run
=
run
;
this
.
build
=
run
instanceof
AbstractBuild
?
(
AbstractBuild
)
run
:
null
;
}
@Deprecated
public
NumberOnlyBuildLabel
(
AbstractBuild
build
)
{
this
.
run
=
build
;
this
.
build
=
build
;
}
/* @since TODO */
public
Run
<?,
?>
getRun
()
{
return
run
;
}
public
int
compareTo
(
NumberOnlyBuildLabel
that
)
{
return
this
.
build
.
number
-
that
.
build
.
number
;
return
this
.
run
.
number
-
that
.
run
.
number
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(!(
o
instanceof
NumberOnlyBuildLabel
))
return
false
;
NumberOnlyBuildLabel
that
=
(
NumberOnlyBuildLabel
)
o
;
return
build
==
that
.
build
;
return
run
==
that
.
run
;
}
@Override
public
int
hashCode
()
{
return
build
.
hashCode
();
return
run
.
hashCode
();
}
@Override
public
String
toString
()
{
return
build
.
getDisplayName
();
return
run
.
getDisplayName
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录