Search in sources :

Example 11 with GDSServerVersion

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

the class TestFirebirdVersionMetaData method shouldReturn3_0ForFirebird4_0.

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

Example 12 with GDSServerVersion

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

the class FBSimpleDataSourceTest method enableWireCompression.

@Test
public void enableWireCompression() throws Exception {
    assumeThat("Test only works with pure java connections", FBTestProperties.GDS_TYPE, isPureJavaType());
    assumeTrue("Test requires wire compression", getDefaultSupportInfo().supportsWireCompression());
    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());
    ds.setWireCompression(true);
    try (Connection connection = ds.getConnection()) {
        assertTrue(connection.isValid(0));
        GDSServerVersion serverVersion = connection.unwrap(FirebirdConnection.class).getFbDatabase().getServerVersion();
        assertTrue("expected wire compression 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 13 with GDSServerVersion

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

the class TestFBConnectionPoolDataSource method enableWireCompression.

@Test
public void enableWireCompression() throws Exception {
    assumeThat("Test only works with pure java connections", FBTestProperties.GDS_TYPE, isPureJavaType());
    assumeTrue("Test requires wire compression", getDefaultSupportInfo().supportsWireCompression());
    ds.setWireCompression(true);
    PooledConnection pooledConnection = ds.getPooledConnection();
    try (Connection connection = pooledConnection.getConnection()) {
        assertTrue(connection.isValid(0));
        GDSServerVersion serverVersion = connection.unwrap(FirebirdConnection.class).getFbDatabase().getServerVersion();
        assertTrue("expected wire compression in use", serverVersion.isWireCompressionUsed());
    } finally {
        pooledConnection.close();
    }
}
Also used : PooledConnection(javax.sql.PooledConnection) GDSServerVersion(org.firebirdsql.gds.impl.GDSServerVersion) Connection(java.sql.Connection) PooledConnection(javax.sql.PooledConnection) FirebirdConnection(org.firebirdsql.jdbc.FirebirdConnection) Test(org.junit.Test)

Example 14 with GDSServerVersion

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

the class TestFBXADataSource method enableWireCompression.

@Test
public void enableWireCompression() throws Exception {
    assumeThat("Test only works with pure java connections", FBTestProperties.GDS_TYPE, isPureJavaType());
    assumeTrue("Test requires wire compression", getDefaultSupportInfo().supportsWireCompression());
    ds.setWireCompression(true);
    XAConnection xaConnection = ds.getXAConnection();
    try (Connection connection = xaConnection.getConnection()) {
        assertTrue(connection.isValid(0));
        GDSServerVersion serverVersion = connection.unwrap(FirebirdConnection.class).getFbDatabase().getServerVersion();
        assertTrue("expected wire compression in use", serverVersion.isWireCompressionUsed());
    } finally {
        xaConnection.close();
    }
}
Also used : GDSServerVersion(org.firebirdsql.gds.impl.GDSServerVersion) XAConnection(javax.sql.XAConnection) FirebirdConnection(org.firebirdsql.jdbc.FirebirdConnection) XAConnection(javax.sql.XAConnection)

Example 15 with GDSServerVersion

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

the class TestFirebirdVersionMetaData method shouldReturn3_0ForFirebird3_0.

@Test
public void shouldReturn3_0ForFirebird3_0() throws Exception {
    GDSServerVersion version = GDSServerVersion.parseRawVersion("WI-V3.0.1.32609 Firebird 3.0");
    assertEquals(FirebirdVersionMetaData.FIREBIRD_3_0, FirebirdVersionMetaData.getVersionMetaDataFor(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