Getting Started with Maven

Source: Internet
Author: User

1. First correct installation and configuration of environment variables;

2. Then create your own HelloWorld, where I'll name it 1.0;

3. Run the project and test it;

4. Package the HelloWorld in the catalog to view;

5. Download the Junit.jar and add a new path to the environment variable;

6. Modify the source code after the test;

You can see that the test was successful!

Attach Source code:

Main

Package com. helloworld.app;/** * Hello world! * */public class App {public    static void Main (string[] args)    {        app app = new app ();        System.out.println ("Hello tan!");    }    Public String Sayapp () {    return "Hello tan!";    }}

Test

Package com. Helloworld.app;import Junit.framework.test;import Junit.framework.*;import Junit.framework.testsuite;import java.io.*;/** * Unit test for simple App. */public class Apptest     extends testcase{    /**     * Create the test case< c3/>*     * @param testname name of the the test case     *    /Public apptest (String testname)    {        super (testname) ;    }    /**     * @return The suite of tests being tested     * * Public    static Test suite ()    {        return new Testsuit E (Apptest.class);    }    /**     * rigourous Test:-)     *    /public void testApp ()    {        app app = new com. HELLOWORLD.APP.APP ();        Assertequals ("Hello tan!", App.sayapp ());}    }

  

Getting Started with Maven

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.