mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-20 18:25:55 +10:00
[강운덕] [LUCYSUS-1744]testcase 수정.
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@498 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
@@ -15,24 +15,18 @@ public class HeaderTBaseSerializerTest {
|
||||
@Test
|
||||
public void testSerialize() throws Exception {
|
||||
HeaderTBaseSerializer serializer = new HeaderTBaseSerializer();
|
||||
|
||||
Header header = new Header();
|
||||
// 10 을 JVMInfoThriftDTO type이라고 가정하자.
|
||||
// 10 을 JVMInfoThriftDTO type
|
||||
header.setType((short) 10);
|
||||
byte[] serialize = serializer.serialize(header, new JVMInfoThriftDTO());
|
||||
|
||||
JVMInfoThriftDTO jvmInfoThriftDTO = new JVMInfoThriftDTO();
|
||||
byte[] serialize = serializer.serialize(header, jvmInfoThriftDTO);
|
||||
dump(serialize);
|
||||
|
||||
HeaderTBaseDeserializer deserializer = new HeaderTBaseDeserializer();
|
||||
// TODO type을 어떻게 class와 쉽게 매칭시킬수 있는 클래스 구현 필요.
|
||||
TBaseLocator tBaseLocator = new TBaseLocator() {
|
||||
@Override
|
||||
public TBase lookup(Header header) {
|
||||
if(header.getType() == 10) {
|
||||
return new JVMInfoThriftDTO();
|
||||
}
|
||||
throw new IllegalArgumentException("type not found:" + header.getType());
|
||||
}
|
||||
};
|
||||
TBase deserialize = deserializer.deserialize(tBaseLocator, serialize);
|
||||
TBaseLocator locator = new DefaultTBaseLocator();
|
||||
TBase deserialize = deserializer.deserialize(locator, serialize);
|
||||
logger.info("deserialize:" + deserialize.getClass());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user