Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
c8f2e071
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c8f2e071
编写于
3月 06, 2014
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up test warnings that show up in Gradle console
上级
cb59d43a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
22 deletion
+22
-22
spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java
...springframework/scheduling/quartz/QuartzSupportTests.java
+21
-20
spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java
...g/springframework/oxm/castor/CastorUnmarshallerTests.java
+1
-2
未找到文件。
spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java
浏览文件 @
c8f2e071
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
4
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -16,10 +16,8 @@
package
org.springframework.scheduling.quartz
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.sql.DataSource
;
...
...
@@ -49,7 +47,6 @@ import org.springframework.beans.factory.support.RootBeanDefinition;
import
org.springframework.beans.factory.support.StaticListableBeanFactory
;
import
org.springframework.context.support.ClassPathXmlApplicationContext
;
import
org.springframework.context.support.StaticApplicationContext
;
import
org.springframework.core.io.FileSystemResourceLoader
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.tests.Assume
;
...
...
@@ -66,6 +63,7 @@ import static org.mockito.BDDMockito.*;
* @author Rob Harrop
* @author Dave Syer
* @author Mark Fisher
* @author Sam Brannen
* @since 20.02.2004
*/
public
class
QuartzSupportTests
{
...
...
@@ -90,7 +88,7 @@ public class QuartzSupportTests {
JobDetailBean
jobDetail0
=
new
JobDetailBean
();
jobDetail0
.
setJobClass
(
Job
.
class
);
jobDetail0
.
setBeanName
(
"myJob0"
);
Map
jobData
=
new
HashMap
();
Map
<
String
,
Object
>
jobData
=
new
HashMap
<
String
,
Object
>
();
jobData
.
put
(
"testBean"
,
tb
);
jobDetail0
.
setJobDataAsMap
(
jobData
);
jobDetail0
.
afterPropertiesSet
();
...
...
@@ -137,7 +135,7 @@ public class QuartzSupportTests {
}
};
schedulerFactoryBean
.
setJobFactory
(
null
);
Map
schedulerContext
=
new
HashMap
();
Map
<
String
,
Object
>
schedulerContext
=
new
HashMap
<
String
,
Object
>
();
schedulerContext
.
put
(
"otherTestBean"
,
tb
);
schedulerFactoryBean
.
setSchedulerContextAsMap
(
schedulerContext
);
if
(
explicitJobDetail
)
{
...
...
@@ -177,7 +175,7 @@ public class QuartzSupportTests {
JobDetailBean
jobDetail0
=
new
JobDetailBean
();
jobDetail0
.
setJobClass
(
Job
.
class
);
jobDetail0
.
setBeanName
(
"myJob0"
);
Map
jobData
=
new
HashMap
();
Map
<
String
,
Object
>
jobData
=
new
HashMap
<
String
,
Object
>
();
jobData
.
put
(
"testBean"
,
tb
);
jobDetail0
.
setJobDataAsMap
(
jobData
);
jobDetail0
.
afterPropertiesSet
();
...
...
@@ -217,7 +215,7 @@ public class QuartzSupportTests {
}
};
schedulerFactoryBean
.
setJobFactory
(
null
);
Map
schedulerContext
=
new
HashMap
();
Map
<
String
,
Object
>
schedulerContext
=
new
HashMap
<
String
,
Object
>
();
schedulerContext
.
put
(
"otherTestBean"
,
tb
);
schedulerFactoryBean
.
setSchedulerContextAsMap
(
schedulerContext
);
schedulerFactoryBean
.
setTriggers
(
new
Trigger
[]
{
trigger0
,
trigger1
});
...
...
@@ -261,7 +259,7 @@ public class QuartzSupportTests {
JobDetailBean
jobDetail0
=
new
JobDetailBean
();
jobDetail0
.
setJobClass
(
Job
.
class
);
jobDetail0
.
setBeanName
(
"myJob0"
);
Map
jobData
=
new
HashMap
();
Map
<
String
,
Object
>
jobData
=
new
HashMap
<
String
,
Object
>
();
jobData
.
put
(
"testBean"
,
tb
);
jobDetail0
.
setJobDataAsMap
(
jobData
);
jobDetail0
.
afterPropertiesSet
();
...
...
@@ -306,7 +304,7 @@ public class QuartzSupportTests {
}
};
schedulerFactoryBean
.
setJobFactory
(
null
);
Map
schedulerContext
=
new
HashMap
();
Map
<
String
,
Object
>
schedulerContext
=
new
HashMap
<
String
,
Object
>
();
schedulerContext
.
put
(
"otherTestBean"
,
tb
);
schedulerFactoryBean
.
setSchedulerContextAsMap
(
schedulerContext
);
schedulerFactoryBean
.
setTriggers
(
new
Trigger
[]
{
trigger0
,
trigger1
});
...
...
@@ -336,6 +334,7 @@ public class QuartzSupportTests {
}
@Test
@SuppressWarnings
(
"deprecation"
)
public
void
testSchedulerFactoryBeanWithListeners
()
throws
Exception
{
JobFactory
jobFactory
=
new
AdaptableJobFactory
();
...
...
@@ -552,7 +551,7 @@ public class QuartzSupportTests {
}
};
schedulerFactoryBean
.
setJobFactory
(
null
);
Map
schedulerContextMap
=
new
HashMap
();
Map
<
String
,
Object
>
schedulerContextMap
=
new
HashMap
<
String
,
Object
>
();
schedulerContextMap
.
put
(
"testBean"
,
tb
);
schedulerFactoryBean
.
setSchedulerContextAsMap
(
schedulerContextMap
);
schedulerFactoryBean
.
setApplicationContext
(
ac
);
...
...
@@ -580,7 +579,7 @@ public class QuartzSupportTests {
JobDetailBean
jobDetail
=
new
JobDetailBean
();
jobDetail
.
setJobClass
(
Job
.
class
);
jobDetail
.
setBeanName
(
"myJob0"
);
Map
jobData
=
new
HashMap
();
Map
<
String
,
Object
>
jobData
=
new
HashMap
<
String
,
Object
>
();
jobData
.
put
(
"testBean"
,
tb
);
jobDetail
.
setJobDataAsMap
(
jobData
);
jobDetail
.
setApplicationContext
(
ac
);
...
...
@@ -592,6 +591,7 @@ public class QuartzSupportTests {
}
@Test
@SuppressWarnings
(
"deprecation"
)
public
void
testMethodInvokingJobDetailFactoryBeanWithListenerNames
()
throws
Exception
{
TestMethodInvokingTask
task
=
new
TestMethodInvokingTask
();
MethodInvokingJobDetailFactoryBean
mijdfb
=
new
MethodInvokingJobDetailFactoryBean
();
...
...
@@ -603,35 +603,34 @@ public class QuartzSupportTests {
mijdfb
.
setJobListenerNames
(
names
);
mijdfb
.
afterPropertiesSet
();
JobDetail
jobDetail
=
mijdfb
.
getObject
();
List
result
=
Arrays
.
asList
(
jobDetail
.
getJobListenerNames
());
assertEquals
(
Arrays
.
asList
(
names
),
result
);
assertArrayEquals
(
names
,
jobDetail
.
getJobListenerNames
());
}
@Test
@SuppressWarnings
(
"deprecation"
)
public
void
testJobDetailBeanWithListenerNames
()
{
JobDetailBean
jobDetail
=
new
JobDetailBean
();
String
[]
names
=
new
String
[]
{
"test1"
,
"test2"
};
jobDetail
.
setJobListenerNames
(
names
);
List
result
=
Arrays
.
asList
(
jobDetail
.
getJobListenerNames
());
assertEquals
(
Arrays
.
asList
(
names
),
result
);
assertArrayEquals
(
names
,
jobDetail
.
getJobListenerNames
());
}
@Test
@SuppressWarnings
(
"deprecation"
)
public
void
testCronTriggerBeanWithListenerNames
()
{
CronTriggerBean
trigger
=
new
CronTriggerBean
();
String
[]
names
=
new
String
[]
{
"test1"
,
"test2"
};
trigger
.
setTriggerListenerNames
(
names
);
List
result
=
Arrays
.
asList
(
trigger
.
getTriggerListenerNames
());
assertEquals
(
Arrays
.
asList
(
names
),
result
);
assertArrayEquals
(
names
,
trigger
.
getTriggerListenerNames
());
}
@Test
@SuppressWarnings
(
"deprecation"
)
public
void
testSimpleTriggerBeanWithListenerNames
()
{
SimpleTriggerBean
trigger
=
new
SimpleTriggerBean
();
String
[]
names
=
new
String
[]
{
"test1"
,
"test2"
};
trigger
.
setTriggerListenerNames
(
names
);
List
result
=
Arrays
.
asList
(
trigger
.
getTriggerListenerNames
());
assertEquals
(
Arrays
.
asList
(
names
),
result
);
assertArrayEquals
(
names
,
trigger
.
getTriggerListenerNames
());
}
@Test
...
...
@@ -946,6 +945,7 @@ public class QuartzSupportTests {
}
@Test
@SuppressWarnings
(
"resource"
)
public
void
testSchedulerAutoStartsOnContextRefreshedEventByDefault
()
throws
Exception
{
StaticApplicationContext
context
=
new
StaticApplicationContext
();
context
.
registerBeanDefinition
(
"scheduler"
,
new
RootBeanDefinition
(
SchedulerFactoryBean
.
class
));
...
...
@@ -956,6 +956,7 @@ public class QuartzSupportTests {
}
@Test
@SuppressWarnings
(
"resource"
)
public
void
testSchedulerAutoStartupFalse
()
throws
Exception
{
StaticApplicationContext
context
=
new
StaticApplicationContext
();
BeanDefinition
beanDefinition
=
BeanDefinitionBuilder
.
genericBeanDefinition
(
...
...
spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java
浏览文件 @
c8f2e071
...
...
@@ -20,6 +20,7 @@ import java.io.ByteArrayInputStream;
import
java.io.IOException
;
import
java.io.StringReader
;
import
java.util.concurrent.atomic.AtomicReference
;
import
javax.xml.transform.sax.SAXSource
;
import
javax.xml.transform.stream.StreamSource
;
...
...
@@ -33,10 +34,8 @@ import org.springframework.oxm.Unmarshaller;
import
org.xml.sax.InputSource
;
import
org.xml.sax.XMLReader
;
import
static
junit
.
framework
.
Assert
.
assertNotNull
;
import
static
org
.
hamcrest
.
CoreMatchers
.*;
import
static
org
.
junit
.
Assert
.*;
import
static
org
.
junit
.
Assert
.
assertEquals
;
/**
* @author Arjen Poutsma
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录