Skip to content

Commit 3a56102

Browse files
author
Steve Powell
committed
Remove redundant imports; unused methods; and some trailing whitespace
1 parent 3f74ea3 commit 3a56102

16 files changed

+11
-47
lines changed

test/src/com/rabbitmq/examples/ChannelCreationPerformance.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
// Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
1515
//
1616

17-
1817
package com.rabbitmq.examples;
1918

2019
import com.rabbitmq.client.*;
@@ -32,27 +31,27 @@ static Connection connect() throws Exception{
3231

3332
abstract static class PerformanceTest{
3433
String name;
35-
Connection c;
34+
Connection c;
3635
int i;
3736

3837
PerformanceTest(String name){
3938
this.name = name;
4039
}
41-
40+
4241
void run() throws Exception{
4342
System.out.println(name);
4443
for(i = START; i <= CHANNEL_MAX ; i += STEP){
4544
c = connect();
46-
long start = System.currentTimeMillis();
47-
body();
45+
long start = System.currentTimeMillis();
46+
body();
4847
long time = System.currentTimeMillis() - start;
4948
System.out.println(i + "\t" + time + " (" + (1000 * i / ((double)time)) + " channels/s)");
5049
c.close();
5150
}
52-
}
51+
}
5352

5453
abstract void body() throws Exception;
55-
54+
5655
}
5756

5857
public static void main(String[] args) throws Exception{
@@ -62,22 +61,22 @@ void body() throws Exception{
6261
c.createChannel();
6362
}
6463
}
65-
}.run();
64+
}.run();
6665

6766
new PerformanceTest("Sequential creation followed by close:"){
6867
void body() throws Exception{
6968
for(int j = 1; j <= i; j++){
7069
c.createChannel().close();
7170
}
7271
}
73-
}.run();
72+
}.run();
7473

7574
new PerformanceTest("Sequential creation then bulk close:"){
7675
void body() throws Exception{
7776
ArrayList<Channel> channels = new ArrayList<Channel>();
7877
for(int j = 1; j <= i; j++){
7978
channels.add(c.createChannel());
80-
}
79+
}
8180
for(Channel chan : channels) chan.close();
8281
}
8382
}.run();
@@ -87,7 +86,7 @@ void body() throws Exception{
8786
ArrayList<Channel> channels = new ArrayList<Channel>();
8887
for(int j = 1; j <= i; j++){
8988
channels.add(c.createChannel());
90-
}
89+
}
9190
Collections.shuffle(channels);
9291
for(Channel chan : channels) chan.close();
9392
}

test/src/com/rabbitmq/examples/FileConsumer.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.apache.commons.cli.Option;
2929
import org.apache.commons.cli.Options;
3030

31-
import com.rabbitmq.client.AMQP;
3231
import com.rabbitmq.client.Channel;
3332
import com.rabbitmq.client.Connection;
3433
import com.rabbitmq.client.ConnectionFactory;
@@ -121,8 +120,4 @@ public static void main(String[] args) {
121120
private static String strArg(CommandLine cmd, char opt, String def) {
122121
return cmd.getOptionValue(opt, def);
123122
}
124-
125-
private static int intArg(CommandLine cmd, char opt, int def) {
126-
return Integer.parseInt(cmd.getOptionValue(opt, Integer.toString(def)));
127-
}
128123
}

test/src/com/rabbitmq/examples/FileProducer.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.apache.commons.cli.Option;
2929
import org.apache.commons.cli.Options;
3030

31-
import com.rabbitmq.client.AMQP;
3231
import com.rabbitmq.client.Channel;
3332
import com.rabbitmq.client.Connection;
3433
import com.rabbitmq.client.ConnectionFactory;
@@ -96,8 +95,4 @@ public static void main(String[] args) {
9695
private static String strArg(CommandLine cmd, char opt, String def) {
9796
return cmd.getOptionValue(opt, def);
9897
}
99-
100-
private static int intArg(CommandLine cmd, char opt, int def) {
101-
return Integer.parseInt(cmd.getOptionValue(opt, Integer.toString(def)));
102-
}
10398
}

test/src/com/rabbitmq/examples/HelloClient.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
// Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
1515
//
1616

17-
1817
package com.rabbitmq.examples;
1918

20-
import com.rabbitmq.client.AMQP;
2119
import com.rabbitmq.client.Channel;
2220
import com.rabbitmq.client.Connection;
2321
import com.rabbitmq.client.ConnectionFactory;

test/src/com/rabbitmq/examples/HelloJsonClient.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
// Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
1515
//
1616

17-
1817
package com.rabbitmq.examples;
1918

20-
import com.rabbitmq.client.AMQP;
2119
import com.rabbitmq.client.Channel;
2220
import com.rabbitmq.client.Connection;
2321
import com.rabbitmq.client.ConnectionFactory;

test/src/com/rabbitmq/examples/HelloJsonServer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
// Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
1515
//
1616

17-
1817
package com.rabbitmq.examples;
1918

20-
import com.rabbitmq.client.AMQP;
2119
import com.rabbitmq.client.Channel;
2220
import com.rabbitmq.client.Connection;
2321
import com.rabbitmq.client.ConnectionFactory;

test/src/com/rabbitmq/examples/LogTail.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
// Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
1515
//
1616

17-
1817
package com.rabbitmq.examples;
1918

20-
import com.rabbitmq.client.AMQP;
2119
import com.rabbitmq.client.Channel;
2220
import com.rabbitmq.client.Connection;
2321
import com.rabbitmq.client.ConnectionFactory;

test/src/com/rabbitmq/examples/ManyConnections.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
// Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
1515
//
1616

17-
1817
package com.rabbitmq.examples;
1918

20-
import com.rabbitmq.client.AMQP;
2119
import com.rabbitmq.client.Channel;
2220
import com.rabbitmq.client.ConnectionFactory;
2321
import com.rabbitmq.client.Connection;

test/src/com/rabbitmq/examples/ProducerMain.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
// Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
1515
//
1616

17-
1817
package com.rabbitmq.examples;
1918

2019
import java.io.ByteArrayOutputStream;
2120
import java.io.DataOutputStream;
2221
import java.io.IOException;
2322

24-
import com.rabbitmq.client.AMQP;
2523
import com.rabbitmq.client.Channel;
2624
import com.rabbitmq.client.Connection;
2725
import com.rabbitmq.client.ConnectionFactory;

test/src/com/rabbitmq/examples/SendString.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
// Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
1515
//
1616

17-
1817
package com.rabbitmq.examples;
1918

20-
import com.rabbitmq.client.AMQP;
2119
import com.rabbitmq.client.Channel;
2220
import com.rabbitmq.client.Connection;
2321
import com.rabbitmq.client.ConnectionFactory;

0 commit comments

Comments
 (0)