Skip to content

Commit 9d6ab80

Browse files
committed
[#1981] Convert deprecated TransportConnector.conenctionCount() calls to use TransportConnector.getConnectionCount()
1 parent 172c79d commit 9d6ab80

7 files changed

Lines changed: 18 additions & 18 deletions

File tree

activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpConnectTimeoutTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ public void run() {
126126
assertTrue("one connection", Wait.waitFor(new Wait.Condition() {
127127
@Override
128128
public boolean isSatisified() throws Exception {
129-
return 1 == brokerService.getTransportConnectorByScheme(getConnectorScheme()).connectionCount();
129+
return 1 == brokerService.getTransportConnectorByScheme(getConnectorScheme()).getConnectionCount();
130130
}
131131
}, TimeUnit.SECONDS.toMillis(15), TimeUnit.MILLISECONDS.toMillis(250)));
132132

133133
// and it should be closed due to inactivity
134134
assertTrue("no dangling connections", Wait.waitFor(new Wait.Condition() {
135135
@Override
136136
public boolean isSatisified() throws Exception {
137-
return 0 == brokerService.getTransportConnectorByScheme(getConnectorScheme()).connectionCount();
137+
return 0 == brokerService.getTransportConnectorByScheme(getConnectorScheme()).getConnectionCount();
138138
}
139139
}, TimeUnit.SECONDS.toMillis(15), TimeUnit.MILLISECONDS.toMillis(500)));
140140

activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -815,15 +815,15 @@ public void testConnectionsAreClosed() throws Exception {
815815
ActiveMQAdmin.enableJMSFrameTracing();
816816

817817
final ConnectorViewMBean connector = getProxyToConnectionView(getTargetConnectorName());
818-
LOG.info("Current number of Connections is: {}", connector.connectionCount());
818+
LOG.info("Current number of Connections is: {}", connector.getConnectionCount());
819819

820820
ArrayList<Connection> connections = new ArrayList<>();
821821

822822
for (int i = 0; i < 10; i++) {
823823
connections.add(createConnection(null));
824824
}
825825

826-
LOG.info("Current number of Connections is: {}", connector.connectionCount());
826+
LOG.info("Current number of Connections is: {}", connector.getConnectionCount());
827827

828828
for (Connection connection : connections) {
829829
connection.close();
@@ -833,8 +833,8 @@ public void testConnectionsAreClosed() throws Exception {
833833

834834
@Override
835835
public boolean isSatisified() throws Exception {
836-
LOG.info("Current number of Connections is: {}", connector.connectionCount());
837-
return connector.connectionCount() == 0;
836+
LOG.info("Current number of Connections is: {}", connector.getConnectionCount());
837+
return connector.getConnectionCount() == 0;
838838
}
839839
}));
840840
}

activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnectionTimeoutTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ public void testInactivityMonitor() throws Exception {
6464
assertTrue("one connection", Wait.waitFor(new Wait.Condition() {
6565
@Override
6666
public boolean isSatisified() throws Exception {
67-
return 1 == broker.getTransportConnectorByScheme(getConnectorScheme()).connectionCount();
67+
return 1 == broker.getTransportConnectorByScheme(getConnectorScheme()).getConnectionCount();
6868
}
6969
}, TimeUnit.SECONDS.toMillis(15), TimeUnit.MILLISECONDS.toMillis(250)));
7070

7171
// and it should be closed due to inactivity
7272
assertTrue("no dangling connections", Wait.waitFor(new Wait.Condition() {
7373
@Override
7474
public boolean isSatisified() throws Exception {
75-
return 0 == broker.getTransportConnectorByScheme(getConnectorScheme()).connectionCount();
75+
return 0 == broker.getTransportConnectorByScheme(getConnectorScheme()).getConnectionCount();
7676
}
7777
}, TimeUnit.SECONDS.toMillis(60), TimeUnit.MILLISECONDS.toMillis(500)));
7878

activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnectionTimeoutTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ public void testInactivityMonitor() throws Exception {
6666
assertTrue("one connection", Wait.waitFor(new Wait.Condition() {
6767
@Override
6868
public boolean isSatisified() throws Exception {
69-
return 1 == broker.getTransportConnectorByScheme(getConnectorScheme()).connectionCount();
69+
return 1 == broker.getTransportConnectorByScheme(getConnectorScheme()).getConnectionCount();
7070
}
7171
}, TimeUnit.SECONDS.toMillis(15), TimeUnit.MILLISECONDS.toMillis(250)));
7272

7373
// and it should be closed due to inactivity
7474
assertTrue("no dangling connections", Wait.waitFor(new Wait.Condition() {
7575
@Override
7676
public boolean isSatisified() throws Exception {
77-
return 0 == broker.getTransportConnectorByScheme(getConnectorScheme()).connectionCount();
77+
return 0 == broker.getTransportConnectorByScheme(getConnectorScheme()).getConnectionCount();
7878
}
7979
}, TimeUnit.SECONDS.toMillis(60), TimeUnit.MILLISECONDS.toMillis(500)));
8080

activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTConnectTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ public void run() {
140140
assertTrue("one connection", Wait.waitFor(new Wait.Condition() {
141141
@Override
142142
public boolean isSatisified() throws Exception {
143-
return 1 == brokerService.getTransportConnectors().get(0).connectionCount();
143+
return 1 == brokerService.getTransportConnectors().get(0).getConnectionCount();
144144
}
145145
}, TimeUnit.SECONDS.toMillis(30), TimeUnit.MILLISECONDS.toMillis(100)));
146146

147147
// and it should be closed due to inactivity
148148
assertTrue("no dangling connections", Wait.waitFor(new Wait.Condition() {
149149
@Override
150150
public boolean isSatisified() throws Exception {
151-
return 0 == brokerService.getTransportConnectors().get(0).connectionCount();
151+
return 0 == brokerService.getTransportConnectors().get(0).getConnectionCount();
152152
}
153153
}, TimeUnit.SECONDS.toMillis(30), TimeUnit.MILLISECONDS.toMillis(100)));
154154

activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/ConnectTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void testStompConnectLeak() throws Exception {
8484
assertTrue("no dangling connections", Wait.waitFor(new Wait.Condition() {
8585
@Override
8686
public boolean isSatisified() throws Exception {
87-
return 0 == brokerService.getTransportConnectors().get(0).connectionCount();
87+
return 0 == brokerService.getTransportConnectors().get(0).getConnectionCount();
8888
}
8989
}, TimeUnit.SECONDS.toMillis(15), TimeUnit.MILLISECONDS.toMillis(200)));
9090

@@ -121,7 +121,7 @@ public void run() {
121121
assertTrue("one connection", Wait.waitFor(new Wait.Condition() {
122122
@Override
123123
public boolean isSatisified() throws Exception {
124-
return 1 == brokerService.getTransportConnectors().get(0).connectionCount();
124+
return 1 == brokerService.getTransportConnectors().get(0).getConnectionCount();
125125
}
126126
}, TimeUnit.SECONDS.toMillis(15), TimeUnit.MILLISECONDS.toMillis(200)));
127127

@@ -164,15 +164,15 @@ public void run() {
164164
assertTrue("one connection", Wait.waitFor(new Wait.Condition() {
165165
@Override
166166
public boolean isSatisified() throws Exception {
167-
return 1 == brokerService.getTransportConnectors().get(0).connectionCount();
167+
return 1 == brokerService.getTransportConnectors().get(0).getConnectionCount();
168168
}
169169
}, TimeUnit.SECONDS.toMillis(15), TimeUnit.MILLISECONDS.toMillis(200)));
170170

171171
// and it should be closed due to inactivity
172172
assertTrue("no dangling connections", Wait.waitFor(new Wait.Condition() {
173173
@Override
174174
public boolean isSatisified() throws Exception {
175-
return 0 == brokerService.getTransportConnectors().get(0).connectionCount();
175+
return 0 == brokerService.getTransportConnectors().get(0).getConnectionCount();
176176
}
177177
}, TimeUnit.SECONDS.toMillis(15), TimeUnit.MILLISECONDS.toMillis(200)));
178178

activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompConnectTimeoutTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ public void run() {
106106
assertTrue("one connection", Wait.waitFor(new Wait.Condition() {
107107
@Override
108108
public boolean isSatisified() throws Exception {
109-
return 1 == brokerService.getTransportConnectorByScheme(getConnectorScheme()).connectionCount();
109+
return 1 == brokerService.getTransportConnectorByScheme(getConnectorScheme()).getConnectionCount();
110110
}
111111
}, TimeUnit.SECONDS.toMillis(15), TimeUnit.MILLISECONDS.toMillis(250)));
112112

113113
// and it should be closed due to inactivity
114114
assertTrue("no dangling connections", Wait.waitFor(new Wait.Condition() {
115115
@Override
116116
public boolean isSatisified() throws Exception {
117-
return 0 == brokerService.getTransportConnectorByScheme(getConnectorScheme()).connectionCount();
117+
return 0 == brokerService.getTransportConnectorByScheme(getConnectorScheme()).getConnectionCount();
118118
}
119119
}, TimeUnit.SECONDS.toMillis(15), TimeUnit.MILLISECONDS.toMillis(500)));
120120

0 commit comments

Comments
 (0)