public class SessionFailoverTest extends DevApiBaseTestCase
| Modifier and Type | Class and Description |
|---|---|
private class |
SessionFailoverTest.ConnectionsCounterFakeServer |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
testsHost |
dbCharset, dbCollation, schema, sessionbaseUrl, DEFAULT_METADATA_CHARSET, fact, isSetForXTests, testHostInfo, testProperties| Constructor and Description |
|---|
SessionFailoverTest() |
| Modifier and Type | Method and Description |
|---|---|
private java.lang.String |
buildConnectionString(java.lang.String... hosts)
Builds a connection string with the given hosts while setting priorities according to their positions.
|
private java.lang.String |
buildConnectionStringNoUser(java.lang.String... hosts) |
void |
setupFailoverTest() |
private void |
testConnectionTimeout_assertFailureTimeout(java.lang.String url,
int expLowLimit,
int expUpLimit) |
private <EX extends java.lang.Throwable> |
testConnectionTimeout_assertFailureTimeout(java.lang.String url,
int expLowLimit,
int expUpLimit,
java.lang.Class<EX> throwable) |
private void |
testConnectionTimeout_assertSuccessTimeout(java.lang.String url,
int expLowLimit,
int expUpLimit) |
void |
testConnectionTimeout()
Tests xdevapi.connect-timeout and connectTimeout functionality.
|
void |
testGetSessionForMultipleHostsWithFailover()
Tests basic failover while getting a
Session instance. |
void |
testGetSessionForSingleHost()
Assures that failover support doesn't affect single host connections.
|
assertNonSecureSession, assertPreparedStatementsCount, assertPreparedStatementsCountsAndId, assertPreparedStatementsStatusCounts, assertSecureSession, assertSecureSession, buildString, count_data, destroyTestSession, dropCollection, getPreparedStatementExecutionsCount, getPreparedStatementId, getPreparedStatementsCount, getPreparedStatementsCount, getPreparedStatementsCount, getPrepDeallocateCount, getPrepExecuteCount, getPrepPrepareCount, getThreadId, isMysqlRunningLocally, isServerRunningOnWindows, makeParam, makeParam, makeParam, setupTestSession, sqlUpdate, supportsTestCertificates, supportsTLSv1_2assertSessionStatusEquals, assertSessionStatusNotEquals, assertThrows, assertThrows, assertThrows, assertThrows, createAuthenticatedTestProtocol, createTempTestCollection, createTestProtocol, createTestSchema, createTestSession, dropTempTestCollection, getEncodedTestHost, getTestDatabase, getTestHost, getTestPassword, getTestPort, getTestUser, mysqlVersionMeetsMinimum, mysqlVersionMeetsMinimumprivate java.lang.String buildConnectionString(java.lang.String... hosts)
hosts - the hosts list, 1st has priority=100, 2nd has priority=99, and so onprivate java.lang.String buildConnectionStringNoUser(java.lang.String... hosts)
@BeforeEach public void setupFailoverTest()
@Test
public void testGetSessionForSingleHost()
throws java.lang.Exception
java.lang.Exception@Test
public void testGetSessionForMultipleHostsWithFailover()
throws java.lang.Exception
Session instance.java.lang.Exception@Test
@Disabled(value="This test doesn\'t execute deterministically on some systems. It can be run manually in local systems when needed.")
public void testConnectionTimeout()
throws java.lang.Exception
java.lang.Exceptionprivate <EX extends java.lang.Throwable> void testConnectionTimeout_assertFailureTimeout(java.lang.String url,
int expLowLimit,
int expUpLimit,
java.lang.Class<EX> throwable)
private void testConnectionTimeout_assertFailureTimeout(java.lang.String url,
int expLowLimit,
int expUpLimit)
private void testConnectionTimeout_assertSuccessTimeout(java.lang.String url,
int expLowLimit,
int expUpLimit)