Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
d81cd2bb
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,发现更多精彩内容 >>
提交
d81cd2bb
编写于
8月 18, 2015
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
1bc69577
8d9ef036
变更
38
隐藏空白更改
内联
并排
Showing
38 changed file
with
185 addition
and
58 deletion
+185
-58
changelog.html
changelog.html
+9
-1
core/src/main/java/hudson/FilePath.java
core/src/main/java/hudson/FilePath.java
+1
-1
core/src/main/java/hudson/FileSystemProvisioner.java
core/src/main/java/hudson/FileSystemProvisioner.java
+1
-1
core/src/main/java/hudson/FileSystemProvisionerDescriptor.java
...src/main/java/hudson/FileSystemProvisionerDescriptor.java
+1
-1
core/src/main/java/hudson/Functions.java
core/src/main/java/hudson/Functions.java
+1
-1
core/src/main/java/hudson/PluginWrapper.java
core/src/main/java/hudson/PluginWrapper.java
+1
-1
core/src/main/java/hudson/cli/CloneableCLICommand.java
core/src/main/java/hudson/cli/CloneableCLICommand.java
+1
-1
core/src/main/java/hudson/model/ChoiceParameterDefinition.java
...src/main/java/hudson/model/ChoiceParameterDefinition.java
+7
-3
core/src/main/java/hudson/model/Computer.java
core/src/main/java/hudson/model/Computer.java
+2
-2
core/src/main/java/hudson/model/UsageStatistics.java
core/src/main/java/hudson/model/UsageStatistics.java
+2
-2
core/src/main/java/hudson/os/SU.java
core/src/main/java/hudson/os/SU.java
+2
-2
core/src/main/java/hudson/scheduler/CronTab.java
core/src/main/java/hudson/scheduler/CronTab.java
+1
-1
core/src/main/java/hudson/security/ACL.java
core/src/main/java/hudson/security/ACL.java
+1
-1
core/src/main/java/hudson/security/SecurityRealm.java
core/src/main/java/hudson/security/SecurityRealm.java
+1
-1
core/src/main/java/hudson/tasks/Maven.java
core/src/main/java/hudson/tasks/Maven.java
+1
-1
core/src/main/java/hudson/util/ChartUtil.java
core/src/main/java/hudson/util/ChartUtil.java
+2
-2
core/src/main/java/hudson/util/DoubleLaunchChecker.java
core/src/main/java/hudson/util/DoubleLaunchChecker.java
+1
-1
core/src/main/java/hudson/util/QuotedStringTokenizer.java
core/src/main/java/hudson/util/QuotedStringTokenizer.java
+3
-3
core/src/main/java/hudson/util/jna/DotNet.java
core/src/main/java/hudson/util/jna/DotNet.java
+1
-1
core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java
...main/java/jenkins/model/JenkinsLocationConfiguration.java
+2
-2
core/src/main/java/jenkins/slaves/restarter/SlaveRestarter.java
...rc/main/java/jenkins/slaves/restarter/SlaveRestarter.java
+1
-1
core/src/main/resources/jenkins/security/s2m/filepath-filter.conf
.../main/resources/jenkins/security/s2m/filepath-filter.conf
+1
-1
core/src/site/markdown/index.md
core/src/site/markdown/index.md
+1
-1
core/src/test/java/hudson/UtilTest.java
core/src/test/java/hudson/UtilTest.java
+125
-10
core/src/test/java/hudson/model/ParametersActionTest.java
core/src/test/java/hudson/model/ParametersActionTest.java
+1
-1
core/src/test/java/hudson/util/ArgumentListBuilderTest.java
core/src/test/java/hudson/util/ArgumentListBuilderTest.java
+2
-2
pom.xml
pom.xml
+1
-1
test/src/main/java/org/jvnet/hudson/test/ExtractResourceSCM.java
...c/main/java/org/jvnet/hudson/test/ExtractResourceSCM.java
+1
-1
test/src/test/java/hudson/cli/SetBuildDisplayNameCommandTest.java
.../test/java/hudson/cli/SetBuildDisplayNameCommandTest.java
+1
-1
test/src/test/java/hudson/model/JobQueueTest.java
test/src/test/java/hudson/model/JobQueueTest.java
+2
-2
test/src/test/java/hudson/model/MyViewsPropertyTest.java
test/src/test/java/hudson/model/MyViewsPropertyTest.java
+1
-1
test/src/test/java/hudson/model/SimpleJobTest.java
test/src/test/java/hudson/model/SimpleJobTest.java
+1
-1
test/src/test/java/hudson/model/UserTest.java
test/src/test/java/hudson/model/UserTest.java
+1
-1
test/src/test/java/hudson/model/ViewTest.java
test/src/test/java/hudson/model/ViewTest.java
+1
-1
test/src/test/java/hudson/model/queue/WideExecutionTest.java
test/src/test/java/hudson/model/queue/WideExecutionTest.java
+1
-1
test/src/test/java/lib/form/RepeatableTest.java
test/src/test/java/lib/form/RepeatableTest.java
+1
-1
translation-tool.pl
translation-tool.pl
+1
-1
war/src/main/webapp/help/project-config/custom-workspace.html
...src/main/webapp/help/project-config/custom-workspace.html
+1
-1
未找到文件。
changelog.html
浏览文件 @
d81cd2bb
...
...
@@ -55,7 +55,15 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div
id=
"trunk"
style=
"display:none"
>
<!--=TRUNK-BEGIN=-->
<ul
class=
image
>
<li
class=
>
<li
class=
"major bug"
>
Fixed a deadlock between the old data monitor and authorization strategies.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-29936"
>
JENKINS-29936
</a>
)
<li
class=
"rfe"
>
Allow rejecting configurations with errors in critical fields via REST / CLI.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-28440"
>
JENKINS-28440
</a>
)
<li
class=
"bug"
>
Do not display
<em>
No changes
</em>
if changelog is still being computed.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-2327"
>
JENKINS-2327
</a>
)
</ul>
</div>
<!--=TRUNK-END=-->
<h3><a
name=
v1.625
>
What's new in 1.625
</a>
(2015/08/17)
</h3>
...
...
core/src/main/java/hudson/FilePath.java
浏览文件 @
d81cd2bb
...
...
@@ -175,7 +175,7 @@ import org.jenkinsci.remoting.RoleSensitive;
* </pre>
*
* <p>
* When {@link FileCallable} is transfered to a remote node, it will be done so
* When {@link FileCallable} is transfer
r
ed to a remote node, it will be done so
* by using the same Java serialization scheme that the remoting module uses.
* See {@link Channel} for more about this.
*
...
...
core/src/main/java/hudson/FileSystemProvisioner.java
浏览文件 @
d81cd2bb
...
...
@@ -238,7 +238,7 @@ public abstract class FileSystemProvisioner implements ExtensionPoint, Describab
@Extension
public
static
final
class
DescriptorImpl
extends
FileSystemProvisionerDescriptor
{
public
boolean
discard
(
FilePath
ws
,
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
// the default provisioner doe
ns'
t do anything special,
// the default provisioner doe
s no
t do anything special,
// so allow other types to manage it
return
false
;
}
...
...
core/src/main/java/hudson/FileSystemProvisionerDescriptor.java
浏览文件 @
d81cd2bb
...
...
@@ -39,7 +39,7 @@ public abstract class FileSystemProvisionerDescriptor extends Descriptor<FileSys
*
* <p>
* Because users may modify the file system behind Hudson, and slaves may come and go when
* configuration changes hapen, in general case Hudson is unable to keep track of which jobs
* configuration changes hap
p
en, in general case Hudson is unable to keep track of which jobs
* have workspaces in which slaves.
*
* <p>
...
...
core/src/main/java/hudson/Functions.java
浏览文件 @
d81cd2bb
...
...
@@ -1385,7 +1385,7 @@ public class Functions {
/**
* If the value exists, return that value. Otherwise return the default value.
* <p>
* Starting 1.294, JEXL supports the elvis operator "x?:y" that super
c
edes this.
* Starting 1.294, JEXL supports the elvis operator "x?:y" that super
s
edes this.
*
* @since 1.150
*/
...
...
core/src/main/java/hudson/PluginWrapper.java
浏览文件 @
d81cd2bb
...
...
@@ -63,7 +63,7 @@ import javax.annotation.CheckForNull;
* for Jenkins to control {@link Plugin}.
*
* <p>
* A plug-in is packaged into a jar file whose extension is <tt>".jpi"</tt> (or <tt>".hpi"</tt> for backward compat
a
bility),
* A plug-in is packaged into a jar file whose extension is <tt>".jpi"</tt> (or <tt>".hpi"</tt> for backward compat
i
bility),
* A plugin needs to have a special manifest entry to identify what it is.
*
* <p>
...
...
core/src/main/java/hudson/cli/CloneableCLICommand.java
浏览文件 @
d81cd2bb
...
...
@@ -26,7 +26,7 @@ package hudson.cli;
/**
* {@link Cloneable} {@link CLICommand}.
*
* Uses {@link #clone()} instead of "new" to create a copy for exection.
* Uses {@link #clone()} instead of "new" to create a copy for exec
u
tion.
*
* @author Kohsuke Kawaguchi
*/
...
...
core/src/main/java/hudson/model/ChoiceParameterDefinition.java
浏览文件 @
d81cd2bb
...
...
@@ -17,20 +17,24 @@ import java.util.Arrays;
* @author huybrechts
*/
public
class
ChoiceParameterDefinition
extends
SimpleParameterDefinition
{
public
static
final
String
CHOICES_DELIMETER
=
"\\r?\\n"
;
public
static
final
String
CHOICES_DELIMITER
=
"\\r?\\n"
;
@Deprecated
public
static
final
String
CHOICES_DELIMETER
=
CHOICES_DELIMITER
;
private
final
List
<
String
>
choices
;
private
final
String
defaultValue
;
public
static
boolean
areValidChoices
(
String
choices
)
{
String
strippedChoices
=
choices
.
trim
();
return
!
StringUtils
.
isEmpty
(
strippedChoices
)
&&
strippedChoices
.
split
(
CHOICES_DELIM
E
TER
).
length
>
0
;
return
!
StringUtils
.
isEmpty
(
strippedChoices
)
&&
strippedChoices
.
split
(
CHOICES_DELIM
I
TER
).
length
>
0
;
}
@DataBoundConstructor
public
ChoiceParameterDefinition
(
String
name
,
String
choices
,
String
description
)
{
super
(
name
,
description
);
this
.
choices
=
Arrays
.
asList
(
choices
.
split
(
CHOICES_DELIM
E
TER
));
this
.
choices
=
Arrays
.
asList
(
choices
.
split
(
CHOICES_DELIM
I
TER
));
defaultValue
=
null
;
}
...
...
core/src/main/java/hudson/model/Computer.java
浏览文件 @
d81cd2bb
...
...
@@ -1566,8 +1566,8 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
if
(
m
.
matches
())
{
File
newLocation
=
new
File
(
dir
,
"logs/slaves/"
+
m
.
group
(
1
)
+
"/slave.log"
+
Util
.
fixNull
(
m
.
group
(
2
)));
newLocation
.
getParentFile
().
mkdirs
();
boolean
relocationSuccessful
l
=
f
.
renameTo
(
newLocation
);
if
(
relocationSuccessful
l
)
{
// The operation will fail if mkdir fails
boolean
relocationSuccessful
=
f
.
renameTo
(
newLocation
);
if
(
relocationSuccessful
)
{
// The operation will fail if mkdir fails
LOGGER
.
log
(
Level
.
INFO
,
"Relocated log file {0} to {1}"
,
new
Object
[]
{
f
.
getPath
(),
newLocation
.
getPath
()});
}
else
{
LOGGER
.
log
(
Level
.
WARNING
,
"Cannot relocate log file {0} to {1}"
,
new
Object
[]
{
f
.
getPath
(),
newLocation
.
getPath
()});
...
...
core/src/main/java/hudson/model/UsageStatistics.java
浏览文件 @
d81cd2bb
...
...
@@ -197,10 +197,10 @@ public class UsageStatistics extends PageDecorator {
}
/**
* As
sy
metric cipher is slow and in case of Sun RSA implementation it can only encyrypt the first block.
* As
ym
metric cipher is slow and in case of Sun RSA implementation it can only encyrypt the first block.
*
* So first create a symmetric key, then place this key in the beginning of the stream by encrypting it
* with the as
sy
metric cipher. The rest of the stream will be encrypted by a symmetric cipher.
* with the as
ym
metric cipher. The rest of the stream will be encrypted by a symmetric cipher.
*/
public
static
final
class
CombinedCipherOutputStream
extends
FilterOutputStream
{
public
CombinedCipherOutputStream
(
OutputStream
out
,
Cipher
asym
,
String
algorithm
)
throws
IOException
,
GeneralSecurityException
{
...
...
core/src/main/java/hudson/os/SU.java
浏览文件 @
d81cd2bb
...
...
@@ -62,7 +62,7 @@ public abstract class SU {
}
/**
* Returns a {@link VirtualChannel} that's connected to the privile
d
ge-escalated environment.
* Returns a {@link VirtualChannel} that's connected to the privilege-escalated environment.
*
* @param listener
* What this method is doing (such as what process it's invoking) will be sent here.
...
...
@@ -122,7 +122,7 @@ public abstract class SU {
}
/**
* Starts a new privile
d
ge-escalated environment, execute a closure, and shut it down.
* Starts a new privilege-escalated environment, execute a closure, and shut it down.
*/
public
static
<
V
,
T
extends
Throwable
>
V
execute
(
TaskListener
listener
,
String
rootUsername
,
String
rootPassword
,
final
Callable
<
V
,
T
>
closure
)
throws
T
,
IOException
,
InterruptedException
{
VirtualChannel
ch
=
start
(
listener
,
rootUsername
,
rootPassword
);
...
...
core/src/main/java/hudson/scheduler/CronTab.java
浏览文件 @
d81cd2bb
...
...
@@ -92,7 +92,7 @@ public final class CronTab {
/**
* @param timezone
* Used to schedule cron in a differnt timezone. Null to use the default system
* Used to schedule cron in a differ
e
nt timezone. Null to use the default system
* timezone
* @since 1.615
*/
...
...
core/src/main/java/hudson/security/ACL.java
浏览文件 @
d81cd2bb
...
...
@@ -127,7 +127,7 @@ public abstract class ACL {
*
* <p>
* This doesn't need to be included in {@link Authentication#getAuthorities()},
* but {@link ACL} is responsible for checking it nontheless, as if it was the
* but {@link ACL} is responsible for checking it non
e
theless, as if it was the
* last entry in the granted authority.
*/
public
static
final
Sid
EVERYONE
=
new
Sid
()
{
...
...
core/src/main/java/hudson/security/SecurityRealm.java
浏览文件 @
d81cd2bb
...
...
@@ -357,7 +357,7 @@ public abstract class SecurityRealm extends AbstractDescribableImpl<SecurityReal
* @param fetchMembers if {@code true} then try and fetch the members of the group if it exists. Trying does not
* imply that the members will be fetched and {@link hudson.security.GroupDetails#getMembers()}
* may still return {@code null}
* @throws UserMayOrMayNotExistException if no conclusive result could be determined regarding the group exist
a
nce.
* @throws UserMayOrMayNotExistException if no conclusive result could be determined regarding the group exist
e
nce.
* @throws UsernameNotFoundException if the group does not exist.
* @throws DataAccessException if the backing security realm could not be connected to.
* @since 1.549
...
...
core/src/main/java/hudson/tasks/Maven.java
浏览文件 @
d81cd2bb
...
...
@@ -460,7 +460,7 @@ public class Maven extends Builder {
/**
* @deprecated since 2009-02-25.
*/
@Deprecated
// kept for backward compatiblity - use getHome()
@Deprecated
// kept for backward compatib
i
lity - use getHome()
private
transient
String
mavenHome
;
/**
...
...
core/src/main/java/hudson/util/ChartUtil.java
浏览文件 @
d81cd2bb
...
...
@@ -113,7 +113,7 @@ public class ChartUtil {
*
* @param defaultSize
* The size of the picture to be generated. These values can be overridden
* by the query paramter 'width' and 'height' in the request.
* by the query param
e
ter 'width' and 'height' in the request.
* @deprecated as of 1.320
* Bind {@link Graph} to the URL space. See {@code hudson.tasks.junit.History} as an example (note that doing so involves
* a bit of URL structure change.)
...
...
@@ -129,7 +129,7 @@ public class ChartUtil {
* @param defaultW
* @param defaultH
* The size of the picture to be generated. These values can be overridden
* by the query paramter 'width' and 'height' in the request.
* by the query param
e
ter 'width' and 'height' in the request.
* @deprecated as of 1.320
* Bind {@link Graph} to the URL space. See {@code hudson.tasks.junit.History} as an example (note that doing so involves
* a bit of URL structure change.)
...
...
core/src/main/java/hudson/util/DoubleLaunchChecker.java
浏览文件 @
d81cd2bb
...
...
@@ -51,7 +51,7 @@ import java.lang.reflect.Method;
* to forestall the problem of running multiple instances of Hudson that point to the same data directory.
*
* <p>
* This set up error occasionally happens especialy when the user is trying to reassign the context path of the app,
* This set up error occasionally happens especial
l
y when the user is trying to reassign the context path of the app,
* and it results in a hard-to-diagnose error, so we actively check this.
*
* <p>
...
...
core/src/main/java/hudson/util/QuotedStringTokenizer.java
浏览文件 @
d81cd2bb
...
...
@@ -44,7 +44,7 @@ import java.util.ArrayList;
/** StringTokenizer with Quoting support.
*
* This class is a copy of the java.util.StringTokenizer API and
* the behaviour is the same, except that single and dou
lb
e quoted
* the behaviour is the same, except that single and dou
bl
e quoted
* string values are recognized.
* Delimiters within quotes are not considered delimiters.
* Quotes can be escaped with '\'.
...
...
@@ -328,7 +328,7 @@ public class QuotedStringTokenizer
/* ------------------------------------------------------------ */
/** Quote a string.
* The string is quoted only if quoting is required due to
* embeded delimiters, quote characters or the
* embed
d
ed delimiters, quote characters or the
* empty string.
* @param s The string to quote.
* @return quoted string
...
...
@@ -358,7 +358,7 @@ public class QuotedStringTokenizer
/* ------------------------------------------------------------ */
/** Quote a string.
* The string is quoted only if quoting is required due to
* embeded delimiters, quote characters or the
* embed
d
ed delimiters, quote characters or the
* empty string.
* @param s The string to quote.
* @return quoted string
...
...
core/src/main/java/hudson/util/jna/DotNet.java
浏览文件 @
d81cd2bb
...
...
@@ -46,7 +46,7 @@ public class DotNet {
try
{
// see http://support.microsoft.com/?scid=kb;en-us;315291 for the basic algorithm
// observation in my registry shows that the actual key name can be things like "v2.0 SP1"
// or "v2.0.50727", so the regexp is written to accomodate this.
// or "v2.0.50727", so the regexp is written to accom
m
odate this.
RegistryKey
key
=
RegistryKey
.
LOCAL_MACHINE
.
openReadonly
(
"SOFTWARE\\Microsoft\\.NETFramework"
);
try
{
for
(
String
keyName
:
key
.
getSubKeys
()
)
{
...
...
core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java
浏览文件 @
d81cd2bb
...
...
@@ -77,7 +77,7 @@ public class JenkinsLocationConfiguration extends GlobalConfiguration {
/**
* Gets the service administrator e-mail address.
* @return Admin adress or "address not configured" stub
* @return Admin ad
d
ress or "address not configured" stub
*/
public
@Nonnull
String
getAdminAddress
()
{
String
v
=
adminAddress
;
...
...
@@ -92,7 +92,7 @@ public class JenkinsLocationConfiguration extends GlobalConfiguration {
public
void
setAdminAddress
(
@CheckForNull
String
adminAddress
)
{
String
address
=
Util
.
nullify
(
adminAddress
);
if
(
address
!=
null
&&
address
.
startsWith
(
"\""
)
&&
address
.
endsWith
(
"\""
))
{
// some users apparently quote the whole thing. Don't k
on
w why
// some users apparently quote the whole thing. Don't k
no
w why
// anyone does this, but it's a machine's job to forgive human mistake
address
=
address
.
substring
(
1
,
address
.
length
()-
1
);
}
...
...
core/src/main/java/jenkins/slaves/restarter/SlaveRestarter.java
浏览文件 @
d81cd2bb
...
...
@@ -11,7 +11,7 @@ import java.util.logging.Logger;
* Extension point to control how to restart JNLP slave when it loses the connection with the master.
*
* <p>
* Objects are instantiated on the master, then transfered to a slave via serialization.
* Objects are instantiated on the master, then transfer
r
ed to a slave via serialization.
*
* @author Kohsuke Kawaguchi
*/
...
...
core/src/main/resources/jenkins/security/s2m/filepath-filter.conf
浏览文件 @
d81cd2bb
...
...
@@ -36,5 +36,5 @@ allow create,mkdirs,read,stat,write <BUILDDIR>/.+
# cobertura also writes out annotated sources to a dir under the job:
allow
create
,
mkdirs
,
read
,
stat
,
write
<
JENKINS_HOME
>/
jobs
/.+/
cobertura
.*
# all the other accesses that aren't specified here will be left upto other rules in this directory.
# all the other accesses that aren't specified here will be left up
to other rules in this directory.
# if no rules in those other files matches, then the access will be rejected.
core/src/site/markdown/index.md
浏览文件 @
d81cd2bb
Collection of Maven auto-generated reports. The primary interest is probably
[
Jelly tag libary reference
](
jelly-taglib-ref.html
)
.
Collection of Maven auto-generated reports. The primary interest is probably
[
Jelly tag lib
r
ary reference
](
jelly-taglib-ref.html
)
.
core/src/test/java/hudson/UtilTest.java
浏览文件 @
d81cd2bb
...
...
@@ -24,17 +24,26 @@
*/
package
hudson
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.util.Locale
;
import
java.util.Properties
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
static
org
.
hamcrest
.
CoreMatchers
.
containsString
;
import
static
org
.
hamcrest
.
CoreMatchers
.
hasItem
;
import
static
org
.
hamcrest
.
CoreMatchers
.
instanceOf
;
import
static
org
.
hamcrest
.
CoreMatchers
.
not
;
import
static
org
.
junit
.
Assert
.*;
import
org.apache.commons.io.FileUtils
;
import
org.hamcrest.BaseMatcher
;
import
org.hamcrest.Description
;
import
org.junit.Assume
;
...
...
@@ -42,12 +51,13 @@ import org.junit.Test;
import
org.jvnet.hudson.test.Issue
;
import
hudson.util.StreamTaskListener
;
import
java.io.FileOutputStream
;
import
java.io.OutputStream
;
import
org.junit.Rule
;
import
org.junit.internal.AssumptionViolatedException
;
import
org.junit.rules.TemporaryFolder
;
import
com.google.common.collect.Lists
;
/**
* @author Kohsuke Kawaguchi
*/
...
...
@@ -248,7 +258,17 @@ public class UtilTest {
}
}
@Test
public
void
deleteFile
()
throws
Exception
{
@Test
public
void
testDeleteFile
()
throws
Exception
{
File
f
=
tmp
.
newFile
();
// Test: File is deleted
mkfiles
(
f
);
Util
.
deleteFile
(
f
);
assertFalse
(
"f exists after calling Util.deleteFile"
,
f
.
exists
());
}
@Test
public
void
testDeleteFile_onWindows
()
throws
Exception
{
Assume
.
assumeTrue
(
Functions
.
isWindows
());
Class
<?>
c
;
try
{
...
...
@@ -256,23 +276,118 @@ public class UtilTest {
}
catch
(
ClassNotFoundException
x
)
{
throw
new
AssumptionViolatedException
(
"prior to JDK 7"
,
x
);
}
File
d
=
tmp
.
getRoot
();
try
{
File
f
=
new
File
(
d
,
"f"
);
OutputStream
os
=
new
FileOutputStream
(
f
);
File
f
=
tmp
.
newFile
();
// Test: If we cannot delete a file, we throw explaining why
mkfiles
(
f
);
lockFileForDeletion
(
f
);
try
{
Util
.
deleteFile
(
f
);
fail
(
"should not have been deletable"
);
}
catch
(
IOException
x
)
{
assertEquals
(
c
,
x
.
getClass
());
}
finally
{
os
.
close
();
assertThat
(
calcExceptionHierarchy
(
x
),
hasItem
(
c
));
assertThat
(
x
.
getMessage
(),
containsString
(
f
.
getPath
()));
}
}
finally
{
Util
.
deleteRecursive
(
d
);
unlockFilesForDeletion
();
}
}
@Test
public
void
testDeleteRecursive
()
throws
Exception
{
final
File
dir
=
tmp
.
newFolder
();
final
File
d1
=
new
File
(
dir
,
"d1"
);
final
File
d2
=
new
File
(
dir
,
"d2"
);
final
File
f1
=
new
File
(
dir
,
"f1"
);
final
File
d1f1
=
new
File
(
d1
,
"d1f1"
);
final
File
d2f2
=
new
File
(
d2
,
"d1f2"
);
// Test: Files and directories are deleted
mkdirs
(
dir
,
d1
,
d2
);
mkfiles
(
f1
,
d1f1
,
d2f2
);
Util
.
deleteRecursive
(
dir
);
assertFalse
(
"dir exists"
,
dir
.
exists
());
}
@Test
public
void
testDeleteRecursive_onWindows
()
throws
Exception
{
Assume
.
assumeTrue
(
Functions
.
isWindows
());
final
File
dir
=
tmp
.
newFolder
();
final
File
d1
=
new
File
(
dir
,
"d1"
);
final
File
d2
=
new
File
(
dir
,
"d2"
);
final
File
f1
=
new
File
(
dir
,
"f1"
);
final
File
d1f1
=
new
File
(
d1
,
"d1f1"
);
final
File
d2f2
=
new
File
(
d2
,
"d1f2"
);
try
{
// Test: If we cannot delete a file, we throw
mkdirs
(
dir
,
d1
,
d2
);
mkfiles
(
f1
,
d1f1
,
d2f2
);
lockFileForDeletion
(
d1f1
);
try
{
Util
.
deleteRecursive
(
dir
);
fail
(
"Expected IOException"
);
}
catch
(
IOException
x
)
{
assertTrue
(
"dir exists"
,
dir
.
exists
());
assertTrue
(
"d1 exists"
,
d1
.
exists
());
assertTrue
(
"d1f1 exists"
,
d1f1
.
exists
());
assertThat
(
x
.
getMessage
(),
containsString
(
dir
.
getPath
()));
}
}
finally
{
unlockFilesForDeletion
();
}
}
/** Creates multiple directories. */
private
static
void
mkdirs
(
File
...
dirs
)
{
for
(
File
d
:
dirs
)
{
d
.
mkdir
();
assertTrue
(
d
.
getPath
(),
d
.
isDirectory
());
}
}
/** Creates multiple files, each containing their filename as text content. */
private
static
void
mkfiles
(
File
...
files
)
throws
IOException
{
for
(
File
f
:
files
)
FileUtils
.
write
(
f
,
f
.
getName
());
}
/** Means of unlocking all the files we have locked, indexed by {@link File}. */
private
final
Map
<
File
,
Callable
<
Void
>>
unlockFileCallables
=
new
HashMap
<
File
,
Callable
<
Void
>>();
/** Prevents a file from being deleted, so we can stress the deletion code's retries. */
private
void
lockFileForDeletion
(
File
f
)
throws
IOException
,
InterruptedException
{
assert
!
unlockFileCallables
.
containsKey
(
f
)
:
f
+
" is already locked."
;
// Limitation: Only works on Windows. On unix we can delete anything we can create.
// On unix, can't use "chmod a-w" on the dir as the code-under-test undoes that.
// On unix, can't use "chattr +i" because that needs root.
// On unix, can't use "chattr +u" because ext fs ignores it.
// On Windows, we can't delete files that are open for reading, so we use that.
assert
Functions
.
isWindows
();
final
InputStream
s
=
new
FileInputStream
(
f
);
unlockFileCallables
.
put
(
f
,
new
Callable
<
Void
>()
{
public
Void
call
()
throws
IOException
{
s
.
close
();
return
null
;
};
});
}
/** Undoes a call to {@link #lockFileForDeletion(File)}. */
private
void
unlockFileForDeletion
(
File
f
)
throws
Exception
{
unlockFileCallables
.
remove
(
f
).
call
();
}
/** Undoes all calls to {@link #lockFileForDeletion(File)}. */
private
void
unlockFilesForDeletion
()
throws
Exception
{
while
(
!
unlockFileCallables
.
isEmpty
()
)
{
unlockFileForDeletion
(
unlockFileCallables
.
keySet
().
iterator
().
next
());
}
}
/** Returns all classes in the exception hierarchy. */
private
static
Iterable
<
Class
<?>>
calcExceptionHierarchy
(
Throwable
t
)
{
final
List
<
Class
<?>>
result
=
Lists
.
newArrayList
();
for
(
;
t
!=
null
;
t
=
t
.
getCause
())
result
.
add
(
t
.
getClass
());
return
result
;
}
@Test
public
void
testHtmlEscape
()
{
assertEquals
(
"<br>"
,
Util
.
escape
(
"\n"
));
...
...
core/src/test/java/hudson/model/ParametersActionTest.java
浏览文件 @
d81cd2bb
...
...
@@ -89,7 +89,7 @@ public class ParametersActionTest {
@Test
@Issue
(
"JENKINS-15094"
)
public
void
checkNullParam
a
terValues
()
{
public
void
checkNullParam
e
terValues
()
{
SubTask
subtask
=
mock
(
SubTask
.
class
);
Build
build
=
mock
(
Build
.
class
);
...
...
core/src/test/java/hudson/util/ArgumentListBuilderTest.java
浏览文件 @
d81cd2bb
...
...
@@ -41,7 +41,7 @@ public class ArgumentListBuilderTest {
builder
.
add
(
"arg"
);
builder
.
add
(
"other"
,
"arguments"
);
assertFalse
(
"There should
n
t be any masked arguments"
,
builder
.
hasMaskedArguments
());
assertFalse
(
"There should
no
t be any masked arguments"
,
builder
.
hasMaskedArguments
());
boolean
[]
array
=
builder
.
toMaskArray
();
assertNotNull
(
"The mask array should not be null"
,
array
);
assertThat
(
"The mask array was incorrect"
,
array
,
is
(
new
boolean
[]
{
false
,
false
,
false
}));
...
...
@@ -166,7 +166,7 @@ public class ArgumentListBuilderTest {
ArgumentListBuilder
builder
=
new
ArgumentListBuilder
();
builder
.
addKeyValuePairs
(
null
,
KEY_VALUES
);
assertFalse
(
"There should
n
t be any masked arguments"
,
builder
.
hasMaskedArguments
());
assertFalse
(
"There should
no
t be any masked arguments"
,
builder
.
hasMaskedArguments
());
boolean
[]
array
=
builder
.
toMaskArray
();
assertNotNull
(
"The mask array should not be null"
,
array
);
assertThat
(
"The mask array was incorrect"
,
array
,
is
(
new
boolean
[]
{
false
,
false
,
false
}));
...
...
pom.xml
浏览文件 @
d81cd2bb
...
...
@@ -348,7 +348,7 @@ THE SOFTWARE.
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-javadoc-plugin
</artifactId>
<version>
2.
8
</version>
<version>
2.
10.3
</version>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
...
...
test/src/main/java/org/jvnet/hudson/test/ExtractResourceSCM.java
浏览文件 @
d81cd2bb
...
...
@@ -57,7 +57,7 @@ public class ExtractResourceSCM extends NullSCM {
/**
* with this constructor your zip can contains a folder
* more useful
l
to create a project test zip foo.zip foo
* more useful to create a project test zip foo.zip foo
* @param zip
* @param parentFolder
*/
...
...
test/src/test/java/hudson/cli/SetBuildDisplayNameCommandTest.java
浏览文件 @
d81cd2bb
...
...
@@ -62,7 +62,7 @@ public class SetBuildDisplayNameCommandTest {
assertThat
(
result
,
failedWith
(-
1
));
}
@Test
public
void
setDescriptionSuccesfully
()
throws
Exception
{
@Test
public
void
setDescriptionSucces
s
fully
()
throws
Exception
{
FreeStyleProject
job
=
j
.
createFreeStyleProject
(
"project"
);
FreeStyleBuild
build
=
job
.
scheduleBuild2
(
0
).
get
();
...
...
test/src/test/java/hudson/model/JobQueueTest.java
浏览文件 @
d81cd2bb
...
...
@@ -89,7 +89,7 @@ public class JobQueueTest {
assertTrue
(
j
.
jenkins
.
getQueue
().
getItem
(
project
)
instanceof
BlockedItem
);
//check is it is blocked
}
else
{
fail
(
"The maximum attemps for checking if the job is in POST_PRODUCTION State have reached"
);
fail
(
"The maximum attemp
t
s for checking if the job is in POST_PRODUCTION State have reached"
);
}
count
=
0
;
while
(!
JobQueueTest
.
fireFinalizeFlag
&&
count
<
100
)
{
...
...
@@ -104,7 +104,7 @@ public class JobQueueTest {
assertFalse
(
j
.
jenkins
.
getQueue
().
getItem
(
project
)
instanceof
BlockedItem
);
}
else
{
fail
(
"The maximum attemps for checking if the job is in COMPLETED State have reached"
);
fail
(
"The maximum attemp
t
s for checking if the job is in COMPLETED State have reached"
);
}
Thread
.
sleep
(
1000
);
//Sleep till job completes.
}
...
...
test/src/test/java/hudson/model/MyViewsPropertyTest.java
浏览文件 @
d81cd2bb
...
...
@@ -186,7 +186,7 @@ public class MyViewsPropertyTest {
user
.
addProperty
(
property
);
View
view
=
new
ListView
(
"foo"
,
property
);
property
.
addView
(
view
);
assertTrue
(
"Property should cont
ia
ns view "
+
view
.
name
,
property
.
getViews
().
contains
(
view
));
assertTrue
(
"Property should cont
ai
ns view "
+
view
.
name
,
property
.
getViews
().
contains
(
view
));
User
.
reload
();
user
=
User
.
get
(
"User"
);
property
=
user
.
getProperty
(
property
.
getClass
());
...
...
test/src/test/java/hudson/model/SimpleJobTest.java
浏览文件 @
d81cd2bb
...
...
@@ -102,7 +102,7 @@ public class SimpleJobTest {
TestBuild
lastBuild
=
new
TestBuild
(
project
,
Result
.
FAILURE
,
50
,
previousBuild
);
runs
.
put
(
1
,
lastBuild
);
// failed builds must not be used, if there are succesfulBuilds available.
// failed builds must not be used, if there are succes
s
fulBuilds available.
assertEquals
(
1
,
project
.
getEstimatedDuration
());
}
...
...
test/src/test/java/hudson/model/UserTest.java
浏览文件 @
d81cd2bb
...
...
@@ -302,7 +302,7 @@ public class UserTest {
assertNotNull
(
"User should not be null."
,
user
);
user
.
clear
();
user
=
User
.
get
(
"John Smith"
,
false
,
Collections
.
emptyMap
());
assertNull
(
"User shou
dl
be null"
,
user
);
assertNull
(
"User shou
ld
be null"
,
user
);
}
@Test
...
...
test/src/test/java/hudson/model/ViewTest.java
浏览文件 @
d81cd2bb
...
...
@@ -362,7 +362,7 @@ public class ViewTest {
ListView
view2
=
listView
(
"foo"
);
try
{
view2
.
rename
(
"renamed"
);
fail
(
"Attemt to rename job with a name used by another view with the same owner should throw exception"
);
fail
(
"Attem
p
t to rename job with a name used by another view with the same owner should throw exception"
);
}
catch
(
Exception
Exception
){
}
...
...
test/src/test/java/hudson/model/queue/WideExecutionTest.java
浏览文件 @
d81cd2bb
...
...
@@ -50,7 +50,7 @@ public class WideExecutionTest {
public
JenkinsRule
j
=
new
JenkinsRule
();
@TestExtension
public
static
class
Contribut
e
r
extends
SubTaskContributor
{
public
static
class
Contribut
o
r
extends
SubTaskContributor
{
public
Collection
<?
extends
SubTask
>
forProject
(
final
AbstractProject
<?,
?>
p
)
{
return
Collections
.
singleton
(
new
AbstractSubTask
()
{
private
final
AbstractSubTask
outer
=
this
;
...
...
test/src/test/java/lib/form/RepeatableTest.java
浏览文件 @
d81cd2bb
...
...
@@ -340,7 +340,7 @@ public class RepeatableTest extends HudsonTestCase {
}
}
/** Tests nested repeatable and use of @DataBoundContructor to process formData */
/** Tests nested repeatable and use of @DataBoundCon
s
tructor to process formData */
public
void
testNested
()
throws
Exception
{
HtmlPage
p
=
createWebClient
().
goTo
(
"self/testNested"
);
HtmlForm
f
=
p
.
getFormByName
(
"config"
);
...
...
translation-tool.pl
浏览文件 @
d81cd2bb
#!/usr/bin/perl -w
# The MIT License
#
# Copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contribut
e
rs
# Copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contribut
o
rs
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
...
...
war/src/main/webapp/help/project-config/custom-workspace.html
浏览文件 @
d81cd2bb
...
...
@@ -18,7 +18,7 @@
If you are in a distributed build environment, unless you tie a job to a specific node, Jenkins may still
move around jobs to different slaves. Sometimes this is desirable, sometimes this is not. Also,
you can map multiple projects to have the same workspace, but if you do so, make sure concurrent executions
of those jobs won't have nasty interfer
a
nce with each other.
of those jobs won't have nasty interfer
e
nce with each other.
<p>
If this path is relative, it's resolved against the "remote FS root" directory of the slave, or
<tt>
$JENKINS_HOME
</tt>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录