Search in sources :

Example 11 with TransportTestUtil

use of org.neo4j.bolt.testing.TransportTestUtil in project neo4j by neo4j.

the class RoutingConnectorCertificatesIT method setUp.

@BeforeAll
public static void setUp() throws IOException, GeneralSecurityException, OperatorCreationException {
    certFactory = new SelfSignedCertificateFactory();
    externalKeyFile = Files.createTempFile("key", "pem");
    externalCertFile = Files.createTempFile("key", "pem");
    // make sure files are not there
    Files.delete(externalKeyFile);
    Files.delete(externalCertFile);
    certFactory.createSelfSignedCertificate(externalCertFile, externalKeyFile, "my.domain");
    internalKeyFile = Files.createTempFile("key", "pem");
    internalCertFile = Files.createTempFile("key", "pem");
    // make sure files are not there
    Files.delete(internalKeyFile);
    Files.delete(internalCertFile);
    certFactory.createSelfSignedCertificate(internalCertFile, internalKeyFile, "my.domain");
    util = new TransportTestUtil();
}
Also used : TransportTestUtil(org.neo4j.bolt.testing.TransportTestUtil) SelfSignedCertificateFactory(org.neo4j.test.ssl.SelfSignedCertificateFactory) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 12 with TransportTestUtil

use of org.neo4j.bolt.testing.TransportTestUtil in project neo4j by neo4j.

the class AbstractBoltTransportsTest method initParameters.

protected void initParameters(Class<? extends TransportConnection> connectionClass, Neo4jPack neo4jPack, String name) throws Exception {
    this.connectionClass = connectionClass;
    this.neo4jPack = neo4jPack;
    this.name = name;
    connection = newConnection();
    util = new TransportTestUtil(neo4jPack);
}
Also used : TransportTestUtil(org.neo4j.bolt.testing.TransportTestUtil)

Example 13 with TransportTestUtil

use of org.neo4j.bolt.testing.TransportTestUtil in project neo4j by neo4j.

the class BoltV4TransportIT method setUp.

@BeforeEach
public void setUp(TestInfo testInfo) throws IOException {
    server.setConfigure(settings -> {
        withOptionalBoltEncryption().accept(settings);
        settings.put(FabricSettings.enabled_by_default, false);
    });
    server.init(testInfo);
    address = server.lookupDefaultConnector();
    util = new TransportTestUtil(newMessageEncoder());
}
Also used : TransportTestUtil(org.neo4j.bolt.testing.TransportTestUtil) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 14 with TransportTestUtil

use of org.neo4j.bolt.testing.TransportTestUtil in project neo4j by neo4j.

the class BoltThrottleMaxDurationIT method setup.

@BeforeEach
public void setup(TestInfo testInfo) throws IOException {
    server.setGraphDatabaseFactory(getTestGraphDatabaseFactory());
    server.setConfigure(getSettingsFunction());
    server.init(testInfo);
    otherThread.set(5, TimeUnit.MINUTES);
    address = server.lookupDefaultConnector();
    util = new TransportTestUtil();
}
Also used : TransportTestUtil(org.neo4j.bolt.testing.TransportTestUtil) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 15 with TransportTestUtil

use of org.neo4j.bolt.testing.TransportTestUtil in project neo4j by neo4j.

the class UnsupportedStructTypesV2IT method setup.

@BeforeEach
public void setup(TestInfo testInfo) throws IOException {
    server.setConfigure(withOptionalBoltEncryption());
    server.init(testInfo);
    address = server.lookupDefaultConnector();
    util = new TransportTestUtil(new Neo4jPackV2());
}
Also used : TransportTestUtil(org.neo4j.bolt.testing.TransportTestUtil) Neo4jPackV2(org.neo4j.bolt.packstream.Neo4jPackV2) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

TransportTestUtil (org.neo4j.bolt.testing.TransportTestUtil)16 BeforeEach (org.junit.jupiter.api.BeforeEach)12 BeforeAll (org.junit.jupiter.api.BeforeAll)3 Neo4jPackV2 (org.neo4j.bolt.packstream.Neo4jPackV2)2 SocketConnection (org.neo4j.bolt.testing.client.SocketConnection)2 SelfSignedCertificateFactory (org.neo4j.test.ssl.SelfSignedCertificateFactory)2 Path (java.nio.file.Path)1 BouncyCastleProvider (org.bouncycastle.jce.provider.BouncyCastleProvider)1 SocketAddress (org.neo4j.configuration.helpers.SocketAddress)1