8000 remove redundant throws clauses (#386) · chakra-coder/rsocket-java@f57c398 · GitHub
[go: up one dir, main page]

Skip to content

Commit f57c398

Browse files
qweekyschimke
authored andcommitted
remove redundant throws clauses (rsocket#386)
remove redundant throws clauses
1 parent 4555881 commit f57c398

File tree

17 files changed

+29
-33
lines changed

17 files changed

+29
-33
lines changed

rsocket-core/src/test/java/io/rsocket/RSocketClientTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void testKeepAlive() throws Exception {
5757
}
5858

5959
@Test(timeout = 2_000)
60-
public void testInvalidFrameOnStream0() throws Throwable {
60+
public void testInvalidFrameOnStream0() {
6161
rule.connection.addToReceivedBuffer(Frame.RequestN.from(0, 10));
6262
assertThat("Unexpected errors.", rule.errors, hasSize(1));
6363
assertThat(
@@ -67,7 +67,7 @@ public void testInvalidFrameOnStream0() throws Throwable {
6767
}
6868

6969
@Test(timeout = 2_000)
70-
public void testStreamInitialN() throws InterruptedException {
70+
public void testStreamInitialN() {
7171
Flux<Payload> stream = rule.socket.requestStream(PayloadImpl.EMPTY);
7272

7373
BaseSubscriber<Payload> subscriber =
@@ -98,7 +98,7 @@ protected void hookOnSubscribe(Subscription subscription) {
9898
}
9999

100100
@Test(timeout = 2_000)
101-
public void testHandleSetupException() throws Throwable {
101+
public void testHandleSetupException() {
102102
rule.connection.addToReceivedBuffer(Frame.Error.from(0, new RejectedSetupException("boom")));
103103
assertThat("Unexpected errors.", rule.errors, hasSize(1));
104104
assertThat(
@@ -108,7 +108,7 @@ public void testHandleSetupException() throws Throwable {
108108
}
109109

110110
@Test(timeout = 2_000)
111-
public void testHandleApplicationException() throws Throwable {
111+
public void testHandleApplicationException() {
112112
rule.connection.clearSendReceiveBuffers();
113113
Publisher<Payload> response = rule.socket.requestResponse(PayloadImpl.EMPTY);
114114
Subscriber<Payload> responseSub = TestSubscriber.create();
@@ -122,7 +122,7 @@ public void testHandleApplicationException() throws Throwable {
122122
}
123123

124124
@Test(timeout = 2_000)
125-
public void testHandleValidFrame() throws Throwable {
125+
public void testHandleValidFrame() {
126126
Publisher<Payload> response = rule.socket.requestResponse(PayloadImpl.EMPTY);
127127
Subscriber<Payload> sub = TestSubscriber.create();
128128
response.subscribe(sub);
@@ -136,7 +136,7 @@ public void testHandleValidFrame() throws Throwable {
136136
}
137137

138138
@Test(timeout = 2_000)
139-
public void testRequestReplyWithCancel() throws Throwable {
139+
public void testRequestReplyWithCancel() {
140140
Mono<Payload> response = rule.socket.requestResponse(PayloadImpl.EMPTY);
141141

142142
try {
@@ -157,7 +157,7 @@ public void testRequestReplyWithCancel() throws Throwable {
157157
}
158158

159159
@Test(timeout = 2_000)
160-
public void testRequestReplyErrorOnSend() throws Throwable {
160+
public void testRequestReplyErrorOnSend() {
161161
rule.connection.setAvailability(0); // Fails send
162162
Mono<Payload> response = rule.socket.requestResponse(PayloadImpl.EMPTY);
163163
Subscriber<Payload> responseSub = TestSubscriber.create();
@@ -167,7 +167,7 @@ public void testRequestReplyErrorOnSend() throws Throwable {
167167
}
168168

169169
@Test
170-
public void testLazyRequestResponse() throws Exception {
170+
public void testLazyRequestResponse() {
171171
Publisher<Payload> response = rule.socket.requestResponse(PayloadImpl.EMPTY);
172172
int streamId = sendRequestResponse(response);
173173
rule.connection.clearSendReceiveBuffers();

rsocket-core/src/test/java/io/rsocket/RSocketServerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void testHandlerEmitsError() throws Exception {
7777
}
7878

7979
@Test(timeout = 2_0000)
80-
public void testCancel() throws Exception {
80+
public void testCancel() {
8181
final int streamId = 4;
8282
final AtomicBoolean cancelled = new AtomicBoolean();
8383
rule.setAcceptingSocket(

rsocket-core/src/test/java/io/rsocket/util/PayloadImplTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ public class PayloadImplTest {
2626
public static final String METADATA_VAL = "metadata";
2727

2828
@Test
29-
public void testReuse() throws Exception {
29+
public void testReuse() {
3030
PayloadImpl p = new PayloadImpl(DATA_VAL, METADATA_VAL);
3131
assertDataAndMetadata(p, DATA_VAL, METADATA_VAL);
3232
assertDataAndMetadata(p, DATA_VAL, METADATA_VAL);
3333
}
3434

3535
@Test
36-
public void testReuseWithExternalMark() throws Exception {
36+
public void testReuseWithExternalMark() {
3737
PayloadImpl p = new PayloadImpl(DATA_VAL, METADATA_VAL);
3838
assertDataAndMetadata(p, DATA_VAL, METADATA_VAL);
3939
p.getData().position(2).mark();

rsocket-examples/src/test/java/io/rsocket/integration/IntegrationTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
import io.rsocket.util.PayloadImpl;
3737
import io.rsocket.util.RSocketProxy;
3838
import java.util.concurrent.CountDownLatch;
39-
import java.util.concurrent.ExecutionException;
40-
import java.util.concurrent.TimeoutException;
4139
import java.util.concurrent.atomic.AtomicInteger;
4240
import org.junit.After;
4341
import org.junit.Before;
@@ -148,7 +146,7 @@ public void testRequest() {
148146
}
149147

150148
@Test
151-
public void testStream() throws Exception {
149+
public void testStream() {
152150
Subscriber<Payload> subscriber = TestSubscriber.createCancelling();
153151
client.requestStream(new PayloadImpl("start")).subscribe(subscriber);
154152

@@ -157,7 +155,7 @@ public void testStream() throws Exception {
157155
}
158156

159157
@Test(timeout = 5_000L)
160-
public void testClose() throws ExecutionException, InterruptedException, TimeoutException {
158+
public void testClose() throws InterruptedException {
161159
client.close().block();
162160
disconnectionCounter.await();
163161
}

rsocket-examples/src/test/java/io/rsocket/integration/TcpIntegrationTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void cleanup() {
6767
}
6868

6969
@Test(timeout = 5_000L)
70-
public void testCompleteWithoutNext() throws InterruptedException {
70+
public void testCompleteWithoutNext() {
7171
handler =
7272
new AbstractRSocket() {
7373
@Override
@@ -83,7 +83,7 @@ public Flux<Payload> requestStream(Payload payload) {
8383
}
8484

8585
@Test(timeout = 5_000L)
86-
public void testSingleStream() throws InterruptedException {
86+
public void testSingleStream() {
8787
handler =
8888
new AbstractRSocket() {
8989
@Override
@@ -100,7 +100,7 @@ public Flux<Payload> requestStream(Payload payload) {
100100
}
101101

102102
@Test(timeout = 5_000L)
103-
public void testZeroPayload() throws InterruptedException {
103+
public void testZeroPayload() {
104104
handler =
105105
new AbstractRSocket() {
106106
@Override
@@ -117,7 +117,7 @@ public Flux<Payload> requestStream(Payload payload) {
117117
}
118118

119119
@Test(timeout = 5_000L)
120-
public void testRequestResponseErrors() throws InterruptedException {
120+
public void testRequestResponseErrors() {
121121
handler =
122122
new AbstractRSocket() {
123123
boolean first = true;

rsocket-tck-drivers/src/main/java/io/rsocket/tckdrivers/client/JavaClientDriver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public JavaClientDriver(Mono<RSocket> clientBuilder) {
6363
.build(
6464
new CacheLoader<String, RSocket>() {
6565
@Override
66-
public RSocket load(String key) throws Exception {
66+
public RSocket load(String key) {
6767
return clientBuilder.block();
6868
}
6969
});

rsocket-tck-drivers/src/main/java/io/rsocket/tckdrivers/main/Main.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,8 @@ public class Main {
7575
* @param host client connects with this host
7676
* @param port client connects on this port
7777
* @param testFilter predicate for tests to run
78-
* @throws Exception if an exception occurs
7978
*/
80-
public static void runTests(String host, int port, Predicate<String> testFilter)
81-
throws Exception {
79+
public static void runTests(String host, int port, Predicate<String> testFilter) {
8280
TcpClientTransport transport = TcpClientTransport.create(host, port);
8381
Mono<RSocket> clientBuilder = RSocketFactory.connect().transport(transport).start();
8482

rsocket-tck-drivers/src/test/java/io/rsocket/tckdrivers/TckTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void runTest() {
4848
* starts a server. It parses each client file and create a parameterized test.
4949
*/
5050
@Parameters(name = "{0} - {1}")
51-
public static Iterable<Object[]> data() throws Exception {
51+
public static Iterable<Object[]> data() {
5252
return TckTestSuite.loadAll(new File("src/test/resources"))
5353
.stream()
5454
.flatMap(s -> s.clientTests().stream().map(c -> new Object[] {s, c}))

rsocket-transport-aeron/src/main/java/io/rsocket/aeron/internal/reactivestreams/AeronClientChannelConnector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public String toString() {
335335
}
336336

337337
@Override
338-
public void close() throws Exception {
338+
public void close() {
339339
running = false;
340340
}
341341
}

rsocket-transport-aeron/src/test/java/io/rsocket/aeron/AeronPing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
public final class AeronPing {
3030

31-
public static void main(String... args) throws Exception {
31+
public static void main(String... args) {
3232
// Create Client Connector
3333
AeronWrapper aeronWrapper = new DefaultAeronWrapper();
3434

rsocket-transport-aeron/src/test/java/io/rsocket/aeron/AeronPongServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public final class AeronPongServer {
3535
MediaDriver.launch(ctx);
3636
}
3737

38-
public static void main(String... args) throws Exception {
38+
public static void main(String... args) {
3939
MediaDriverHolder.getInstance();
4040
AeronWrapper aeronWrapper = new DefaultAeronWrapper();
4141

rsocket-transport-aeron/src/test/java/io/rsocket/aeron/internal/reactivestreams/AeronChannelPing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
/** */
3030
public final class AeronChannelPing {
31-
public static void main(String... args) throws Exception {
31+
public static void main(String... args) {
3232
int count = 1_000_000_000;
3333
final Recorder histogram = new Recorder(Long.MAX_VALUE, 3);
3434
Executors.newSingleThreadScheduledExecutor()

rsocket-transport-local/src/test/java/io/rsocket/transport/local/LocalPingPong.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
public final class LocalPingPong {
2727

28-
public static void main(String... args) throws Exception {
28+
public static void main(String... args) {
2929
RSocketFactory.receive()
3030
.acceptor(new PingHandler())
3131
.transport(LocalServerTransport.create("test-local-server"))

rsocket-transport-netty/src/test/java/io/rsocket/transport/netty/TcpPing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
public final class TcpPing {
2727

28-
public static void main(String... args) throws Exception {
28+
public static void main(String... args) {
2929
Mono<RSocket> client =
3030
RSocketFactory.connect().transport(TcpClientTransport.create(7878)).start();
3131

rsocket-transport-netty/src/test/java/io/rsocket/transport/netty/TcpPongServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
public final class TcpPongServer {
2323

24-
public static void main(String... args) throws Exception {
24+
public static void main(String... args) {
2525
RSocketFactory.receive()
2626
.acceptor(new PingHandler())
2727
.transport(TcpServerTransport.create(7878))

rsocket-transport-netty/src/test/java/io/rsocket/transport/netty/WebsocketPing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
public final class WebsocketPing {
2727

28-
public static void main(String... args) throws Exception {
28+
public static void main(String... args) {
2929
Mono<RSocket> client =
3030
RSocketFactory.connect().transport(WebsocketClientTransport.create(7878)).start();
3131

rsocket-transport-netty/src/test/java/io/rsocket/transport/netty/WebsocketPongServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
public final class WebsocketPongServer {
2323

24-
public static void main(String... args) throws Exception {
24+
public static void main(String... args) {
2525
RSocketFactory.receive()
2626
.acceptor(new PingHandler())
2727
.transport(WebsocketServerTransport.create(7878))

0 commit comments

Comments
 (0)
0