Skip to content

Commit d1fccaf

Browse files
committed
opt case
1 parent bfa9947 commit d1fccaf

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

src/test/java/com/alipay/oceanbase/rpc/ObTableFullTextIndexTest.java

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public class ObTableFullTextIndexTest {
4040
String truncateNoPartTableSQL = "truncate table tbl1;";
4141
String truncatePartTableSQL = "truncate table part_tbl1;";
4242
String truncateTTLTableSQL = "truncate table ttl_tbl1;";
43-
String dropTableSQL = "drop table tbl1";
4443
String idCol = "id";
4544
String c2Col = "c2";
4645
String txtCol = "txt";
@@ -57,7 +56,9 @@ public void setup() throws Exception {
5756

5857
@After
5958
public void teardown() throws Exception {
60-
// executeSQL(dropTableSQL);
59+
executeSQL("drop table " + noPartTableName);
60+
executeSQL("drop table " + partTableName);
61+
executeSQL("drop table " + ttlTableName);
6162
}
6263

6364
@Test
@@ -71,6 +72,9 @@ public void testInsert() throws Exception {
7172
Assert.assertEquals(1, res.getAffectedRows());
7273
} catch (Exception e) {
7374
e.printStackTrace();
75+
Assert.fail();
76+
} finally {
77+
executeSQL(truncatePartTableSQL);
7478
}
7579
}
7680

@@ -92,6 +96,9 @@ public void testGet() throws Exception {
9296
Assert.assertEquals(txt, res.get(txtCol));
9397
} catch (Exception e) {
9498
e.printStackTrace();
99+
Assert.fail();
100+
} finally {
101+
executeSQL(truncatePartTableSQL);
95102
}
96103
}
97104

@@ -119,6 +126,9 @@ public void testDel() throws Exception {
119126
Assert.assertTrue(res.isEmpty());
120127
} catch (Exception e) {
121128
e.printStackTrace();
129+
Assert.fail();
130+
} finally {
131+
executeSQL(truncatePartTableSQL);
122132
}
123133
}
124134

@@ -178,6 +188,9 @@ public void testUpd() throws Exception {
178188
Assert.assertEquals(txt, res.get(txtCol));
179189
} catch (Exception e) {
180190
e.printStackTrace();
191+
Assert.fail();
192+
} finally {
193+
executeSQL(truncatePartTableSQL);
181194
}
182195
}
183196

@@ -239,6 +252,7 @@ public void testInsOrUpd() throws Exception {
239252

240253
} catch (Exception e) {
241254
e.printStackTrace();
255+
Assert.fail();
242256
} finally {
243257
executeSQL(truncatePartTableSQL);
244258
}
@@ -302,6 +316,7 @@ public void testReplace() throws Exception {
302316

303317
} catch (Exception e) {
304318
e.printStackTrace();
319+
Assert.fail();
305320
} finally {
306321
executeSQL(truncatePartTableSQL);
307322
}
@@ -370,8 +385,9 @@ public void testTTLInsert() throws Exception {
370385
Assert.assertEquals(txt4, res.get(txtCol));
371386
} catch(Exception e) {
372387
e.printStackTrace();
388+
Assert.fail();
373389
} finally {
374-
// executeSQL(truncateTTLTableSQL);
390+
executeSQL(truncateTTLTableSQL);
375391
}
376392
}
377393

@@ -404,8 +420,9 @@ public void testIncrment() throws Exception {
404420
Assert.assertEquals(null, getRes.get(txtCol));
405421
} catch(Exception e) {
406422
e.printStackTrace();
423+
Assert.fail();
407424
} finally {
408-
// executeSQL(truncateTTLTableSQL);
425+
executeSQL(truncatePartTableSQL);
409426
}
410427
}
411428

@@ -439,8 +456,9 @@ public void testAppend() throws Exception {
439456
Assert.assertEquals(txt1+txt2, getRes.get(txtCol));
440457
} catch(Exception e) {
441458
e.printStackTrace();
459+
Assert.fail();
442460
} finally {
443-
// executeSQL(truncateTTLTableSQL);
461+
executeSQL(truncatePartTableSQL);
444462
}
445463
}
446464

@@ -500,6 +518,7 @@ public void testFTSQuery() throws Exception {
500518
Assert.assertTrue(2 == count);
501519
} catch (Exception e) {
502520
e.printStackTrace();
521+
Assert.fail();
503522
} finally {
504523
executeSQL(truncatePartTableSQL);
505524
}
@@ -571,6 +590,9 @@ public void testFTSQueryWithTTL() throws Exception {
571590
Assert.assertTrue(1 == count);
572591
} catch (Exception e) {
573592
e.printStackTrace();
593+
Assert.fail();
594+
} finally {
595+
executeSQL(truncateTTLTableSQL);
574596
}
575597
}
576598

@@ -622,6 +644,7 @@ public void testQueryWithLimitOffset() throws Exception {
622644
Assert.assertTrue(1 == count);
623645
} catch (Exception e) {
624646
e.printStackTrace();
647+
Assert.fail();
625648
} finally {
626649
executeSQL(truncateNoPartTableSQL);
627650
}
@@ -730,6 +753,9 @@ public void testBatch() throws Exception {
730753
}
731754
} catch (Exception e) {
732755
e.printStackTrace();
756+
Assert.fail();
757+
} finally {
758+
executeSQL(truncatePartTableSQL);
733759
}
734760
}
735761
}

0 commit comments

Comments
 (0)