Search in sources :

Example 16 with HostnamePort

use of org.neo4j.internal.helpers.HostnamePort in project neo4j by neo4j.

the class WebContainerTestUtils method verifyConnector.

public static void verifyConnector(GraphDatabaseService db, String name, boolean enabled) {
    HostnamePort address = connectorAddress(db, name);
    if (enabled) {
        assertNotNull(address);
        assertTrue(canConnectToSocket(address.getHost(), address.getPort()));
    } else {
        assertNull(address);
    }
}
Also used : HostnamePort(org.neo4j.internal.helpers.HostnamePort)

Example 17 with HostnamePort

use of org.neo4j.internal.helpers.HostnamePort in project neo4j by neo4j.

the class BoltIT method assertEventuallyServerResponds.

private void assertEventuallyServerResponds(String host, int port) throws Exception {
    SocketConnection conn = new SocketConnection();
    conn.connect(new HostnamePort(host, port));
    conn.send(new byte[] { (byte) 0x60, (byte) 0x60, (byte) 0xB0, (byte) 0x17, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 });
    assertThat(conn.recv(4)).isEqualTo(new byte[] { 0, 0, 0, 4 });
}
Also used : SocketConnection(org.neo4j.bolt.testing.client.SocketConnection) HostnamePort(org.neo4j.internal.helpers.HostnamePort)

Example 18 with HostnamePort

use of org.neo4j.internal.helpers.HostnamePort in project neo4j by neo4j.

the class ConnectorPortRegister method register.

private void register(String connectorKey, String hostname, int port) {
    HostnamePort hostnamePort = new HostnamePort(hostname, port);
    connectorsInfo.put(connectorKey, hostnamePort);
}
Also used : HostnamePort(org.neo4j.internal.helpers.HostnamePort)

Aggregations

HostnamePort (org.neo4j.internal.helpers.HostnamePort)18 Test (org.junit.jupiter.api.Test)7 SocketAddress (org.neo4j.configuration.helpers.SocketAddress)5 AssertableLogProvider (org.neo4j.logging.AssertableLogProvider)5 SocketConnection (org.neo4j.bolt.testing.client.SocketConnection)4 InputStream (java.io.InputStream)3 Socket (java.net.Socket)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 MapValueBuilder (org.neo4j.values.virtual.MapValueBuilder)3 URI (java.net.URI)2 EnumSource (org.junit.jupiter.params.provider.EnumSource)2 DynamicTest (org.junit.jupiter.api.DynamicTest)1 DynamicTest.dynamicTest (org.junit.jupiter.api.DynamicTest.dynamicTest)1 DependencyResolver (org.neo4j.common.DependencyResolver)1