Search in sources :

Example 6 with GDSServerVersion

use of org.firebirdsql.gds.impl.GDSServerVersion in project jaybird by FirebirdSQL.

the class TestFirebirdVersionMetaData method shouldReturn4_0ForFirebird4_0.

@Test
public void shouldReturn4_0ForFirebird4_0() throws Exception {
    GDSServerVersion version = GDSServerVersion.parseRawVersion("WI-V4.0.0.459 Firebird 4.0");
    assertEquals(FirebirdVersionMetaData.FIREBIRD_4_0, FirebirdVersionMetaData.getVersionMetaDataFor(version));
}
Also used : GDSServerVersion(org.firebirdsql.gds.impl.GDSServerVersion) Test(org.junit.Test)

Example 7 with GDSServerVersion

use of org.firebirdsql.gds.impl.GDSServerVersion in project jaybird by FirebirdSQL.

the class FBServiceManagerTest method testGetServerVersion.

// NOTE Some of these tests may fail when using a Firebird 3.0 or earlier client library with the NATIVE protocol
@ParameterizedTest
@MethodSource
void testGetServerVersion(String serverName, Integer portNumber, String serviceName) throws Exception {
    final FBServiceManager fbServiceManager = new FBServiceManager(FBTestProperties.getGdsType());
    fbServiceManager.setServerName(serverName);
    if (portNumber != null)
        fbServiceManager.setPortNumber(portNumber);
    fbServiceManager.setServiceName(serviceName);
    fbServiceManager.setUser(FBTestProperties.DB_USER);
    fbServiceManager.setPassword(FBTestProperties.DB_PASSWORD);
    final GDSServerVersion serverVersion = fbServiceManager.getServerVersion();
    assertThat(serverVersion, allOf(notNullValue(), not(equalTo(GDSServerVersion.INVALID_VERSION))));
}
Also used : GDSServerVersion(org.firebirdsql.gds.impl.GDSServerVersion) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 8 with GDSServerVersion

use of org.firebirdsql.gds.impl.GDSServerVersion in project jaybird by FirebirdSQL.

the class FBSimpleDataSourceTest method defaultDisableWireCompression.

@Test
public void defaultDisableWireCompression() throws Exception {
    assumeThat("Test only works with pure java connections", FBTestProperties.GDS_TYPE, isPureJavaType());
    FBSimpleDataSource ds = new FBSimpleDataSource();
    ds.setDatabaseName(FBTestProperties.DB_DATASOURCE_URL);
    ds.setUser(FBTestProperties.DB_USER);
    ds.setPassword(FBTestProperties.DB_PASSWORD);
    ds.setType(FBTestProperties.getGdsType().toString());
    try (Connection connection = ds.getConnection()) {
        assertTrue(connection.isValid(0));
        GDSServerVersion serverVersion = connection.unwrap(FirebirdConnection.class).getFbDatabase().getServerVersion();
        assertFalse("expected wire compression not in use", serverVersion.isWireCompressionUsed());
    }
}
Also used : GDSServerVersion(org.firebirdsql.gds.impl.GDSServerVersion) Connection(java.sql.Connection) FirebirdConnection(org.firebirdsql.jdbc.FirebirdConnection) Test(org.junit.Test)

Example 9 with GDSServerVersion

use of org.firebirdsql.gds.impl.GDSServerVersion in project jaybird by FirebirdSQL.

the class TestV13Authentication method authenticateServiceUsingSrpAuth.

/**
 * This test assumes that the Firebird 3 config for {@code UserManager} contains {@code Srp}.
 * <p>
 * Replicates the test of {@link org.firebirdsql.management.TestFBServiceManager#testGetServerVersion()}.
 * </p>
 */
@Test
public void authenticateServiceUsingSrpAuth() throws Exception {
    final String username = "srpauth";
    final String password = "srp";
    databaseUserRule.createUser(username, password, "Srp");
    final FBServiceManager fbServiceManager = new FBServiceManager(FBTestProperties.getGdsType());
    fbServiceManager.setHost(FBTestProperties.DB_SERVER_URL);
    fbServiceManager.setPort(FBTestProperties.DB_SERVER_PORT);
    fbServiceManager.setUser(username);
    fbServiceManager.setPassword(password);
    final GDSServerVersion serverVersion = fbServiceManager.getServerVersion();
    assertThat(serverVersion, allOf(notNullValue(), not(equalTo(GDSServerVersion.INVALID_VERSION))));
}
Also used : GDSServerVersion(org.firebirdsql.gds.impl.GDSServerVersion) FBServiceManager(org.firebirdsql.management.FBServiceManager) Test(org.junit.Test)

Example 10 with GDSServerVersion

use of org.firebirdsql.gds.impl.GDSServerVersion in project jaybird by FirebirdSQL.

the class TestFBServiceManager method testGetServerVersion.

@Test
public void testGetServerVersion() throws Exception {
    final FBServiceManager fbServiceManager = new FBServiceManager(FBTestProperties.getGdsType());
    fbServiceManager.setHost(FBTestProperties.DB_SERVER_URL);
    fbServiceManager.setPort(FBTestProperties.DB_SERVER_PORT);
    fbServiceManager.setUser(FBTestProperties.DB_USER);
    fbServiceManager.setPassword(FBTestProperties.DB_PASSWORD);
    final GDSServerVersion serverVersion = fbServiceManager.getServerVersion();
    assertThat(serverVersion, allOf(notNullValue(), not(equalTo(GDSServerVersion.INVALID_VERSION))));
}
Also used : GDSServerVersion(org.firebirdsql.gds.impl.GDSServerVersion) Test(org.junit.Test)

Aggregations

GDSServerVersion (org.firebirdsql.gds.impl.GDSServerVersion)20 Test (org.junit.Test)17 FirebirdConnection (org.firebirdsql.jdbc.FirebirdConnection)4 FBServiceManager (org.firebirdsql.management.FBServiceManager)4 Connection (java.sql.Connection)3 Properties (java.util.Properties)3 FBTestProperties (org.firebirdsql.common.FBTestProperties)3 JaybirdSystemProperties (org.firebirdsql.gds.JaybirdSystemProperties)3 IConnectionProperties (org.firebirdsql.gds.ng.IConnectionProperties)3 FBManagedConnection (org.firebirdsql.jaybird.xca.FBManagedConnection)3 PooledConnection (javax.sql.PooledConnection)1 XAConnection (javax.sql.XAConnection)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1