Skip to content

Commit 5f63ed1

Browse files
author
haotian
committed
AJ-716: fix broken case
1 parent 1dacda0 commit 5f63ed1

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

test/com/xxdb/DBConnectionTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ public String getLogMessages() {
178178
conn.connect(HOST,port,"admin","123456","",true,N,true,false,trynums);
179179
logCapture.stop();
180180
String s=logCapture.getLogMessages();
181-
int temp=trynums*(1+N.length);
182-
assertTrue(s.contains("Connect failed after "+temp+" reconnect attemps for every node in high availability sites."));
181+
assertTrue(s.contains("Connect failed after "+trynums+" reconnect attemps for every node in high availability sites."));
183182
}
184183
@Test
185184
public void test_Connect_tryReconnectNums_Filed_enableHighAvailability_true_enableLoadBalance_true() throws IOException {
@@ -205,8 +204,7 @@ public String getLogMessages() {
205204
conn.connect(HOST,port,"admin","123456","",true,N,true,true,trynums);
206205
logCapture.stop();
207206
String s=logCapture.getLogMessages();
208-
int temp=trynums*(1+N.length);
209-
assertTrue(s.contains("Connect failed after "+temp+" reconnect attemps for every node in high availability sites."));
207+
assertTrue(s.contains("Connect failed after "+trynums+" reconnect attemps for every node in high availability sites."));
210208

211209

212210
}

test/com/xxdb/SimpleDBConnectionPoolTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,8 +1257,7 @@ public String getLogMessages() {
12571257
pool = new SimpleDBConnectionPool(config);
12581258
logCapture.stop();
12591259
String s=logCapture.getLogMessages();
1260-
int temp=trynums*(1+highAvailabilitySites.length);
1261-
assertTrue(s.contains("Connect failed after "+temp+" reconnect attemps for every node in high availability sites."));
1260+
assertTrue(s.contains("Connect failed after "+trynums+" reconnect attemps for every node in high availability sites."));
12621261
}
12631262
@Test(expected = RuntimeException.class)
12641263
public void test_SimpleDBConnectionPool_getConnection_Failed_TryReconnectNums_enableHighAvailability_true_enableLoadBalance_true(){
@@ -1288,8 +1287,7 @@ public String getLogMessages() {
12881287
logCapture.start();
12891288
pool = new SimpleDBConnectionPool(config);
12901289
String s=logCapture.getLogMessages();
1291-
int temp=trynums*(1+highAvailabilitySites.length);
1292-
assertTrue(s.contains("Connect failed after "+temp+" reconnect attemps for every node in high availability sites."));
1290+
assertTrue(s.contains("Connect failed after "+trynums+" reconnect attemps for every node in high availability sites."));
12931291
}
12941292

12951293
@Test

0 commit comments

Comments
 (0)