Search in sources :

Example 6 with PackedOutputArray

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

the class TransportUnauthenticatedConnectionErrorIT method createHelloWithOversizeDeclaredList.

byte[] createHelloWithOversizeDeclaredList(Neo4jPack neo4jPack) throws IOException {
    PackedOutputArray output = new PackedOutputArray();
    Neo4jPack.Packer packer = neo4jPack.newPacker(output);
    packer.packStructHeader(2, HelloMessage.SIGNATURE);
    packer.packMapHeader(1);
    packer.pack("x");
    // list claims to be huge when it isn't
    packer.packListHeader(Integer.MAX_VALUE);
    TextArray labels = ALICE.labels();
    for (int i = 0; i < labels.length(); i++) {
        String labelName = labels.stringValue(i);
        packer.pack(labelName);
    }
    return output.bytes();
}
Also used : PackedOutputArray(org.neo4j.bolt.packstream.PackedOutputArray) Neo4jPack(org.neo4j.bolt.packstream.Neo4jPack) TextArray(org.neo4j.values.storable.TextArray)

Example 7 with PackedOutputArray

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

the class UnsupportedStructTypesV2IT method createRunWith.

private 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 8 with PackedOutputArray

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

the class UnsupportedStructTypesV1V2IT method createUnknownMsg.

private byte[] createUnknownMsg() throws IOException {
    PackedOutputArray out = new PackedOutputArray();
    Neo4jPack.Packer packer = neo4jPack.newPacker(out);
    packer.packStructHeader(0, DEFAULT_SIGNATURE);
    return out.bytes();
}
Also used : PackedOutputArray(org.neo4j.bolt.packstream.PackedOutputArray) Neo4jPack(org.neo4j.bolt.packstream.Neo4jPack)

Example 9 with PackedOutputArray

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

the class UnsupportedStructTypesV1V2IT method createMsgWithNullKey.

private byte[] createMsgWithNullKey() throws IOException {
    PackedOutputArray out = new PackedOutputArray();
    Neo4jPack.Packer packer = neo4jPack.newPacker(out);
    packer.packStructHeader(2, DEFAULT_SIGNATURE);
    packer.pack("Text");
    packMapWithNullKey(packer);
    return out.bytes();
}
Also used : PackedOutputArray(org.neo4j.bolt.packstream.PackedOutputArray) Neo4jPack(org.neo4j.bolt.packstream.Neo4jPack)

Example 10 with PackedOutputArray

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

the class UnsupportedStructTypesV1V2IT method createMsgWithDuplicateKey.

private byte[] createMsgWithDuplicateKey() throws IOException {
    PackedOutputArray out = new PackedOutputArray();
    Neo4jPack.Packer packer = neo4jPack.newPacker(out);
    packer.packStructHeader(2, DEFAULT_SIGNATURE);
    packer.pack("Text");
    packMapWithDuplicateKey(packer);
    return out.bytes();
}
Also used : PackedOutputArray(org.neo4j.bolt.packstream.PackedOutputArray) Neo4jPack(org.neo4j.bolt.packstream.Neo4jPack)

Aggregations

Neo4jPack (org.neo4j.bolt.packstream.Neo4jPack)11 PackedOutputArray (org.neo4j.bolt.packstream.PackedOutputArray)11 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1 Neo4jPackV2 (org.neo4j.bolt.packstream.Neo4jPackV2)1 TextArray (org.neo4j.values.storable.TextArray)1