Java 类org.junit.jupiter.api.RepeatedTest 实例源码
项目:junit-extensions
文件:TemporaryFolderExtensionParameterTest.java
@RepeatedTest(5)
@ExtendWith(TemporaryFolderExtension.class)
public void willCreateANewTemporaryFileEveryTime(TemporaryFolder temporaryFolder)
throws IOException {
File file = temporaryFolder.createFile("foo.txt");
assertThat(file.exists(), is(true));
if (temporaryFilePaths.isEmpty()) {
temporaryFilePaths.add(file.getAbsolutePath());
} else {
assertThat(
"Received the same value twice, expected each random value to be different!",
temporaryFilePaths,
not(hasItem(file.getAbsolutePath())));
temporaryFilePaths.add(file.getAbsolutePath());
}
}
项目:junit-extensions
文件:TemporaryFolderExtensionParameterTest.java
@RepeatedTest(5)
@ExtendWith(TemporaryFolderExtension.class)
public void willCreateANewTemporaryDirectoryEveryTime(TemporaryFolder temporaryFolder) {
File dir = temporaryFolder.createDirectory("bar");
assertThat(dir.exists(), is(true));
if (temporaryDirectoryPaths.isEmpty()) {
temporaryDirectoryPaths.add(dir.getAbsolutePath());
} else {
assertThat(
"Received the same value twice, expected each random value to be different!",
temporaryDirectoryPaths,
not(hasItem(dir.getAbsolutePath())));
temporaryDirectoryPaths.add(dir.getAbsolutePath());
}
}
项目:Simplify-Core
文件:ProxyTest.java
@RepeatedTest(10)
void proxy02() throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
System.out.println("===================proxyTest02 asmProxy===================");
try {
Asm asm = new Asm();
MyInterceptor myInterceptor = new MyInterceptor();
Asm asm_tmp = null;
asm_tmp = (Asm) Proxy.wrap(asm, myInterceptor);
asm_tmp.halloAop();
} catch (ClassNotFoundException e) {
System.out.println(e);
}
// AopClassAdapter aopClassAdapter = new AopClassAdapter();
}
项目:filter-sort-jooq-api
文件:FilteringJooqTest.java
@RepeatedTest(10)
void getFilterGetsSameFirstKeyFoundOnDuplicates() {
filteringJooqImpl1.getFilterValues().add(Filter.of("myKey", DSL::trueCondition));
filteringJooqImpl1.getFilterValues().add(Filter.of("myKey2", DSL::trueCondition));
filteringJooqImpl1.getFilterValues().add(Filter.of("myKey", notParsed -> 5, val -> DSL.trueCondition()));
final Optional<FilterValue> myKey = filteringJooqImpl1.getFilter("myKey");
Assertions.assertTrue(myKey.isPresent());
Assertions.assertTrue(myKey.get().isConditionSupplier());
for (int i = 0; i < 10; i++) {
Assertions.assertEquals(myKey.get(), filteringJooqImpl1.getFilter("myKey").get());
Assertions.assertTrue(filteringJooqImpl1.getFilter("myKey").get().isConditionSupplier());
}
}
项目:junit-extensions
文件:TemporaryFolderExtensionFieldTest.java
@RepeatedTest(5)
public void willCreateANewTemporaryFileEveryTime() throws IOException {
File file = temporaryFolder.createFile("foo.txt");
assertThat(file.exists(), is(true));
if (temporaryFilePaths.isEmpty()) {
temporaryFilePaths.add(file.getAbsolutePath());
} else {
assertThat(
"Received the same value twice, expected each random value to be different!",
temporaryFilePaths,
not(hasItem(file.getAbsolutePath())));
temporaryFilePaths.add(file.getAbsolutePath());
}
}
项目:junit-extensions
文件:TemporaryFolderExtensionFieldTest.java
@RepeatedTest(5)
public void willCreateANewTemporaryDirectoryEveryTime() throws IOException {
File dir = temporaryFolder.createDirectory("bar");
assertThat(dir.exists(), is(true));
if (temporaryDirectoryPaths.isEmpty()) {
temporaryDirectoryPaths.add(dir.getAbsolutePath());
} else {
assertThat(
"Received the same value twice, expected each random value to be different!",
temporaryDirectoryPaths,
not(hasItem(dir.getAbsolutePath())));
temporaryDirectoryPaths.add(dir.getAbsolutePath());
}
}
项目:junit-extensions
文件:RandomBeansExtensionFieldTest.java
@RepeatedTest(5)
public void willInjectANewRandomValueEachTime() {
assertThat(anyString, notNullValue());
if (anyStrings.isEmpty()) {
anyStrings.add(anyString);
} else {
assertThat(
"Received the same value twice, expected each random value to be different!",
anyStrings,
not(hasItem(anyString)));
anyStrings.add(anyString);
}
}
项目:junit-extensions
文件:RandomBeansExtensionParameterTest.java
@RepeatedTest(5)
@ExtendWith(RandomBeansExtension.class)
public void willInjectANewRandomValueEachTime(@Random String anyString) {
assertThat(anyString, notNullValue());
if (anyStrings.isEmpty()) {
anyStrings.add(anyString);
} else {
assertThat(
"Received the same value twice, expected each random value to be different!",
anyStrings,
not(hasItem(anyString)));
anyStrings.add(anyString);
}
}
项目:mastering-junit5
文件:RepetitionInfoTest.java
@RepeatedTest(2)
void test(RepetitionInfo repetitionInfo) {
System.out.println("** Test " + repetitionInfo.getCurrentRepetition()
+ "/" + repetitionInfo.getTotalRepetitions());
}
项目:mastering-junit5
文件:SimpleRepeatedTest.java
@RepeatedTest(5)
void test() {
System.out.println("Repeated test");
}
项目:mastering-junit5
文件:TunningDisplayInRepeatedTest.java
@RepeatedTest(value = 2, name = "{displayName} {currentRepetition}/{totalRepetitions}")
@DisplayName("Repeat!")
void customDisplayName(TestInfo testInfo) {
System.out.println(testInfo.getDisplayName());
}
项目:mastering-junit5
文件:TunningDisplayInRepeatedTest.java
@RepeatedTest(value = 2, name = RepeatedTest.LONG_DISPLAY_NAME)
@DisplayName("Test using long display name")
void customDisplayNameWithLongPattern(TestInfo testInfo) {
System.out.println(testInfo.getDisplayName());
}
项目:mastering-junit5
文件:TunningDisplayInRepeatedTest.java
@RepeatedTest(value = 2, name = RepeatedTest.SHORT_DISPLAY_NAME)
@DisplayName("Test using short display name")
void customDisplayNameWithShortPattern(TestInfo testInfo) {
System.out.println(testInfo.getDisplayName());
}
项目:codingdojoleipzig
文件:NestedTestExample.java
@RepeatedTest(10)
public void nestedNestedTestSomething() {
String result = underTest.convert(5);
assertEquals("V", result);
}
项目:codingdojoleipzig
文件:UnitTest.java
@RepeatedTest(10)
public void testRepeated() {
System.out.println("testRepeated");
}
项目:Telejam
文件:TextTest.java
@RepeatedTest(50)
public void testTextHtmlSerializationAndDeserialization_randomText() {
Text text = randomText();
assertEquals(text, Text.parse(text.toString(ParseMode.HTML), ParseMode.HTML));
}
项目:Mastering-Software-Testing-with-JUnit-5
文件:RepetitionInfoTest.java
@RepeatedTest(2)
void test1(RepetitionInfo repetitionInfo) {
System.out.println("** Test " + repetitionInfo.getCurrentRepetition()
+ "/" + repetitionInfo.getTotalRepetitions());
}
项目:Mastering-Software-Testing-with-JUnit-5
文件:SimpleRepeatedTest.java
@RepeatedTest(5)
void test() {
System.out.println("Repeated test");
}
项目:Mastering-Software-Testing-with-JUnit-5
文件:TunningDisplayInRepeatedTest.java
@RepeatedTest(value = 2, name = "{displayName} {currentRepetition}/{totalRepetitions}")
@DisplayName("Repeat!")
void customDisplayName(TestInfo testInfo) {
System.out.println(testInfo.getDisplayName());
}
项目:Mastering-Software-Testing-with-JUnit-5
文件:TunningDisplayInRepeatedTest.java
@RepeatedTest(value = 2, name = RepeatedTest.LONG_DISPLAY_NAME)
@DisplayName("Test using long display name")
void customDisplayNameWithLongPattern(TestInfo testInfo) {
System.out.println(testInfo.getDisplayName());
}
项目:Mastering-Software-Testing-with-JUnit-5
文件:TunningDisplayInRepeatedTest.java
@RepeatedTest(value = 2, name = RepeatedTest.SHORT_DISPLAY_NAME)
@DisplayName("Test using short display name")
void customDisplayNameWithShortPattern(TestInfo testInfo) {
System.out.println(testInfo.getDisplayName());
}
项目:junit5-demo
文件:RepeatedTests.java
@RepeatedTest(5)
void repeatedTest(RepetitionInfo repetitionInfo) {
assertEquals(5, repetitionInfo.getTotalRepetitions());
}
项目:junit5-demo
文件:RepeatedTests.java
@RepeatedTest(value = 5, name = "Wiederholung {currentRepetition} von {totalRepetitions}")
void repeatedTestInGerman() {
// ...
}
项目:dOOv
文件:SampleStreamTest.java
@RepeatedTest(1)
public void stream_sequential_apply_wait() {
new SampleModelWrapper(SampleModels.sample()).stream().peek(e -> doSomeStuff()).count();
}
项目:dOOv
文件:Sample2StreamTest.java
@RepeatedTest(1)
public void stream_parallel_apply_count() {
new Sample2ModelWrapper(Sample2Models.sample()).parallelStream().peek(e -> doSomeStuff()).count();
}
项目:dOOv
文件:Sample2StreamTest.java
@RepeatedTest(1)
public void stream_sequential_apply_count() {
new Sample2ModelWrapper(Sample2Models.sample()).stream().peek(e -> doSomeStuff()).count();
}
项目:dOOv
文件:Sample2StreamTest.java
@RepeatedTest(1)
public void stream_parallel_apply_wait_collect_map() {
new Sample2ModelWrapper(Sample2Models.sample()).parallelStream()
.peek(e -> doSomeStuff())
.collect(FieldModels.toConcurrentFieldModel(new Sample2ModelWrapper()));
}
项目:dOOv
文件:Sample2StreamTest.java
@RepeatedTest(1)
public void stream_parallel_apply_wait_collect_concurrent() {
new Sample2ModelWrapper(Sample2Models.sample()).parallelStream()
.peek(e -> doSomeStuff())
.collect(FieldModels.toConcurrentFieldModel(new Sample2ModelWrapper()));
}
项目:dOOv
文件:Sample2StreamTest.java
@RepeatedTest(1)
public void stream_sequential_apply_wait_collect() {
new Sample2ModelWrapper(Sample2Models.sample()).stream()
.peek(e -> doSomeStuff())
.collect(FieldModels.toFieldModel(new Sample2ModelWrapper()));
}