JUnit test Case compilation and run configuration under Linux

Source: Internet
Author: User

Compilation and operation of Java programs under 1.linux

command line mode for compiling Java code under Linux:

Javac-cp.:./lib/sequoiadb.jar./com/sequoiadb/test/csandcloperation.java

command line mode for compiling Java code under Linux:

Java-cp.:./lib/sequoiadb.jar com.sequoiadb.test.CsAndClOperation

The compilation and operation of JUnit test cases under 2.linux

command line mode for compiling JUnit test cases under Linux:

Javac-cp.:./lib/junit.jar:./lib/sequoiadb.jar:./lib/hamcrest-core-1.3.jar./com/sequoiadb/test/clquery.java

command line mode for compiling JUnit test cases under Linux:

Java-cp.:./lib/junit.jar:./lib/sequoiadb.jar:./lib/hamcrest-core-1.3.jar Org.junit.runner.JUnitCore Com.sequoiadb.test.CLQuery

Org.junit.runner.JUnitCore is a framework for running unit tests that supports JUnit 4,junit 3.8.x, as well as mashup usage. When you start executing junit test cases from the command line, use Java org.junit.runner.JUnitCore TestClass1 TestClass2 .... For a test case, use the static method Runclasses (class[]). If you want to add a special listener, you can create an instance of Junitcore and use it to run the test case. -----Detailed Link: http://junit.sourceforge.net/javadoc/org/junit/runner/JUnitCore.html

This method is called to the class: Org.hamcrest.SelfDescribing, which belongs to Hamcrest-core-1.3.jar, so it needs to be added when compiling and running.

3. Extension

For Java small White, the understanding of Java's package is very important. Java's package is a very interesting thing, a bit similar to the C + + library.

Question: 1. What is the way to compile and execute multiple Java source code files? Need to understand the basic Java syntax and write Java Code.

JUnit test Case compilation and run configuration under Linux

Related Article

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.