码迷,mamicode.com
首页 > 其他好文 > 详细

软件管理

时间:2015-04-27 23:04:57      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:

public class Main {
    public String sayHello() {           
        return "Hello ZhangKexin!";
    }
    public static void main(String[] args) {
        HelloWorld helloWorld = new HelloWorld();
        System.out.println(helloWorld.Hello());
    }
}
public class HelloWorld {
    public String Hello() {           
        return "Hello Xu Luhan";
    }
    public static void main(String[] args) {
        HelloWorld world = new HelloWorld();
        System.out.println(world.Hello());
    }
}
import junit.framework.TestCase;


public class Test extends TestCase{
    public Test(String name){
        super(name);
    }
    public static void main(String args[]){
        junit.textui.TestRunner.run(Test.class);
    }
    public void test() {
        HelloWorld world = new HelloWorld();
        assertEquals("Hello Xu Luhan", world.Hello());
    }
}

技术分享

以上为TASK1。

 

技术分享

package Maven1.Maven01;
/**
 * Hello world!
 *
 */
public class App 
{
    public String sayHello(){
        return "Hello Xu Luhan";
    }
    public static void main( String[] args )
    {
        App world = new App();
        System.out.println(world.sayHello());
    }
}
package Maven1.Maven01;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
 * Unit test for simple App.
 */
public class AppTest 
    extends TestCase
{
    /**
     * Create the test case
     *
     * @param testName name of the test case
     */
    public AppTest( String testName )
    {
        super( testName );
    }
    /**
     * @return the suite of tests being tested
     */
    public static Test suite()
    {
        return new TestSuite( AppTest.class );
    }
    /**
     * Rigourous Test :-)
     */
    public void testApp()
    {
        assertTrue( true );
    }
    public void testSayHello(){
        App app = new App();
        String result = app.sayHello();
        assertEquals("Hello Xu Luhan",result);
    }
}

技术分享

以上为TASK2。

 

软件管理

标签:

原文地址:http://www.cnblogs.com/Twink1900/p/4461531.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!