Search in sources :

Example 1 with LongHashSet

use of org.agrona.collections.LongHashSet in project angler by LMAX-Exchange.

the class CurrentProcessSocketInodeRetrieverTest method shouldFindMultipleSocketInodeValues.

@Test
public void shouldFindMultipleSocketInodeValues() throws Exception {
    try (final DatagramChannel channel1 = DatagramChannel.open().bind(new InetSocketAddress(55555));
        final DatagramChannel channel2 = DatagramChannel.open().bind(new InetSocketAddress(44444))) {
        final LongHashSet target = new LongHashSet(4);
        retriever.accept(target);
        assertThat(target.size(), is(atLeast(2)));
    }
}
Also used : LongHashSet(org.agrona.collections.LongHashSet) InetSocketAddress(java.net.InetSocketAddress) DatagramChannel(java.nio.channels.DatagramChannel) Test(org.junit.Test)

Example 2 with LongHashSet

use of org.agrona.collections.LongHashSet in project angler by LMAX-Exchange.

the class CurrentProcessSocketInodeRetrieverTest method shouldFindSocketInodeValue.

@Test
public void shouldFindSocketInodeValue() throws Exception {
    try (final DatagramChannel channel = DatagramChannel.open().bind(new InetSocketAddress(55555))) {
        final LongHashSet target = new LongHashSet(4);
        retriever.accept(target);
        assertThat(target.size(), is(atLeast(1)));
    }
}
Also used : LongHashSet(org.agrona.collections.LongHashSet) InetSocketAddress(java.net.InetSocketAddress) DatagramChannel(java.nio.channels.DatagramChannel) Test(org.junit.Test)

Aggregations

InetSocketAddress (java.net.InetSocketAddress)2 DatagramChannel (java.nio.channels.DatagramChannel)2 LongHashSet (org.agrona.collections.LongHashSet)2 Test (org.junit.Test)2