Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
d6002092
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,体验更适合开发者的 AI 搜索 >>
提交
d6002092
编写于
11月 04, 2019
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up build warnings for ApplicationContextExpressionTests
上级
01fb35bd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
9 deletion
+13
-9
spring-context/src/test/java/org/springframework/context/expression/ApplicationContextExpressionTests.java
...context/expression/ApplicationContextExpressionTests.java
+13
-9
未找到文件。
spring-context/src/test/java/org/springframework/context/expression/ApplicationContextExpressionTests.java
浏览文件 @
d6002092
...
@@ -36,7 +36,6 @@ import org.springframework.beans.factory.ObjectFactory;
...
@@ -36,7 +36,6 @@ import org.springframework.beans.factory.ObjectFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
;
import
org.springframework.beans.factory.config.Scope
;
import
org.springframework.beans.factory.config.Scope
;
import
org.springframework.beans.factory.config.TypedStringValue
;
import
org.springframework.beans.factory.config.TypedStringValue
;
import
org.springframework.beans.factory.support.AutowireCandidateQualifier
;
import
org.springframework.beans.factory.support.AutowireCandidateQualifier
;
...
@@ -66,13 +65,14 @@ import static org.springframework.tests.TestGroup.PERFORMANCE;
...
@@ -66,13 +65,14 @@ import static org.springframework.tests.TestGroup.PERFORMANCE;
* @author Sam Brannen
* @author Sam Brannen
* @since 3.0
* @since 3.0
*/
*/
public
class
ApplicationContextExpressionTests
{
class
ApplicationContextExpressionTests
{
private
static
final
Log
factoryLog
=
LogFactory
.
getLog
(
DefaultListableBeanFactory
.
class
);
private
static
final
Log
factoryLog
=
LogFactory
.
getLog
(
DefaultListableBeanFactory
.
class
);
@Test
@Test
public
void
genericApplicationContext
()
throws
Exception
{
@SuppressWarnings
(
"deprecation"
)
void
genericApplicationContext
()
throws
Exception
{
GenericApplicationContext
ac
=
new
GenericApplicationContext
();
GenericApplicationContext
ac
=
new
GenericApplicationContext
();
AnnotationConfigUtils
.
registerAnnotationConfigProcessors
(
ac
);
AnnotationConfigUtils
.
registerAnnotationConfigProcessors
(
ac
);
...
@@ -105,7 +105,8 @@ public class ApplicationContextExpressionTests {
...
@@ -105,7 +105,8 @@ public class ApplicationContextExpressionTests {
ac
.
getBeanFactory
().
setConversionService
(
new
DefaultConversionService
());
ac
.
getBeanFactory
().
setConversionService
(
new
DefaultConversionService
());
PropertyPlaceholderConfigurer
ppc
=
new
PropertyPlaceholderConfigurer
();
org
.
springframework
.
beans
.
factory
.
config
.
PropertyPlaceholderConfigurer
ppc
=
new
org
.
springframework
.
beans
.
factory
.
config
.
PropertyPlaceholderConfigurer
();
Properties
placeholders
=
new
Properties
();
Properties
placeholders
=
new
Properties
();
placeholders
.
setProperty
(
"code"
,
"123"
);
placeholders
.
setProperty
(
"code"
,
"123"
);
ppc
.
setProperties
(
placeholders
);
ppc
.
setProperties
(
placeholders
);
...
@@ -211,7 +212,7 @@ public class ApplicationContextExpressionTests {
...
@@ -211,7 +212,7 @@ public class ApplicationContextExpressionTests {
}
}
@Test
@Test
public
void
prototypeCreationReevaluatesExpressions
()
{
void
prototypeCreationReevaluatesExpressions
()
{
GenericApplicationContext
ac
=
new
GenericApplicationContext
();
GenericApplicationContext
ac
=
new
GenericApplicationContext
();
AnnotationConfigUtils
.
registerAnnotationConfigProcessors
(
ac
);
AnnotationConfigUtils
.
registerAnnotationConfigProcessors
(
ac
);
GenericConversionService
cs
=
new
GenericConversionService
();
GenericConversionService
cs
=
new
GenericConversionService
();
...
@@ -247,7 +248,7 @@ public class ApplicationContextExpressionTests {
...
@@ -247,7 +248,7 @@ public class ApplicationContextExpressionTests {
@Test
@Test
@EnabledForTestGroups
(
PERFORMANCE
)
@EnabledForTestGroups
(
PERFORMANCE
)
public
void
prototypeCreationIsFastEnough
()
{
void
prototypeCreationIsFastEnough
()
{
Assume
.
notLogging
(
factoryLog
);
Assume
.
notLogging
(
factoryLog
);
GenericApplicationContext
ac
=
new
GenericApplicationContext
();
GenericApplicationContext
ac
=
new
GenericApplicationContext
();
RootBeanDefinition
rbd
=
new
RootBeanDefinition
(
TestBean
.
class
);
RootBeanDefinition
rbd
=
new
RootBeanDefinition
(
TestBean
.
class
);
...
@@ -273,10 +274,11 @@ public class ApplicationContextExpressionTests {
...
@@ -273,10 +274,11 @@ public class ApplicationContextExpressionTests {
System
.
getProperties
().
remove
(
"name"
);
System
.
getProperties
().
remove
(
"name"
);
}
}
assertThat
(
sw
.
getTotalTimeMillis
()
<
6000
).
as
(
"Prototype creation took too long: "
+
sw
.
getTotalTimeMillis
()).
isTrue
();
assertThat
(
sw
.
getTotalTimeMillis
()
<
6000
).
as
(
"Prototype creation took too long: "
+
sw
.
getTotalTimeMillis
()).
isTrue
();
ac
.
close
();
}
}
@Test
@Test
public
void
systemPropertiesSecurityManager
()
{
void
systemPropertiesSecurityManager
()
{
AnnotationConfigApplicationContext
ac
=
new
AnnotationConfigApplicationContext
();
AnnotationConfigApplicationContext
ac
=
new
AnnotationConfigApplicationContext
();
GenericBeanDefinition
bd
=
new
GenericBeanDefinition
();
GenericBeanDefinition
bd
=
new
GenericBeanDefinition
();
...
@@ -309,10 +311,11 @@ public class ApplicationContextExpressionTests {
...
@@ -309,10 +311,11 @@ public class ApplicationContextExpressionTests {
System
.
setSecurityManager
(
oldSecurityManager
);
System
.
setSecurityManager
(
oldSecurityManager
);
System
.
getProperties
().
remove
(
"country"
);
System
.
getProperties
().
remove
(
"country"
);
}
}
ac
.
close
();
}
}
@Test
@Test
public
void
stringConcatenationWithDebugLogging
()
{
void
stringConcatenationWithDebugLogging
()
{
AnnotationConfigApplicationContext
ac
=
new
AnnotationConfigApplicationContext
();
AnnotationConfigApplicationContext
ac
=
new
AnnotationConfigApplicationContext
();
GenericBeanDefinition
bd
=
new
GenericBeanDefinition
();
GenericBeanDefinition
bd
=
new
GenericBeanDefinition
();
...
@@ -323,10 +326,11 @@ public class ApplicationContextExpressionTests {
...
@@ -323,10 +326,11 @@ public class ApplicationContextExpressionTests {
String
str
=
ac
.
getBean
(
"str"
,
String
.
class
);
String
str
=
ac
.
getBean
(
"str"
,
String
.
class
);
assertThat
(
str
.
startsWith
(
"test-"
)).
isTrue
();
assertThat
(
str
.
startsWith
(
"test-"
)).
isTrue
();
ac
.
close
();
}
}
@Test
@Test
public
void
resourceInjection
()
throws
IOException
{
void
resourceInjection
()
throws
IOException
{
System
.
setProperty
(
"logfile"
,
"do_not_delete_me.txt"
);
System
.
setProperty
(
"logfile"
,
"do_not_delete_me.txt"
);
try
(
AnnotationConfigApplicationContext
ac
=
new
AnnotationConfigApplicationContext
(
ResourceInjectionBean
.
class
))
{
try
(
AnnotationConfigApplicationContext
ac
=
new
AnnotationConfigApplicationContext
(
ResourceInjectionBean
.
class
))
{
ResourceInjectionBean
resourceInjectionBean
=
ac
.
getBean
(
ResourceInjectionBean
.
class
);
ResourceInjectionBean
resourceInjectionBean
=
ac
.
getBean
(
ResourceInjectionBean
.
class
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录