Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
ffb6552a
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
未验证
提交
ffb6552a
编写于
5月 15, 2018
作者:
J
Jesse Glick
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into flatten-JENKINS-51247-source-fork
上级
82f90da4
9e64bcdc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
2 deletion
+25
-2
core/src/main/java/hudson/model/Fingerprint.java
core/src/main/java/hudson/model/Fingerprint.java
+6
-1
pom.xml
pom.xml
+1
-1
test/src/test/java/hudson/model/FingerprintTest.java
test/src/test/java/hudson/model/FingerprintTest.java
+18
-0
未找到文件。
core/src/main/java/hudson/model/Fingerprint.java
浏览文件 @
ffb6552a
...
...
@@ -1366,7 +1366,12 @@ public class Fingerprint implements ModelObject, Saveable {
start
=
System
.
currentTimeMillis
();
try
{
Fingerprint
f
=
(
Fingerprint
)
configFile
.
read
();
Object
loaded
=
configFile
.
read
();
if
(!(
loaded
instanceof
Fingerprint
))
{
throw
new
IOException
(
"Unexpected Fingerprint type. Expected "
+
Fingerprint
.
class
+
" or subclass but got "
+
(
loaded
!=
null
?
loaded
.
getClass
()
:
"null"
));
}
Fingerprint
f
=
(
Fingerprint
)
loaded
;
if
(
logger
.
isLoggable
(
Level
.
FINE
))
logger
.
fine
(
"Loading fingerprint "
+
file
+
" took "
+(
System
.
currentTimeMillis
()-
start
)+
"ms"
);
if
(
f
.
facets
==
null
)
...
...
pom.xml
浏览文件 @
ffb6552a
...
...
@@ -75,7 +75,7 @@ THE SOFTWARE.
</issueManagement>
<properties>
<revision>
2.12
2
</revision>
<revision>
2.12
3
</revision>
<changelist>
-SNAPSHOT
</changelist>
<!-- *.html files are in UTF-8, and *.properties are in iso-8859-1, so this configuration is actually incorrect,
...
...
test/src/test/java/hudson/model/FingerprintTest.java
浏览文件 @
ffb6552a
...
...
@@ -23,6 +23,7 @@
*/
package
hudson.model
;
import
hudson.XmlFile
;
import
hudson.security.ACL
;
import
hudson.security.ACLContext
;
import
hudson.security.AuthorizationMatrixProperty
;
...
...
@@ -30,6 +31,8 @@ import hudson.security.Permission;
import
hudson.security.ProjectMatrixAuthorizationStrategy
;
import
hudson.tasks.ArtifactArchiver
;
import
hudson.tasks.Fingerprinter
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.HashMap
;
...
...
@@ -50,6 +53,7 @@ import org.jvnet.hudson.test.MockFolder;
import
org.jvnet.hudson.test.SecuredMockFolder
;
import
org.jvnet.hudson.test.WorkspaceCopyFileBuilder
;
import
static
org
.
hamcrest
.
Matchers
.
containsString
;
import
static
org
.
junit
.
Assert
.*;
import
static
org
.
hamcrest
.
Matchers
.
notNullValue
;
import
static
org
.
hamcrest
.
Matchers
.
nullValue
;
...
...
@@ -115,6 +119,20 @@ public class FingerprintTest {
assertTrue
(
"Usages do not have a reference to "
+
project
,
usages
.
containsKey
(
project
.
getName
()));
assertTrue
(
"Usages do not have a reference to "
+
project2
,
usages
.
containsKey
(
project2
.
getName
()));
}
@Test
@Issue
(
"JENKINS-51179"
)
public
void
shouldThrowIOExceptionWhenFileIsInvalid
()
throws
Exception
{
XmlFile
f
=
new
XmlFile
(
new
File
(
rule
.
jenkins
.
getRootDir
(),
"foo.xml"
));
f
.
write
(
"Hello, world!"
);
try
{
Fingerprint
.
load
(
f
.
getFile
());
}
catch
(
IOException
ex
)
{
assertThat
(
ex
.
getMessage
(),
containsString
(
"Unexpected Fingerprint type"
));
return
;
}
fail
(
"Expected IOException"
);
}
@Test
@Issue
(
"SECURITY-153"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录