Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
c454eaac
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,发现更多精彩内容 >>
提交
c454eaac
编写于
3月 21, 2013
作者:
J
Jesse Glick
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ohtake’s
20249e4a
accidentally suppressed all but one test case.
上级
b0f30aba
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
0 deletion
+13
-0
core/src/test/java/hudson/scheduler/CronTabTest.java
core/src/test/java/hudson/scheduler/CronTabTest.java
+13
-0
未找到文件。
core/src/test/java/hudson/scheduler/CronTabTest.java
浏览文件 @
c454eaac
...
...
@@ -40,6 +40,8 @@ import static java.util.Calendar.MONDAY;
* @author Kohsuke Kawaguchi
*/
public
class
CronTabTest
{
@Test
public
void
test1
()
throws
ANTLRException
{
new
CronTab
(
"@yearly"
);
new
CronTab
(
"@weekly"
);
...
...
@@ -48,6 +50,7 @@ public class CronTabTest {
new
CronTab
(
"0 0 * 1-10/3 *"
);
}
@Test
public
void
testCeil1
()
throws
Exception
{
CronTab
x
=
new
CronTab
(
"0,30 * * * *"
);
Calendar
c
=
new
GregorianCalendar
(
2000
,
2
,
1
,
1
,
10
);
...
...
@@ -58,6 +61,7 @@ public class CronTabTest {
compare
(
new
GregorianCalendar
(
2000
,
2
,
1
,
2
,
0
),
x
.
ceil
(
c
));
}
@Test
public
void
testCeil2
()
throws
Exception
{
// make sure that lower fields are really reset correctly
CronTab
x
=
new
CronTab
(
"15,45 3 * * *"
);
...
...
@@ -65,6 +69,7 @@ public class CronTabTest {
compare
(
new
GregorianCalendar
(
2000
,
2
,
1
,
3
,
15
),
x
.
ceil
(
c
));
}
@Test
public
void
testCeil3
()
throws
Exception
{
// conflict between DoM and DoW. In this we need to find a day that's the first day of a month and Sunday
CronTab
x
=
new
CronTab
(
"0 0 1 * 0"
);
...
...
@@ -87,6 +92,7 @@ public class CronTabTest {
* Verifies that HUDSON-8656 never crops up again.
*/
@Url
(
"http://issues.hudson-ci.org/browse/HUDSON-8656"
)
@Test
public
void
testCeil4
()
throws
ANTLRException
{
final
Calendar
cal
=
Calendar
.
getInstance
(
new
Locale
(
"de"
,
"de"
));
cal
.
set
(
2011
,
0
,
16
,
0
,
0
,
0
);
// Sunday, Jan 16th 2011, 00:00
...
...
@@ -108,6 +114,7 @@ public class CronTabTest {
* Verifies that HUDSON-8656 never crops up again.
*/
@Url
(
"http://issues.hudson-ci.org/browse/HUDSON-8656"
)
@Test
public
void
testCeil5
()
throws
ANTLRException
{
final
Calendar
cal
=
Calendar
.
getInstance
(
new
Locale
(
"de"
,
"at"
));
cal
.
set
(
2011
,
0
,
16
,
0
,
0
,
0
);
// Sunday, Jan 16th 2011, 00:00
...
...
@@ -125,6 +132,7 @@ public class CronTabTest {
assertEquals
(
expectedDate
.
get
(
Calendar
.
DAY_OF_MONTH
),
next
.
get
(
Calendar
.
DAY_OF_MONTH
));
// FAILS: is Monday, Jan 10th, 23:00
}
@Test
public
void
testFloor1
()
throws
Exception
{
CronTab
x
=
new
CronTab
(
"30 * * * *"
);
Calendar
c
=
new
GregorianCalendar
(
2000
,
2
,
1
,
1
,
40
);
...
...
@@ -135,6 +143,7 @@ public class CronTabTest {
compare
(
new
GregorianCalendar
(
2000
,
2
,
1
,
0
,
30
),
x
.
floor
(
c
));
}
@Test
public
void
testFloor2
()
throws
Exception
{
// make sure that lower fields are really reset correctly
CronTab
x
=
new
CronTab
(
"15,45 3 * * *"
);
...
...
@@ -142,6 +151,7 @@ public class CronTabTest {
compare
(
new
GregorianCalendar
(
2000
,
2
,
1
,
3
,
45
),
x
.
floor
(
c
));
}
@Test
public
void
testFloor3
()
throws
Exception
{
// conflict between DoM and DoW. In this we need to find a day that's the first day of a month and Sunday in 2010
CronTab
x
=
new
CronTab
(
"0 0 1 * 0"
);
...
...
@@ -151,6 +161,7 @@ public class CronTabTest {
}
@Bug
(
8401
)
@Test
public
void
testFloor4
()
throws
Exception
{
// conflict between DoM and DoW. In this we need to find a day that's the first day of a month and Sunday in 2010
CronTab
x
=
new
CronTab
(
"0 0 1 * 0"
);
...
...
@@ -171,6 +182,7 @@ public class CronTabTest {
assertEquals
(
a
,
b
);
}
@Test
public
void
testHash1
()
throws
Exception
{
CronTab
x
=
new
CronTab
(
"H H(5-8) * * *"
,
new
Hash
()
{
public
int
next
(
int
n
)
{
...
...
@@ -182,6 +194,7 @@ public class CronTabTest {
assertEquals
(
x
.
bits
[
1
],
1L
<<
8
);
}
@Test
public
void
testHash2
()
throws
Exception
{
CronTab
x
=
new
CronTab
(
"H H(5-8) * * *"
,
new
Hash
()
{
public
int
next
(
int
n
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录