|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2013 the original author or authors. |
|
|
|
* Copyright 2002-2014 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -27,24 +27,26 @@ import java.util.Set; |
|
|
|
import javax.sql.DataSource; |
|
|
|
import javax.sql.DataSource; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.BeansException; |
|
|
|
import org.springframework.beans.BeansException; |
|
|
|
import org.springframework.tests.sample.beans.ITestBean; |
|
|
|
|
|
|
|
import org.springframework.tests.sample.beans.IndexedTestBean; |
|
|
|
|
|
|
|
import org.springframework.tests.sample.beans.TestBean; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.BeanFactory; |
|
|
|
import org.springframework.beans.factory.BeanFactory; |
|
|
|
import org.springframework.beans.factory.BeanFactoryAware; |
|
|
|
import org.springframework.beans.factory.BeanFactoryAware; |
|
|
|
import org.springframework.beans.factory.BeanNameAware; |
|
|
|
import org.springframework.beans.factory.BeanNameAware; |
|
|
|
import org.springframework.beans.factory.DisposableBean; |
|
|
|
import org.springframework.beans.factory.DisposableBean; |
|
|
|
import org.springframework.tests.sample.beans.factory.DummyFactory; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.InitializingBean; |
|
|
|
import org.springframework.beans.factory.InitializingBean; |
|
|
|
import org.springframework.beans.factory.config.BeanPostProcessor; |
|
|
|
import org.springframework.beans.factory.config.BeanPostProcessor; |
|
|
|
import org.springframework.beans.factory.support.MethodReplacer; |
|
|
|
import org.springframework.beans.factory.support.MethodReplacer; |
|
|
|
|
|
|
|
import org.springframework.tests.sample.beans.ITestBean; |
|
|
|
|
|
|
|
import org.springframework.tests.sample.beans.IndexedTestBean; |
|
|
|
|
|
|
|
import org.springframework.tests.sample.beans.TestBean; |
|
|
|
|
|
|
|
import org.springframework.tests.sample.beans.factory.DummyFactory; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Types used by {@link XmlBeanFactoryTests} and its attendant XML config files. |
|
|
|
* Types used by {@link XmlBeanFactoryTests} and its attendant XML config files. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Chris Beams |
|
|
|
* @author Chris Beams |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
final class XmlBeanFactoryTestTypes { } |
|
|
|
final class XmlBeanFactoryTestTypes { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Simple bean used to check constructor dependency checking. |
|
|
|
* Simple bean used to check constructor dependency checking. |
|
|
|
@ -174,18 +176,12 @@ abstract class ConstructorInjectedOverrides { |
|
|
|
return this.tb; |
|
|
|
return this.tb; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected abstract FactoryMethods createFactoryMethods(); |
|
|
|
protected abstract FactoryMethods createFactoryMethods(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @return Returns the setterString. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public String getSetterString() { |
|
|
|
public String getSetterString() { |
|
|
|
return setterString; |
|
|
|
return setterString; |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
|
|
|
|
* @param setterString The setterString to set. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void setSetterString(String setterString) { |
|
|
|
public void setSetterString(String setterString) { |
|
|
|
this.setterString = setterString; |
|
|
|
this.setterString = setterString; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -229,7 +225,6 @@ class DerivedConstructorDependenciesBean extends ConstructorDependenciesBean { |
|
|
|
private void destroy() { |
|
|
|
private void destroy() { |
|
|
|
this.destroyed = true; |
|
|
|
this.destroyed = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -240,7 +235,6 @@ class DerivedConstructorDependenciesBean extends ConstructorDependenciesBean { |
|
|
|
interface DummyBo { |
|
|
|
interface DummyBo { |
|
|
|
|
|
|
|
|
|
|
|
void something(); |
|
|
|
void something(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -258,9 +252,7 @@ class DummyBoImpl implements DummyBo { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void something() { |
|
|
|
public void something() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -274,7 +266,6 @@ class DummyDao { |
|
|
|
public DummyDao(DataSource ds) { |
|
|
|
public DummyDao(DataSource ds) { |
|
|
|
this.ds = ds; |
|
|
|
this.ds = ds; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -290,7 +281,6 @@ class DummyReferencer { |
|
|
|
|
|
|
|
|
|
|
|
private DummyFactory dummyFactory; |
|
|
|
private DummyFactory dummyFactory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DummyReferencer() { |
|
|
|
public DummyReferencer() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -321,7 +311,6 @@ class DummyReferencer { |
|
|
|
public TestBean getTestBean2() { |
|
|
|
public TestBean getTestBean2() { |
|
|
|
return testBean2; |
|
|
|
return testBean2; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -370,13 +359,11 @@ class FactoryMethods { |
|
|
|
return Collections.EMPTY_LIST; |
|
|
|
return Collections.EMPTY_LIST; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int num = 0; |
|
|
|
private int num = 0; |
|
|
|
private String name = "default"; |
|
|
|
private String name = "default"; |
|
|
|
private TestBean tb; |
|
|
|
private TestBean tb; |
|
|
|
private String stringValue; |
|
|
|
private String stringValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Constructor is private: not for use outside this class, |
|
|
|
* Constructor is private: not for use outside this class, |
|
|
|
* even by IoC container. |
|
|
|
* even by IoC container. |
|
|
|
@ -421,7 +408,6 @@ class FactoryMethods { |
|
|
|
public void setName(String name) { |
|
|
|
public void setName(String name) { |
|
|
|
this.name = name; |
|
|
|
this.name = name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -436,7 +422,6 @@ class FixedMethodReplacer implements MethodReplacer { |
|
|
|
public Object reimplement(Object obj, Method method, Object[] args) throws Throwable { |
|
|
|
public Object reimplement(Object obj, Method method, Object[] args) throws Throwable { |
|
|
|
return VALUE; |
|
|
|
return VALUE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -469,22 +454,17 @@ class MethodReplaceCandidate { |
|
|
|
public String replaceMe(String echo) { |
|
|
|
public String replaceMe(String echo) { |
|
|
|
return echo; |
|
|
|
return echo; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Bean that exposes a simple property that can be set |
|
|
|
* Bean that exposes a simple property that can be set |
|
|
|
* to a mix of references and individual values. |
|
|
|
* to a mix of references and individual values. |
|
|
|
* |
|
|
|
|
|
|
|
* @author Rod Johnson |
|
|
|
|
|
|
|
* @since 27.05.2003 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
class MixedCollectionBean { |
|
|
|
class MixedCollectionBean { |
|
|
|
|
|
|
|
|
|
|
|
private Collection<?> jumble; |
|
|
|
private Collection<?> jumble; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setJumble(Collection<?> jumble) { |
|
|
|
public void setJumble(Collection<?> jumble) { |
|
|
|
this.jumble = jumble; |
|
|
|
this.jumble = jumble; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -492,7 +472,6 @@ class MixedCollectionBean { |
|
|
|
public Collection<?> getJumble() { |
|
|
|
public Collection<?> getJumble() { |
|
|
|
return jumble; |
|
|
|
return jumble; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -504,7 +483,6 @@ interface OverrideInterface { |
|
|
|
TestBean getPrototypeDependency(); |
|
|
|
TestBean getPrototypeDependency(); |
|
|
|
|
|
|
|
|
|
|
|
TestBean getPrototypeDependency(Object someParam); |
|
|
|
TestBean getPrototypeDependency(Object someParam); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -521,7 +499,7 @@ abstract class OverrideOneMethod extends MethodReplaceCandidate implements Overr |
|
|
|
return new TestBean(); |
|
|
|
return new TestBean(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public TestBean invokesOverridenMethodOnSelf() { |
|
|
|
public TestBean invokesOverriddenMethodOnSelf() { |
|
|
|
return getPrototypeDependency(); |
|
|
|
return getPrototypeDependency(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -563,7 +541,6 @@ abstract class OverrideOneMethodSubclass extends OverrideOneMethod { |
|
|
|
// This implementation does nothing!
|
|
|
|
// This implementation does nothing!
|
|
|
|
// It's not overloaded
|
|
|
|
// It's not overloaded
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -591,7 +568,6 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial |
|
|
|
|
|
|
|
|
|
|
|
protected boolean destroyed; |
|
|
|
protected boolean destroyed; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setInitMethodDeclared(boolean initMethodDeclared) { |
|
|
|
public void setInitMethodDeclared(boolean initMethodDeclared) { |
|
|
|
this.initMethodDeclared = initMethodDeclared; |
|
|
|
this.initMethodDeclared = initMethodDeclared; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -707,7 +683,6 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial |
|
|
|
return bean; |
|
|
|
return bean; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -722,7 +697,6 @@ class ReverseMethodReplacer implements MethodReplacer, Serializable { |
|
|
|
String s = (String) args[0]; |
|
|
|
String s = (String) args[0]; |
|
|
|
return new StringBuffer(s).reverse().toString(); |
|
|
|
return new StringBuffer(s).reverse().toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -733,7 +707,6 @@ class ReverseMethodReplacer implements MethodReplacer, Serializable { |
|
|
|
abstract class SerializableMethodReplacerCandidate extends MethodReplaceCandidate implements Serializable { |
|
|
|
abstract class SerializableMethodReplacerCandidate extends MethodReplaceCandidate implements Serializable { |
|
|
|
|
|
|
|
|
|
|
|
//public abstract Point getPoint();
|
|
|
|
//public abstract Point getPoint();
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -769,5 +742,4 @@ class SingleSimpleTypeConstructorBean { |
|
|
|
public String getTestString() { |
|
|
|
public String getTestString() { |
|
|
|
return testString; |
|
|
|
return testString; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|