Skip to content

Commit

Permalink
#2286 Add function of getting thread dump from agent
Browse files Browse the repository at this point in the history
1. fix test fail
  • Loading branch information
koo-taejin committed Dec 21, 2016
1 parent 1083035 commit 1e98aaf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.navercorp.pinpoint.web.view;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.navercorp.pinpoint.common.util.CollectionUtils;
import com.navercorp.pinpoint.common.util.ThreadMXBeanUtils;
import com.navercorp.pinpoint.profiler.util.ThreadDumpUtils;
import com.navercorp.pinpoint.thrift.dto.command.TActiveThreadDump;
Expand All @@ -26,6 +27,7 @@
import org.junit.Test;

import java.lang.management.ThreadInfo;
import java.util.List;
import java.util.Map;

/**
Expand All @@ -41,7 +43,11 @@ public void serializeTest() throws Exception {
AgentActiveThreadDumpList activeThreadDumpList = createThreadDumpList(allThreadInfo);
String jsonValue = mapper.writeValueAsString(activeThreadDumpList);

Map map = mapper.readValue(jsonValue, Map.class);
List list = mapper.readValue(jsonValue, List.class);

Assert.assertTrue(CollectionUtils.isNotEmpty(list));

Map map = (Map) list.get(0);
Assert.assertTrue(map.containsKey("threadId"));
Assert.assertTrue(map.containsKey("threadName"));
Assert.assertTrue(map.containsKey("threadState"));
Expand Down

0 comments on commit 1e98aaf

Please # to comment.