簡單的Junit4 case
在junit4的架構下,直接用 Annotation表示要執行的test method import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; /* * if unit test need run many times with different parameter and result */ @RunWith(Parameterized.class) public class IPUtil_UT_HasIP { private List<String> ipList; private String ip; private boolean result; @SuppressWarnings("rawtypes") @Parameters public static Collection data() { List<String> ips = new ArrayList<String>(300); ...