spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
55.3k stars 37.62k forks source link

EventPublicationInterceptor test failing [SPR-231] #4962

Closed spring-projects-issues closed 19 years ago

spring-projects-issues commented 19 years ago

Tim Nolan opened SPR-231 and commented

org.springframework.context.event.EventPublicationInterceptor V1.5

This is causing it's corresponing unit test to fail: org.springframework.context.EventPublicationInterceptorTests

Throwing the exception has been deferred until afterPropertiesSet method. Not sure whether class or test needs fixing. Would normally like to throw Exceptions as soon as possible. In either case a runtime Exception should probably be documented in the Javadoc.

PS - Apologies if you're in the process of checking in, but I do re-check CVS after a half hour or so before adding a bug. Keep up the good work - Spring is fantastic. I hope I'm helping.

Test details below: testWithIncorrectRequiredProperties

Should have thrown IllegalStateException

junit.framework.AssertionFailedError: Should have thrown IllegalStateException at org.springframework.context.EventPublicationInterceptorTests.testWithIncorrectRequiredProperties(EventPublicationInterceptorTests.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


Affects: 1.0.2

spring-projects-issues commented 19 years ago

Dmitriy Kopylenko commented

The state of the EventPublicationInterceptor is checked in afterPropertiesSet() as the use of this interceptor is intended via IoC container. Changed the test case to accomodate this.