|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2016 the original author or authors. |
|
|
|
* Copyright 2002-2017 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. |
|
|
|
@ -270,7 +270,7 @@ public class SimpAnnotationMethodMessageHandlerTests { |
|
|
|
this.messageHandler.handleMessage(message); |
|
|
|
this.messageHandler.handleMessage(message); |
|
|
|
|
|
|
|
|
|
|
|
controller.future.run(); |
|
|
|
controller.future.run(); |
|
|
|
assertTrue(controller.exceptionCatched); |
|
|
|
assertTrue(controller.exceptionCaught); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@ -340,7 +340,6 @@ public class SimpAnnotationMethodMessageHandlerTests { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static class TestSimpAnnotationMethodMessageHandler extends SimpAnnotationMethodMessageHandler { |
|
|
|
private static class TestSimpAnnotationMethodMessageHandler extends SimpAnnotationMethodMessageHandler { |
|
|
|
|
|
|
|
|
|
|
|
public TestSimpAnnotationMethodMessageHandler(SimpMessageSendingOperations brokerTemplate, |
|
|
|
public TestSimpAnnotationMethodMessageHandler(SimpMessageSendingOperations brokerTemplate, |
|
|
|
@ -434,6 +433,7 @@ public class SimpAnnotationMethodMessageHandlerTests { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Controller |
|
|
|
@Controller |
|
|
|
@MessageMapping("pre") |
|
|
|
@MessageMapping("pre") |
|
|
|
private static class DotPathSeparatorController { |
|
|
|
private static class DotPathSeparatorController { |
|
|
|
@ -447,12 +447,14 @@ public class SimpAnnotationMethodMessageHandlerTests { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Controller |
|
|
|
@Controller |
|
|
|
@MessageMapping("listenable-future") |
|
|
|
@MessageMapping("listenable-future") |
|
|
|
private static class ListenableFutureController { |
|
|
|
private static class ListenableFutureController { |
|
|
|
|
|
|
|
|
|
|
|
private ListenableFutureTask<String> future; |
|
|
|
private ListenableFutureTask<String> future; |
|
|
|
private boolean exceptionCatched = false; |
|
|
|
|
|
|
|
|
|
|
|
private boolean exceptionCaught = false; |
|
|
|
|
|
|
|
|
|
|
|
@MessageMapping("success") |
|
|
|
@MessageMapping("success") |
|
|
|
public ListenableFutureTask<String> handleListenableFuture() { |
|
|
|
public ListenableFutureTask<String> handleListenableFuture() { |
|
|
|
@ -470,11 +472,11 @@ public class SimpAnnotationMethodMessageHandlerTests { |
|
|
|
|
|
|
|
|
|
|
|
@MessageExceptionHandler(IllegalStateException.class) |
|
|
|
@MessageExceptionHandler(IllegalStateException.class) |
|
|
|
public void handleValidationException() { |
|
|
|
public void handleValidationException() { |
|
|
|
this.exceptionCatched = true; |
|
|
|
this.exceptionCaught = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Controller |
|
|
|
@Controller |
|
|
|
private static class CompletableFutureController { |
|
|
|
private static class CompletableFutureController { |
|
|
|
|
|
|
|
|
|
|
|
@ -492,14 +494,14 @@ public class SimpAnnotationMethodMessageHandlerTests { |
|
|
|
public void handleValidationException() { |
|
|
|
public void handleValidationException() { |
|
|
|
this.exceptionCaught = true; |
|
|
|
this.exceptionCaught = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static class StringTestValidator implements Validator { |
|
|
|
private static class StringTestValidator implements Validator { |
|
|
|
|
|
|
|
|
|
|
|
private final String invalidValue; |
|
|
|
private final String invalidValue; |
|
|
|
|
|
|
|
|
|
|
|
private StringTestValidator(String invalidValue) { |
|
|
|
public StringTestValidator(String invalidValue) { |
|
|
|
this.invalidValue = invalidValue; |
|
|
|
this.invalidValue = invalidValue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|