Java 类org.junit.jupiter.params.provider.CsvFileSource 实例源码

项目:mastering-junit5    文件:CsvFileSourceParameterizedTest.java   
@ParameterizedTest
@CsvFileSource(resources = "/input.csv")
void testWithCsvFileSource(String first, int second) {
    System.out.println("Yet another parameterized test with (String) "
            + first + " and (int) " + second);

    assertNotNull(first);
    assertNotEquals(0, second);
}
项目:Mastering-Software-Testing-with-JUnit-5    文件:CsvFileSourceParameterizedTest.java   
@ParameterizedTest
@CsvFileSource(resources = "/input.csv")
void testWithCsvFileSource(String first, int second) {
    System.out.println("Yet another parameterized test with (String) "
            + first + " and (int) " + second);

    assertNotNull(first);
    assertNotEquals(0, second);
}
项目:url-verifier    文件:UrlVerifierTest.java   
@ParameterizedTest(name = "{index} => verify({0}) should return {1}")
@CsvFileSource(resources = {"/urls.csv"}, delimiter = ';')
public void urlTests( final String url, int expectedResult) throws IOException {
    LOGGER.log(Level.INFO, "Testing {0} with expected HTTP status code: {1}", new Object[]{ url, expectedResult });
    assertEquals(expectedResult, ( (HttpURLConnection) new URL( url ).openConnection()).getResponseCode() );
}
项目:roman-kata-scturkey    文件:RomanKataConverterTest.java   
@ParameterizedTest
@CsvFileSource(resources = "/data.csv")
void roman_number_test(int given, String expected) throws Exception {
    RomanKataConverter converter = new RomanKataConverter();
    assertEquals(expected,converter.convert(given));
}