Commit Graph

869 Commits

Author SHA1 Message Date
Sam Brannen
71ed8143a1 Disable StandardScriptFactoryTests on Java 15+
This commit disables StandardScriptFactoryTests on Java 15 or higher
since the Nashorn JavaScript engine is no longer part of the JDK.
2020-04-28 16:56:15 +02:00
Juergen Hoeller
73fadd8b7c Polishing 2020-04-27 11:45:41 +02:00
Juergen Hoeller
127e879726 Store source in index-derived ScannedGenericBeanDefinition as well
Includes consistent constructor-level storage of derived resource in ScannedGenericBeanDefinition and ConfigurationClassBeanDefinition.

Closes gh-24978
2020-04-27 11:45:08 +02:00
陈其苗
13970ae528 Use autoboxing instead of explicit wrapping in tests
Closes gh-24801
2020-04-01 14:34:20 +02:00
Sam Brannen
01cf0a3d4e Polish MBeanClientInterceptorTests and recover two lost tests
Two test methods were missing the @Test annotation after the migration
from JUnit 3 to JUnit 4.
2020-03-31 19:02:15 +02:00
Sam Brannen
9bd74c270f Remove flaky check in MBeanClientInterceptorTests
Prior to this commit, the testTestLazyConnectionToRemote() method in
MBeanClientInterceptorTests expected an exception to be thrown while
attempting to access the state of a proxied MBean after the MBeanServer
had been shutdown; however, the test occasionally failed if the server
had not been properly shutdown.

Since an attempt to wait on the server to shutdown proved not to be
consistently helpful in this scenario, we are entirely removing this
check from the test.
2020-03-31 18:55:54 +02:00
Qimiao Chen
7c831d2ef4 Replace anonymous inner classes with lambdas in tests
Closes gh-24808
2020-03-30 12:02:23 +02:00
Sam Brannen
06fa8692cd Attempt to make MBeanClientInterceptorTests more robust 2020-03-27 11:18:45 +01:00
Qimiao Chen
09b36380cd Fix typos in source files
Closes gh-24746
2020-03-20 20:06:52 +01:00
Juergen Hoeller
bcee6b9da4 Consistent assertions for supplier-based bean definition tests 2020-03-11 14:55:39 +01:00
Juergen Hoeller
bee63e38c1 Create ScannedGenericBeanDefinitions for index-derived components as well
Closes gh-24638
2020-03-11 14:54:16 +01:00
ZhangT
6add7b4dec Polishing
Closes gh-24543
2020-02-17 17:33:39 +01:00
Juergen Hoeller
a4179b4795 Polishing 2020-02-12 18:32:32 +01:00
Sam Brannen
9dbd411f81 Suppress warnings in Gradle build 2020-02-12 11:04:07 +01:00
Sam Brannen
974cacac31 Support nested annotations in ASM-based processing again
Spring Framework 5.0 introduced a regression in ASM-based annotation
processing. Specifically, nested annotations were no longer supported,
and component scanning resulted in an exception if a candidate
component was annotated with an annotation that contained nested
annotations.

This commit fixes this regression by introducing special handling in
AnnotationTypeMapping that supports extracting values from objects of
type TypeMappedAnnotation when necessary.

Closes gh-24375
2020-02-12 10:36:54 +01:00
Juergen Hoeller
82adb09490 ImportSelector.getExclusionFilter() naming and javadoc clarification
See gh-24175
2020-02-05 18:20:27 +01:00
Juergen Hoeller
d93303c008 ImportSelector.getCandidateFilter() for transitive filtering of classes
Closes gh-24175
2020-02-05 12:35:16 +01:00
Sam Brannen
2a2efbe611 Introduce @Disabled regression test for gh-24375 2020-01-16 17:16:57 +01:00
Stephane Nicoll
bdb9f9570e Polish 2020-01-09 17:08:48 +01:00
Juergen Hoeller
b0e4b7e29c Re-calculate SimpleKey's hashCode field on deserialization
Closes gh-24320
2020-01-09 15:39:04 +01:00
Sam Brannen
8a371c7669 Use Gradle test fixture support for spring-aop
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen
57b771ba92 Move common FactoryMethods to spring-beans test fixtures
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen
726b1bb1d0 Rename test fixture package in spring-context
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen
7cd4ddf5fc Rename test fixture package in spring-beans
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen
4260c34b47 Rename test fixture package in spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen
61d4ee594d Use Gradle test fixture support for spring-beans and spring-context
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen
5718bf424b Use Gradle test fixture support for spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Juergen Hoeller
7474ee7041 Polishing 2019-12-16 16:50:30 +01:00
Sam Brannen
47b18e5ea9 Polishing 2019-12-13 16:12:39 +01:00
lixiaolong11000
bee2b7cd73 Add missing test cases in XmlBeanFactoryTests
Closes gh-24189
2019-12-13 15:56:06 +01:00
Johnny Lim
1e83e889aa Use hasSize() where possible
See gh-24172
2019-12-10 07:58:53 +01:00
Sam Brannen
093323beeb Introduce Checkstyle rule to prohibit class names ending with "Test" 2019-11-29 17:30:29 +01:00
Sam Brannen
59e250c93c Consistent use of SCOPE_PROTOTYPE and SCOPE_SINGLETON constants
Closes gh-19905
2019-11-24 13:49:43 +01:00
Sam Brannen
8df3afd0b6 Polish contribution
See gh-23895
2019-11-14 13:26:38 +01:00
Sam Brannen
8186b77b58 Polish contribution
See gh-23895
2019-11-14 09:59:42 +01:00
monosoul
a0e4ac39bf Inverse condition to fix ISO-formatted Instant parsing
Prior to this commit, InstantFormatter was able to properly serialize
an Instant that is far in the future (or in the past), but it could not
properly deserialize it, because in such scenarios an ISO-formatted
Instant starts with a +/- sign.

This commit fixes this issue, while maintaining the previous contract,
and also introduces tests for InstantFormatter.

Closes gh-23895
2019-11-14 09:59:42 +01:00
Juergen Hoeller
3dc5e7b1d5 Avoid String concatenation for lookup in StaticMessageSource
Closes gh-22451
2019-11-13 23:41:26 +01:00
Juergen Hoeller
22211a01ce Polishing 2019-11-13 17:23:23 +01:00
Juergen Hoeller
c4ec6aea68 Fix Checkstyle violations
See gh-23784
2019-11-11 17:18:52 +01:00
Steven Schlansker
fc55e66d50 ApplicationListenerMethodAdapter: gracefully handle beans which are actually NullBean
Currently, if you have an optional event listener (via a @Bean method returning `null`)
this causes the event multicaster to explode violently.  Now, we just safely skip it.
2019-11-11 15:43:29 +01:00
Sam Brannen
d6002092c4 Clean up build warnings for ApplicationContextExpressionTests 2019-11-04 15:44:53 +01:00
Sam Brannen
74b7b550f6 Make MBeanServer tests more robust
This commit refactors several tests to use SocketUtils to find an
available port, compose a custom JMX service URL using that port, and
start an MBeanServer for the particular test using that port.

This commit also makes other changes to MBeanServer related tests in an
effort to make them more robust when executed concurrently.

Closes gh-23699
2019-10-31 14:34:57 +01:00
Sam Brannen
9f00eb68e9 Clean up warnings 2019-10-30 19:14:58 +01:00
Christoph Dreis
3c17178b16 Fix Mockito deprecations 2019-10-30 18:30:05 +01:00
Brian Clozel
4beb25b318 Reorder date formatting converter in registrar
Prior to this commit, the `DateFormatterRegistrar` would register the
annotation-based formatter before the pattern-based formatter. This
would create an issue when an application tries to convert a `String` to
an annotated `@DateTimeFormat Date`: since the converters are considered
in reversed order of registration in
`GenericConversionServicei#ConvertersForPair`, the pattern-based variant
would always be considered before the annotation-based variant,
overriding the developer's opinion.

This commit aligns the `DateFormatterRegistrar` with the
`DateTimeFormatterRegistrar` and registers the annotation-based variant
last.

Closes gh-23893
2019-10-30 17:15:59 +01:00
Sam Brannen
6a207d0012 Polish AnnotationConfigApplicationContextTests 2019-09-26 16:45:49 +02:00
Johnny Lim
2a4dbcc623 Fix an assertion in AnnotationConfigApplicationContextTests
Closes gh-23719
2019-09-26 16:34:27 +02:00
Sam Brannen
b9013ada9f Abort MBeanServer tests if BindException encountered
This commit builds on the previous commit but covers exceptions thrown
by @BeforeEach and @AfterEach methods as well as @Test methods.
2019-09-24 19:20:39 +02:00
Sam Brannen
435cc67026 Abort MBeanServer tests if BindException encountered 2019-09-24 18:57:30 +02:00
Juergen Hoeller
e68132686d Restore lenient target type handling for FactoryBean definitions
Closes gh-23561
2019-09-20 21:54:32 +02:00