Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
3e7181d9
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,发现更多精彩内容 >>
提交
3e7181d9
编写于
7月 26, 2013
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
6af91274
85592268
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
111 addition
and
5 deletion
+111
-5
rpm/SOURCES/jenkins.init.in
rpm/SOURCES/jenkins.init.in
+4
-0
rpm/SOURCES/jenkins.sysconfig.in
rpm/SOURCES/jenkins.sysconfig.in
+36
-0
test/src/test/java/hudson/console/ConsoleAnnotatorTest.java
test/src/test/java/hudson/console/ConsoleAnnotatorTest.java
+2
-1
test/src/test/java/hudson/model/QueueTest.java
test/src/test/java/hudson/model/QueueTest.java
+2
-1
test/src/test/java/hudson/model/UpdateSiteTest.java
test/src/test/java/hudson/model/UpdateSiteTest.java
+67
-3
未找到文件。
rpm/SOURCES/jenkins.init.in
浏览文件 @
3e7181d9
...
...
@@ -73,7 +73,11 @@ done
JAVA_CMD
=
"
$JENKINS_JAVA_CMD
$JENKINS_JAVA_OPTIONS
-DJENKINS_HOME=
$JENKINS_HOME
-jar
$JENKINS_WAR
"
PARAMS
=
"--logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon"
[
-n
"
$JENKINS_PORT
"
]
&&
PARAMS
=
"
$PARAMS
--httpPort=
$JENKINS_PORT
"
[
-n
"
$JENKINS_LISTEN_ADDRESS
"
]
&&
PARAMS
=
"
$PARAMS
--httpListenAddress=
$JENKINS_LISTEN_ADDRESS
"
[
-n
"
$JENKINS_HTTPS_PORT
"
]
&&
PARAMS
=
"
$PARAMS
--httpsPort=
$JENKINS_HTTPS_PORT
"
[
-n
"
$JENKINS_HTTPS_LISTEN_ADDRESS
"
]
&&
PARAMS
=
"
$PARAMS
--httpsListenAddress=
$JENKINS_HTTPS_LISTEN_ADDRESS
"
[
-n
"
$JENKINS_AJP_PORT
"
]
&&
PARAMS
=
"
$PARAMS
--ajp13Port=
$JENKINS_AJP_PORT
"
[
-n
"
$JENKINS_AJP_LISTEN_ADDRESS
"
]
&&
PARAMS
=
"
$PARAMS
--ajp13ListenAddress=
$JENKINS_AJP_LISTEN_ADDRESS
"
[
-n
"
$JENKINS_DEBUG_LEVEL
"
]
&&
PARAMS
=
"
$PARAMS
--debug=
$JENKINS_DEBUG_LEVEL
"
[
-n
"
$JENKINS_HANDLER_STARTUP
"
]
&&
PARAMS
=
"
$PARAMS
--handlerCountStartup=
$JENKINS_HANDLER_STARTUP
"
[
-n
"
$JENKINS_HANDLER_MAX
"
]
&&
PARAMS
=
"
$PARAMS
--handlerCountMax=
$JENKINS_HANDLER_MAX
"
...
...
rpm/SOURCES/jenkins.sysconfig.in
浏览文件 @
3e7181d9
...
...
@@ -45,6 +45,33 @@ JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
#
JENKINS_PORT="8080"
## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# IP address Jenkins listens on for HTTP requests.
# Default is all interfaces (0.0.0.0).
#
JENKINS_LISTEN_ADDRESS=""
## Type: integer(0:65535)
## Default: ""
## ServiceRestart: jenkins
#
# HTTPS port Jenkins is listening on.
# Default is disabled.
#
JENKINS_HTTPS_PORT=""
## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# IP address Jenkins listens on for HTTPS requests.
# Default is disabled.
#
JENKINS_HTTPS_LISTEN_ADDRESS=""
## Type: integer(0:65535)
## Default: 8009
## ServiceRestart: jenkins
...
...
@@ -54,6 +81,15 @@ JENKINS_PORT="8080"
#
JENKINS_AJP_PORT="8009"
## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# IP address Jenkins listens on for Ajp13 requests.
# Default is all interfaces (0.0.0.0).
#
JENKINS_AJP_LISTEN_ADDRESS=""
## Type: integer(1:9)
## Default: 5
## ServiceRestart: jenkins
...
...
test/src/test/java/hudson/console/ConsoleAnnotatorTest.java
浏览文件 @
3e7181d9
...
...
@@ -81,9 +81,10 @@ public class ConsoleAnnotatorTest extends HudsonTestCase {
};
public
static
class
DemoAnnotator
extends
ConsoleAnnotator
<
Object
>
{
private
static
final
String
ANNOTATE_TEXT
=
"ooo"
+
System
.
getProperty
(
"line.separator"
);
@Override
public
ConsoleAnnotator
annotate
(
Object
build
,
MarkupText
text
)
{
if
(
text
.
getText
().
equals
(
"ooo\n"
))
{
if
(
text
.
getText
().
equals
(
ANNOTATE_TEXT
))
{
text
.
addMarkup
(
0
,
3
,
"<b class=demo>"
,
"</b>"
);
return
null
;
}
...
...
test/src/test/java/hudson/model/QueueTest.java
浏览文件 @
3e7181d9
...
...
@@ -282,7 +282,8 @@ public class QueueTest extends HudsonTestCase {
// View for build should group duplicates
WebClient
wc
=
new
WebClient
();
String
buildPage
=
wc
.
getPage
(
build
,
""
).
asText
().
replace
(
'\n'
,
' '
);
String
nl
=
System
.
getProperty
(
"line.separator"
);
String
buildPage
=
wc
.
getPage
(
build
,
""
).
asText
().
replace
(
nl
,
" "
);
assertTrue
(
"Build page should combine duplicates and show counts: "
+
buildPage
,
buildPage
.
contains
(
"Started by user SYSTEM (2 times) "
+
"Started by an SCM change (3 times) "
...
...
test/src/test/java/hudson/model/UpdateSiteTest.java
浏览文件 @
3e7181d9
...
...
@@ -27,22 +27,86 @@ package hudson.model;
import
hudson.model.UpdateSite.Data
;
import
hudson.util.FormValidation
;
import
hudson.util.PersistedList
;
import
java.io.File
;
import
java.io.IOException
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
static
org
.
junit
.
Assert
.*;
import
org.apache.commons.io.FileUtils
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.jvnet.hudson.test.JenkinsRule
;
import
org.mortbay.jetty.HttpConnection
;
import
org.mortbay.jetty.Server
;
import
org.mortbay.jetty.bio.SocketConnector
;
import
org.mortbay.jetty.handler.AbstractHandler
;
public
class
UpdateSiteTest
{
@Rule
public
JenkinsRule
j
=
new
JenkinsRule
();
private
final
String
RELATIVE_BASE
=
"/_relative/"
;
private
Server
server
;
private
URL
baseUrl
;
private
String
getResource
(
String
resourceName
)
throws
IOException
{
try
{
URL
url
=
UpdateSiteTest
.
class
.
getResource
(
resourceName
);
return
(
url
!=
null
)?
FileUtils
.
readFileToString
(
new
File
(
url
.
toURI
())):
null
;
}
catch
(
URISyntaxException
e
)
{
return
null
;
}
}
/**
* Startup a web server to access resources via HTTP.
* @throws Exception
*/
@Before
public
void
setUpWebServer
()
throws
Exception
{
server
=
new
Server
();
SocketConnector
connector
=
new
SocketConnector
();
server
.
addConnector
(
connector
);
server
.
setHandler
(
new
AbstractHandler
()
{
public
void
handle
(
String
target
,
HttpServletRequest
request
,
HttpServletResponse
response
,
int
dispatch
)
throws
IOException
,
ServletException
{
if
(
target
.
startsWith
(
RELATIVE_BASE
))
{
target
=
target
.
substring
(
RELATIVE_BASE
.
length
());
}
String
responseBody
=
getResource
(
target
);
if
(
responseBody
!=
null
)
{
HttpConnection
.
getCurrentConnection
().
getRequest
().
setHandled
(
true
);
response
.
setContentType
(
"text/plain; charset=utf-8"
);
response
.
setStatus
(
HttpServletResponse
.
SC_OK
);
response
.
getOutputStream
().
write
(
responseBody
.
getBytes
());
}
}
});
server
.
start
();
baseUrl
=
new
URL
(
"http"
,
"localhost"
,
connector
.
getLocalPort
(),
RELATIVE_BASE
);
}
@After
public
void
shutdownWebserver
()
throws
Exception
{
server
.
stop
();
}
@Test
public
void
relativeURLs
()
throws
Exception
{
PersistedList
<
UpdateSite
>
sites
=
j
.
jenkins
.
getUpdateCenter
().
getSites
();
sites
.
clear
();
URL
url
=
UpdateSiteTest
.
class
.
getResource
(
"/plugins/tasks-update-center.json"
);
URL
url
=
new
URL
(
baseUrl
,
"/plugins/tasks-update-center.json"
);
UpdateSite
site
=
new
UpdateSite
(
UpdateCenter
.
ID_DEFAULT
,
url
.
toString
());
sites
.
add
(
site
);
assertEquals
(
FormValidation
.
ok
(),
site
.
updateDirectly
(
false
).
get
());
...
...
@@ -55,14 +119,14 @@ public class UpdateSiteTest {
}
@Test
public
void
updateDirectlyWithJson
()
throws
Exception
{
UpdateSite
us
=
new
UpdateSite
(
"default"
,
UpdateSiteTest
.
class
.
getResource
(
"update-center.json"
).
toExternalForm
());
UpdateSite
us
=
new
UpdateSite
(
"default"
,
new
URL
(
baseUrl
,
"update-center.json"
).
toExternalForm
());
assertNull
(
us
.
getPlugin
(
"AdaptivePlugin"
));
assertEquals
(
FormValidation
.
ok
(),
us
.
updateDirectly
(
true
).
get
());
assertNotNull
(
us
.
getPlugin
(
"AdaptivePlugin"
));
}
@Test
public
void
updateDirectlyWithHtml
()
throws
Exception
{
UpdateSite
us
=
new
UpdateSite
(
"default"
,
UpdateSiteTest
.
class
.
getResource
(
"update-center.json.html"
).
toExternalForm
());
UpdateSite
us
=
new
UpdateSite
(
"default"
,
new
URL
(
baseUrl
,
"update-center.json.html"
).
toExternalForm
());
assertNull
(
us
.
getPlugin
(
"AdaptivePlugin"
));
assertEquals
(
FormValidation
.
ok
(),
us
.
updateDirectly
(
true
).
get
());
assertNotNull
(
us
.
getPlugin
(
"AdaptivePlugin"
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录