@Test void forPort_hostPort() { P4ServerName name = P4ServerName.forPort("host:1234"); assertThat("null", name, notNullValue()); assertThat("secure", name.isSecure(), is(false)); assertThat("connection type", name.getServerProtocol(), is(IServerAddress.Protocol.P4JRPCNTS)); assertThat("port", name.getServerPort(), is("host:1234")); assertThat("display", name.getDisplayName(), is("host:1234")); assertThat("url", name.getUrl(), is("p4jrpcnts://host:1234")); assertThat("full port", name.getFullPort(), is("host:1234")); assertThat("protocol name", name.getProtocolName(), is("java")); }
@Test void forPort_ssl() { P4ServerName name = P4ServerName.forPort("ssl://host:1234"); assertThat("null", name, notNullValue()); assertThat("secure", name.isSecure(), is(true)); assertThat("connection type", name.getServerProtocol(), is(IServerAddress.Protocol.P4JRPCNTSSSL)); assertThat("port", name.getServerPort(), is("host:1234")); assertThat("display", name.getDisplayName(), is("ssl:host:1234")); assertThat("url", name.getUrl(), is("p4jrpcntsssl://host:1234")); assertThat("full port", name.getFullPort(), is("ssl://host:1234")); assertThat("protocol name", name.getProtocolName(), is("ssl")); }
@Test void forPort_justPort() { P4ServerName name = P4ServerName.forPort("1667"); assertThat("null", name, notNullValue()); assertThat("secure", name.isSecure(), is(false)); assertThat("connection type", name.getServerProtocol(), is(IServerAddress.Protocol.P4JRPCNTS)); assertThat("port", name.getServerPort(), is("localhost:1667")); assertThat("display", name.getDisplayName(), is("localhost:1667")); assertThat("url", name.getUrl(), is("p4jrpcnts://localhost:1667")); assertThat("full port", name.getFullPort(), is("localhost:1667")); assertThat("protocol name", name.getProtocolName(), is("java")); }
@Test void forPort_simpleProtocolPort() { P4ServerName name = P4ServerName.forPort("tcp:host:1234"); assertThat("null", name, notNullValue()); assertThat("secure", name.isSecure(), is(false)); assertThat("connection type", name.getServerProtocol(), is(IServerAddress.Protocol.P4JRPCNTS)); assertThat("port", name.getServerPort(), is("host:1234")); assertThat("display", name.getDisplayName(), is("host:1234")); assertThat("url", name.getUrl(), is("p4jrpcnts://host:1234")); assertThat("full port", name.getFullPort(), is("host:1234")); assertThat("protocol name", name.getProtocolName(), is("java")); }