提交 91ab61b9 编写于 作者: P pengys5

Remove system out in test case

上级 67cb71e0
......@@ -40,7 +40,6 @@ public enum JsonDataMerge {
if (!entry.getValue().isJsonNull()) {
value = entry.getValue().getAsString();
}
System.out.printf("key: %s, value: %s \n", key, value);
if (entry.getValue().isJsonNull()) {
Assert.assertEquals(true, actualData.get(key).isJsonNull());
......
......@@ -55,7 +55,6 @@ public enum MetricDataMergeJson {
if (!entry.getValue().isJsonNull()) {
value = entry.getValue().getAsString();
}
System.out.printf("key: %s, value: %s \n", key, value);
if (entry.getValue().isJsonNull()) {
Assert.assertEquals(true, actualData.get(key).isJsonNull());
......@@ -90,7 +89,6 @@ public enum MetricDataMergeJson {
changedId = changedId + Const.ID_SPLIT + ids[i];
}
changedId = String.valueOf(changedSlice) + changedId;
System.out.printf("changedId: %s", changedId);
return changedId;
}
}
......@@ -55,7 +55,6 @@ public enum RecordDataMergeJson {
if (!entry.getValue().isJsonNull()) {
value = entry.getValue().getAsString();
}
System.out.printf("key: %s, value: %s \n", key, value);
if (entry.getValue().isJsonNull()) {
Assert.assertEquals(true, actualData.get(key).isJsonNull());
......@@ -86,7 +85,6 @@ public enum RecordDataMergeJson {
changedId = changedId + Const.ID_SPLIT + ids[i];
}
changedId = String.valueOf(changedSlice) + changedId;
System.out.printf("changedId: %s", changedId);
return changedId;
} else {
return id;
......
......@@ -96,7 +96,6 @@ public class GlobalTraceGetWithGlobalIdTestCase {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
String globalId = (String) invocation.getArguments()[0];
System.out.println(globalId);
Assert.assertEquals("Test", globalId);
return null;
}
......
......@@ -23,11 +23,8 @@ public class GlobalTraceSearchWithGlobalIdUseDB {
globalTraceSearchWithGlobalId.onWork("Trace.1491277147443.-1562443425.70539.65.2", response);
JsonArray nodeArray = response.get("result").getAsJsonArray();
System.out.println(nodeArray.size());
System.out.println(nodeArray.toString());
for (int i = 0; i < nodeArray.size(); i++) {
JsonObject nodeJsonObj = nodeArray.get(i).getAsJsonObject();
System.out.println(nodeJsonObj);
}
}
}
......@@ -30,7 +30,6 @@ public class GetWithHttpServletTestCase {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Integer status = (Integer)invocation.getArguments()[0];
System.out.println(status);
Assert.assertEquals(new Integer(200), status);
return null;
}
......
......@@ -47,7 +47,6 @@ public class PostWithHttpServletTestCase {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Integer status = (Integer)invocation.getArguments()[0];
System.out.println(status);
Assert.assertEquals(new Integer(200), status);
return null;
}
......@@ -57,7 +56,6 @@ public class PostWithHttpServletTestCase {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Segment segment = (Segment)invocation.getArguments()[0];
System.out.println(segment.getTraceSegmentId());
Assert.assertEquals("TestTest2", segment.getTraceSegmentId());
return null;
}
......@@ -76,7 +74,6 @@ public class PostWithHttpServletTestCase {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Integer status = (Integer)invocation.getArguments()[0];
System.out.println(status);
Assert.assertEquals(new Integer(500), status);
return null;
}
......
......@@ -29,8 +29,6 @@ public class TestAbstractGet extends AbstractGet {
}
public static class Factory extends AbstractGetProvider<TestAbstractGet> {
public static Factory INSTANCE = new Factory();
@Override
public Role role() {
return TestAbstractGet.WorkerRole.INSTANCE;
......
......@@ -39,8 +39,6 @@ public class TestAbstractPost extends AbstractPost {
}
public static class Factory extends AbstractPostProvider<TestAbstractPost> {
public static Factory INSTANCE = new Factory();
@Override
public String servletPath() {
return "/TestAbstractPost";
......
......@@ -18,11 +18,6 @@ public class MergeDataAnswer implements Answer<Object> {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
MergeData mergeData = (MergeData)invocation.getArguments()[0];
System.out.printf("id: %s \n", mergeData.getId());
// for (Map.Entry<String, ?> entry : mergeData.toSource().entrySet()) {
// System.out.printf("key: %s, value: %s \n", entry.getKey(), entry.getValue());
// }
mergeDataList.add(mergeData);
return null;
}
......
......@@ -20,12 +20,7 @@ public class MetricDataAnswer implements Answer<Object> {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
MetricData metricData = (MetricData)invocation.getArguments()[0];
System.out.printf("id: %s \n", metricData.getId());
metricDataList.add(metricData);
Gson gson = new Gson();
// String jsonStr = gson.toJson(metricData.toMap());
// System.out.printf("data: %s \n", jsonStr);
return null;
}
......
package com.a.eye.skywalking.collector.worker.mock;
import com.a.eye.skywalking.collector.worker.storage.RecordData;
import com.google.gson.JsonElement;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
/**
* @author pengys5
......@@ -20,9 +16,6 @@ public class RecordDataAnswer implements Answer<Object> {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
RecordData recordData = (RecordData)invocation.getArguments()[0];
System.out.printf("id: %s \n", recordData.getId());
System.out.println(recordData.getRecord().toString());
recordDataList.add(recordData);
return null;
}
......
......@@ -3,8 +3,6 @@ package com.a.eye.skywalking.collector.worker.mock;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
......@@ -13,8 +11,6 @@ import org.mockito.stubbing.Answer;
*/
public class SaveToEsSourceAnswer implements Answer<Object> {
private Logger logger = LogManager.getFormatterLogger(SaveToEsSourceAnswer.class);
public SourceObj sourceObj = new SourceObj();
@Override
......@@ -22,8 +18,6 @@ public class SaveToEsSourceAnswer implements Answer<Object> {
Gson gson = new Gson();
String source = (String)invocation.getArguments()[0];
JsonObject sourceJsonObj = gson.fromJson(source, JsonObject.class);
logger.debug("sourceJsonObj: %s", sourceJsonObj.toString());
sourceObj.setSource(sourceJsonObj);
return null;
}
......@@ -35,10 +29,6 @@ public class SaveToEsSourceAnswer implements Answer<Object> {
source = new JsonArray();
}
public JsonArray getSource() {
return source;
}
public void setSource(JsonObject source) {
this.source.add(source);
}
......
......@@ -23,11 +23,8 @@ public class NodeCompWithTimeSliceUseDB {
nodeCompLoad.onWork(null, response);
JsonArray nodeArray = response.get("result").getAsJsonArray();
System.out.println(nodeArray.size());
System.out.println(nodeArray.toString());
for (int i = 0; i < nodeArray.size(); i++) {
JsonObject nodeJsonObj = nodeArray.get(i).getAsJsonObject();
System.out.println(nodeJsonObj);
}
}
}
......@@ -28,11 +28,8 @@ public class NodeMappingSearchWithTimeSliceUseDB {
nodeMappingSearch.onWork(requestEntity, response);
JsonArray nodeArray = response.get("result").getAsJsonArray();
System.out.println(nodeArray.size());
System.out.println(nodeArray.toString());
for (int i = 0; i < nodeArray.size(); i++) {
JsonObject nodeJsonObj = nodeArray.get(i).getAsJsonObject();
System.out.println(nodeJsonObj);
}
}
}
......@@ -26,8 +26,6 @@ public enum NodeRefAnalyse {
Gson gson = new Gson();
String recordJsonStr = gson.toJson(recordAnswer.getNodeRefResRecordList());
System.out.println(recordJsonStr);
JsonArray recordJsonArray = gson.fromJson(recordJsonStr, JsonArray.class);
JsonDataMerge.INSTANCE.merge(resSumJsonFile, recordJsonArray);
}
......
......@@ -21,9 +21,6 @@ public class NodeRefResRecordAnswer implements Answer<Object> {
AbstractNodeRefResSumAnalysis.NodeRefResRecord nodeRefResRecord = (AbstractNodeRefResSumAnalysis.NodeRefResRecord)invocation.getArguments()[0];
String recordJsonStr = gson.toJson(nodeRefResRecord);
JsonObject recordJsonObj = gson.fromJson(recordJsonStr, JsonObject.class);
System.out.printf("NodeRefId: %s \n", nodeRefResRecord.getNodeRefId());
System.out.printf("NodeRefResRecord data: %s \n", recordJsonStr);
nodeRefResRecordList.add(recordJsonObj);
return null;
}
......
......@@ -28,10 +28,8 @@ public class NodeRefResSumGroupWithTimeSliceUseDB {
nodeRefSearch.onWork(requestEntity, response);
JsonArray nodeRefArray = response.get("result").getAsJsonArray();
System.out.println(nodeRefArray.toString());
for (int i = 0; i < nodeRefArray.size(); i++) {
JsonObject nodeRefJsonObj = nodeRefArray.get(i).getAsJsonObject();
System.out.println(nodeRefJsonObj);
}
}
}
......@@ -28,10 +28,8 @@ public class NodeRefResSumSearchWithTimeSliceUseDB {
nodeRefSearch.onWork(requestEntity, response);
JsonArray nodeRefArray = response.get("result").getAsJsonArray();
System.out.println(nodeRefArray.toString());
for (int i = 0; i < nodeRefArray.size(); i++) {
JsonObject nodeRefJsonObj = nodeRefArray.get(i).getAsJsonObject();
System.out.println(nodeRefJsonObj);
}
}
}
......@@ -28,10 +28,8 @@ public class NodeRefSearchWithTimeSliceUseDB {
nodeRefSearch.onWork(requestEntity, response);
JsonArray nodeRefArray = response.get("result").getAsJsonArray();
System.out.println(nodeRefArray.toString());
for (int i = 0; i < nodeRefArray.size(); i++) {
JsonObject nodeRefJsonObj = nodeRefArray.get(i).getAsJsonObject();
System.out.println(nodeRefJsonObj);
}
}
}
......@@ -36,7 +36,6 @@ public enum HttpClientTools {
try (CloseableHttpResponse response = httpClient.execute(httpget)) {
HttpEntity entity = response.getEntity();
System.out.println(response.getStatusLine());
if (entity != null) {
return EntityUtils.toString(entity);
}
......
......@@ -75,7 +75,6 @@ public class SpanSearchWithIdTestCase {
spanSearchWithId.onWork(request, response);
JsonObject spanJsonObj = response.get(Const.RESULT).getAsJsonObject();
System.out.println(spanJsonObj.toString());
String value = spanJsonObj.get("operationName").getAsString();
Assert.assertEquals("/portal/", value);
}
......
......@@ -35,10 +35,10 @@ public class DateToolsTestCase {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(1490922929258L);
calendar.set(Calendar.SECOND, calendar.get(Calendar.SECOND) - 3);
System.out.println(calendar.getTimeInMillis());
// System.out.println(calendar.getTimeInMillis());
calendar.set(Calendar.SECOND, calendar.get(Calendar.SECOND) - 2);
System.out.println(calendar.getTimeInMillis());
// System.out.println(calendar.getTimeInMillis());
calendar.set(Calendar.SECOND, calendar.get(Calendar.SECOND) - 2);
System.out.println(calendar.getTimeInMillis());
// System.out.println(calendar.getTimeInMillis());
}
}
......@@ -13,7 +13,7 @@ public class IdSplitTestCase {
String id = "201703221502..-..portal-service..-..[127.0.0.1:8002]";
String[] ids = id.split(Const.IDS_SPLIT);
for (String splitId : ids) {
System.out.println(splitId);
// System.out.println(splitId);
}
}
}
......@@ -26,11 +26,11 @@ public class TraceDagWindowDataBuilderTestCase {
JsonArray lineArray = dagJsonObj.getAsJsonArray("nodeRefs");
for (int i = 0; i < pointArray.size(); i++) {
System.out.println(pointArray.get(i).getAsJsonObject());
// System.out.println(pointArray.get(i).getAsJsonObject());
}
for (int i = 0; i < lineArray.size(); i++) {
System.out.println(lineArray.get(i).getAsJsonObject());
// System.out.println(lineArray.get(i).getAsJsonObject());
}
}
......
......@@ -110,8 +110,6 @@ public class TraceSegmentTestCase {
message.append(segment);
String json = gson.toJson(message);
System.out.println(json);
message = gson.fromJson(json, SegmentsMessage.class);
TraceSegment newSegment = message.getSegments().get(0);
......
......@@ -50,7 +50,6 @@ public class HTTPRestServiceTestApp {
post.setEntity(entity);
try {
CloseableHttpResponse httpResponse = httpclient.execute(post);
System.out.println(httpResponse.getStatusLine().getStatusCode());
} catch (IOException e) {
e.printStackTrace();
}
......@@ -69,7 +68,6 @@ public class HTTPRestServiceTestApp {
while ((str = br.readLine()) != null) {
wholeStr += str;
}
System.out.println(wholeStr);
response.setContentType("text/html; charset=utf-8");
response.setStatus(HttpServletResponse.SC_OK);
baseRequest.setHandled(true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册