1717 */
1818package org .apache .hadoop .hbase .replication ;
1919
20- import static org .apache .hadoop .hbase .replication .TestReplicationBase .NB_RETRIES ;
21- import static org .apache .hadoop .hbase .replication .TestReplicationBase .SLEEP_TIME ;
22- import static org .apache .hadoop .hbase .replication .TestReplicationBase .row ;
23- import static org .junit .Assert .assertEquals ;
20+ import static org .apache .hadoop .hbase .replication .TestReplicationBaseNoBeforeAll .NB_RETRIES ;
21+ import static org .apache .hadoop .hbase .replication .TestReplicationBaseNoBeforeAll .SLEEP_TIME ;
22+ import static org .apache .hadoop .hbase .replication .TestReplicationBaseNoBeforeAll .row ;
23+ import static org .junit .jupiter . api . Assertions .assertEquals ;
2424
2525import java .io .IOException ;
2626import java .util .ArrayList ;
3232import org .apache .hadoop .conf .Configuration ;
3333import org .apache .hadoop .fs .FileSystem ;
3434import org .apache .hadoop .fs .Path ;
35- import org .apache .hadoop .hbase .HBaseClassTestRule ;
3635import org .apache .hadoop .hbase .HBaseTestingUtility ;
3736import org .apache .hadoop .hbase .HConstants ;
3837import org .apache .hadoop .hbase .TableName ;
4544import org .apache .hadoop .hbase .tool .BulkLoadHFiles ;
4645import org .apache .hadoop .hbase .util .Bytes ;
4746import org .apache .hadoop .hbase .util .HFileTestUtil ;
48- import org .junit .ClassRule ;
49- import org .junit .Test ;
50- import org .junit .experimental .categories .Category ;
47+ import org .junit .jupiter .api .Tag ;
48+ import org .junit .jupiter .api .Test ;
5149import org .slf4j .Logger ;
5250import org .slf4j .LoggerFactory ;
5351
54- @ Category ({ ReplicationTests .class , LargeTests .class })
52+ @ Tag (ReplicationTests .TAG )
53+ @ Tag (LargeTests .TAG )
5554public class TestReplicationSyncUpToolWithBulkLoadedData extends TestReplicationSyncUpToolBase {
5655
57- @ ClassRule
58- public static final HBaseClassTestRule CLASS_RULE =
59- HBaseClassTestRule .forClass (TestReplicationSyncUpToolWithBulkLoadedData .class );
60-
6156 private static final Logger LOG =
6257 LoggerFactory .getLogger (TestReplicationSyncUpToolWithBulkLoadedData .class );
6358
@@ -122,12 +117,12 @@ private void mimicSyncUpAfterBulkLoad(Iterator<String> randomHFileRangeListItera
122117 loadAndReplicateHFiles (false , randomHFileRangeListIterator );
123118
124119 int rowCount_ht1Source = UTIL1 .countRows (ht1Source );
125- assertEquals ("t1_syncup has 206 rows on source, after bulk load of another 103 hfiles" , 206 ,
126- rowCount_ht1Source );
120+ assertEquals (206 , rowCount_ht1Source ,
121+ "t1_syncup has 206 rows on source, after bulk load of another 103 hfiles" );
127122
128123 int rowCount_ht2Source = UTIL1 .countRows (ht2Source );
129- assertEquals ("t2_syncup has 406 rows on source, after bulk load of another 203 hfiles" , 406 ,
130- rowCount_ht2Source );
124+ assertEquals (406 , rowCount_ht2Source ,
125+ "t2_syncup has 406 rows on source, after bulk load of another 203 hfiles" );
131126
132127 shutDownSourceHBaseCluster ();
133128 restartTargetHBaseCluster (1 );
@@ -137,8 +132,8 @@ private void mimicSyncUpAfterBulkLoad(Iterator<String> randomHFileRangeListItera
137132 // Before sync up
138133 int rowCountHt1TargetAtPeer1 = UTIL2 .countRows (ht1TargetAtPeer1 );
139134 int rowCountHt2TargetAtPeer1 = UTIL2 .countRows (ht2TargetAtPeer1 );
140- assertEquals ("@Peer1 t1_syncup should still have 100 rows" , 100 , rowCountHt1TargetAtPeer1 );
141- assertEquals ("@Peer1 t2_syncup should still have 200 rows" , 200 , rowCountHt2TargetAtPeer1 );
135+ assertEquals (100 , rowCountHt1TargetAtPeer1 , "@Peer1 t1_syncup should still have 100 rows" );
136+ assertEquals (200 , rowCountHt2TargetAtPeer1 , "@Peer1 t2_syncup should still have 200 rows" );
142137
143138 // Run sync up tool
144139 syncUp (UTIL1 );
@@ -157,10 +152,10 @@ private void mimicSyncUpAfterBulkLoad(Iterator<String> randomHFileRangeListItera
157152 rowCount_ht2Source = UTIL1 .countRows (ht2Source );
158153 LOG .debug ("t2_syncup should have 406 rows at source, and it is " + rowCount_ht2Source );
159154 }
160- assertEquals ("@Peer1 t1_syncup should be sync up and have 200 rows" , 200 ,
161- rowCountHt1TargetAtPeer1 );
162- assertEquals ("@Peer1 t2_syncup should be sync up and have 400 rows" , 400 ,
163- rowCountHt2TargetAtPeer1 );
155+ assertEquals (200 , rowCountHt1TargetAtPeer1 ,
156+ "@Peer1 t1_syncup should be sync up and have 200 rows" );
157+ assertEquals (400 , rowCountHt2TargetAtPeer1 ,
158+ "@Peer1 t2_syncup should be sync up and have 400 rows" );
164159 }
165160 if (rowCountHt1TargetAtPeer1 == 200 && rowCountHt2TargetAtPeer1 == 400 ) {
166161 LOG .info ("SyncUpAfterBulkLoad succeeded at retry = " + i );
@@ -228,7 +223,7 @@ private void loadAndValidateHFileReplication(String testName, byte[] row, byte[]
228223 Table source , byte [][][] hfileRanges , int numOfRows ) throws Exception {
229224 Path dir = UTIL1 .getDataTestDirOnTestFS (testName );
230225 FileSystem fs = UTIL1 .getTestFileSystem ();
231- dir = dir .makeQualified (fs );
226+ dir = dir .makeQualified (fs . getUri (), fs . getWorkingDirectory () );
232227 Path familyDir = new Path (dir , Bytes .toString (fam ));
233228
234229 int hfileIdx = 0 ;
@@ -248,7 +243,7 @@ private void loadFromOtherHDFSAndValidateHFileReplication(String testName, byte[
248243 Table source , byte [][][] hfileRanges , int numOfRows ) throws Exception {
249244 Path dir = UTIL2 .getDataTestDirOnTestFS (testName );
250245 FileSystem fs = UTIL2 .getTestFileSystem ();
251- dir = dir .makeQualified (fs );
246+ dir = dir .makeQualified (fs . getUri (), fs . getWorkingDirectory () );
252247 Path familyDir = new Path (dir , Bytes .toString (fam ));
253248
254249 int hfileIdx = 0 ;
@@ -269,7 +264,7 @@ private void wait(Table target, int expectedCount, String msg)
269264 for (int i = 0 ; i < NB_RETRIES ; i ++) {
270265 int rowCountHt2TargetAtPeer1 = UTIL2 .countRows (target );
271266 if (i == NB_RETRIES - 1 ) {
272- assertEquals (msg , expectedCount , rowCountHt2TargetAtPeer1 );
267+ assertEquals (expectedCount , rowCountHt2TargetAtPeer1 , msg );
273268 }
274269 if (expectedCount == rowCountHt2TargetAtPeer1 ) {
275270 break ;
0 commit comments