package org.unidal.cat.message;

import java.io.IOException;

import junit.framework.Assert;

import org.junit.Test;
import org.unidal.cat.message.MessageId;
import org.unidal.lookup.ComponentTestCase;

public class MessageIdTest extends ComponentTestCase {
	@Test
	public void test() throws IOException {
		MessageId id = MessageId.parse("child-0a260015-403899-12345");

		Assert.assertEquals("child", id.getDomain());
		Assert.assertEquals("0a260015", id.getIpAddressInHex());
		Assert.assertEquals("10.38.0.21", id.getIpAddress());
		Assert.assertEquals(170262549, id.getIpAddressValue());
		Assert.assertEquals(403899, id.getHour());
		Assert.assertEquals(1454036400000L, id.getTimestamp());
		Assert.assertEquals(12345, id.getIndex());

	}
}

@@ -735,13 +735,531 @@
 ex());%0A%0A
+%09%7D%0A%09%0A%09@Test%0A%09public void testDomain() throws IOException %7B%0A%09%09MessageId id = MessageId.parse(%22child-child-child-0a260015-403899-12345%22);%0A%0A%09%09Assert.assertEquals(%22child-child-child%22, id.getDomain());%0A%09%09Assert.assertEquals(%220a260015%22, id.getIpAddressInHex());%0A%09%09Assert.assertEquals(%2210.38.0.21%22, id.getIpAddress());%0A%09%09Assert.assertEquals(170262549, id.getIpAddressValue());%0A%09%09Assert.assertEquals(403899, id.getHour());%0A%09%09Assert.assertEquals(1454036400000L, id.getTimestamp());%0A%09%09Assert.assertEquals(12345, id.getIndex());%0A
 %09%7D%0A%7D%0A

add the test