Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
a3aaf246
C
cat
项目概览
梦中观雨
/
cat
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a3aaf246
编写于
5月 08, 2012
作者:
F
Frankie Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
upgrade codegen plugin to 1.0.16
上级
60396544
变更
35
隐藏空白更改
内联
并排
Showing
35 changed file
with
82 addition
and
82 deletion
+82
-82
cat-consumer/pom.xml
cat-consumer/pom.xml
+1
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java
...n/java/com/dianping/cat/consumer/event/EventAnalyzer.java
+2
-2
cat-consumer/src/main/java/com/dianping/cat/consumer/heartbeat/HeartbeatAnalyzer.java
...om/dianping/cat/consumer/heartbeat/HeartbeatAnalyzer.java
+3
-3
cat-consumer/src/main/java/com/dianping/cat/consumer/ip/TopIpAnalyzer.java
...main/java/com/dianping/cat/consumer/ip/TopIpAnalyzer.java
+2
-2
cat-consumer/src/main/java/com/dianping/cat/consumer/problem/ProblemAnalyzer.java
...va/com/dianping/cat/consumer/problem/ProblemAnalyzer.java
+2
-2
cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java
...ianping/cat/consumer/transaction/TransactionAnalyzer.java
+2
-2
cat-consumer/src/test/java/com/dianping/cat/consumer/ip/IpReportTest.java
.../test/java/com/dianping/cat/consumer/ip/IpReportTest.java
+3
-3
cat-consumer/src/test/java/com/dianping/cat/consumer/problem/model/ProblemReportTest.java
...ianping/cat/consumer/problem/model/ProblemReportTest.java
+3
-3
cat-consumer/src/test/java/com/dianping/cat/consumer/transaction/TransactionReportTest.java
...nping/cat/consumer/transaction/TransactionReportTest.java
+3
-3
cat-core/pom.xml
cat-core/pom.xml
+1
-1
cat-core/src/main/java/com/dianping/cat/Cat.java
cat-core/src/main/java/com/dianping/cat/Cat.java
+3
-3
cat-core/src/main/java/com/dianping/cat/configuration/ServerConfigManager.java
...a/com/dianping/cat/configuration/ServerConfigManager.java
+2
-2
cat-core/src/test/java/com/dianping/cat/message/configuration/ClientConfigTest.java
.../dianping/cat/message/configuration/ClientConfigTest.java
+4
-4
cat-core/src/test/java/com/dianping/cat/status/model/StatusInfoTest.java
...st/java/com/dianping/cat/status/model/StatusInfoTest.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/event/HistoricalEventService.java
...g/cat/report/page/model/event/HistoricalEventService.java
+3
-3
cat-home/src/main/java/com/dianping/cat/report/page/model/event/LocalEventService.java
...anping/cat/report/page/model/event/LocalEventService.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/event/RemoteEventService.java
...nping/cat/report/page/model/event/RemoteEventService.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/heartbeat/HistoricalHeartbeatService.java
...port/page/model/heartbeat/HistoricalHeartbeatService.java
+3
-3
cat-home/src/main/java/com/dianping/cat/report/page/model/heartbeat/LocalHeartbeatService.java
...at/report/page/model/heartbeat/LocalHeartbeatService.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/heartbeat/RemoteHeartbeatService.java
...t/report/page/model/heartbeat/RemoteHeartbeatService.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/ip/HistoricalIpService.java
...ianping/cat/report/page/model/ip/HistoricalIpService.java
+3
-3
cat-home/src/main/java/com/dianping/cat/report/page/model/ip/LocalIpService.java
...com/dianping/cat/report/page/model/ip/LocalIpService.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/ip/RemoteIpService.java
...om/dianping/cat/report/page/model/ip/RemoteIpService.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/problem/HistoricalProblemService.java
...t/report/page/model/problem/HistoricalProblemService.java
+3
-3
cat-home/src/main/java/com/dianping/cat/report/page/model/problem/LocalProblemService.java
...ng/cat/report/page/model/problem/LocalProblemService.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/problem/RemoteProblemService.java
...g/cat/report/page/model/problem/RemoteProblemService.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/transaction/HistoricalTransactionService.java
.../page/model/transaction/HistoricalTransactionService.java
+3
-3
cat-home/src/main/java/com/dianping/cat/report/page/model/transaction/LocalTransactionService.java
...eport/page/model/transaction/LocalTransactionService.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/transaction/RemoteTransactionService.java
...port/page/model/transaction/RemoteTransactionService.java
+2
-2
cat-home/src/main/java/com/dianping/cat/servlet/CatServlet.java
...me/src/main/java/com/dianping/cat/servlet/CatServlet.java
+3
-3
cat-home/src/test/java/com/dianping/cat/report/page/model/EventReportFilterTest.java
...dianping/cat/report/page/model/EventReportFilterTest.java
+2
-2
cat-home/src/test/java/com/dianping/cat/report/page/model/TransactionReportFilterTest.java
...ng/cat/report/page/model/TransactionReportFilterTest.java
+2
-2
cat-home/src/test/java/com/dianping/cat/report/page/model/event/EventNameAggregatorTest.java
.../cat/report/page/model/event/EventNameAggregatorTest.java
+2
-2
cat-home/src/test/java/com/dianping/cat/report/page/model/transaction/TransactionNameAggregatorTest.java
...page/model/transaction/TransactionNameAggregatorTest.java
+2
-2
cat-home/src/test/java/com/dianping/cat/report/page/transaction/TransactionReportMergerTest.java
.../report/page/transaction/TransactionReportMergerTest.java
+3
-3
未找到文件。
cat-consumer/pom.xml
浏览文件 @
a3aaf246
...
...
@@ -30,7 +30,7 @@
<plugin>
<groupId>
com.site.maven.plugins
</groupId>
<artifactId>
maven-codegen-plugin
</artifactId>
<version>
1.0.1
5
</version>
<version>
1.0.1
6
</version>
<executions>
<execution>
<id>
generate heartbeat report model
</id>
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventAnalyzer.java
浏览文件 @
a3aaf246
...
...
@@ -18,7 +18,7 @@ import com.dianping.cat.consumer.event.model.entity.EventReport;
import
com.dianping.cat.consumer.event.model.entity.EventType
;
import
com.dianping.cat.consumer.event.model.entity.Range
;
import
com.dianping.cat.consumer.event.model.transform.DefaultXmlBuilder
;
import
com.dianping.cat.consumer.event.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.event.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.hadoop.dal.Report
;
import
com.dianping.cat.hadoop.dal.ReportDao
;
import
com.dianping.cat.message.Event
;
...
...
@@ -83,7 +83,7 @@ public class EventAnalyzer extends AbstractMessageAnalyzer<EventReport> implemen
}
private
void
loadReports
()
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
Bucket
<
String
>
reportBucket
=
null
;
try
{
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/heartbeat/HeartbeatAnalyzer.java
浏览文件 @
a3aaf246
...
...
@@ -17,7 +17,7 @@ import com.dianping.cat.consumer.heartbeat.model.entity.Disk;
import
com.dianping.cat.consumer.heartbeat.model.entity.HeartbeatReport
;
import
com.dianping.cat.consumer.heartbeat.model.entity.Period
;
import
com.dianping.cat.consumer.heartbeat.model.transform.DefaultXmlBuilder
;
import
com.dianping.cat.consumer.heartbeat.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.heartbeat.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.hadoop.dal.Report
;
import
com.dianping.cat.hadoop.dal.ReportDao
;
import
com.dianping.cat.message.Heartbeat
;
...
...
@@ -92,7 +92,7 @@ public class HeartbeatAnalyzer extends AbstractMessageAnalyzer<HeartbeatReport>
StatusInfo
info
=
null
;
try
{
info
=
new
com
.
dianping
.
cat
.
status
.
model
.
transform
.
Default
Xml
Parser
().
parse
(
xml
);
info
=
new
com
.
dianping
.
cat
.
status
.
model
.
transform
.
Default
Dom
Parser
().
parse
(
xml
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
...
...
@@ -172,7 +172,7 @@ public class HeartbeatAnalyzer extends AbstractMessageAnalyzer<HeartbeatReport>
}
private
void
loadReports
()
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
Bucket
<
String
>
reportBucket
=
null
;
try
{
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/ip/TopIpAnalyzer.java
浏览文件 @
a3aaf246
...
...
@@ -17,7 +17,7 @@ import com.dianping.cat.consumer.ip.model.entity.Ip;
import
com.dianping.cat.consumer.ip.model.entity.IpReport
;
import
com.dianping.cat.consumer.ip.model.entity.Period
;
import
com.dianping.cat.consumer.ip.model.transform.DefaultXmlBuilder
;
import
com.dianping.cat.consumer.ip.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.ip.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.hadoop.dal.Report
;
import
com.dianping.cat.hadoop.dal.ReportDao
;
import
com.dianping.cat.message.Event
;
...
...
@@ -87,7 +87,7 @@ public class TopIpAnalyzer extends AbstractMessageAnalyzer<IpReport> implements
}
private
void
loadReports
()
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
Bucket
<
String
>
reportBucket
=
null
;
try
{
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/problem/ProblemAnalyzer.java
浏览文件 @
a3aaf246
...
...
@@ -18,7 +18,7 @@ import com.dianping.cat.consumer.problem.model.entity.Machine;
import
com.dianping.cat.consumer.problem.model.entity.ProblemReport
;
import
com.dianping.cat.consumer.problem.model.entity.Segment
;
import
com.dianping.cat.consumer.problem.model.transform.DefaultXmlBuilder
;
import
com.dianping.cat.consumer.problem.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.problem.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.hadoop.dal.Report
;
import
com.dianping.cat.hadoop.dal.ReportDao
;
import
com.dianping.cat.message.Message
;
...
...
@@ -117,7 +117,7 @@ public class ProblemAnalyzer extends AbstractMessageAnalyzer<ProblemReport> impl
}
private
void
loadReports
()
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
Bucket
<
String
>
bucket
=
null
;
try
{
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java
浏览文件 @
a3aaf246
...
...
@@ -19,7 +19,7 @@ import com.dianping.cat.consumer.transaction.model.entity.TransactionName;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionReport
;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionType
;
import
com.dianping.cat.consumer.transaction.model.transform.DefaultXmlBuilder
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.hadoop.dal.Report
;
import
com.dianping.cat.hadoop.dal.ReportDao
;
import
com.dianping.cat.message.Message
;
...
...
@@ -86,7 +86,7 @@ public class TransactionAnalyzer extends AbstractMessageAnalyzer<TransactionRepo
}
private
void
loadReports
()
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
Bucket
<
String
>
bucket
=
null
;
try
{
...
...
cat-consumer/src/test/java/com/dianping/cat/consumer/ip/IpReportTest.java
浏览文件 @
a3aaf246
...
...
@@ -6,13 +6,13 @@ import org.junit.Test;
import
com.dianping.cat.consumer.ip.model.entity.IpReport
;
import
com.dianping.cat.consumer.ip.model.transform.DefaultJsonBuilder
;
import
com.dianping.cat.consumer.ip.model.transform.DefaultXmlBuilder
;
import
com.dianping.cat.consumer.ip.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.ip.model.transform.Default
Dom
Parser
;
import
com.site.helper.Files
;
public
class
IpReportTest
{
@Test
public
void
testXml
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"IpReport.xml"
),
"utf-8"
);
IpReport
report
=
parser
.
parse
(
source
);
String
xml
=
new
DefaultXmlBuilder
().
buildXml
(
report
);
...
...
@@ -23,7 +23,7 @@ public class IpReportTest {
@Test
public
void
testJson
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"IpReport.xml"
),
"utf-8"
);
IpReport
report
=
parser
.
parse
(
source
);
String
json
=
new
DefaultJsonBuilder
().
buildJson
(
report
);
...
...
cat-consumer/src/test/java/com/dianping/cat/consumer/problem/model/ProblemReportTest.java
浏览文件 @
a3aaf246
...
...
@@ -6,13 +6,13 @@ import org.junit.Test;
import
com.dianping.cat.consumer.problem.model.entity.ProblemReport
;
import
com.dianping.cat.consumer.problem.model.transform.DefaultJsonBuilder
;
import
com.dianping.cat.consumer.problem.model.transform.DefaultXmlBuilder
;
import
com.dianping.cat.consumer.problem.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.problem.model.transform.Default
Dom
Parser
;
import
com.site.helper.Files
;
public
class
ProblemReportTest
{
@Test
public
void
testXml
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"problem-report.xml"
),
"utf-8"
);
ProblemReport
root
=
parser
.
parse
(
source
);
String
xml
=
new
DefaultXmlBuilder
().
buildXml
(
root
);
...
...
@@ -23,7 +23,7 @@ public class ProblemReportTest {
@Test
public
void
testJson
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"problem-report.xml"
),
"utf-8"
);
ProblemReport
root
=
parser
.
parse
(
source
);
String
json
=
new
DefaultJsonBuilder
().
buildJson
(
root
);
...
...
cat-consumer/src/test/java/com/dianping/cat/consumer/transaction/TransactionReportTest.java
浏览文件 @
a3aaf246
...
...
@@ -6,13 +6,13 @@ import org.junit.Test;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionReport
;
import
com.dianping.cat.consumer.transaction.model.transform.DefaultJsonBuilder
;
import
com.dianping.cat.consumer.transaction.model.transform.DefaultXmlBuilder
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Dom
Parser
;
import
com.site.helper.Files
;
public
class
TransactionReportTest
{
@Test
public
void
testXml
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"TransactionReport.xml"
),
"utf-8"
);
TransactionReport
report
=
parser
.
parse
(
source
);
String
xml
=
new
DefaultXmlBuilder
().
buildXml
(
report
);
...
...
@@ -23,7 +23,7 @@ public class TransactionReportTest {
@Test
public
void
testJson
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"TransactionReport.xml"
),
"utf-8"
);
TransactionReport
report
=
parser
.
parse
(
source
);
String
json
=
new
DefaultJsonBuilder
().
buildJson
(
report
);
...
...
cat-core/pom.xml
浏览文件 @
a3aaf246
...
...
@@ -39,7 +39,7 @@
<plugin>
<groupId>
com.site.maven.plugins
</groupId>
<artifactId>
maven-codegen-plugin
</artifactId>
<version>
1.0.1
5
</version>
<version>
1.0.1
6
</version>
<executions>
<execution>
<id>
generate configuration model
</id>
...
...
cat-core/src/main/java/com/dianping/cat/Cat.java
浏览文件 @
a3aaf246
...
...
@@ -14,7 +14,7 @@ import org.codehaus.plexus.logging.Logger;
import
com.dianping.cat.configuration.ClientConfigMerger
;
import
com.dianping.cat.configuration.ClientConfigValidator
;
import
com.dianping.cat.configuration.client.entity.ClientConfig
;
import
com.dianping.cat.configuration.client.transform.Default
Xml
Parser
;
import
com.dianping.cat.configuration.client.transform.Default
Dom
Parser
;
import
com.dianping.cat.message.MessageProducer
;
import
com.dianping.cat.message.spi.MessageManager
;
import
com.site.helper.Files
;
...
...
@@ -123,7 +123,7 @@ public class Cat {
if
(
configFile
.
exists
())
{
String
xml
=
Files
.
forIO
().
readFrom
(
configFile
.
getCanonicalFile
(),
"utf-8"
);
globalConfig
=
new
Default
Xml
Parser
().
parse
(
xml
);
globalConfig
=
new
Default
Dom
Parser
().
parse
(
xml
);
}
else
{
s_instance
.
m_logger
.
warn
(
String
.
format
(
"Global config file(%s) not found, IGNORED."
,
configFile
));
}
...
...
@@ -140,7 +140,7 @@ public class Cat {
if
(
in
!=
null
)
{
String
xml
=
Files
.
forIO
().
readFrom
(
in
,
"utf-8"
);
clientConfig
=
new
Default
Xml
Parser
().
parse
(
xml
);
clientConfig
=
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
}
catch
(
Exception
e
)
{
...
...
cat-core/src/main/java/com/dianping/cat/configuration/ServerConfigManager.java
浏览文件 @
a3aaf246
...
...
@@ -17,7 +17,7 @@ import com.dianping.cat.configuration.server.entity.LongUrl;
import
com.dianping.cat.configuration.server.entity.Property
;
import
com.dianping.cat.configuration.server.entity.ServerConfig
;
import
com.dianping.cat.configuration.server.entity.StorageConfig
;
import
com.dianping.cat.configuration.server.transform.Default
Xml
Parser
;
import
com.dianping.cat.configuration.server.transform.Default
Dom
Parser
;
import
com.site.helper.Files
;
import
com.site.helper.Threads
;
import
com.site.helper.Threads.Task
;
...
...
@@ -167,7 +167,7 @@ public class ServerConfigManager implements LogEnabled {
m_logger
.
info
(
String
.
format
(
"Loading configuration file(%s) ..."
,
configFile
.
getCanonicalPath
()));
String
xml
=
Files
.
forIO
().
readFrom
(
configFile
,
"utf-8"
);
ServerConfig
config
=
new
Default
Xml
Parser
().
parse
(
xml
);
ServerConfig
config
=
new
Default
Dom
Parser
().
parse
(
xml
);
// do validation
config
.
accept
(
new
ServerConfigValidator
());
...
...
cat-core/src/test/java/com/dianping/cat/message/configuration/ClientConfigTest.java
浏览文件 @
a3aaf246
...
...
@@ -21,7 +21,7 @@ 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.DefaultXmlBuilder
;
import
com.dianping.cat.configuration.client.transform.Default
Xml
Parser
;
import
com.dianping.cat.configuration.client.transform.Default
Dom
Parser
;
import
com.site.helper.Files
;
public
class
ClientConfigTest
{
...
...
@@ -51,14 +51,14 @@ public class ClientConfigTest {
private
ClientConfig
loadConfig
(
String
configXml
)
throws
IOException
,
SAXException
{
InputStream
in
=
getClass
().
getResourceAsStream
(
configXml
);
String
xml
=
Files
.
forIO
().
readFrom
(
in
,
"utf-8"
);
ClientConfig
clientConfig
=
new
Default
Xml
Parser
().
parse
(
xml
);
ClientConfig
clientConfig
=
new
Default
Dom
Parser
().
parse
(
xml
);
return
clientConfig
;
}
@Test
public
void
testConfig
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"config.xml"
),
"utf-8"
);
ClientConfig
root
=
parser
.
parse
(
source
);
String
xml
=
new
DefaultXmlBuilder
().
buildXml
(
root
);
...
...
@@ -91,7 +91,7 @@ public class ClientConfigTest {
public
void
testServer
()
throws
Exception
{
InputStream
in
=
getClass
().
getResourceAsStream
(
"server.xml"
);
String
xml
=
Files
.
forIO
().
readFrom
(
in
,
"utf-8"
);
ClientConfig
config
=
new
Default
Xml
Parser
().
parse
(
xml
);
ClientConfig
config
=
new
Default
Dom
Parser
().
parse
(
xml
);
Assert
.
assertEquals
(
"server"
,
config
.
getMode
());
Assert
.
assertEquals
(
"192.168.8.21"
,
config
.
getBind
().
getIp
());
...
...
cat-core/src/test/java/com/dianping/cat/status/model/StatusInfoTest.java
浏览文件 @
a3aaf246
...
...
@@ -5,13 +5,13 @@ import org.junit.Test;
import
com.dianping.cat.status.model.entity.StatusInfo
;
import
com.dianping.cat.status.model.transform.DefaultXmlBuilder
;
import
com.dianping.cat.status.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.status.model.transform.Default
Dom
Parser
;
import
com.site.helper.Files
;
public
class
StatusInfoTest
{
@Test
public
void
testXml
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"status.xml"
),
"utf-8"
);
StatusInfo
root
=
parser
.
parse
(
source
);
String
xml
=
new
DefaultXmlBuilder
().
buildXml
(
root
);
...
...
cat-home/src/main/java/com/dianping/cat/report/page/model/event/HistoricalEventService.java
浏览文件 @
a3aaf246
...
...
@@ -4,7 +4,7 @@ import java.util.Date;
import
java.util.List
;
import
com.dianping.cat.consumer.event.model.entity.EventReport
;
import
com.dianping.cat.consumer.event.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.event.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.hadoop.dal.Report
;
import
com.dianping.cat.hadoop.dal.ReportDao
;
import
com.dianping.cat.hadoop.dal.ReportEntity
;
...
...
@@ -43,7 +43,7 @@ public class HistoricalEventService extends BaseHistoricalModelService<EventRepo
private
EventReport
getReportFromDatabase
(
long
timestamp
,
String
domain
)
throws
Exception
{
List
<
Report
>
reports
=
m_reportDao
.
findAllByPeriodDomainTypeName
(
new
Date
(
timestamp
),
domain
,
1
,
getName
(),
ReportEntity
.
READSET_FULL
);
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
EventReportMerger
merger
=
null
;
for
(
Report
report
:
reports
)
{
...
...
@@ -64,6 +64,6 @@ public class HistoricalEventService extends BaseHistoricalModelService<EventRepo
Bucket
<
String
>
bucket
=
m_bucketManager
.
getReportBucket
(
timestamp
,
"event"
);
String
xml
=
bucket
.
findById
(
domain
);
return
xml
==
null
?
null
:
new
Default
Xml
Parser
().
parse
(
xml
);
return
xml
==
null
?
null
:
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/event/LocalEventService.java
浏览文件 @
a3aaf246
package
com.dianping.cat.report.page.model.event
;
import
com.dianping.cat.consumer.event.model.entity.EventReport
;
import
com.dianping.cat.consumer.event.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.event.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.spi.ModelPeriod
;
import
com.dianping.cat.report.page.model.spi.ModelRequest
;
import
com.dianping.cat.report.page.model.spi.internal.BaseLocalModelService
;
...
...
@@ -35,6 +35,6 @@ public class LocalEventService extends BaseLocalModelService<EventReport> {
Bucket
<
String
>
bucket
=
m_bucketManager
.
getReportBucket
(
timestamp
,
"event"
);
String
xml
=
bucket
.
findById
(
domain
);
return
xml
==
null
?
null
:
new
Default
Xml
Parser
().
parse
(
xml
);
return
xml
==
null
?
null
:
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/event/RemoteEventService.java
浏览文件 @
a3aaf246
...
...
@@ -5,7 +5,7 @@ import java.io.IOException;
import
org.xml.sax.SAXException
;
import
com.dianping.cat.consumer.event.model.entity.EventReport
;
import
com.dianping.cat.consumer.event.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.event.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.spi.internal.BaseRemoteModelService
;
public
class
RemoteEventService
extends
BaseRemoteModelService
<
EventReport
>
{
...
...
@@ -15,6 +15,6 @@ public class RemoteEventService extends BaseRemoteModelService<EventReport> {
@Override
protected
EventReport
buildModel
(
String
xml
)
throws
SAXException
,
IOException
{
return
new
Default
Xml
Parser
().
parse
(
xml
);
return
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/heartbeat/HistoricalHeartbeatService.java
浏览文件 @
a3aaf246
...
...
@@ -5,7 +5,7 @@ import java.util.List;
import
com.dianping.cat.consumer.heartbeat.model.entity.HeartbeatReport
;
import
com.dianping.cat.consumer.heartbeat.model.transform.DefaultMerger
;
import
com.dianping.cat.consumer.heartbeat.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.heartbeat.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.hadoop.dal.Report
;
import
com.dianping.cat.hadoop.dal.ReportDao
;
import
com.dianping.cat.hadoop.dal.ReportEntity
;
...
...
@@ -44,7 +44,7 @@ public class HistoricalHeartbeatService extends BaseHistoricalModelService<Heart
private
HeartbeatReport
getReportFromDatabase
(
long
timestamp
,
String
domain
)
throws
Exception
{
List
<
Report
>
reports
=
m_reportDao
.
findAllByPeriodDomainTypeName
(
new
Date
(
timestamp
),
domain
,
1
,
getName
(),
ReportEntity
.
READSET_FULL
);
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
DefaultMerger
merger
=
null
;
for
(
Report
report
:
reports
)
{
...
...
@@ -65,6 +65,6 @@ public class HistoricalHeartbeatService extends BaseHistoricalModelService<Heart
Bucket
<
String
>
bucket
=
m_bucketManager
.
getReportBucket
(
timestamp
,
"heartbeat"
);
String
xml
=
bucket
.
findById
(
domain
);
return
xml
==
null
?
null
:
new
Default
Xml
Parser
().
parse
(
xml
);
return
xml
==
null
?
null
:
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/heartbeat/LocalHeartbeatService.java
浏览文件 @
a3aaf246
package
com.dianping.cat.report.page.model.heartbeat
;
import
com.dianping.cat.consumer.heartbeat.model.entity.HeartbeatReport
;
import
com.dianping.cat.consumer.heartbeat.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.heartbeat.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.spi.ModelPeriod
;
import
com.dianping.cat.report.page.model.spi.ModelRequest
;
import
com.dianping.cat.report.page.model.spi.internal.BaseLocalModelService
;
...
...
@@ -35,6 +35,6 @@ public class LocalHeartbeatService extends BaseLocalModelService<HeartbeatReport
Bucket
<
String
>
bucket
=
m_bucketManager
.
getReportBucket
(
timestamp
,
"heartbeat"
);
String
xml
=
bucket
.
findById
(
domain
);
return
xml
==
null
?
null
:
new
Default
Xml
Parser
().
parse
(
xml
);
return
xml
==
null
?
null
:
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/heartbeat/RemoteHeartbeatService.java
浏览文件 @
a3aaf246
...
...
@@ -5,7 +5,7 @@ import java.io.IOException;
import
org.xml.sax.SAXException
;
import
com.dianping.cat.consumer.heartbeat.model.entity.HeartbeatReport
;
import
com.dianping.cat.consumer.heartbeat.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.heartbeat.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.spi.internal.BaseRemoteModelService
;
public
class
RemoteHeartbeatService
extends
BaseRemoteModelService
<
HeartbeatReport
>
{
...
...
@@ -15,6 +15,6 @@ public class RemoteHeartbeatService extends BaseRemoteModelService<HeartbeatRepo
@Override
protected
HeartbeatReport
buildModel
(
String
xml
)
throws
SAXException
,
IOException
{
return
new
Default
Xml
Parser
().
parse
(
xml
);
return
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/ip/HistoricalIpService.java
浏览文件 @
a3aaf246
...
...
@@ -4,7 +4,7 @@ import java.util.Date;
import
java.util.List
;
import
com.dianping.cat.consumer.ip.model.entity.IpReport
;
import
com.dianping.cat.consumer.ip.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.ip.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.hadoop.dal.Report
;
import
com.dianping.cat.hadoop.dal.ReportDao
;
import
com.dianping.cat.hadoop.dal.ReportEntity
;
...
...
@@ -43,7 +43,7 @@ public class HistoricalIpService extends BaseHistoricalModelService<IpReport> {
private
IpReport
getReportFromDatabase
(
long
timestamp
,
String
domain
)
throws
Exception
{
List
<
Report
>
reports
=
m_reportDao
.
findAllByPeriodDomainTypeName
(
new
Date
(
timestamp
),
domain
,
1
,
getName
(),
ReportEntity
.
READSET_FULL
);
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
IpReportMerger
merger
=
null
;
for
(
Report
report
:
reports
)
{
...
...
@@ -64,6 +64,6 @@ public class HistoricalIpService extends BaseHistoricalModelService<IpReport> {
Bucket
<
String
>
bucket
=
m_bucketManager
.
getReportBucket
(
timestamp
,
"ip"
);
String
xml
=
bucket
.
findById
(
domain
);
return
xml
==
null
?
null
:
new
Default
Xml
Parser
().
parse
(
xml
);
return
xml
==
null
?
null
:
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/ip/LocalIpService.java
浏览文件 @
a3aaf246
package
com.dianping.cat.report.page.model.ip
;
import
com.dianping.cat.consumer.ip.model.entity.IpReport
;
import
com.dianping.cat.consumer.ip.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.ip.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.spi.ModelPeriod
;
import
com.dianping.cat.report.page.model.spi.ModelRequest
;
import
com.dianping.cat.report.page.model.spi.internal.BaseLocalModelService
;
...
...
@@ -34,6 +34,6 @@ public class LocalIpService extends BaseLocalModelService<IpReport> {
Bucket
<
String
>
bucket
=
m_bucketManager
.
getReportBucket
(
timestamp
,
"ip"
);
String
xml
=
bucket
.
findById
(
domain
);
return
xml
==
null
?
null
:
new
Default
Xml
Parser
().
parse
(
xml
);
return
xml
==
null
?
null
:
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/ip/RemoteIpService.java
浏览文件 @
a3aaf246
...
...
@@ -5,7 +5,7 @@ import java.io.IOException;
import
org.xml.sax.SAXException
;
import
com.dianping.cat.consumer.ip.model.entity.IpReport
;
import
com.dianping.cat.consumer.ip.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.ip.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.spi.internal.BaseRemoteModelService
;
public
class
RemoteIpService
extends
BaseRemoteModelService
<
IpReport
>
{
...
...
@@ -15,6 +15,6 @@ public class RemoteIpService extends BaseRemoteModelService<IpReport> {
@Override
protected
IpReport
buildModel
(
String
xml
)
throws
SAXException
,
IOException
{
return
new
Default
Xml
Parser
().
parse
(
xml
);
return
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/problem/HistoricalProblemService.java
浏览文件 @
a3aaf246
...
...
@@ -5,7 +5,7 @@ import java.util.List;
import
com.dianping.cat.consumer.problem.model.entity.ProblemReport
;
import
com.dianping.cat.consumer.problem.model.transform.DefaultMerger
;
import
com.dianping.cat.consumer.problem.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.problem.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.hadoop.dal.Report
;
import
com.dianping.cat.hadoop.dal.ReportDao
;
import
com.dianping.cat.hadoop.dal.ReportEntity
;
...
...
@@ -44,7 +44,7 @@ public class HistoricalProblemService extends BaseHistoricalModelService<Problem
private
ProblemReport
getReportFromDatabase
(
long
timestamp
,
String
domain
)
throws
Exception
{
List
<
Report
>
reports
=
m_reportDao
.
findAllByPeriodDomainTypeName
(
new
Date
(
timestamp
),
domain
,
1
,
getName
(),
ReportEntity
.
READSET_FULL
);
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
DefaultMerger
merger
=
null
;
for
(
Report
report
:
reports
)
{
...
...
@@ -65,6 +65,6 @@ public class HistoricalProblemService extends BaseHistoricalModelService<Problem
Bucket
<
String
>
bucket
=
m_bucketManager
.
getReportBucket
(
timestamp
,
"problem"
);
String
xml
=
bucket
.
findById
(
domain
);
return
xml
==
null
?
null
:
new
Default
Xml
Parser
().
parse
(
xml
);
return
xml
==
null
?
null
:
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/problem/LocalProblemService.java
浏览文件 @
a3aaf246
package
com.dianping.cat.report.page.model.problem
;
import
com.dianping.cat.consumer.problem.model.entity.ProblemReport
;
import
com.dianping.cat.consumer.problem.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.problem.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.spi.ModelPeriod
;
import
com.dianping.cat.report.page.model.spi.ModelRequest
;
import
com.dianping.cat.report.page.model.spi.internal.BaseLocalModelService
;
...
...
@@ -35,6 +35,6 @@ public class LocalProblemService extends BaseLocalModelService<ProblemReport> {
Bucket
<
String
>
bucket
=
m_bucketManager
.
getReportBucket
(
timestamp
,
"problem"
);
String
xml
=
bucket
.
findById
(
domain
);
return
xml
==
null
?
null
:
new
Default
Xml
Parser
().
parse
(
xml
);
return
xml
==
null
?
null
:
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/problem/RemoteProblemService.java
浏览文件 @
a3aaf246
...
...
@@ -5,7 +5,7 @@ import java.io.IOException;
import
org.xml.sax.SAXException
;
import
com.dianping.cat.consumer.problem.model.entity.ProblemReport
;
import
com.dianping.cat.consumer.problem.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.problem.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.spi.internal.BaseRemoteModelService
;
public
class
RemoteProblemService
extends
BaseRemoteModelService
<
ProblemReport
>
{
...
...
@@ -15,6 +15,6 @@ public class RemoteProblemService extends BaseRemoteModelService<ProblemReport>
@Override
protected
ProblemReport
buildModel
(
String
xml
)
throws
SAXException
,
IOException
{
return
new
Default
Xml
Parser
().
parse
(
xml
);
return
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/transaction/HistoricalTransactionService.java
浏览文件 @
a3aaf246
...
...
@@ -4,7 +4,7 @@ import java.util.Date;
import
java.util.List
;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionReport
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.hadoop.dal.Report
;
import
com.dianping.cat.hadoop.dal.ReportDao
;
import
com.dianping.cat.hadoop.dal.ReportEntity
;
...
...
@@ -43,7 +43,7 @@ public class HistoricalTransactionService extends BaseHistoricalModelService<Tra
private
TransactionReport
getReportFromDatabase
(
long
timestamp
,
String
domain
)
throws
Exception
{
List
<
Report
>
reports
=
m_reportDao
.
findAllByPeriodDomainTypeName
(
new
Date
(
timestamp
),
domain
,
1
,
getName
(),
ReportEntity
.
READSET_FULL
);
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
TransactionReportMerger
merger
=
null
;
for
(
Report
report
:
reports
)
{
...
...
@@ -64,6 +64,6 @@ public class HistoricalTransactionService extends BaseHistoricalModelService<Tra
Bucket
<
String
>
bucket
=
m_bucketManager
.
getReportBucket
(
timestamp
,
"transaction"
);
String
xml
=
bucket
.
findById
(
domain
);
return
xml
==
null
?
null
:
new
Default
Xml
Parser
().
parse
(
xml
);
return
xml
==
null
?
null
:
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/transaction/LocalTransactionService.java
浏览文件 @
a3aaf246
package
com.dianping.cat.report.page.model.transaction
;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionReport
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.spi.ModelPeriod
;
import
com.dianping.cat.report.page.model.spi.ModelRequest
;
import
com.dianping.cat.report.page.model.spi.internal.BaseLocalModelService
;
...
...
@@ -35,6 +35,6 @@ public class LocalTransactionService extends BaseLocalModelService<TransactionRe
Bucket
<
String
>
bucket
=
m_bucketManager
.
getReportBucket
(
timestamp
,
"transaction"
);
String
xml
=
bucket
.
findById
(
domain
);
return
xml
==
null
?
null
:
new
Default
Xml
Parser
().
parse
(
xml
);
return
xml
==
null
?
null
:
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/model/transaction/RemoteTransactionService.java
浏览文件 @
a3aaf246
...
...
@@ -5,7 +5,7 @@ import java.io.IOException;
import
org.xml.sax.SAXException
;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionReport
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.spi.internal.BaseRemoteModelService
;
public
class
RemoteTransactionService
extends
BaseRemoteModelService
<
TransactionReport
>
{
...
...
@@ -15,6 +15,6 @@ public class RemoteTransactionService extends BaseRemoteModelService<Transaction
@Override
protected
TransactionReport
buildModel
(
String
xml
)
throws
SAXException
,
IOException
{
return
new
Default
Xml
Parser
().
parse
(
xml
);
return
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
cat-home/src/main/java/com/dianping/cat/servlet/CatServlet.java
浏览文件 @
a3aaf246
...
...
@@ -14,7 +14,7 @@ import javax.servlet.http.HttpServletResponse;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.configuration.ServerConfigManager
;
import
com.dianping.cat.configuration.client.entity.ClientConfig
;
import
com.dianping.cat.configuration.client.transform.Default
Xml
Parser
;
import
com.dianping.cat.configuration.client.transform.Default
Dom
Parser
;
import
com.dianping.cat.message.spi.MessageHandler
;
import
com.dianping.cat.message.spi.MessageManager
;
import
com.dianping.cat.message.spi.internal.DefaultMessageHandler
;
...
...
@@ -70,7 +70,7 @@ public class CatServlet extends AbstractContainerServlet {
if
(
configFile
!=
null
)
{
String
xml
=
Files
.
forIO
().
readFrom
(
new
File
(
configFile
).
getCanonicalFile
(),
"utf-8"
);
config
=
new
Default
Xml
Parser
().
parse
(
xml
);
config
=
new
Default
Dom
Parser
().
parse
(
xml
);
}
if
(
config
==
null
)
{
...
...
@@ -83,7 +83,7 @@ public class CatServlet extends AbstractContainerServlet {
if
(
in
!=
null
)
{
String
xml
=
Files
.
forIO
().
readFrom
(
in
,
"utf-8"
);
config
=
new
Default
Xml
Parser
().
parse
(
xml
);
config
=
new
Default
Dom
Parser
().
parse
(
xml
);
}
}
}
catch
(
Exception
e
)
{
...
...
cat-home/src/test/java/com/dianping/cat/report/page/model/EventReportFilterTest.java
浏览文件 @
a3aaf246
...
...
@@ -5,14 +5,14 @@ import junit.framework.Assert;
import
org.junit.Test
;
import
com.dianping.cat.consumer.event.model.entity.EventReport
;
import
com.dianping.cat.consumer.event.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.event.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.Handler.EventReportFilter
;
import
com.site.helper.Files
;
public
class
EventReportFilterTest
{
@Test
public
void
test
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"event.xml"
),
"utf-8"
);
EventReport
report
=
parser
.
parse
(
source
);
...
...
cat-home/src/test/java/com/dianping/cat/report/page/model/TransactionReportFilterTest.java
浏览文件 @
a3aaf246
...
...
@@ -5,14 +5,14 @@ import junit.framework.Assert;
import
org.junit.Test
;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionReport
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.Handler.TransactionReportFilter
;
import
com.site.helper.Files
;
public
class
TransactionReportFilterTest
{
@Test
public
void
test
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"transaction.xml"
),
"utf-8"
);
TransactionReport
report
=
parser
.
parse
(
source
);
...
...
cat-home/src/test/java/com/dianping/cat/report/page/model/event/EventNameAggregatorTest.java
浏览文件 @
a3aaf246
...
...
@@ -5,13 +5,13 @@ import org.junit.Test;
import
com.dianping.cat.consumer.event.model.entity.EventName
;
import
com.dianping.cat.consumer.event.model.entity.EventReport
;
import
com.dianping.cat.consumer.event.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.event.model.transform.Default
Dom
Parser
;
import
com.site.helper.Files
;
public
class
EventNameAggregatorTest
{
@Test
public
void
test
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"event.xml"
),
"utf-8"
);
EventReport
report
=
parser
.
parse
(
source
);
String
expected
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"event-names.xml"
),
"utf-8"
);
...
...
cat-home/src/test/java/com/dianping/cat/report/page/model/transaction/TransactionNameAggregatorTest.java
浏览文件 @
a3aaf246
...
...
@@ -5,13 +5,13 @@ import org.junit.Test;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionName
;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionReport
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Dom
Parser
;
import
com.site.helper.Files
;
public
class
TransactionNameAggregatorTest
{
@Test
public
void
test
()
throws
Exception
{
Default
XmlParser
parser
=
new
DefaultXml
Parser
();
Default
DomParser
parser
=
new
DefaultDom
Parser
();
String
source
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"transaction.xml"
),
"utf-8"
);
TransactionReport
report
=
parser
.
parse
(
source
);
String
expected
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"transaction-names.xml"
),
"utf-8"
);
...
...
cat-home/src/test/java/com/dianping/cat/report/page/transaction/TransactionReportMergerTest.java
浏览文件 @
a3aaf246
...
...
@@ -6,7 +6,7 @@ import org.unidal.webres.helper.Files;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionReport
;
import
com.dianping.cat.consumer.transaction.model.transform.DefaultXmlBuilder
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Xml
Parser
;
import
com.dianping.cat.consumer.transaction.model.transform.Default
Dom
Parser
;
import
com.dianping.cat.report.page.model.transaction.TransactionReportMerger
;
public
class
TransactionReportMergerTest
{
...
...
@@ -14,8 +14,8 @@ public class TransactionReportMergerTest {
public
void
testTransactionReportMerge
()
throws
Exception
{
String
oldXml
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"TransactionReportOld.xml"
),
"utf-8"
);
String
newXml
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"TransactionReportNew.xml"
),
"utf-8"
);
TransactionReport
reportOld
=
new
Default
Xml
Parser
().
parse
(
oldXml
);
TransactionReport
reportNew
=
new
Default
Xml
Parser
().
parse
(
newXml
);
TransactionReport
reportOld
=
new
Default
Dom
Parser
().
parse
(
oldXml
);
TransactionReport
reportNew
=
new
Default
Dom
Parser
().
parse
(
newXml
);
String
expected
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"TransactionReportMergeResult.xml"
),
"utf-8"
);
TransactionReportMerger
merger
=
new
TransactionReportMerger
(
reportOld
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录