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));
}
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))));
}
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());
}
}
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))));
}
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))));
}
Aggregations