SQLUnit environment build _ MySQL

Source: Internet
Author: User
Tags xsl file
SQLUnit environment construction 1 technology needs to accumulate a few days ago to go to a flute friend Xiao laijia to play, only to know that his flute playing well is not accidental. It is because he has really worked hard. he has downloaded many videos and tutorials on his computer! This really shocked me! I have been working in the company for a long time, but I cannot find the materials. how many technical materials have I sorted out?
Therefore, I had the idea of setting up the environment and simple usage of SQLUnit, a database testing tool used in these days. Maybe I will try again later ~
2. quick environment construction
1. SQLUnit
2. Apache Ant
Apache Ant entry example
3. Java
3. Compile and enter the SQLUnit root directory.
// Compile it into the release jar file ant installant test
4 MySQL connection test example reference sqlunit-5.0/test/mysql/README instructions. Since MySQL does not support stored procedures, the following tests demonstrate non-stored procedures.
4.1 create a database
create database sqlunitdb;use sqlunitdb;
4.2 edit connection information edit in sqlunit-5.0/test/mysql/connectiontest. xml, change to the correct user name and password.
4.3 Copy the test target to the root directory cp connectiontest. xml ../../
4.4 run ant-Dlog. format = canoo-Doutput. file = demotest. xml-Dtestfile = connectiontest. xml sqlunit-flat canoo2html
The test results are generated into xml and html files. for example, the html display result is shown in:
5. Problems and Solutions

5.1 Problem: failed to create task or type sqlunit. Cause: The name is undefined.

The test target should not be added to build. xml. at that time, the following test target was added to build. xml, and an error occurred during the call.


HaltOnFailure = "false" debug = "false"/>

The correct way to perform the test is to place the test xml file in the build. xml directory, and then execute the file that generates the test html result.
5.2 build failed cannot compile the style sheet to modify the canoo2html_result_transform.xsl file. Comment out the TestResults. xsl file referenced in the second line.
5.3 com. mysql. jdbc. Driver not found in specified Context: place the mysql connection library in the lib folder. For example, directly copy the mysql-connector-java-5.1.12-bin.jar file to the lib folder.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.