Package com.dianping.cat.report.task.utilization

Source Code of com.dianping.cat.report.task.utilization.UtilizationBuilderTest

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

import java.text.SimpleDateFormat;

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

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

public class UtilizationBuilderTest extends ComponentTestCase{
 
  @Test
  public void testHourlyReport() throws Exception{
    UtilizationReportBuilder builder = lookup(UtilizationReportBuilder.class);
    HostinfoService hostinfoService = lookup(HostinfoService.class);
   
    hostinfoService.initialize();
    builder.buildHourlyTask(Constants.REPORT_UTILIZATION,Constants.CAT, new SimpleDateFormat("yyyyMMddHH").parse("2013082617"));
  }
 
  @Test
  public void testDailyReport() throws Exception{
    UtilizationReportBuilder builder = lookup(UtilizationReportBuilder.class);
    HostinfoService hostinfoService = lookup(HostinfoService.class);
   
    hostinfoService.initialize();
    builder.buildDailyTask(Constants.REPORT_UTILIZATION, Constants.CAT, new SimpleDateFormat("yyyyMMdd").parse("20130826"));
  }

  @Test
  public void testWeeklyReport() throws Exception{
    UtilizationReportBuilder builder = lookup(UtilizationReportBuilder.class);
    HostinfoService hostinfoService = lookup(HostinfoService.class);
   
    hostinfoService.initialize()
    builder.buildWeeklyTask(Constants.REPORT_UTILIZATION, Constants.CAT, new SimpleDateFormat("yyyyMMdd").parse("20130717"));
  }
 
  @Test
  public void testMonthlyReport() throws Exception{
    UtilizationReportBuilder builder = lookup(UtilizationReportBuilder.class);
    HostinfoService hostinfoService = lookup(HostinfoService.class);
   
    hostinfoService.initialize();
    builder.buildMonthlyTask(Constants.REPORT_UTILIZATION, Constants.CAT, new SimpleDateFormat("yyyyMMdd").parse("20130701"));
  }

 
 
}
TOP

Related Classes of com.dianping.cat.report.task.utilization.UtilizationBuilderTest

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.