Search in sources :

Example 16 with BoltProtocolVersion

use of org.neo4j.bolt.BoltProtocolVersion in project neo4j by neo4j.

the class BoltStateMachineFactoryImplTest method shouldCreateBoltStateMachinesV3.

@Test
void shouldCreateBoltStateMachinesV3() {
    BoltStateMachineFactoryImpl factory = newBoltFactory();
    var memoryTracker = mock(MemoryTracker.class, RETURNS_MOCKS);
    BoltStateMachine boltStateMachine = factory.newStateMachine(new BoltProtocolVersion(3, 0), CHANNEL, MapValue.EMPTY, memoryTracker);
    assertNotNull(boltStateMachine);
    assertThat(boltStateMachine).isInstanceOf(BoltStateMachineV3.class);
    verify(memoryTracker).getScopedMemoryTracker();
    verify(memoryTracker, times(3)).allocateHeap(anyLong());
    verifyNoMoreInteractions(memoryTracker);
}
Also used : BoltStateMachine(org.neo4j.bolt.runtime.statemachine.BoltStateMachine) BoltProtocolVersion(org.neo4j.bolt.BoltProtocolVersion) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 17 with BoltProtocolVersion

use of org.neo4j.bolt.BoltProtocolVersion in project neo4j by neo4j.

the class BoltProtocolV4Test method shouldVersionReturnBoltV4.

@Test
void shouldVersionReturnBoltV4() throws Throwable {
    BoltProtocolV4 protocolV4 = createProtocolV4();
    assertThat(protocolV4.version()).isEqualTo(new BoltProtocolVersion(4, 0));
}
Also used : BoltProtocolVersion(org.neo4j.bolt.BoltProtocolVersion) Test(org.junit.jupiter.api.Test)

Aggregations

BoltProtocolVersion (org.neo4j.bolt.BoltProtocolVersion)17 Test (org.junit.jupiter.api.Test)12 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)10 BoltStateMachine (org.neo4j.bolt.runtime.statemachine.BoltStateMachine)6 BoltProtocol (org.neo4j.bolt.BoltProtocol)5 EmbeddedChannel (io.netty.channel.embedded.EmbeddedChannel)3 ByteBuf (io.netty.buffer.ByteBuf)2 BoltChannel (org.neo4j.bolt.BoltChannel)2 BoltConnectionFactory (org.neo4j.bolt.runtime.BoltConnectionFactory)2 BoltStateMachineFactory (org.neo4j.bolt.runtime.statemachine.BoltStateMachineFactory)2 BoltTestUtil.newTestBoltChannel (org.neo4j.bolt.testing.BoltTestUtil.newTestBoltChannel)2 BoltProtocolFactory (org.neo4j.bolt.transport.BoltProtocolFactory)2 TestDatabaseIdRepository (org.neo4j.kernel.database.TestDatabaseIdRepository)2 ArrayList (java.util.ArrayList)1 CsvSource (org.junit.jupiter.params.provider.CsvSource)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1 ValueSource (org.junit.jupiter.params.provider.ValueSource)1 BoltResponseMessageWriter (org.neo4j.bolt.messaging.BoltResponseMessageWriter)1 BoltConnection (org.neo4j.bolt.runtime.BoltConnection)1 ChannelProtector (org.neo4j.bolt.transport.pipeline.ChannelProtector)1