当前位置: 首页>>代码示例>>Java>>正文


Java ParameterizedTest类代码示例

本文整理汇总了Java中org.junit.jupiter.params.ParameterizedTest的典型用法代码示例。如果您正苦于以下问题:Java ParameterizedTest类的具体用法?Java ParameterizedTest怎么用?Java ParameterizedTest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ParameterizedTest类属于org.junit.jupiter.params包,在下文中一共展示了ParameterizedTest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildConditions

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@MethodSource("goodMapConditionAndResult")
void buildConditions(final Map<String, String> params, final List<FilterValue> filterValues, final Condition expectedCondition) {
    filteringJooqImpl1.getFilterValues().addAll(filterValues);
    final Condition condition = filteringJooqImpl1.buildConditions(params);
    Assertions.assertEquals(expectedCondition, condition);
}
 
开发者ID:Blackdread,项目名称:filter-sort-jooq-api,代码行数:8,代码来源:FilteringJooqTest.java

示例2: timerLineProtocol

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@EnumSource(StatsdFlavor.class)
void timerLineProtocol(StatsdFlavor flavor) {
    String line = null;
    switch (flavor) {
        case Etsy:
            line = "myTimer.myTag.val:1|ms";
            break;
        case Datadog:
            line = "my.timer:1|ms|#my.tag:val";
            break;
        case Telegraf:
            line = "my_timer,my_tag=val:1|ms";
    }

    assertLines(r -> r.timer("my.timer", "my.tag", "val").record(1, TimeUnit.MILLISECONDS),
        flavor, line);
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:19,代码来源:StatsdMeterRegistryTest.java

示例3: testCpcPlusFileSuccesses

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@MethodSource("successData")
void testCpcPlusFileSuccesses(Path entry) throws IOException {
	AllErrors errors = null;

	Converter converter = new Converter(new PathSource(entry));

	try {
		converter.transform();
	} catch (TransformException failure) {
		errors = failure.getDetails();
	}

	assertThat(errors).isNull();
}
 
开发者ID:CMSgov,项目名称:qpp-conversion-tool,代码行数:16,代码来源:CpcPlusAcceptanceTest.java

示例4: testPresetStrings

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@EnumSource(Color.Preset.class)
void testPresetStrings(Color.Preset preset) {
    Color color = Color.of(preset.toString());
    assertValid(color);
    assertTrue(color.isPreset());
    assertThat(color.asPreset(), is(equalTo(preset)));
}
 
开发者ID:palantir,项目名称:roboslack,代码行数:9,代码来源:ColorTests.java

示例5: testWithStrings

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@ValueSource(strings = { "Hello", "World" })
void testWithStrings(String argument) {
    System.out.println(
            "Parameterized test with (String) parameter: " + argument);
    assertNotNull(argument);
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:8,代码来源:ValueSourceStringsParameterizedTest.java

示例6: testWithLongs

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@ValueSource(longs = { 2L, 3L })
void testWithLongs(long argument) {
    System.out.println(
            "Parameterized test with (long) argument: " + argument);
    assertNotNull(argument);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Software-Testing-with-JUnit-5,代码行数:8,代码来源:ValueSourcePrimitiveTypesParameterizedTest.java

示例7: testWithExcludeEnum

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@EnumSource(value = TimeUnit.class, mode = EXCLUDE, names = { "DAYS",
        "HOURS" })
void testWithExcludeEnum(TimeUnit argument) {
    System.out.println(
            "Parameterized test with excluded (TimeUnit) argument: "
                    + argument);
    assertNotNull(argument);
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:10,代码来源:EnumSourceFilteringParameterizedTest.java

示例8: serializesToSc2ApiUnitSelectionPointType

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest(name = "\"{0}\" is serialization of {1}")
@MethodSource(value = "unitSelectionPointTypeMappings")
void serializesToSc2ApiUnitSelectionPointType(
        Spatial.ActionSpatialUnitSelectionPoint.Type expectedSc2ApiSelectionPointType,
        ActionSpatialUnitSelectionPoint.Type selectionPointType) {
    assertThat(selectionPointType.toSc2Api()).isEqualTo(expectedSc2ApiSelectionPointType);
}
 
开发者ID:ocraft,项目名称:ocraft-s2client,代码行数:8,代码来源:ActionSpatialUnitSelectionPointTest.java

示例9: serializesToSc2ApiControlGroupAction

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest(name = "\"{0}\" is serialization of {1}")
@MethodSource(value = "controlGroupActionMappings")
void serializesToSc2ApiControlGroupAction(
        Ui.ActionControlGroup.ControlGroupAction expectedSc2ApiControlGroupAction,
        ActionUiControlGroup.Action controlGroupAction) {
    assertThat(controlGroupAction.toSc2Api()).isEqualTo(expectedSc2ApiControlGroupAction);
}
 
开发者ID:ocraft,项目名称:ocraft-s2client,代码行数:8,代码来源:ActionUiControlGroupTest.java

示例10: testWithArgumentsSource

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@ArgumentsSources({ @ArgumentsSource(CustomArgumentsProvider1.class),
        @ArgumentsSource(CustomArgumentsProvider2.class) })
void testWithArgumentsSource(String first, int second) {
    System.out.println("Parameterized test with (String) " + first
            + " and (int) " + second);

    assertNotNull(first);
    assertTrue(second > 0);
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:11,代码来源:ArgumentSourcesParameterizedTest.java

示例11: testWithLongProvider

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@MethodSource("longProvider")
void testWithLongProvider(long argument) {
    System.out.println(
            "Parameterized test with (long) argument: " + argument);
    assertNotNull(argument);
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:8,代码来源:MethodSourcePrimitiveTypesParameterizedTest.java

示例12: testWithStringProvider

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@MethodSource("stringProvider")
void testWithStringProvider(String argument) {
    System.out.println(
            "Parameterized test with (String) argument: " + argument);
    assertNotNull(argument);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Software-Testing-with-JUnit-5,代码行数:8,代码来源:MethodSourceStringsParameterizedTest.java

示例13: testWithDoubles

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@ValueSource(doubles = { 4d, 5d })
void testWithDoubles(double argument) {
    System.out.println(
            "Parameterized test with (double) argument: " + argument);
    assertNotNull(argument);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Software-Testing-with-JUnit-5,代码行数:8,代码来源:ValueSourcePrimitiveTypesParameterizedTest.java

示例14: testWithImplicitConversionToEnum

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@ValueSource(strings = "SECONDS")
void testWithImplicitConversionToEnum(TimeUnit argument) {
    System.out.println("Argument " + argument + " is a type of "
            + argument.getDeclaringClass());
    assertNotNull(argument.name());
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:8,代码来源:ImplicitConversionParameterizedTest.java

示例15: testWithRegexEnum

import org.junit.jupiter.params.ParameterizedTest; //导入依赖的package包/类
@ParameterizedTest
@EnumSource(value = TimeUnit.class, mode = MATCH_ALL, names = "^(M|N).+SECONDS$")
void testWithRegexEnum(TimeUnit argument) {
    System.out.println(
            "Parameterized test with regex filtered (TimeUnit) argument: "
                    + argument);
    assertNotNull(argument);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Software-Testing-with-JUnit-5,代码行数:9,代码来源:EnumSourceFilteringParameterizedTest.java


注:本文中的org.junit.jupiter.params.ParameterizedTest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。