Package com.dianping.cat.report.task.service

Source Code of com.dianping.cat.report.task.service.ServiceBuilderTest

package com.dianping.cat.report.task.service;

import java.text.SimpleDateFormat;

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

import com.dianping.cat.Cat;
import com.dianping.cat.Constants;
import com.dianping.cat.service.HostinfoService;

public class ServiceBuilderTest  extends ComponentTestCase{
 
  @Test
  public void testHourlyReport() throws Exception{
    Cat.initialize("192.168.7.43");
    ServiceReportBuilder builder = lookup(ServiceReportBuilder.class);
    HostinfoService hostinfoService = lookup(HostinfoService.class);
   
    hostinfoService.initialize();
    builder.buildHourlyTask(Constants.REPORT_SERVICE, "cat", new SimpleDateFormat("yyyyMMddHH").parse("2013082011"));
  }
 
  @Test
  public void testDailyReport() throws Exception{
    ServiceReportBuilder builder = lookup(ServiceReportBuilder.class);
    HostinfoService hostinfoService = lookup(HostinfoService.class);
   
    hostinfoService.initialize();
    builder.buildDailyTask(Constants.REPORT_SERVICE, "cat", new SimpleDateFormat("yyyyMMdd").parse("20130712"));
  }

  @Test
  public void testWeeklyReport() throws Exception{
    ServiceReportBuilder builder = lookup(ServiceReportBuilder.class);
    HostinfoService hostinfoService = lookup(HostinfoService.class);
   
    hostinfoService.initialize();
    builder.buildWeeklyTask(Constants.REPORT_SERVICE, "cat", new SimpleDateFormat("yyyyMMdd").parse("20130710"));
  }
 
  @Test
  public void testMonthlyReport() throws Exception{
    ServiceReportBuilder builder = lookup(ServiceReportBuilder.class);
    HostinfoService hostinfoService = lookup(HostinfoService.class);
   
    hostinfoService.initialize();
    builder.buildMonthlyTask(Constants.REPORT_SERVICE, "cat", new SimpleDateFormat("yyyyMMdd").parse("20130701"));
  }

}
TOP

Related Classes of com.dianping.cat.report.task.service.ServiceBuilderTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.