forked from fanruan/design
Browse Source
* 'feature/10.0' of http://cloud.finedevelop.com:2015/scm/~xiaoxia/design: REPORT-16456 【10.0.3埋点-模板】远程设计不生效 REPORT-16494 模板信息收集, 设计器启动有报错=>调整代码 REPORT-16494 模板信息收集, 设计器启动有报错=>调整代码 REPORT-16494 模板信息收集, 设计器启动有报错research/10.0
XiaXiang
6 years ago
3 changed files with 42 additions and 8 deletions
@ -0,0 +1,35 @@ |
|||||||
|
package com.fr.design.mainframe.template.info; |
||||||
|
|
||||||
|
import com.fr.invoke.Reflect; |
||||||
|
import com.fr.stable.xml.XMLableReader; |
||||||
|
import com.fr.third.javax.xml.stream.XMLStreamException; |
||||||
|
|
||||||
|
import java.io.StringReader; |
||||||
|
|
||||||
|
import static org.junit.Assert.assertTrue; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by plough on 2019/4/25. |
||||||
|
*/ |
||||||
|
public class SendHelperTest { |
||||||
|
private static final String CONSUMING_URL = "http://cloud.fanruan.com/api/monitor/record_of_reports_consuming/single"; |
||||||
|
private static final String PROCESS_URL = "http://cloud.fanruan.com/api/monitor/record_of_reports_process/single"; |
||||||
|
|
||||||
|
private static final String NORMAL_INFO = "<TemplateInfo templateID=\"16a988ce-8529-42f5-b17c-2ee849355071\" day_count=\"9\">\n" + |
||||||
|
"<processMap process=\"\" float_count=\"0\" widget_count=\"0\" cell_count=\"1\" block_count=\"0\" report_type=\"0\"/>\n" + |
||||||
|
"<consumingMap activitykey=\"2e0ea413-fa9c241e0-9723-4354fce51e81\" jar_time=\"不是安装版本\" create_time=\"2019-03-26 16:13\" uuid=\"476ca2cc-f789-4c5d-8e89-ef146580775c\" time_consume=\"129\" version=\"10.0\" username=\"plough\"/>\n" + |
||||||
|
"</TemplateInfo>"; |
||||||
|
|
||||||
|
// 只在调试的时候运行,不需要每次都自动运行
|
||||||
|
public static void main(String[] args) throws XMLStreamException { |
||||||
|
StringReader sr = new StringReader(NORMAL_INFO); |
||||||
|
XMLableReader xmlReader = XMLableReader.createXMLableReader(sr); |
||||||
|
TemplateInfo templateInfo = TemplateInfo.newInstanceByRead(xmlReader); |
||||||
|
|
||||||
|
boolean res = Reflect.on(SendHelper.class).call("sendSingleTemplateInfo", CONSUMING_URL, templateInfo.getConsumingMapJsonString()).get(); |
||||||
|
assertTrue(res); |
||||||
|
|
||||||
|
boolean res2 = Reflect.on(SendHelper.class).call("sendSingleTemplateInfo", PROCESS_URL, templateInfo.getProcessMapJsonString()).get(); |
||||||
|
assertTrue(res2); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue