package ModelTest;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.bench4q.share.models.master.statistics.ScriptBriefResultModel;
import org.junit.Test;

import static org.junit.Assert.*;

public class IpTest {
	@Test
	public void testIp() throws UnknownHostException {
		InetAddress addr = InetAddress.getLocalHost();
		System.out.println(addr.getHostAddress().toString());
		System.out.println(new SimpleDateFormat("yyyyMMdd").format(new Date()));
	}

	@Test
	public void testClassName() throws ClassNotFoundException {
		ScriptBriefResultModel model = new ScriptBriefResultModel();
		System.out.println(model.getClass().getName());
		assertTrue(Class.forName(model.getClass().getName()).equals(
				model.getClass()));
	}

	@Test
	public void testForInheritance() throws ClassNotFoundException {
		Object model = new ScriptBriefResultModel();
		assertEquals(ScriptBriefResultModel.class.getName(), model.getClass()
				.getName());
	}
}
