[enhance](test): remove some System.out.println in UT. (#10859)

This commit is contained in:
jakevin
2022-07-15 11:16:24 +08:00
committed by GitHub
parent 39325bd666
commit 33e9d5b2da
12 changed files with 9 additions and 26 deletions

View File

@ -101,7 +101,6 @@ public class SchemaChangeHandlerTest extends TestWithFeService {
tbl.readLock();
try {
Assertions.assertNotNull(tbl);
System.out.println(tbl.getName());
Assertions.assertEquals("Doris", tbl.getEngine());
Assertions.assertEquals(9, tbl.getBaseSchema().size());
} finally {
@ -245,7 +244,6 @@ public class SchemaChangeHandlerTest extends TestWithFeService {
tbl.readLock();
try {
Assertions.assertNotNull(tbl);
System.out.println(tbl.getName());
Assertions.assertEquals("Doris", tbl.getEngine());
Assertions.assertEquals(8, tbl.getBaseSchema().size());
} finally {
@ -302,7 +300,6 @@ public class SchemaChangeHandlerTest extends TestWithFeService {
tbl.readLock();
try {
Assertions.assertNotNull(tbl);
System.out.println(tbl.getName());
Assertions.assertEquals("Doris", tbl.getEngine());
Assertions.assertEquals(6, tbl.getBaseSchema().size());
} finally {

View File

@ -150,7 +150,6 @@ public class BackupJobInfoTest {
Assert.fail();
}
Assert.assertNotNull(jobInfo);
System.out.println(jobInfo.toString());
Assert.assertEquals(1522231864000L, jobInfo.backupTime);
Assert.assertEquals("snapshot1", jobInfo.name);
@ -160,7 +159,6 @@ public class BackupJobInfoTest {
Assert.assertEquals(2, jobInfo.getOlapTableInfo("table1").getPartInfo("partition1").indexes.size());
Assert.assertEquals(2,
jobInfo.getOlapTableInfo("table1").getPartInfo("partition1").getIdx("rollup1").tablets.size());
System.out.println(jobInfo.getOlapTableInfo("table1").getPartInfo("partition1").getIdx("rollup1").tablets);
Assert.assertEquals(2,
jobInfo.getOlapTableInfo("table1").getPartInfo("partition1")
.getIdx("rollup1").getTabletFiles(10007L).size());

View File

@ -267,7 +267,6 @@ public class BackupJobTest {
Assert.assertEquals(job.getJobId(), upTask.getJobId());
Map<String, String> srcToDest = upTask.getSrcToDestPath();
Assert.assertEquals(1, srcToDest.size());
System.out.println(srcToDest);
String dest = srcToDest.get(snapshotPath + "/" + tabletId + "/" + 0);
Assert.assertNotNull(dest);

View File

@ -109,7 +109,6 @@ public class MetadataViewerTest {
null };
List<List<String>> result = (List<List<String>>) getTabletStatusMethod.invoke(null, args);
Assert.assertEquals(3, result.size());
System.out.println(result);
args = new Object[] { CatalogMocker.TEST_DB_NAME, CatalogMocker.TEST_TBL_NAME, partitions, ReplicaStatus.DEAD,
Operator.EQ };
@ -128,7 +127,6 @@ public class MetadataViewerTest {
Object[] args = new Object[] { CatalogMocker.TEST_DB_NAME, CatalogMocker.TEST_TBL_NAME, null };
List<List<String>> result = (List<List<String>>) getTabletDistributionMethod.invoke(null, args);
Assert.assertEquals(3, result.size());
System.out.println(result);
}
}

View File

@ -147,7 +147,6 @@ public class ClusterLoadStatisticsTest {
Tag.DEFAULT_BACKEND_TAG, systemInfoService, invertedIndex);
loadStatistic.init();
List<List<String>> infos = loadStatistic.getClusterStatistic(TStorageMedium.HDD);
System.out.println(infos);
Assert.assertEquals(3, infos.size());
}

View File

@ -36,7 +36,7 @@ import java.util.Base64;
public class TableQueryPlanActionTest extends DorisHttpTestCase {
private static String PATH_URI = "/_query_plan";
private static String PATH_URI = "/_query_plan";
protected static String ES_TABLE_URL;
@Override
@ -56,9 +56,9 @@ public class TableQueryPlanActionTest extends DorisHttpTestCase {
.url(URI + PATH_URI)
.build();
Response response = networkClient.newCall(request).execute();
Assert.assertNotNull(response.body());
String respStr = response.body().string();
JSONObject jsonObject = (JSONObject) JSONValue.parse(respStr);
System.out.println(respStr);
Assert.assertEquals(200, (long) ((JSONObject) jsonObject.get("data")).get("status"));
JSONObject partitionsObject = (JSONObject) ((JSONObject) jsonObject.get("data")).get("partitions");
@ -88,9 +88,8 @@ public class TableQueryPlanActionTest extends DorisHttpTestCase {
.url(URI + PATH_URI)
.build();
Response response = networkClient.newCall(request).execute();
Assert.assertNotNull(response.body());
String respStr = response.body().string();
System.out.println(respStr);
Assert.assertNotNull(respStr);
JSONObject jsonObject = (JSONObject) JSONValue.parse(respStr);
Assert.assertEquals(403, (long) jsonObject.get("code"));
String exception = (String) jsonObject.get("data");
@ -107,8 +106,8 @@ public class TableQueryPlanActionTest extends DorisHttpTestCase {
.url(URI + PATH_URI)
.build();
Response response = networkClient.newCall(request).execute();
Assert.assertNotNull(response.body());
String respStr = response.body().string();
System.out.println(respStr);
Assert.assertNotNull(respStr);
JSONObject jsonObject = (JSONObject) JSONValue.parse(respStr);
Assert.assertEquals(403, (long) jsonObject.get("code"));
@ -127,8 +126,8 @@ public class TableQueryPlanActionTest extends DorisHttpTestCase {
.url(URI + PATH_URI)
.build();
Response response = networkClient.newCall(request).execute();
Assert.assertNotNull(response.body());
String respStr = response.body().string();
System.out.println(respStr);
Assert.assertNotNull(respStr);
JSONObject jsonObject = (JSONObject) JSONValue.parse(respStr);
Assert.assertEquals(400, (long) ((JSONObject) jsonObject.get("data")).get("status"));
@ -166,10 +165,10 @@ public class TableQueryPlanActionTest extends DorisHttpTestCase {
.url(ES_TABLE_URL + PATH_URI)
.build();
Response response = networkClient.newCall(request).execute();
Assert.assertNotNull(response.body());
String respStr = response.body().string();
Assert.assertNotNull(respStr);
JSONObject jsonObject = (JSONObject) JSONValue.parse(respStr);
System.out.println(respStr);
Assert.assertEquals(1, (long) jsonObject.get("code"));
String exception = (String) jsonObject.get("data");
Assert.assertTrue(exception.contains("table type is not OLAP"));

View File

@ -39,8 +39,8 @@ public class TableRowCountActionTest extends DorisHttpTestCase {
.build();
Response response = networkClient.newCall(request).execute();
Assert.assertNotNull(response.body());
String res = response.body().string();
System.out.println(res);
JSONObject jsonObject = (JSONObject) JSONValue.parse(res);
Assert.assertEquals(200, (long) ((JSONObject) jsonObject.get("data")).get("status"));
Assert.assertEquals(2000, (long) ((JSONObject) jsonObject.get("data")).get("size"));

View File

@ -53,12 +53,9 @@ public class KafkaProducerTest {
RecordMetadata metadata = kafkaProducer.send(record).get();
System.out.println("Record send with value " + value + " to partition "
+ metadata.partition() + " with offset " + metadata.offset());
} catch (ExecutionException e) {
} catch (ExecutionException | InterruptedException e) {
System.out.println("Error in sending record " + value);
System.out.println(e);
} catch (InterruptedException e) {
System.out.println("Error in sending record " + value);
System.out.println(e);
e.printStackTrace();
}
i++;
}

View File

@ -213,7 +213,6 @@ public class PolicyTest extends TestWithFeService {
DataOutputStream output = new DataOutputStream(emptyOutputStream);
rowPolicy.write(output);
byte[] bytes = emptyOutputStream.toByteArray();
System.out.println(emptyOutputStream.toString());
DataInputStream input = new DataInputStream(new ByteArrayInputStream(bytes));
Policy newPolicy = Policy.read(input);

View File

@ -138,6 +138,5 @@ public class JournalObservableTest {
latch.countDown();
System.out.println(latch.getCount());
} // CHECKSTYLE IGNORE THIS LINE
System.out.println("success");
}
}

View File

@ -175,7 +175,6 @@ public class HeartbeatMgrTest {
Assert.assertTrue(response instanceof BrokerHbResponse);
BrokerHbResponse hbResponse = (BrokerHbResponse) response;
System.out.println(hbResponse.toString());
Assert.assertEquals(HbStatus.OK, hbResponse.getStatus());
}

View File

@ -255,7 +255,6 @@ public class SystemInfoServiceTest {
beCounterMap.put(beId, beCounterMap.getOrDefault(beId, 0) + 1);
}
}
System.out.println(beCounterMap);
List<Integer> list = Lists.newArrayList(beCounterMap.values());
Collections.sort(list);
int diff = list.get(list.size() - 1) - list.get(0);