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


Java RepeatedTest类代码示例

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


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

示例1: willCreateANewTemporaryFileEveryTime

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@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());
  }
}
 
开发者ID:glytching,项目名称:junit-extensions,代码行数:19,代码来源:TemporaryFolderExtensionParameterTest.java

示例2: willCreateANewTemporaryDirectoryEveryTime

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@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());
  }
}
 
开发者ID:glytching,项目名称:junit-extensions,代码行数:18,代码来源:TemporaryFolderExtensionParameterTest.java

示例3: Asm

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@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();
    }
 
开发者ID:lovejj1994,项目名称:Simplify-Core,代码行数:16,代码来源:ProxyTest.java

示例4: Should_throwException_When_UserDoesNotExist

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@Test
@RepeatedTest(5)
@DisplayName("Throws exception if user with given email does not exist")
public void Should_throwException_When_UserDoesNotExist() {
	String email = "[email protected]";
	Mockito.when(this.userDAO.findByEmail(email)).thenReturn(new ArrayList<User>());
	assertThatThrownBy(() -> this.userService.doesUserExist(email)).isInstanceOf(UserNotFoundException.class)
			.hasMessage("User does not exist in the database.");
}
 
开发者ID:PacktPublishing,项目名称:Building-Web-Apps-with-Spring-5-and-Angular,代码行数:10,代码来源:UserServiceTests.java

示例5: getFilterGetsSameFirstKeyFoundOnDuplicates

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@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());
    }
}
 
开发者ID:Blackdread,项目名称:filter-sort-jooq-api,代码行数:14,代码来源:FilteringJooqTest.java

示例6: willCreateANewTemporaryFileEveryTime

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@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());
  }
}
 
开发者ID:glytching,项目名称:junit-extensions,代码行数:16,代码来源:TemporaryFolderExtensionFieldTest.java

示例7: willCreateANewTemporaryDirectoryEveryTime

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@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());
  }
}
 
开发者ID:glytching,项目名称:junit-extensions,代码行数:15,代码来源:TemporaryFolderExtensionFieldTest.java

示例8: willInjectANewRandomValueEachTime

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@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);
  }
}
 
开发者ID:glytching,项目名称:junit-extensions,代码行数:15,代码来源:RandomBeansExtensionFieldTest.java

示例9: willInjectANewRandomValueEachTime

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@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);
  }
}
 
开发者ID:glytching,项目名称:junit-extensions,代码行数:16,代码来源:RandomBeansExtensionParameterTest.java

示例10: test

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@RepeatedTest(2)
void test(RepetitionInfo repetitionInfo) {
    System.out.println("** Test " + repetitionInfo.getCurrentRepetition()
            + "/" + repetitionInfo.getTotalRepetitions());
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:6,代码来源:RepetitionInfoTest.java

示例11: test

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@RepeatedTest(5)
void test() {
    System.out.println("Repeated test");
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:5,代码来源:SimpleRepeatedTest.java

示例12: customDisplayName

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@RepeatedTest(value = 2, name = "{displayName} {currentRepetition}/{totalRepetitions}")
@DisplayName("Repeat!")
void customDisplayName(TestInfo testInfo) {
    System.out.println(testInfo.getDisplayName());
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:6,代码来源:TunningDisplayInRepeatedTest.java

示例13: customDisplayNameWithLongPattern

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@RepeatedTest(value = 2, name = RepeatedTest.LONG_DISPLAY_NAME)
@DisplayName("Test using long display name")
void customDisplayNameWithLongPattern(TestInfo testInfo) {
    System.out.println(testInfo.getDisplayName());
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:6,代码来源:TunningDisplayInRepeatedTest.java

示例14: customDisplayNameWithShortPattern

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@RepeatedTest(value = 2, name = RepeatedTest.SHORT_DISPLAY_NAME)
@DisplayName("Test using short display name")
void customDisplayNameWithShortPattern(TestInfo testInfo) {
    System.out.println(testInfo.getDisplayName());
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:6,代码来源:TunningDisplayInRepeatedTest.java

示例15: nestedNestedTestSomething

import org.junit.jupiter.api.RepeatedTest; //导入依赖的package包/类
@RepeatedTest(10)
public void nestedNestedTestSomething() {
    String result = underTest.convert(5);
    assertEquals("V", result);
}
 
开发者ID:JanMosigItemis,项目名称:codingdojoleipzig,代码行数:6,代码来源:NestedTestExample.java


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