- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.epam.wilma.domain.sequence.WilmaSequence.checkIfAllResponsesArrived()
方法的一些代码示例,展示了WilmaSequence.checkIfAllResponsesArrived()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WilmaSequence.checkIfAllResponsesArrived()
方法的具体详情如下:
包路径:com.epam.wilma.domain.sequence.WilmaSequence
类名称:WilmaSequence
方法名:checkIfAllResponsesArrived
[英]Checks if all of the requests' responses arrived with the exception of the request with the given loggerId.
[中]检查是否所有请求的响应都已到达,但具有给定loggerId的请求除外。
代码示例来源:origin: epam/Wilma
/**
* Waits for the given sequence's responses to arrive.
* Throws a {@link ResponseTimeoutException} if the waiting times out.
* @param stubbedRequest the request that got stubbed
* @param actualSequence the given request
* @throws InterruptedException if the waiting is interrupted
*/
public void waitForResponses(final WilmaHttpRequest stubbedRequest, final WilmaSequence actualSequence) throws InterruptedException {
String wilmaLoggerId = stubbedRequest.getWilmaMessageId();
boolean allResponsesArrived = actualSequence.checkIfAllResponsesArrived(wilmaLoggerId);
int timeWaited = 0;
getProperties();
int waitInterval = properties.getWaitInterval();
int timeout = properties.getTimeout();
while (!allResponsesArrived) {
Thread.sleep(waitInterval);
timeWaited += waitInterval;
if (timeWaited > timeout) {
throw new ResponseTimeoutException(TIMEOUT_ERROR_MESSAGE);
}
allResponsesArrived = actualSequence.checkIfAllResponsesArrived(wilmaLoggerId);
}
}
代码示例来源:origin: epam/Wilma
@Test
public void testWaitForResponses() throws InterruptedException {
//GIVEN
given(actualSequence.checkIfAllResponsesArrived(LOGGER_ID)).willReturn(false, false, false, true);
//WHEN
underTest.waitForResponses(stubbedRequest, actualSequence);
//THEN
verify(actualSequence, times(4)).checkIfAllResponsesArrived(LOGGER_ID);
}
}
代码示例来源:origin: epam/Wilma
@Test(expectedExceptions = ResponseTimeoutException.class)
public void testWhenResponsesCannotArriveInTimeThenExceptionIsThrown() throws InterruptedException {
//GIVEN
given(actualSequence.checkIfAllResponsesArrived(LOGGER_ID)).willReturn(false);
//WHEN
underTest.waitForResponses(stubbedRequest, actualSequence);
//THEN exception is thrown
}
代码示例来源:origin: epam/Wilma
@Test
public void testCheckShouldNotLookForResponsePairOfTheGivenLoggerId() {
//GIVEN
Map<String, RequestResponsePair> messages = new HashMap<>();
RequestResponsePair pair = new RequestResponsePair(new WilmaHttpRequest());
messages.put(STUBBED_REQUEST_LOGGER_ID, pair);
given(messageStore.getMessages()).willReturn(messages);
//WHEN
boolean result = underTest.checkIfAllResponsesArrived(STUBBED_REQUEST_LOGGER_ID);
//THEN
assertTrue(result);
}
代码示例来源:origin: epam/Wilma
@Test
public void testCheckShouldReturnFalseWhenAResponseIsNull() {
//GIVEN
Map<String, RequestResponsePair> messages = new TreeMap<>();
RequestResponsePair pair = new RequestResponsePair(new WilmaHttpRequest());
pair.setResponse(new WilmaHttpResponse(isVolatile));
RequestResponsePair pair2 = new RequestResponsePair(new WilmaHttpRequest());
messages.put("id2", pair);
messages.put("id3", pair2);
given(messageStore.getMessages()).willReturn(messages);
//WHEN
boolean result = underTest.checkIfAllResponsesArrived(STUBBED_REQUEST_LOGGER_ID);
//THEN
assertFalse(result);
}
代码示例来源:origin: epam/Wilma
@Test
public void testCheckShouldReturnTrueWhenNoneOfTheResponsesAreNull() {
//GIVEN
Map<String, RequestResponsePair> messages = new TreeMap<>();
RequestResponsePair pair = new RequestResponsePair(new WilmaHttpRequest());
pair.setResponse(new WilmaHttpResponse(isVolatile));
RequestResponsePair pair2 = new RequestResponsePair(new WilmaHttpRequest());
pair2.setResponse(new WilmaHttpResponse(isVolatile));
messages.put("id2", pair);
messages.put("id3", pair2);
given(messageStore.getMessages()).willReturn(messages);
//WHEN
boolean result = underTest.checkIfAllResponsesArrived(STUBBED_REQUEST_LOGGER_ID);
//THEN
assertTrue(result);
}
}
本文整理了Java中com.epam.wilma.domain.sequence.WilmaSequence类的一些代码示例,展示了WilmaSequence类的具体用法。这些代码示例主要来源于Git
本文整理了Java中com.epam.wilma.domain.sequence.WilmaSequence.setTimeout()方法的一些代码示例,展示了WilmaSequence.setTim
本文整理了Java中com.epam.wilma.domain.sequence.WilmaSequence.addPair()方法的一些代码示例,展示了WilmaSequence.addPair()
本文整理了Java中com.epam.wilma.domain.sequence.WilmaSequence.getPairs()方法的一些代码示例,展示了WilmaSequence.getPairs
本文整理了Java中com.epam.wilma.domain.sequence.WilmaSequence.getSequenceKey()方法的一些代码示例,展示了WilmaSequence.ge
本文整理了Java中com.epam.wilma.domain.sequence.WilmaSequence.checkIfAllResponsesArrived()方法的一些代码示例,展示了Wilm
本文整理了Java中com.epam.wilma.domain.sequence.WilmaSequence.isExpired()方法的一些代码示例,展示了WilmaSequence.isExpir
本文整理了Java中com.epam.wilma.message.search.web.support.ZipOutputStreamFactory类的一些代码示例,展示了ZipOutputStrea
本文整理了Java中com.epam.wilma.message.search.web.support.ZipOutputStreamFactory.createZipOutputStream()方法
我是一名优秀的程序员,十分优秀!