Skip to content

Commit 63fb837

Browse files
removed test, removed ununsed imports
1 parent b4adb1f commit 63fb837

File tree

1 file changed

+0
-57
lines changed

1 file changed

+0
-57
lines changed

src/test/java/com/timgroup/statsd/NonBlockingStatsDClientTest.java

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
import java.util.Random;
1717
import java.util.concurrent.Callable;
1818
import java.util.concurrent.CountDownLatch;
19-
import java.util.concurrent.ArrayBlockingQueue;
20-
import java.util.concurrent.LinkedBlockingQueue;
21-
import java.util.concurrent.BlockingQueue;
2219
import java.util.logging.Logger;
2320

2421
import static org.hamcrest.MatcherAssert.assertThat;
@@ -1341,58 +1338,4 @@ public SlowStatsDNonBlockingStatsDClient build() throws StatsDClientException {
13411338
}
13421339
}
13431340

1344-
@Test(timeout = 5000L)
1345-
public void failed_write_buffer() throws Exception {
1346-
final BlockingQueue sync = new ArrayBlockingQueue(1);
1347-
final IOException marker = new IOException();
1348-
NonBlockingStatsDClientBuilder builder = new NonBlockingStatsDClientBuilder() {
1349-
@Override
1350-
public NonBlockingStatsDClient build() {
1351-
this.originDetectionEnabled(false);
1352-
this.bufferPoolSize(1);
1353-
return new NonBlockingStatsDClient(resolve()) {
1354-
@Override
1355-
ClientChannel createByteChannel(Callable<SocketAddress> addressLookup, int timeout, int bufferSize) throws Exception {
1356-
return new DatagramClientChannel(addressLookup.call()) {
1357-
@Override
1358-
public int write(ByteBuffer data) throws IOException {
1359-
try {
1360-
sync.put(new Object());
1361-
} catch (InterruptedException e) {
1362-
}
1363-
throw marker;
1364-
}
1365-
};
1366-
}
1367-
};
1368-
}
1369-
};
1370-
1371-
final BlockingQueue errors = new LinkedBlockingQueue();
1372-
NonBlockingStatsDClient client = builder
1373-
.hostname("localhost")
1374-
.blocking(true)
1375-
.errorHandler(new StatsDClientErrorHandler() {
1376-
@Override
1377-
public void handle(Exception ex) {
1378-
if (ex == marker) {
1379-
return;
1380-
}
1381-
System.out.println(ex.toString());
1382-
try {
1383-
errors.put(ex);
1384-
} catch (InterruptedException e) {
1385-
}
1386-
}
1387-
1388-
})
1389-
.build();
1390-
1391-
client.gauge("test", 1);
1392-
sync.take();
1393-
client.gauge("test", 1);
1394-
client.stop();
1395-
1396-
assertEquals(0, errors.size());
1397-
}
13981341
}

0 commit comments

Comments
 (0)