Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
4ae06599
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 搜索 >>
提交
4ae06599
编写于
4月 08, 2016
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
(cherry picked from commit
aa5c12c5
)
上级
3abe75b2
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
31 addition
and
27 deletion
+31
-27
spring-context-support/src/test/java/org/springframework/scheduling/quartz/CronTriggerFactoryBeanTests.java
...mework/scheduling/quartz/CronTriggerFactoryBeanTests.java
+0
-1
spring-context-support/src/test/java/org/springframework/scheduling/quartz/SimpleTriggerFactoryBeanTests.java
...work/scheduling/quartz/SimpleTriggerFactoryBeanTests.java
+0
-1
spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java
...a/org/springframework/expression/spel/SpelReproTests.java
+9
-9
spring-web/src/main/java/org/springframework/web/method/support/ModelAndViewContainer.java
...ngframework/web/method/support/ModelAndViewContainer.java
+4
-1
spring-web/src/test/java/org/springframework/http/server/ServletServerHttpRequestTests.java
...gframework/http/server/ServletServerHttpRequestTests.java
+1
-3
spring-web/src/test/java/org/springframework/web/method/support/InvocableHandlerMethodTests.java
...ework/web/method/support/InvocableHandlerMethodTests.java
+2
-4
spring-web/src/test/java/org/springframework/web/method/support/ModelAndViewContainerTests.java
...mework/web/method/support/ModelAndViewContainerTests.java
+3
-4
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewMethodReturnValueHandlerTests.java
...annotation/ModelAndViewMethodReturnValueHandlerTests.java
+4
-1
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewResolverMethodReturnValueHandlerTests.java
...on/ModelAndViewResolverMethodReturnValueHandlerTests.java
+8
-3
未找到文件。
spring-context-support/src/test/java/org/springframework/scheduling/quartz/CronTriggerFactoryBeanTests.java
浏览文件 @
4ae06599
...
...
@@ -24,7 +24,6 @@ import org.quartz.CronTrigger;
import
static
org
.
junit
.
Assert
.*;
/**
*
* @author Stephane Nicoll
*/
public
class
CronTriggerFactoryBeanTests
{
...
...
spring-context-support/src/test/java/org/springframework/scheduling/quartz/SimpleTriggerFactoryBeanTests.java
浏览文件 @
4ae06599
...
...
@@ -24,7 +24,6 @@ import org.quartz.SimpleTrigger;
import
static
org
.
junit
.
Assert
.*;
/**
*
* @author Stephane Nicoll
*/
public
class
SimpleTriggerFactoryBeanTests
{
...
...
spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java
浏览文件 @
4ae06599
...
...
@@ -1901,7 +1901,7 @@ public class SpelReproTests extends AbstractExpressionTests {
}
@Test
public
void
SPR12803
()
throws
Exception
{
public
void
SPR12803
()
{
StandardEvaluationContext
sec
=
new
StandardEvaluationContext
();
sec
.
setVariable
(
"iterable"
,
Collections
.
emptyList
());
SpelExpressionParser
parser
=
new
SpelExpressionParser
();
...
...
@@ -1910,7 +1910,7 @@ public class SpelReproTests extends AbstractExpressionTests {
}
@Test
public
void
SPR12808
()
throws
Exception
{
public
void
SPR12808
()
{
SpelExpressionParser
parser
=
new
SpelExpressionParser
();
Expression
expression
=
parser
.
parseExpression
(
"T(org.springframework.expression.spel.SpelReproTests.DistanceEnforcer).from(#no)"
);
StandardEvaluationContext
sec
=
new
StandardEvaluationContext
();
...
...
@@ -2123,9 +2123,9 @@ public class SpelReproTests extends AbstractExpressionTests {
}
private
static
enum
ABC
{
A
,
B
,
C
}
private
enum
ABC
{
A
,
B
,
C
}
private
static
enum
XYZ
{
X
,
Y
,
Z
}
private
enum
XYZ
{
X
,
Y
,
Z
}
public
static
class
BooleanHolder
{
...
...
@@ -2152,9 +2152,9 @@ public class SpelReproTests extends AbstractExpressionTests {
}
private
static
interface
GenericInterface
<
T
extends
Number
>
{
private
interface
GenericInterface
<
T
extends
Number
>
{
public
T
getProperty
();
T
getProperty
();
}
...
...
@@ -2179,9 +2179,9 @@ public class SpelReproTests extends AbstractExpressionTests {
}
public
static
interface
StaticFinal
{
public
interface
StaticFinal
{
public
static
final
String
VALUE
=
"interfaceValue"
;
String
VALUE
=
"interfaceValue"
;
}
...
...
@@ -2258,7 +2258,7 @@ public class SpelReproTests extends AbstractExpressionTests {
}
@SuppressWarnings
({
"rawtypes"
,
"serial"
})
@SuppressWarnings
({
"rawtypes"
,
"serial"
})
public
static
class
MapWithConstant
extends
HashMap
{
public
static
final
int
X
=
1
;
...
...
spring-web/src/main/java/org/springframework/web/method/support/ModelAndViewContainer.java
浏览文件 @
4ae06599
...
...
@@ -153,6 +153,7 @@ public class ModelAndViewContainer {
/**
* Whether binding is disabled for the given model attribute.
* @since 4.3
*/
public
boolean
isBindingDisabled
(
String
name
)
{
return
this
.
bindingDisabledAttributes
.
contains
(
name
);
...
...
@@ -172,7 +173,8 @@ public class ModelAndViewContainer {
* model (redirect URL preparation). Use of this method may be needed for
* advanced cases when access to the "default" model is needed regardless,
* e.g. to save model attributes specified via {@code @SessionAttributes}.
* @return the default model, never {@code null}
* @return the default model (never {@code null})
* @since 4.1.4
*/
public
ModelMap
getDefaultModel
()
{
return
this
.
defaultModel
;
...
...
@@ -215,6 +217,7 @@ public class ModelAndViewContainer {
/**
* Return the configured HTTP status, if any.
* @since 4.3
*/
public
HttpStatus
getStatus
()
{
return
this
.
status
;
...
...
spring-web/src/test/java/org/springframework/http/server/ServletServerHttpRequestTests.java
浏览文件 @
4ae06599
...
...
@@ -64,9 +64,7 @@ public class ServletServerHttpRequestTests {
assertEquals
(
"Invalid uri"
,
uri
,
request
.
getURI
());
}
// SPR-13876
@Test
@Test
// SPR-13876
public
void
getUriWithEncoding
()
throws
Exception
{
URI
uri
=
new
URI
(
"https://example.com/%E4%B8%AD%E6%96%87"
+
"?redirect=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-framework"
);
...
...
spring-web/src/test/java/org/springframework/web/method/support/InvocableHandlerMethodTests.java
浏览文件 @
4ae06599
...
...
@@ -29,7 +29,7 @@ import org.springframework.web.bind.support.WebDataBinderFactory;
import
org.springframework.web.context.request.NativeWebRequest
;
import
org.springframework.web.context.request.ServletWebRequest
;
import
static
org
.
hamcrest
.
Matchers
.
containsString
;
import
static
org
.
hamcrest
.
Matchers
.
*
;
import
static
org
.
junit
.
Assert
.*;
/**
...
...
@@ -196,9 +196,7 @@ public class InvocableHandlerMethodTests {
}
}
// SPR-13917
@Test
@Test
// SPR-13917
public
void
invocationErrorMessage
()
throws
Exception
{
HandlerMethodArgumentResolverComposite
composite
=
new
HandlerMethodArgumentResolverComposite
();
composite
.
addResolver
(
new
StubArgumentResolver
(
double
.
class
,
null
));
...
...
spring-web/src/test/java/org/springframework/web/method/support/ModelAndViewContainerTests.java
浏览文件 @
4ae06599
...
...
@@ -16,13 +16,12 @@
package
org.springframework.web.method.support
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.springframework.ui.ModelMap
;
import
static
org
.
junit
.
Assert
.*;
/**
* Test fixture for {@link ModelAndViewContainer}.
...
...
@@ -76,7 +75,7 @@ public class ModelAndViewContainerTests {
assertTrue
(
this
.
mavContainer
.
getModel
().
isEmpty
());
}
@Test
// SPR-14045
@Test
// SPR-14045
public
void
ignoreDefaultModelAndWithoutRedirectModel
()
{
this
.
mavContainer
.
setIgnoreDefaultModelOnRedirect
(
true
);
this
.
mavContainer
.
setRedirectModelScenario
(
true
);
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewMethodReturnValueHandlerTests.java
浏览文件 @
4ae06599
...
...
@@ -47,6 +47,7 @@ public class ModelAndViewMethodReturnValueHandlerTests {
private
MethodParameter
returnParamModelAndView
;
@Before
public
void
setUp
()
throws
Exception
{
this
.
handler
=
new
ModelAndViewMethodReturnValueHandler
();
...
...
@@ -55,6 +56,7 @@ public class ModelAndViewMethodReturnValueHandlerTests {
this
.
returnParamModelAndView
=
getReturnValueParam
(
"modelAndView"
);
}
@Test
public
void
supportsReturnType
()
throws
Exception
{
assertTrue
(
handler
.
supportsReturnType
(
returnParamModelAndView
));
...
...
@@ -143,7 +145,7 @@ public class ModelAndViewMethodReturnValueHandlerTests {
assertNotSame
(
"RedirectAttributes should not be used if controller doesn't redirect"
,
redirectAttributes
,
model
);
}
@Test
// SPR-14045
@Test
// SPR-14045
public
void
handleRedirectWithIgnoreDefaultModel
()
throws
Exception
{
mavContainer
.
setIgnoreDefaultModelOnRedirect
(
true
);
...
...
@@ -163,6 +165,7 @@ public class ModelAndViewMethodReturnValueHandlerTests {
return
new
MethodParameter
(
method
,
-
1
);
}
@SuppressWarnings
(
"unused"
)
ModelAndView
modelAndView
()
{
return
null
;
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewResolverMethodReturnValueHandlerTests.java
浏览文件 @
4ae06599
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
6
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.
...
...
@@ -50,6 +50,7 @@ public class ModelAndViewResolverMethodReturnValueHandlerTests {
private
ServletWebRequest
request
;
@Before
public
void
setUp
()
{
mavResolvers
=
new
ArrayList
<
ModelAndViewResolver
>();
...
...
@@ -58,6 +59,7 @@ public class ModelAndViewResolverMethodReturnValueHandlerTests {
request
=
new
ServletWebRequest
(
new
MockHttpServletRequest
());
}
@Test
public
void
modelAndViewResolver
()
throws
Exception
{
MethodParameter
returnType
=
new
MethodParameter
(
getClass
().
getDeclaredMethod
(
"testBeanReturnValue"
),
-
1
);
...
...
@@ -71,7 +73,7 @@ public class ModelAndViewResolverMethodReturnValueHandlerTests {
assertFalse
(
mavContainer
.
isRequestHandled
());
}
@Test
(
expected
=
UnsupportedOperationException
.
class
)
@Test
(
expected
=
UnsupportedOperationException
.
class
)
public
void
modelAndViewResolverUnresolved
()
throws
Exception
{
MethodParameter
returnType
=
new
MethodParameter
(
getClass
().
getDeclaredMethod
(
"intReturnValue"
),
-
1
);
mavResolvers
.
add
(
new
TestModelAndViewResolver
(
TestBean
.
class
));
...
...
@@ -88,7 +90,7 @@ public class ModelAndViewResolverMethodReturnValueHandlerTests {
assertTrue
(
mavContainer
.
getModel
().
isEmpty
());
}
@Test
(
expected
=
UnsupportedOperationException
.
class
)
@Test
(
expected
=
UnsupportedOperationException
.
class
)
public
void
handleSimpleType
()
throws
Exception
{
MethodParameter
returnType
=
new
MethodParameter
(
getClass
().
getDeclaredMethod
(
"intReturnValue"
),
-
1
);
handler
.
handleReturnValue
(
55
,
returnType
,
mavContainer
,
request
);
...
...
@@ -102,6 +104,7 @@ public class ModelAndViewResolverMethodReturnValueHandlerTests {
assertTrue
(
mavContainer
.
containsAttribute
(
"testBean"
));
}
@SuppressWarnings
(
"unused"
)
private
int
intReturnValue
()
{
return
0
;
...
...
@@ -112,6 +115,7 @@ public class ModelAndViewResolverMethodReturnValueHandlerTests {
return
null
;
}
private
static
class
TestModelAndViewResolver
implements
ModelAndViewResolver
{
private
Class
<?>
returnValueType
;
...
...
@@ -132,4 +136,5 @@ public class ModelAndViewResolverMethodReturnValueHandlerTests {
}
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录