mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-15 15:55:54 +10:00
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-commons/trunk@833 84d0f5b1-2673-498c-a247-62c4ff18d310
29 lines
800 B
Java
29 lines
800 B
Java
package com.profiler.common.util;
|
|
|
|
import com.profiler.common.dto.Header;
|
|
import com.profiler.common.util.HeaderUtils;
|
|
import org.apache.thrift.TException;
|
|
import org.junit.Assert;
|
|
import org.junit.Test;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
public class HeaderUtilsTest {
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass().getName());
|
|
|
|
@Test
|
|
public void validateSignature() throws TException {
|
|
Header header = new Header();
|
|
Assert.assertTrue(HeaderUtils.validateSignature(header.getSignature()));
|
|
|
|
|
|
Header error = new Header((byte) 0x11, (byte) 0x20, (short) 1);
|
|
Assert.assertTrue(!HeaderUtils.validateSignature(error.getSignature()));
|
|
|
|
|
|
logger.info(header.toString());
|
|
}
|
|
|
|
}
|