From 21be702a4e479a0e6ebcd3922c513ced59a7f5fd Mon Sep 17 00:00:00 2001 From: "yong.you" Date: Thu, 28 Nov 2013 18:35:22 +0800 Subject: [PATCH] remove unused testcase --- .../test/java/com/dianping/cat/AllTests.java | 2 -- .../cat/configuration/ConfigTest.java | 26 ------------------- .../task/heavy/HeavyReportBuilderTest.java | 21 +-------------- 3 files changed, 1 insertion(+), 48 deletions(-) diff --git a/cat-client/src/test/java/com/dianping/cat/AllTests.java b/cat-client/src/test/java/com/dianping/cat/AllTests.java index 7228b9061..003f3a928 100644 --- a/cat-client/src/test/java/com/dianping/cat/AllTests.java +++ b/cat-client/src/test/java/com/dianping/cat/AllTests.java @@ -56,8 +56,6 @@ ConfigTest.class, /* .internal */ MessageIdFactoryTest.class, -MillisSecondTimerTest.class, - MockMessageBuilderTest.class, /* .spi.codec */ diff --git a/cat-client/src/test/java/com/dianping/cat/configuration/ConfigTest.java b/cat-client/src/test/java/com/dianping/cat/configuration/ConfigTest.java index f317adb3d..535d580da 100644 --- a/cat-client/src/test/java/com/dianping/cat/configuration/ConfigTest.java +++ b/cat-client/src/test/java/com/dianping/cat/configuration/ConfigTest.java @@ -4,19 +4,12 @@ import java.io.IOException; import java.io.InputStream; import java.util.List; -import javax.xml.transform.stream.StreamSource; -import javax.xml.validation.Schema; -import javax.xml.validation.SchemaFactory; -import javax.xml.validation.Validator; - import junit.framework.Assert; -import org.junit.Ignore; import org.junit.Test; import org.unidal.helper.Files; import org.xml.sax.SAXException; -import com.dianping.cat.configuration.client.IEntity; import com.dianping.cat.configuration.client.entity.ClientConfig; import com.dianping.cat.configuration.client.entity.Server; import com.dianping.cat.configuration.client.transform.DefaultSaxParser; @@ -64,23 +57,4 @@ public class ConfigTest { Assert.assertEquals("XML is not well parsed!", expected.replace("\r", ""), xml.replace("\r", "")); } - @Test - @Ignore - public void testSchema() throws Exception { - // define the type of schema - we use W3C: - String schemaLang = "http://www.w3.org/2001/XMLSchema"; - - // get validation driver: - SchemaFactory factory = SchemaFactory.newInstance(schemaLang); - - // create schema by reading it from an XSD file: - String path = "/" + IEntity.class.getPackage().getName().replace('.', '/'); - Schema schema = factory.newSchema(new StreamSource(getClass().getResourceAsStream(path + "/config.xsd"))); - Validator validator = schema.newValidator(); - - // at last perform validation: - validator.validate(new StreamSource(getClass().getResourceAsStream("client.xml"))); - validator.validate(new StreamSource(getClass().getResourceAsStream("server.xml"))); - validator.validate(new StreamSource(getClass().getResourceAsStream("config.xml"))); - } } diff --git a/cat-home/src/test/java/com/dianping/cat/report/task/heavy/HeavyReportBuilderTest.java b/cat-home/src/test/java/com/dianping/cat/report/task/heavy/HeavyReportBuilderTest.java index 6c8d1945e..b06113885 100644 --- a/cat-home/src/test/java/com/dianping/cat/report/task/heavy/HeavyReportBuilderTest.java +++ b/cat-home/src/test/java/com/dianping/cat/report/task/heavy/HeavyReportBuilderTest.java @@ -1,34 +1,15 @@ package com.dianping.cat.report.task.heavy; -import java.text.SimpleDateFormat; -import java.util.Date; - import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; -import org.unidal.lookup.ComponentTestCase; import org.unidal.helper.Files; +import org.unidal.lookup.ComponentTestCase; -import com.dianping.cat.Constants; -import com.dianping.cat.helper.TimeUtil; import com.dianping.cat.home.heavy.entity.HeavyReport; import com.dianping.cat.home.heavy.transform.DefaultSaxParser; public class HeavyReportBuilderTest extends ComponentTestCase { - @Test - @Ignore - public void test() throws Exception { - HeavyReportBuilder builder = lookup(HeavyReportBuilder.class); - Date date = new SimpleDateFormat("yyyyMMddHH").parse("2013082600"); - for (int i = 0; i < 24; i++) { - Date current = new Date(date.getTime() + TimeUtil.ONE_HOUR * i); - builder.buildHourlyTask(Constants.REPORT_HEAVY, Constants.CAT, current); - } - - builder.buildDailyTask(Constants.REPORT_HEAVY, Constants.CAT, date); - } - @Test public void testMerge() throws Exception { String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("old.xml"), "utf-8"); -- GitLab