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


Java Repeat类代码示例

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


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

示例1: testAddFileUsingMultipartFile

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Repeat(1)
@Test
public void testAddFileUsingMultipartFile() throws UnsupportedEncodingException, IOException {
	MultipartFile file = getResume();
	FileParams params = ParamFactory.fileParams();
	try {
		FileWrapper fileWrapper = bullhornData.addFile(Candidate.class, testEntities.getCandidateId(), file, "portfolio", params);
		assertFileWrapperIncludingFileName(fileWrapper);

		FileApiResponse fileApiResponse = bullhornData.deleteFile(Candidate.class, testEntities.getCandidateId(),
				fileWrapper.getId());

		assertFileApiResponse(fileApiResponse, fileWrapper.getId());
	} catch (HttpStatusCodeException error) {
		assertTrue(StringUtils.equals("" + error.getStatusCode().value(), "500"));
	}

}
 
开发者ID:bullhorn,项目名称:sdk-rest,代码行数:19,代码来源:TestStandardBullhornApiRestFile.java

示例2: testAddFileUsingFile

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Repeat(1)
@Test
public void testAddFileUsingFile() throws UnsupportedEncodingException, IOException {
	File file = getFile();
	FileParams params = ParamFactory.fileParams();
	try {
		FileWrapper fileWrapper = bullhornData.addFile(Candidate.class, testEntities.getCandidateId(), file, "portfolio", params);
		assertFileWrapperIncludingFileName(fileWrapper);

		FileApiResponse fileApiResponse = bullhornData.deleteFile(Candidate.class, testEntities.getCandidateId(),
				fileWrapper.getId());

		assertFileApiResponse(fileApiResponse, fileWrapper.getId());
	} catch (HttpStatusCodeException error) {
		assertTrue(StringUtils.equals("" + error.getStatusCode().value(), "500"));
	}

}
 
开发者ID:bullhorn,项目名称:sdk-rest,代码行数:19,代码来源:TestStandardBullhornApiRestFile.java

示例3: testDeleteFile

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Repeat(1)
@Test
public void testDeleteFile() throws UnsupportedEncodingException, IOException {
	MultipartFile file = getResume();
	FileParams params = ParamFactory.fileParams();
	try {
		FileWrapper fileWrapper = bullhornData.addFile(Candidate.class, testEntities.getCandidateId(), file, "portfolio", params);

		assertFileWrapper(fileWrapper);

		FileApiResponse fileApiResponse = bullhornData.deleteFile(Candidate.class, testEntities.getCandidateId(),
				fileWrapper.getId());

		assertFileApiResponse(fileApiResponse, fileWrapper.getId());
	} catch (HttpStatusCodeException error) {
		assertTrue(StringUtils.equals("" + error.getStatusCode().value(), "500"));
	}

}
 
开发者ID:bullhorn,项目名称:sdk-rest,代码行数:20,代码来源:TestStandardBullhornApiRestFile.java

示例4: test

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Test
@Repeat(value = 4)
public void test() {
    final Object ref = this.conf;
    assertNotNull(this.conf);
    assertEquals("https://localhost/Tic", this.conf.getUrl());
    assertEquals(2, this.conf.getAMap().size());

    // Simulates configuration file change
    this.factory.withResourceName("net/jmob/jsconf/core/sample/app_06_2").reload();
    assertTrue(ref == this.conf);
    assertEquals("https://localhost/Tac", this.conf.getUrl());
    assertEquals(null, this.conf.getAMap());

    this.factory.withResourceName("net/jmob/jsconf/core/sample/app_06").reload();
}
 
开发者ID:yyvess,项目名称:jsconf,代码行数:17,代码来源:Sample06.java

示例5: notTransactionalWithSpringTimeout

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Test
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@Timed(millis = 10000)
@Repeat(5)
public void notTransactionalWithSpringTimeout() {
	assertInTransaction(false);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:TimedTransactionalSpringRunnerTests.java

示例6: singleRepetitionExceedsTimeout

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Test
@Timed(millis = 10)
@Repeat(1)
public void singleRepetitionExceedsTimeout() throws Exception {
	incrementInvocationCount();
	Thread.sleep(15);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:RepeatedSpringRuleTests.java

示例7: firstRepetitionOfManyExceedsTimeout

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Test
@Timed(millis = 20)
@Repeat(4)
public void firstRepetitionOfManyExceedsTimeout() throws Exception {
	incrementInvocationCount();
	Thread.sleep(25);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:RepeatedSpringRuleTests.java

示例8: collectiveRepetitionsExceedTimeout

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Test
@Timed(millis = 100)
@Repeat(10)
public void collectiveRepetitionsExceedTimeout() throws Exception {
	incrementInvocationCount();
	Thread.sleep(11);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:RepeatedSpringRuleTests.java

示例9: transactionalWithJUnitTimeout

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
/**
 * Overridden since Spring's Rule-based JUnit support cannot properly
 * integrate with timed execution that is controlled by a third-party runner.
 */
@Test(timeout = 10000)
@Repeat(5)
@Override
public void transactionalWithJUnitTimeout() {
	assertInTransaction(false);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:TimedTransactionalSpringRuleTests.java

示例10: uploadOneSequenceDifferentAuthors

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Test
@Repeat(value = 10)
public void uploadOneSequenceDifferentAuthors() throws IOException {
    Map<String, InputStream> files = new HashMap<>();
    String firstFirstName = randomAlphanumeric(10);
    String firstMiddleName = randomAlphanumeric(10);
    String firstLastName = randomAlphanumeric(10);

    String secondFirstName = randomAlphanumeric(10);
    String secondMiddleName = randomAlphanumeric(10);
    String secondLastName = randomAlphanumeric(10);

    String sequence = randomAlphanumeric(10);
    files.put(randomAlphanumeric(10) + ".fb2", new Fb2Creator(randomAlphanumeric(10)).
            addAuthor(firstFirstName, firstMiddleName, firstLastName).
            addSequence(sequence, 1).getFbook());
    files.put(randomAlphanumeric(10) + ".fb2", new Fb2Creator(randomAlphanumeric(10)).
            addAuthor(secondFirstName, secondMiddleName, secondLastName).
            addSequence(sequence, 2).getFbook());
    files.put(randomAlphanumeric(10) + ".fb2", new Fb2Creator(randomAlphanumeric(10)).
            addAuthor(firstFirstName, firstMiddleName, firstLastName).
            addAuthor(secondFirstName, secondMiddleName, secondLastName).
            addSequence(sequence, 2).getFbook());

    ResponseEntity<List<BookUploadInfo>> response = httpClient.uploadFiles("book/upload",
            "file", files, new ParameterizedTypeReference<List<BookUploadInfo>>() {
            });
    assertThat(response.getStatusCode(), equalTo(HttpStatus.OK));
    assertThat(response.getBody(), hasSize(3));
    Assert.assertTrue(response.getBody().stream().
            allMatch(info -> info.getStatus().equals(BookUploadInfo.Status.Success)));
    Book book1 = httpClient.get("book/" + response.getBody().get(0).getId(), Book.class);
    Book book2 = httpClient.get("book/" + response.getBody().get(1).getId(), Book.class);
    Book book3 = httpClient.get("book/" + response.getBody().get(2).getId(), Book.class);
    long sequenceId = book1.getSequences().get(0).getSequence().getId();
    Assert.assertTrue(sequenceId > 0);
    Assert.assertTrue(book2.getSequences().get(0).getSequence().getId() == sequenceId);
    Assert.assertTrue(book3.getSequences().get(0).getSequence().getId() == sequenceId);
}
 
开发者ID:patexoid,项目名称:ZombieLib2,代码行数:40,代码来源:UploadIT.java

示例11: test

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Test
@Transactional
@Rollback(true)
@Repeat(3)
public void test() {

}
 
开发者ID:sunlin901203,项目名称:example-java,代码行数:8,代码来源:SpringJUnit4Example.java

示例12: DirtiesContextTest

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
/**
 * 当测试方法被@DirtiesContext注解修饰时,当测试方法结束的时候,Spring
 * TestContext会刷新Spring的上下文(就是重新创建ApplicationContext)
 */
@Test
@Rollback(true)
@Repeat(3)
@DirtiesContext
public void DirtiesContextTest() {

}
 
开发者ID:sunlin901203,项目名称:example-java,代码行数:12,代码来源:SpringJUnit4Example.java

示例13: encryptTest

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Test
@Repeat(100)
public void encryptTest() {
    byte[] salt = randomNumberGenerator.generate();
    String inputPassword = "password";
    String encryptedPassword = passwordEncryptor.encrypt(inputPassword, salt);
    byte[] hash = BaseEncoding.base64().decode(encryptedPassword);
    System.out.println("(" + hash.length + ") " + encryptedPassword);
    Assert.assertEquals(32, hash.length);
}
 
开发者ID:brainagenet,项目名称:nuri,代码行数:11,代码来源:PasswordEncryptorTest.java

示例14: testGenerateSalt

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Test
@Repeat(100)
public void testGenerateSalt() {
    byte[] salt = randomNumberGenerator.generate();
    System.out.println("salt: " + BaseEncoding.base64().encode(salt));
    Assert.assertEquals(randomNumberGenerator.getKeyLength(), salt.length);
}
 
开发者ID:brainagenet,项目名称:nuri,代码行数:8,代码来源:RandomNumberGeneratorTest.java

示例15: testGenerateSalt24

import org.springframework.test.annotation.Repeat; //导入依赖的package包/类
@Test
@Repeat(100)
public void testGenerateSalt24() {
    byte[] salt = randomNumberGenerator2.generate();
    System.out.println("salt: " + BaseEncoding.base64().encode(salt));
    Assert.assertEquals(randomNumberGenerator2.getKeyLength(), salt.length);
}
 
开发者ID:brainagenet,项目名称:nuri,代码行数:8,代码来源:RandomNumberGeneratorTest.java


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