author | chegar |
Wed, 07 Feb 2018 21:45:37 +0000 | |
branch | http-client-branch |
changeset 56092 | fd85b2bf2b0d |
parent 56089 | test/jdk/java/net/httpclient/websocket/java.net.http/java/net/http/internal/websocket/MockTransport.java@42208b2f224e |
permissions | -rw-r--r-- |
48083 | 1 |
/* |
2 |
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
56092
fd85b2bf2b0d
http-client-branch: move implementation to jdk.internal.net.http
chegar
parents:
56089
diff
changeset
|
24 |
package jdk.internal.net.http.websocket; |
48083 | 25 |
|
56089
42208b2f224e
http-client-branch: move to standard package and module name
chegar
parents:
55988
diff
changeset
|
26 |
import java.net.http.WebSocket.MessagePart; |
56092
fd85b2bf2b0d
http-client-branch: move implementation to jdk.internal.net.http
chegar
parents:
56089
diff
changeset
|
27 |
import jdk.internal.net.http.common.Demand; |
fd85b2bf2b0d
http-client-branch: move implementation to jdk.internal.net.http
chegar
parents:
56089
diff
changeset
|
28 |
import jdk.internal.net.http.common.SequentialScheduler; |
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
29 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
30 |
import java.io.IOException; |
48083 | 31 |
import java.nio.ByteBuffer; |
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
32 |
import java.util.Collection; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
33 |
import java.util.LinkedList; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
34 |
import java.util.List; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
35 |
import java.util.Objects; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
36 |
import java.util.Queue; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
37 |
import java.util.concurrent.CompletableFuture; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
38 |
import java.util.concurrent.ConcurrentLinkedQueue; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
39 |
import java.util.function.Consumer; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
40 |
import java.util.function.Supplier; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
41 |
|
56092
fd85b2bf2b0d
http-client-branch: move implementation to jdk.internal.net.http
chegar
parents:
56089
diff
changeset
|
42 |
import static jdk.internal.net.http.websocket.TestSupport.fullCopy; |
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
43 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
44 |
public class MockTransport<T> implements Transport<T> { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
45 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
46 |
private final long startTime = System.currentTimeMillis(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
47 |
private final Queue<Invocation> output = new ConcurrentLinkedQueue<>(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
48 |
private final Queue<CompletableFuture<Consumer<MessageStreamConsumer>>> |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
49 |
input = new ConcurrentLinkedQueue<>(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
50 |
private final Supplier<T> supplier; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
51 |
private final MessageStreamConsumer consumer; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
52 |
private final SequentialScheduler scheduler |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
53 |
= new SequentialScheduler(new ReceiveTask()); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
54 |
private final Demand demand = new Demand(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
55 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
56 |
public MockTransport(Supplier<T> sendResultSupplier, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
57 |
MessageStreamConsumer consumer) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
58 |
this.supplier = sendResultSupplier; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
59 |
this.consumer = consumer; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
60 |
input.addAll(receive()); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
61 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
62 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
63 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
64 |
public final CompletableFuture<T> sendText(CharSequence message, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
65 |
boolean isLast) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
66 |
output.add(Invocation.sendText(message, isLast)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
67 |
return send(String.format("sendText(%s, %s)", message, isLast), |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
68 |
() -> sendText0(message, isLast)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
69 |
} |
48083 | 70 |
|
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
71 |
protected CompletableFuture<T> sendText0(CharSequence message, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
72 |
boolean isLast) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
73 |
return defaultSend(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
74 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
75 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
76 |
protected CompletableFuture<T> defaultSend() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
77 |
return CompletableFuture.completedFuture(result()); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
78 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
79 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
80 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
81 |
public final CompletableFuture<T> sendBinary(ByteBuffer message, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
82 |
boolean isLast) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
83 |
output.add(Invocation.sendBinary(message, isLast)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
84 |
return send(String.format("sendBinary(%s, %s)", message, isLast), |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
85 |
() -> sendBinary0(message, isLast)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
86 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
87 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
88 |
protected CompletableFuture<T> sendBinary0(ByteBuffer message, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
89 |
boolean isLast) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
90 |
return defaultSend(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
91 |
} |
48083 | 92 |
|
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
93 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
94 |
public final CompletableFuture<T> sendPing(ByteBuffer message) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
95 |
output.add(Invocation.sendPing(message)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
96 |
return send(String.format("sendPing(%s)", message), |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
97 |
() -> sendPing0(message)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
98 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
99 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
100 |
protected CompletableFuture<T> sendPing0(ByteBuffer message) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
101 |
return defaultSend(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
102 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
103 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
104 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
105 |
public final CompletableFuture<T> sendPong(ByteBuffer message) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
106 |
output.add(Invocation.sendPong(message)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
107 |
return send(String.format("sendPong(%s)", message), |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
108 |
() -> sendPong0(message)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
109 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
110 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
111 |
protected CompletableFuture<T> sendPong0(ByteBuffer message) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
112 |
return defaultSend(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
113 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
114 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
115 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
116 |
public final CompletableFuture<T> sendClose(int statusCode, String reason) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
117 |
output.add(Invocation.sendClose(statusCode, reason)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
118 |
return send(String.format("sendClose(%s, %s)", statusCode, reason), |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
119 |
() -> sendClose0(statusCode, reason)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
120 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
121 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
122 |
protected CompletableFuture<T> sendClose0(int statusCode, String reason) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
123 |
return defaultSend(); |
48083 | 124 |
} |
125 |
||
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
126 |
protected Collection<CompletableFuture<Consumer<MessageStreamConsumer>>> receive() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
127 |
return List.of(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
128 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
129 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
130 |
public static Consumer<MessageStreamConsumer> onText(CharSequence data, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
131 |
MessagePart part) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
132 |
return c -> c.onText(data.toString(), part); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
133 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
134 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
135 |
public static Consumer<MessageStreamConsumer> onBinary(ByteBuffer data, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
136 |
MessagePart part) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
137 |
return c -> c.onBinary(fullCopy(data), part); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
138 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
139 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
140 |
public static Consumer<MessageStreamConsumer> onPing(ByteBuffer data) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
141 |
return c -> c.onPing(fullCopy(data)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
142 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
143 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
144 |
public static Consumer<MessageStreamConsumer> onPong(ByteBuffer data) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
145 |
return c -> c.onPong(fullCopy(data)); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
146 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
147 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
148 |
public static Consumer<MessageStreamConsumer> onClose(int statusCode, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
149 |
String reason) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
150 |
return c -> c.onClose(statusCode, reason); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
151 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
152 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
153 |
public static Consumer<MessageStreamConsumer> onError(Throwable error) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
154 |
return c -> c.onError(error); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
155 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
156 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
157 |
public static Consumer<MessageStreamConsumer> onComplete() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
158 |
return c -> c.onComplete(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
159 |
} |
48083 | 160 |
|
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
161 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
162 |
public void request(long n) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
163 |
demand.increase(n); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
164 |
scheduler.runOrSchedule(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
165 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
166 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
167 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
168 |
public void acknowledgeReception() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
169 |
demand.tryDecrement(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
170 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
171 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
172 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
173 |
public final void closeOutput() throws IOException { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
174 |
output.add(Invocation.closeOutput()); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
175 |
begin("closeOutput()"); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
176 |
closeOutput0(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
177 |
end("closeOutput()"); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
178 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
179 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
180 |
protected void closeOutput0() throws IOException { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
181 |
defaultClose(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
182 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
183 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
184 |
protected void defaultClose() throws IOException { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
185 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
186 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
187 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
188 |
public final void closeInput() throws IOException { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
189 |
output.add(Invocation.closeInput()); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
190 |
begin("closeInput()"); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
191 |
closeInput0(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
192 |
end("closeInput()"); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
193 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
194 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
195 |
protected void closeInput0() throws IOException { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
196 |
defaultClose(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
197 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
198 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
199 |
public abstract static class Invocation { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
200 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
201 |
static Invocation.SendText sendText(CharSequence message, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
202 |
boolean isLast) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
203 |
return new SendText(message, isLast); |
48083 | 204 |
} |
205 |
||
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
206 |
static Invocation.SendBinary sendBinary(ByteBuffer message, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
207 |
boolean isLast) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
208 |
return new SendBinary(message, isLast); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
209 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
210 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
211 |
static Invocation.SendPing sendPing(ByteBuffer message) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
212 |
return new SendPing(message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
213 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
214 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
215 |
static Invocation.SendPong sendPong(ByteBuffer message) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
216 |
return new SendPong(message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
217 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
218 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
219 |
static Invocation.SendClose sendClose(int statusCode, String reason) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
220 |
return new SendClose(statusCode, reason); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
221 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
222 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
223 |
public static CloseOutput closeOutput() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
224 |
return new CloseOutput(); |
48083 | 225 |
} |
226 |
||
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
227 |
public static CloseInput closeInput() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
228 |
return new CloseInput(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
229 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
230 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
231 |
public static final class SendText extends Invocation { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
232 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
233 |
final CharSequence message; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
234 |
final boolean isLast; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
235 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
236 |
SendText(CharSequence message, boolean isLast) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
237 |
this.message = message.toString(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
238 |
this.isLast = isLast; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
239 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
240 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
241 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
242 |
public boolean equals(Object obj) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
243 |
if (this == obj) return true; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
244 |
if (obj == null || getClass() != obj.getClass()) return false; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
245 |
SendText sendText = (SendText) obj; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
246 |
return isLast == sendText.isLast && |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
247 |
Objects.equals(message, sendText.message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
248 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
249 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
250 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
251 |
public int hashCode() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
252 |
return Objects.hash(isLast, message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
253 |
} |
48083 | 254 |
} |
255 |
||
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
256 |
public static final class SendBinary extends Invocation { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
257 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
258 |
final ByteBuffer message; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
259 |
final boolean isLast; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
260 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
261 |
SendBinary(ByteBuffer message, boolean isLast) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
262 |
this.message = fullCopy(message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
263 |
this.isLast = isLast; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
264 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
265 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
266 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
267 |
public boolean equals(Object obj) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
268 |
if (this == obj) return true; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
269 |
if (obj == null || getClass() != obj.getClass()) return false; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
270 |
SendBinary that = (SendBinary) obj; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
271 |
return isLast == that.isLast && |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
272 |
Objects.equals(message, that.message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
273 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
274 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
275 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
276 |
public int hashCode() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
277 |
return Objects.hash(message, isLast); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
278 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
279 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
280 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
281 |
private static final class SendPing extends Invocation { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
282 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
283 |
final ByteBuffer message; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
284 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
285 |
SendPing(ByteBuffer message) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
286 |
this.message = fullCopy(message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
287 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
288 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
289 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
290 |
public boolean equals(Object obj) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
291 |
if (this == obj) return true; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
292 |
if (obj == null || getClass() != obj.getClass()) return false; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
293 |
SendPing sendPing = (SendPing) obj; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
294 |
return Objects.equals(message, sendPing.message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
295 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
296 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
297 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
298 |
public int hashCode() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
299 |
return Objects.hash(message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
300 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
301 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
302 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
303 |
private static final class SendPong extends Invocation { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
304 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
305 |
final ByteBuffer message; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
306 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
307 |
SendPong(ByteBuffer message) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
308 |
this.message = fullCopy(message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
309 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
310 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
311 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
312 |
public boolean equals(Object obj) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
313 |
if (this == obj) return true; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
314 |
if (obj == null || getClass() != obj.getClass()) return false; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
315 |
SendPing sendPing = (SendPing) obj; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
316 |
return Objects.equals(message, sendPing.message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
317 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
318 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
319 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
320 |
public int hashCode() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
321 |
return Objects.hash(message); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
322 |
} |
48083 | 323 |
} |
324 |
||
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
325 |
private static final class SendClose extends Invocation { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
326 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
327 |
final int statusCode; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
328 |
final String reason; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
329 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
330 |
SendClose(int statusCode, String reason) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
331 |
this.statusCode = statusCode; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
332 |
this.reason = reason; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
333 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
334 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
335 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
336 |
public boolean equals(Object obj) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
337 |
if (this == obj) return true; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
338 |
if (obj == null || getClass() != obj.getClass()) return false; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
339 |
SendClose sendClose = (SendClose) obj; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
340 |
return statusCode == sendClose.statusCode && |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
341 |
Objects.equals(reason, sendClose.reason); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
342 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
343 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
344 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
345 |
public int hashCode() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
346 |
return Objects.hash(statusCode, reason); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
347 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
348 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
349 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
350 |
private static final class CloseOutput extends Invocation { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
351 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
352 |
CloseOutput() { } |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
353 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
354 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
355 |
public int hashCode() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
356 |
return 0; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
357 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
358 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
359 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
360 |
public boolean equals(Object obj) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
361 |
return obj instanceof CloseOutput; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
362 |
} |
48083 | 363 |
} |
364 |
||
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
365 |
private static final class CloseInput extends Invocation { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
366 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
367 |
CloseInput() { } |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
368 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
369 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
370 |
public int hashCode() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
371 |
return 0; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
372 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
373 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
374 |
@Override |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
375 |
public boolean equals(Object obj) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
376 |
return obj instanceof CloseInput; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
377 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
378 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
379 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
380 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
381 |
public Queue<Invocation> invocations() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
382 |
return new LinkedList<>(output); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
383 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
384 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
385 |
protected final T result() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
386 |
return supplier.get(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
387 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
388 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
389 |
private CompletableFuture<T> send(String name, |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
390 |
Supplier<CompletableFuture<T>> supplier) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
391 |
begin(name); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
392 |
CompletableFuture<T> cf = supplier.get().whenComplete((r, e) -> { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
393 |
System.out.printf("[%6s ms.] complete %s%n", elapsedTime(), name); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
394 |
}); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
395 |
end(name); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
396 |
return cf; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
397 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
398 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
399 |
private void begin(String name) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
400 |
System.out.printf("[%6s ms.] begin %s%n", elapsedTime(), name); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
401 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
402 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
403 |
private void end(String name) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
404 |
System.out.printf("[%6s ms.] end %s%n", elapsedTime(), name); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
405 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
406 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
407 |
private long elapsedTime() { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
408 |
return System.currentTimeMillis() - startTime; |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
409 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
410 |
|
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
411 |
private final class ReceiveTask implements SequentialScheduler.RestartableTask { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
412 |
|
48083 | 413 |
@Override |
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
414 |
public void run(SequentialScheduler.DeferredCompleter taskCompleter) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
415 |
if (!scheduler.isStopped() && !demand.isFulfilled() && !input.isEmpty()) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
416 |
CompletableFuture<Consumer<MessageStreamConsumer>> cf = input.remove(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
417 |
if (cf.isDone()) { // Forcing synchronous execution |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
418 |
cf.join().accept(consumer); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
419 |
repeat(taskCompleter); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
420 |
} else { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
421 |
cf.whenCompleteAsync((r, e) -> { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
422 |
r.accept(consumer); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
423 |
repeat(taskCompleter); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
424 |
}); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
425 |
} |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
426 |
} else { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
427 |
taskCompleter.complete(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
428 |
} |
48083 | 429 |
} |
430 |
||
55988
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
431 |
private void repeat(SequentialScheduler.DeferredCompleter taskCompleter) { |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
432 |
taskCompleter.complete(); |
7f1e0cf933a6
http-client-branch: (WebSocket) refactoring for the sake of extra test coverage
prappo
parents:
48083
diff
changeset
|
433 |
scheduler.runOrSchedule(); |
48083 | 434 |
} |
435 |
} |
|
436 |
} |