Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dk131072
spring-framework
提交
376eeed8
S
spring-framework
项目概览
dk131072
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
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,发现更多精彩内容 >>
提交
376eeed8
编写于
10月 27, 2012
作者:
P
Phillip Webb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish whitespace
上级
461d99af
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
44 addition
and
44 deletion
+44
-44
spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTestTypes.java
...gframework/beans/factory/xml/XmlBeanFactoryTestTypes.java
+27
-27
spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-delegationOverrides.xml
...s/factory/xml/XmlBeanFactoryTests-delegationOverrides.xml
+14
-14
spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java
...pringframework/beans/factory/xml/XmlBeanFactoryTests.java
+3
-3
未找到文件。
spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTestTypes.java
浏览文件 @
376eeed8
...
...
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
...
@@ -41,7 +41,7 @@ import org.springframework.beans.factory.support.MethodReplacer;
/**
* Types used by {@link XmlBeanFactoryTests} and its attendant XML config files.
*
*
* @author Chris Beams
*/
final
class
XmlBeanFactoryTestTypes
{
}
...
...
@@ -161,20 +161,20 @@ class SimpleConstructorArgBean {
* @author Rod Johnson
*/
abstract
class
ConstructorInjectedOverrides
{
private
ITestBean
tb
;
private
String
setterString
;
public
ConstructorInjectedOverrides
(
ITestBean
tb
)
{
this
.
tb
=
tb
;
}
public
ITestBean
getTestBean
()
{
return
this
.
tb
;
}
protected
abstract
FactoryMethods
createFactoryMethods
();
/**
...
...
@@ -234,7 +234,7 @@ class DerivedConstructorDependenciesBean extends ConstructorDependenciesBean {
/**
*
*
* @author Rod Johnson
*/
interface
DummyBo
{
...
...
@@ -245,19 +245,19 @@ interface DummyBo {
/**
*
*
* @author Rod Johnson
*/
class
DummyBoImpl
implements
DummyBo
{
DummyDao
dao
;
public
DummyBoImpl
(
DummyDao
dao
)
{
this
.
dao
=
dao
;
}
public
void
something
()
{
}
}
...
...
@@ -267,7 +267,7 @@ class DummyBoImpl implements DummyBo {
* @author Rod Johnson
*/
class
DummyDao
{
DataSource
ds
;
public
DummyDao
(
DataSource
ds
)
{
...
...
@@ -332,7 +332,7 @@ class DummyReferencer {
* @author Juergen Hoeller
*/
class
FactoryMethods
{
public
static
FactoryMethods
nullInstance
()
{
return
null
;
}
...
...
@@ -342,21 +342,21 @@ class FactoryMethods {
tb
.
setName
(
"defaultInstance"
);
return
new
FactoryMethods
(
tb
,
"default"
,
0
);
}
/**
* Note that overloaded methods are supported.
*/
public
static
FactoryMethods
newInstance
(
TestBean
tb
)
{
return
new
FactoryMethods
(
tb
,
"default"
,
0
);
}
protected
static
FactoryMethods
newInstance
(
TestBean
tb
,
int
num
,
String
name
)
{
if
(
name
==
null
)
{
throw
new
IllegalStateException
(
"Should never be called with null value"
);
}
return
new
FactoryMethods
(
tb
,
name
,
num
);
}
static
FactoryMethods
newInstance
(
TestBean
tb
,
int
num
,
Integer
something
)
{
if
(
something
!=
null
)
{
throw
new
IllegalStateException
(
"Should never be called with non-null value"
);
...
...
@@ -384,35 +384,35 @@ class FactoryMethods {
this
.
name
=
name
;
this
.
num
=
num
;
}
public
void
setStringValue
(
String
stringValue
)
{
this
.
stringValue
=
stringValue
;
}
public
String
getStringValue
()
{
return
this
.
stringValue
;
}
public
TestBean
getTestBean
()
{
return
this
.
tb
;
}
protected
TestBean
protectedGetTestBean
()
{
return
this
.
tb
;
}
private
TestBean
privateGetTestBean
()
{
return
this
.
tb
;
}
public
int
getNum
()
{
return
num
;
}
public
String
getName
()
{
return
name
;
}
/**
* Set via Setter Injection once instance is created.
*/
...
...
@@ -550,7 +550,7 @@ abstract class OverrideOneMethod extends MethodReplaceCandidate implements Overr
* @author Rod Johnson
*/
abstract
class
OverrideOneMethodSubclass
extends
OverrideOneMethod
{
protected
void
doSomething
(
String
arg
)
{
// This implementation does nothing!
// It's not overloaded
...
...
spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-delegationOverrides.xml
浏览文件 @
376eeed8
...
...
@@ -7,16 +7,16 @@
Not yet in use: illustration of possible approach
-->
<bean
id=
"overrideOneMethod"
class=
"org.springframework.beans.factory.xml.OverrideOneMethod"
>
<lookup-method
name=
"getPrototypeDependency"
bean=
"jenny"
/>
<lookup-method
name=
"protectedOverrideSingleton"
bean=
"david"
/>
<!-- Arbitrary method replacer -->
<replaced-method
name=
"replaceMe"
replacer=
"reverseReplacer"
>
<arg-type>
String
</arg-type>
</replaced-method>
<replaced-method
name=
"replaceMe"
replacer=
"fixedReplacer"
/>
</bean>
...
...
@@ -39,25 +39,25 @@
</bean>
<bean
id=
"reverseReplacer"
<bean
id=
"reverseReplacer"
class=
"org.springframework.beans.factory.xml.ReverseMethodReplacer"
/>
<bean
id=
"fixedReplacer"
<bean
id=
"fixedReplacer"
class=
"org.springframework.beans.factory.xml.FixedMethodReplacer"
/>
<bean
id=
"doSomethingReplacer"
<bean
id=
"doSomethingReplacer"
class=
"org.springframework.beans.factory.xml.XmlBeanFactoryTests$DoSomethingReplacer"
/>
<bean
id=
"serializableReplacer"
<bean
id=
"serializableReplacer"
class=
"org.springframework.beans.factory.xml.SerializableMethodReplacerCandidate"
>
<!-- Arbitrary method replacer -->
<replaced-method
name=
"replaceMe"
replacer=
"reverseReplacer"
>
<arg-type>
String
</arg-type>
</replaced-method>
</bean>
<bean
id=
"jenny"
class=
"org.springframework.beans.TestBean"
scope=
"prototype"
>
<property
name=
"name"
><value>
Jenny
</value></property>
...
...
@@ -67,7 +67,7 @@
<ref
local=
"david"
/>
</property>
</bean>
<bean
id=
"david"
class=
"org.springframework.beans.TestBean"
scope=
"singleton"
>
<description>
...
...
spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java
浏览文件 @
376eeed8
...
...
@@ -83,10 +83,10 @@ import org.xml.sax.InputSource;
* @author Chris Beams
*/
public
final
class
XmlBeanFactoryTests
{
private
static
final
Class
<?>
CLASS
=
XmlBeanFactoryTests
.
class
;
private
static
final
String
CLASSNAME
=
CLASS
.
getSimpleName
();
private
static
final
ClassPathResource
AUTOWIRE_CONTEXT
=
classPathResource
(
"-autowire.xml"
);
private
static
final
ClassPathResource
CHILD_CONTEXT
=
classPathResource
(
"-child.xml"
);
private
static
final
ClassPathResource
CLASS_NOT_FOUND_CONTEXT
=
classPathResource
(
"-classNotFound.xml"
);
...
...
@@ -128,7 +128,7 @@ public final class XmlBeanFactoryTests {
private
static
final
ClassPathResource
REFTYPES_CONTEXT
=
classPathResource
(
"-reftypes.xml"
);
private
static
final
ClassPathResource
DEFAULT_LAZY_CONTEXT
=
classPathResource
(
"-defaultLazyInit.xml"
);
private
static
final
ClassPathResource
DEFAULT_AUTOWIRE_CONTEXT
=
classPathResource
(
"-defaultAutowire.xml"
);
private
static
ClassPathResource
classPathResource
(
String
suffix
)
{
return
new
ClassPathResource
(
CLASSNAME
+
suffix
,
CLASS
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录