use of org.firebirdsql.management.FBServiceManager in project jaybird by FirebirdSQL.
the class TestV13Authentication method authenticateServiceUsingLegacyAuth.
/**
* This test assumes that the Firebird 3 config for {@code UserManager} contains {@code Legacy_UserManager}.
* <p>
* Replicates the test of {@link org.firebirdsql.management.TestFBServiceManager#testGetServerVersion()}.
* </p>
*/
@Test
public void authenticateServiceUsingLegacyAuth() throws Exception {
final String username = "legacyauth";
final String password = "legacy";
databaseUserRule.createUser(username, password, "Legacy_UserManager");
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.management.FBServiceManager in project jaybird by FirebirdSQL.
the class FBTestProperties method getDefaultSupportInfo.
/**
* The {@link org.firebirdsql.util.FirebirdSupportInfo} for the default test server.
*
* @return Support info object
*/
public static FirebirdSupportInfo getDefaultSupportInfo() {
try {
if (firebirdSupportInfo == null) {
final GDSType gdsType = getGdsType();
final FBServiceManager fbServiceManager = new FBServiceManager(gdsType);
if (gdsType == GDSType.getType("PURE_JAVA") || gdsType == GDSType.getType("NATIVE") || gdsType == GDSType.getType("OOREMOTE")) {
fbServiceManager.setServerName(DB_SERVER_URL);
fbServiceManager.setPortNumber(DB_SERVER_PORT);
}
fbServiceManager.setUser(FBTestProperties.DB_USER);
fbServiceManager.setPassword(FBTestProperties.DB_PASSWORD);
firebirdSupportInfo = FirebirdSupportInfo.supportInfoFor(fbServiceManager.getServerVersion());
}
return firebirdSupportInfo;
} catch (Exception e) {
throw new IllegalStateException("Cannot initialize support info", e);
}
}
use of org.firebirdsql.management.FBServiceManager 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.management.FBServiceManager in project jaybird by FirebirdSQL.
the class Firebird3PlusAuthenticationTest method authenticateServiceUsingLegacyAuth.
/**
* This test assumes that the Firebird 3 config for {@code UserManager} contains {@code Legacy_UserManager}.
* <p>
* Replicates the test of {@code FBServiceManagerTest.testGetServerVersion()}.
* </p>
*/
@Test
public void authenticateServiceUsingLegacyAuth() throws Exception {
final String username = "legacyauth";
final String password = "legacy";
databaseUserRule.createUser(username, password, "Legacy_UserManager");
final FBServiceManager fbServiceManager = new FBServiceManager(FBTestProperties.getGdsType());
fbServiceManager.setServerName(FBTestProperties.DB_SERVER_URL);
fbServiceManager.setPortNumber(FBTestProperties.DB_SERVER_PORT);
fbServiceManager.setUser(username);
fbServiceManager.setPassword(password);
fbServiceManager.setAuthPlugins("Legacy_Auth");
final GDSServerVersion serverVersion = fbServiceManager.getServerVersion();
assertThat(serverVersion, allOf(notNullValue(), not(equalTo(GDSServerVersion.INVALID_VERSION))));
}
use of org.firebirdsql.management.FBServiceManager in project jaybird by FirebirdSQL.
the class Firebird3PlusAuthenticationTest method authenticateServiceUsingSrpAuth.
/**
* This test assumes that the Firebird 3 config for {@code UserManager} contains {@code Srp}.
* <p>
* Replicates the test of {@code FBServiceManagerTest.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.setServerName(FBTestProperties.DB_SERVER_URL);
fbServiceManager.setPortNumber(FBTestProperties.DB_SERVER_PORT);
fbServiceManager.setUser(username);
fbServiceManager.setPassword(password);
final GDSServerVersion serverVersion = fbServiceManager.getServerVersion();
assertThat(serverVersion, allOf(notNullValue(), not(equalTo(GDSServerVersion.INVALID_VERSION))));
}
Aggregations