use of com.navercorp.pinpoint.common.server.bo.event.DeadlockEventBo in project pinpoint by naver.
the class ThriftAgentEventMapperTest method simpleTest2.
@Test
public void simpleTest2() {
final String agentId = "agentId";
final long startTimestamp = Long.MAX_VALUE;
final long eventTimestamp = startTimestamp;
final TAgentStat agentStat = createAgentStat(agentId, startTimestamp, eventTimestamp, 0);
DeadlockBo deadlockBo = new DeadlockBo();
DeadlockEventBo expectedEventBo = new DeadlockEventBo(agentId, startTimestamp, eventTimestamp, AgentEventType.AGENT_DEADLOCK_DETECTED, deadlockBo);
when(this.deadlockEventBoMapper.map(any(String.class), any(Long.class), any(Long.class), any(TDeadlock.class))).thenReturn(expectedEventBo);
AgentEventBo actualEventBo = agentEventMapper.map(agentStat);
Assert.assertNull(actualEventBo);
}
use of com.navercorp.pinpoint.common.server.bo.event.DeadlockEventBo in project pinpoint by naver.
the class ThriftAgentEventMapperTest method simpleTest1.
@Test
public void simpleTest1() {
final String agentId = "agentId";
final long startTimestamp = Long.MAX_VALUE;
final long eventTimestamp = startTimestamp;
final TAgentStat agentStat = createAgentStat(agentId, startTimestamp, eventTimestamp, 2);
DeadlockBo deadlockBo = new DeadlockBo();
deadlockBo.setDeadlockedThreadCount(agentStat.getDeadlock().getDeadlockedThreadCount());
DeadlockEventBo expectedEventBo = new DeadlockEventBo(agentId, startTimestamp, eventTimestamp, AgentEventType.AGENT_DEADLOCK_DETECTED, deadlockBo);
when(this.deadlockEventBoMapper.map(agentId, startTimestamp, startTimestamp, agentStat.getDeadlock())).thenReturn(expectedEventBo);
AgentEventBo actualEventBo = agentEventMapper.map(agentStat);
Assert.assertEquals(expectedEventBo, actualEventBo);
}
Aggregations