|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2018 the original author or authors. |
|
|
|
* Copyright 2002-2019 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. |
|
|
|
@ -155,6 +155,7 @@ public class AnnotationDrivenEventListenerTests { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void methodSignatureNoEvent() { |
|
|
|
public void methodSignatureNoEvent() { |
|
|
|
|
|
|
|
@SuppressWarnings("resource") |
|
|
|
AnnotationConfigApplicationContext failingContext = |
|
|
|
AnnotationConfigApplicationContext failingContext = |
|
|
|
new AnnotationConfigApplicationContext(); |
|
|
|
new AnnotationConfigApplicationContext(); |
|
|
|
failingContext.register(BasicConfiguration.class, |
|
|
|
failingContext.register(BasicConfiguration.class, |
|
|
|
@ -173,7 +174,6 @@ public class AnnotationDrivenEventListenerTests { |
|
|
|
ReplyEventListener replyEventListener = this.context.getBean(ReplyEventListener.class); |
|
|
|
ReplyEventListener replyEventListener = this.context.getBean(ReplyEventListener.class); |
|
|
|
TestEventListener listener = this.context.getBean(TestEventListener.class); |
|
|
|
TestEventListener listener = this.context.getBean(TestEventListener.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.eventCollector.assertNoEventReceived(listener); |
|
|
|
this.eventCollector.assertNoEventReceived(listener); |
|
|
|
this.eventCollector.assertNoEventReceived(replyEventListener); |
|
|
|
this.eventCollector.assertNoEventReceived(replyEventListener); |
|
|
|
this.context.publishEvent(event); |
|
|
|
this.context.publishEvent(event); |
|
|
|
@ -747,7 +747,7 @@ public class AnnotationDrivenEventListenerTests { |
|
|
|
@EventListener |
|
|
|
@EventListener |
|
|
|
@Async |
|
|
|
@Async |
|
|
|
public void handleAsync(AnotherTestEvent event) { |
|
|
|
public void handleAsync(AnotherTestEvent event) { |
|
|
|
assertTrue(!Thread.currentThread().getName().equals(event.content)); |
|
|
|
assertNotEquals(event.content, Thread.currentThread().getName()); |
|
|
|
collectEvent(event); |
|
|
|
collectEvent(event); |
|
|
|
this.countDownLatch.countDown(); |
|
|
|
this.countDownLatch.countDown(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -794,7 +794,7 @@ public class AnnotationDrivenEventListenerTests { |
|
|
|
@EventListener |
|
|
|
@EventListener |
|
|
|
@Async |
|
|
|
@Async |
|
|
|
public void handleAsync(AnotherTestEvent event) { |
|
|
|
public void handleAsync(AnotherTestEvent event) { |
|
|
|
assertTrue(!Thread.currentThread().getName().equals(event.content)); |
|
|
|
assertNotEquals(event.content, Thread.currentThread().getName()); |
|
|
|
this.eventCollector.addEvent(this, event); |
|
|
|
this.eventCollector.addEvent(this, event); |
|
|
|
this.countDownLatch.countDown(); |
|
|
|
this.countDownLatch.countDown(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -820,7 +820,7 @@ public class AnnotationDrivenEventListenerTests { |
|
|
|
@EventListener |
|
|
|
@EventListener |
|
|
|
@Async |
|
|
|
@Async |
|
|
|
public void handleAsync(AnotherTestEvent event) { |
|
|
|
public void handleAsync(AnotherTestEvent event) { |
|
|
|
assertTrue(!Thread.currentThread().getName().equals(event.content)); |
|
|
|
assertNotEquals(event.content, Thread.currentThread().getName()); |
|
|
|
this.eventCollector.addEvent(this, event); |
|
|
|
this.eventCollector.addEvent(this, event); |
|
|
|
this.countDownLatch.countDown(); |
|
|
|
this.countDownLatch.countDown(); |
|
|
|
} |
|
|
|
} |
|
|
|
|