@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()); } }
@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()); } }
@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(); }
@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()); } }
@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()); } }
@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()); } }
@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); } }
@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); } }
@RepeatedTest(2) void test(RepetitionInfo repetitionInfo) { System.out.println("** Test " + repetitionInfo.getCurrentRepetition() + "/" + repetitionInfo.getTotalRepetitions()); }
@RepeatedTest(5) void test() { System.out.println("Repeated test"); }
@RepeatedTest(value = 2, name = "{displayName} {currentRepetition}/{totalRepetitions}") @DisplayName("Repeat!") void customDisplayName(TestInfo testInfo) { System.out.println(testInfo.getDisplayName()); }
@RepeatedTest(value = 2, name = RepeatedTest.LONG_DISPLAY_NAME) @DisplayName("Test using long display name") void customDisplayNameWithLongPattern(TestInfo testInfo) { System.out.println(testInfo.getDisplayName()); }
@RepeatedTest(value = 2, name = RepeatedTest.SHORT_DISPLAY_NAME) @DisplayName("Test using short display name") void customDisplayNameWithShortPattern(TestInfo testInfo) { System.out.println(testInfo.getDisplayName()); }
@RepeatedTest(10) public void nestedNestedTestSomething() { String result = underTest.convert(5); assertEquals("V", result); }
@RepeatedTest(10) public void testRepeated() { System.out.println("testRepeated"); }
@RepeatedTest(50) public void testTextHtmlSerializationAndDeserialization_randomText() { Text text = randomText(); assertEquals(text, Text.parse(text.toString(ParseMode.HTML), ParseMode.HTML)); }
@RepeatedTest(2) void test1(RepetitionInfo repetitionInfo) { System.out.println("** Test " + repetitionInfo.getCurrentRepetition() + "/" + repetitionInfo.getTotalRepetitions()); }
@RepeatedTest(5) void repeatedTest(RepetitionInfo repetitionInfo) { assertEquals(5, repetitionInfo.getTotalRepetitions()); }
@RepeatedTest(value = 5, name = "Wiederholung {currentRepetition} von {totalRepetitions}") void repeatedTestInGerman() { // ... }
@RepeatedTest(1) public void stream_sequential_apply_wait() { new SampleModelWrapper(SampleModels.sample()).stream().peek(e -> doSomeStuff()).count(); }
@RepeatedTest(1) public void stream_parallel_apply_count() { new Sample2ModelWrapper(Sample2Models.sample()).parallelStream().peek(e -> doSomeStuff()).count(); }
@RepeatedTest(1) public void stream_sequential_apply_count() { new Sample2ModelWrapper(Sample2Models.sample()).stream().peek(e -> doSomeStuff()).count(); }
@RepeatedTest(1) public void stream_parallel_apply_wait_collect_map() { new Sample2ModelWrapper(Sample2Models.sample()).parallelStream() .peek(e -> doSomeStuff()) .collect(FieldModels.toConcurrentFieldModel(new Sample2ModelWrapper())); }
@RepeatedTest(1) public void stream_parallel_apply_wait_collect_concurrent() { new Sample2ModelWrapper(Sample2Models.sample()).parallelStream() .peek(e -> doSomeStuff()) .collect(FieldModels.toConcurrentFieldModel(new Sample2ModelWrapper())); }
@RepeatedTest(1) public void stream_sequential_apply_wait_collect() { new Sample2ModelWrapper(Sample2Models.sample()).stream() .peek(e -> doSomeStuff()) .collect(FieldModels.toFieldModel(new Sample2ModelWrapper())); }