Polishing

This commit is contained in:
Juergen Hoeller
2019-06-11 20:57:27 +02:00
parent 1956cb1e57
commit 7dc92aa05d
30 changed files with 82 additions and 106 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2019 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.
@@ -23,7 +23,9 @@ import org.junit.Test;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.tests.sample.beans.TestBean;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* @author Rod Johnson
@@ -36,9 +38,9 @@ public class BeanDefinitionBuilderTests {
String[] dependsOn = new String[] { "A", "B", "C" };
BeanDefinitionBuilder bdb = BeanDefinitionBuilder.rootBeanDefinition(TestBean.class);
bdb.setScope(BeanDefinition.SCOPE_PROTOTYPE);
bdb.addPropertyReference("age", "15");
for (int i = 0; i < dependsOn.length; i++) {
bdb.addDependsOn(dependsOn[i]);
bdb.addPropertyValue("age", "15");
for (String dependsOnEntry : dependsOn) {
bdb.addDependsOn(dependsOnEntry);
}
RootBeanDefinition rbd = (RootBeanDefinition) bdb.getBeanDefinition();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2019 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.
@@ -61,8 +61,6 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt
private ITestBean spouse;
protected ITestBean[] spouses;
private String touchy;
private String[] stringArray;