@@ -1567,6 +1567,7 @@ public void testGetBeanByTypeInstanceDefinedInParent() {
1567
1567
RootBeanDefinition bd1 = createConstructorDependencyBeanDefinition (99 );
1568
1568
parent .registerBeanDefinition ("bd1" , bd1 );
1569
1569
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory (parent );
1570
+
1570
1571
ConstructorDependency bean = lbf .getBean (ConstructorDependency .class , 42 );
1571
1572
assertThat (bean .beanName , equalTo ("bd1" ));
1572
1573
assertThat (bean .spouseAge , equalTo (42 ));
@@ -1579,7 +1580,6 @@ public void testGetBeanByTypeInstanceWithAmbiguity() {
1579
1580
RootBeanDefinition bd2 = new RootBeanDefinition (ConstructorDependency .class );
1580
1581
bd2 .setScope (RootBeanDefinition .SCOPE_PROTOTYPE );
1581
1582
bd2 .getConstructorArgumentValues ().addGenericArgumentValue ("43" );
1582
-
1583
1583
lbf .registerBeanDefinition ("bd1" , bd1 );
1584
1584
lbf .registerBeanDefinition ("bd2" , bd2 );
1585
1585
@@ -1595,6 +1595,7 @@ public void testGetBeanByTypeInstanceWithPrimary() {
1595
1595
bd2 .setPrimary (true );
1596
1596
lbf .registerBeanDefinition ("bd1" , bd1 );
1597
1597
lbf .registerBeanDefinition ("bd2" , bd2 );
1598
+
1598
1599
ConstructorDependency bean = lbf .getBean (ConstructorDependency .class , 42 );
1599
1600
assertThat (bean .beanName , equalTo ("bd2" ));
1600
1601
assertThat (bean .spouseAge , equalTo (42 ));
@@ -1607,9 +1608,9 @@ public void testGetBeanByTypeInstanceWithMultiplePrimary() {
1607
1608
RootBeanDefinition bd2 = createConstructorDependencyBeanDefinition (43 );
1608
1609
bd1 .setPrimary (true );
1609
1610
bd2 .setPrimary (true );
1610
-
1611
1611
lbf .registerBeanDefinition ("bd1" , bd1 );
1612
1612
lbf .registerBeanDefinition ("bd2" , bd2 );
1613
+
1613
1614
thrown .expect (NoUniqueBeanDefinitionException .class );
1614
1615
thrown .expectMessage (containsString ("more than one 'primary'" ));
1615
1616
lbf .getBean (ConstructorDependency .class , 42 );
@@ -1661,7 +1662,7 @@ public void testGetBeanWithArgsNotCreatedForFactoryBeanChecking() {
1661
1662
private RootBeanDefinition createConstructorDependencyBeanDefinition (int age ) {
1662
1663
RootBeanDefinition bd = new RootBeanDefinition (ConstructorDependency .class );
1663
1664
bd .setScope (RootBeanDefinition .SCOPE_PROTOTYPE );
1664
- bd .getConstructorArgumentValues ().addGenericArgumentValue (String . valueOf ( age ) );
1665
+ bd .getConstructorArgumentValues ().addGenericArgumentValue (age );
1665
1666
return bd ;
1666
1667
}
1667
1668
@@ -2383,7 +2384,7 @@ public void testPrototypeCreationWithPropertiesIsFastEnough() {
2383
2384
}
2384
2385
sw .stop ();
2385
2386
// System.out.println(sw.getTotalTimeMillis());
2386
- assertTrue ("Prototype creation took too long: " + sw .getTotalTimeMillis (), sw .getTotalTimeMillis () < 3000 );
2387
+ assertTrue ("Prototype creation took too long: " + sw .getTotalTimeMillis (), sw .getTotalTimeMillis () < 4000 );
2387
2388
}
2388
2389
2389
2390
@ Test
0 commit comments