Search in sources :

Example 6 with Neo4jPackV2

use of org.neo4j.bolt.packstream.Neo4jPackV2 in project neo4j by neo4j.

the class UnsupportedStructTypesV2IT method createRunWith.

private static byte[] createRunWith(ThrowingConsumer<Neo4jPack.Packer, IOException> valuePacker) throws IOException {
    PackedOutputArray out = new PackedOutputArray();
    Neo4jPack.Packer packer = new Neo4jPackV2().newPacker(out);
    packer.packStructHeader(2, RunMessage.SIGNATURE);
    packer.pack("RETURN $x");
    packer.packMapHeader(1);
    packer.pack("x");
    valuePacker.accept(packer);
    return out.bytes();
}
Also used : PackedOutputArray(org.neo4j.bolt.packstream.PackedOutputArray) Neo4jPack(org.neo4j.bolt.packstream.Neo4jPack) Neo4jPackV2(org.neo4j.bolt.packstream.Neo4jPackV2)

Example 7 with Neo4jPackV2

use of org.neo4j.bolt.packstream.Neo4jPackV2 in project neo4j by neo4j.

the class MessageDecoderTest method shouldCallExternalErrorOnTime.

@ParameterizedTest
@MethodSource("argumentsProvider")
public void shouldCallExternalErrorOnTime(Neo4jPack packerUnderTest) throws Exception {
    this.packerUnderTest = packerUnderTest;
    assumeThat(packerUnderTest.version()).isEqualTo(1);
    testUnpackableStructParametersWithKnownType(new Neo4jPackV2(), ValueUtils.of(OffsetTime.now()), "OffsetTime values cannot be unpacked with this version of bolt.");
}
Also used : Neo4jPackV2(org.neo4j.bolt.packstream.Neo4jPackV2) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 8 with Neo4jPackV2

use of org.neo4j.bolt.packstream.Neo4jPackV2 in project neo4j by neo4j.

the class MessageDecoderTest method shouldCallExternalErrorOnDateTimeWithOffset.

@ParameterizedTest
@MethodSource("argumentsProvider")
public void shouldCallExternalErrorOnDateTimeWithOffset(Neo4jPack packerUnderTest) throws Exception {
    this.packerUnderTest = packerUnderTest;
    assumeThat(packerUnderTest.version()).isEqualTo(1);
    testUnpackableStructParametersWithKnownType(new Neo4jPackV2(), ValueUtils.of(OffsetDateTime.now()), "OffsetDateTime values cannot be unpacked with this version of bolt.");
}
Also used : Neo4jPackV2(org.neo4j.bolt.packstream.Neo4jPackV2) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 9 with Neo4jPackV2

use of org.neo4j.bolt.packstream.Neo4jPackV2 in project neo4j by neo4j.

the class MessageDecoderTest method shouldCallExternalErrorOnLocalDateTime.

@ParameterizedTest
@MethodSource("argumentsProvider")
public void shouldCallExternalErrorOnLocalDateTime(Neo4jPack packerUnderTest) throws Exception {
    this.packerUnderTest = packerUnderTest;
    assumeThat(packerUnderTest.version()).isEqualTo(1);
    testUnpackableStructParametersWithKnownType(new Neo4jPackV2(), ValueUtils.of(LocalDateTime.now()), "LocalDateTime values cannot be unpacked with this version of bolt.");
}
Also used : Neo4jPackV2(org.neo4j.bolt.packstream.Neo4jPackV2) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 10 with Neo4jPackV2

use of org.neo4j.bolt.packstream.Neo4jPackV2 in project neo4j by neo4j.

the class MessageDecoderTest method shouldCallExternalErrorOnDateTimeWithZoneName.

@ParameterizedTest
@MethodSource("argumentsProvider")
public void shouldCallExternalErrorOnDateTimeWithZoneName(Neo4jPack packerUnderTest) throws Exception {
    this.packerUnderTest = packerUnderTest;
    assumeThat(packerUnderTest.version()).isEqualTo(1);
    testUnpackableStructParametersWithKnownType(new Neo4jPackV2(), ValueUtils.of(ZonedDateTime.now()), "ZonedDateTime values cannot be unpacked with this version of bolt.");
}
Also used : Neo4jPackV2(org.neo4j.bolt.packstream.Neo4jPackV2) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

Neo4jPackV2 (org.neo4j.bolt.packstream.Neo4jPackV2)10 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)7 MethodSource (org.junit.jupiter.params.provider.MethodSource)7 BeforeEach (org.junit.jupiter.api.BeforeEach)2 TransportTestUtil (org.neo4j.bolt.testing.TransportTestUtil)2 Neo4jPack (org.neo4j.bolt.packstream.Neo4jPack)1 PackedOutputArray (org.neo4j.bolt.packstream.PackedOutputArray)1