public class Person {
	
	public void run(){
		System.out.println("run!");
	}
	
	public void eat(){
		System.out.println("eat!");
	}
}

有2个方法,再建一个类

import org.junit.Test;

public class TestDome {
	
	@Test
	public void testRun(){
		Person p = new Person();
		p.run();
	}
	
	@Test
	public void testEun(){
		Person p = new Person();
		p.eat();
	}
}



可以运行进行测试

其中也能加些Assert(断言),进行测试