[강운덕] [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:
Woonduk Kang
2012-08-03 10:33:35 +00:00
parent 8c819d628c
commit a9dd5c4234
2 changed files with 15 additions and 34 deletions
@@ -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());
}