package com.chinacloudly.utils.id.generator;

import java.util.Date;

import org.junit.Test;

import com.chinacloudly.utils.id.generator.IDGenerator;

public class TestIDGenerator {

	@Test
	public void testIDGenerator() throws Exception {
		System.out.println(IDGenerator.generateId(1));
	}
	
	@Test
	public void testGetTimeById() throws Exception {
		long id = IDGenerator.generateId(1);
		long time = IDGenerator.getTimeByID(id);
		System.out.println(time);
		System.out.println(new Date(time));
	}
	
	@Test
	public void testGetServerIdByID() throws Exception {
		long id = IDGenerator.generateId(12);
		int serverID = IDGenerator.getServerIdByID(id);
		System.out.println(serverID);
	}
}

@@ -39,16 +39,62 @@
 rator;%0A%0A
+import static org.junit.Assert.assertEquals;%0A%0A
 import j
@@ -596,32 +596,57 @@
 ows Exception %7B%0A
+%09%09int origServerID = 12;%0A
 %09%09long id = IDGe
@@ -664,18 +664,28 @@
 erateId(
-12
+origServerID
 );%0A%09%09int
@@ -731,35 +731,43 @@
 (id);%0A%09%09
-System.out.println(
+assertEquals(origServerID, 
 serverID

complete unit test