package com.dianping.cat.report.analyzer;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.junit.Test;
import org.unidal.lookup.ComponentTestCase;

import com.dianping.cat.consumer.event.EventAnalyzer;
import com.dianping.cat.consumer.heartbeat.HeartbeatAnalyzer;
import com.dianping.cat.consumer.problem.ProblemAnalyzer;
import com.dianping.cat.consumer.transaction.TransactionAnalyzer;
import com.dianping.cat.report.task.event.EventReportBuilder;
import com.dianping.cat.report.task.heartbeat.HeartbeatReportBuilder;
import com.dianping.cat.report.task.problem.ProblemReportBuilder;
import com.dianping.cat.report.task.transaction.TransactionReportBuilder;

public class GraphBuilderTest extends ComponentTestCase {
	
	@Test
	public void test() throws ParseException{
		HeartbeatReportBuilder builder = lookup(HeartbeatReportBuilder.class);
		
		Date period = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2013-12-16 16:00:00");
		builder.buildHourlyTask(HeartbeatAnalyzer.ID, "Cat", period);
	}

	@Test
	public void testProblem() throws ParseException{
		ProblemReportBuilder builder = lookup(ProblemReportBuilder.class);
		
		Date period = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2013-12-16 16:00:00");
		builder.buildHourlyTask(ProblemAnalyzer.ID, "Cat", period);
	}
	
	@Test
	public void testTransaction() throws ParseException{
		TransactionReportBuilder builder = lookup(TransactionReportBuilder.class);
		
		Date period = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2013-12-16 16:00:00");
		builder.buildHourlyTask(TransactionAnalyzer.ID, "Cat", period);
	}
	

	@Test
	public void testEvent() throws ParseException{
		EventReportBuilder builder = lookup(EventReportBuilder.class);
		
		Date period = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2013-12-16 16:00:00");
		builder.buildHourlyTask(EventAnalyzer.ID, "Cat", period);
	}
}

@@ -963,36 +963,36 @@
 parse(%222013-12-1
-6 16
+8 10
 :00:00%22);%0A%09%09buil
@@ -1026,35 +1026,41 @@
 atAnalyzer.ID, %22
-Cat
+ReviewWeb
 %22, period);%0A%09%7D%0A%0A

modify the testcase