Search in sources :

Example 1 with Flow

use of io.pravega.client.connection.impl.Flow in project pravega by pravega.

the class FlowTest method testSequenceNumberOverflow.

@Test
public void testSequenceNumberOverflow() {
    Flow id = new Flow(Integer.MAX_VALUE, Integer.MAX_VALUE);
    assertEquals(0, (int) id.getNextSequenceNumber());
}
Also used : Flow(io.pravega.client.connection.impl.Flow) Test(org.junit.Test)

Example 2 with Flow

use of io.pravega.client.connection.impl.Flow in project pravega by pravega.

the class FlowTest method testNextSequenceNumber.

@Test
public void testNextSequenceNumber() {
    Flow id = Flow.create();
    assertEquals(id.getFlowId(), (int) (id.asLong() >> 32));
    assertEquals("SequenceNumber should be 0 for " + id, 0, (int) id.asLong());
    assertEquals("SequenceNumber should be incremented", (int) id.asLong() + 1, (int) id.getNextSequenceNumber());
    assertEquals(id, Flow.from(id.asLong()));
}
Also used : Flow(io.pravega.client.connection.impl.Flow) Test(org.junit.Test)

Aggregations

Flow (io.pravega.client.connection.impl.Flow)2 Test (org.junit.Test)2