This is a created
article in which the information may have evolved or changed.
A task recently was to convert the JUnit XML format report into HTML format using Golang, and then learned the Golang template package.
The tool that is based on template transforming Junit XML
Video address:Http://www.chuanke.com/v1983382-135467-384869.htmlThis content is actually already in use, I in an article robotium-only apk file test has already spoken this content, and oneself also uses Python+wxpython to write the interface program, realizes the run case+ obtains the XML result +xml turns html+ The ability to send mailMain content:First, test requirements1. Statistic the execution time of
The following xml file is the ant execution file that successfully runs the JUnit test and generates the test report after I modify it. First, list the code as a reference, and then introduce some problems that I encountered during the file writing process and make some analysis, hoping to help the learners later.
[Html]
1. What should I do if I want to reference
Follow the steps in this link to automatically generate Ant's Build.xml files for an existing Robotium project: http://xiaomaozi.blog.51cto.com/925779/932284/
Follow the steps in this link to import android-junit-report.jar items and manipulate them according to the links: http://www.xuebuyuan.com/2148574.html
Http://www.tuicool.com/articles/RzayieAdd the following code to the Build.xml file:
target name="Fetch-test-
; Modifying Build.xml filesThe specific code is as follows:
The main concern is the following code section, which needs to correspond with its own project name and class name, package name.
Regressiontest, Regressiontest.classpath, Testdemo, xxx
Pay particular attention to the code of 4> Run Build.xml Generate report
Right-click Build.xml-> Run as-Ant Build ...--Select the desired test name in targets (Build [default] is required on the default tick)
Problem description
JUnit test report No socket available Error
When Eclipse makes JUnit tests, it always pops up no socket available window, causing the test to fail.
Solution One:
Open Run configurations__ Let's check keep JUnit running after a test run when debugging
reported a null pointer (which was later reported, was blank at first, and nothing), and the JUnit program did not respond.Null pointer exception Analysis for the console report:Right-click into the jar where the exception is located (I have installed the anti-compilation, if the item exists the jar is absolutely accessible.) ), found below the purple box in the method where the class is not found!Such as:Is it the eclipse (I'm using STS, like Eclips
Calculate.java PackageNet.oschina.bairrfhoinn.main; Public classCalculator { Public voidAddintN) {Result+=N;} Public voidSubstract (intN) {Result-=N;} Public voidMultiplyintN) {Result*=N;} Public voidDivideintN) {Result/=N;} Public voidSquareintN) {Result= n *N;} Public intgetreuslt () {returnresult;} Public voidClear () {result= 0;}Private Static intresult;}Testcalculate.java Packagenet.oschina.bairrfhoinn.test;Import Staticorg.junit.assert.*;Importorg.junit.Test;ImportNet.oschina.bairrfhoinn.m
using ant to integrate JUnit for Automatic Testing and generate test reports can greatly improve the test efficiency. The advantage is the batch processing function of test cases. Not long ago, I saw a lot of articles about JUnit testing on the Internet: . I'm glad ant has supported JUnit integration and can't wait to try again. 1. Configuration: ant in this c
this question is actually very simple, but I have been puzzled by it before. If, as I wrote in the previous log , if you add Junitreport to the back:The report is only generated in XML format, but if it is under Batchtest, if all the test cases are executed, a series of HTML reports will be generated, for example:just a little experience and a summary.
ApplicationContext. xml files are stored in different locations, resulting in different paths in jUnit testing. applicationcontext
If the applicationContext. xml file is placed under src, the path written during jUint testing should be as follows:
@ Testpublic void testFindByPage () {ApplicationContext ctx = new ClassPathXmlApplicationContext ("applicationC
Testng.xmlCreate a testng.xml in C: \ > Testng_workspace to execute Test casesXML version="1.0"Encoding= "UTF-8" ?> name= "simple Html-xml Suite" > name "simple html-xml test" > name= "sampletest" / > Compile using the Javac Sampletest class.C:\testng_workspace>javac Sampletest.javaNow, run Testng.xml.C:\TESTNG_WORKSPACE>JAVA-CP "C:\TestNG_WORKSPACE" Org.testng.TestNG testng.xmlVerify the out
With the popularity of the B/S system and the deep application of XML technology, more and more data packets are stored and discarded in the XML coat. Many of the data comes from the database, but after some processing, the data is more streamlined and closer to the application. If the report tool can use the XML data,
(JREXception e) {e.printstacktrace (); }
}
}In JasperReports, parameters are organized through a map collection, and in the example program (3), a variable named title is passed to the report template with the value "Data Source from TableModel". After the collection of construction parameters is complete, the parameters can be passed to the report template through the Fillreport function, and the meth
in the database through the background.
The content and format of the report body are defined in the XML file. XML, as an effective tool for data transmission and storage, is no longer suitable for defining the subject content and content format of the stored report. As a configuration file,
XML is mainly used to describe the name of the printed report, data source, format, paging printing and other information, the specific label can be defined, the following is the author for the member Management system report printed by the XML document:
Memberlist.xml
〈xml
web|xml| Report Printing
Recently made a B/s project, in the printing of the use of IE embedded in the. NET WinForm control and XML combination of the way (see http://www.yesky.com/20030214/1652186.shtml), in the actual application process, there are some ideas, Share with you.(i). format an XML file with a generic tem
You can use the following code to add data to javascript:
VaR request = new activexobject ('Microsoft. xmlhttp ');
Request. Open ("get", "data. xml", false );
Request. Send ();
Cell. readfromxml (request. responsetext );
In this way, you only need to generate an XML
Design and implementation of report printing scheme based on XML technology
In order to be able to quickly realize a simple report printing, design the following scheme. Write a general printing page, to print the report to write parameters to an XML document, call the page
xml| Generate XML
Some time ago when you do a Web project, you receive a task and the report exports Excel. You cannot use a Third-party reporting tool, which can only be resolved by manipulating the Excel library.
The first is to call COM write Excel on the server side to the client; This is not feasible because of the number of users in the system, C # operatio
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.