use of com.netflix.hystrix.HystrixThreadPoolProperties in project Hystrix by Netflix.
the class BasicCommandPropertiesTest method testGetUser.
@Test
public void testGetUser() throws NoSuchFieldException, IllegalAccessException {
User u1 = userService.getUser("1", "name: ");
assertEquals("name: 1", u1.getName());
assertEquals(1, HystrixRequestLog.getCurrentRequest().getAllExecutedCommands().size());
HystrixInvokableInfo<?> command = HystrixRequestLog.getCurrentRequest().getAllExecutedCommands().iterator().next();
assertEquals("GetUserCommand", command.getCommandKey().name());
assertEquals("UserGroupKey", command.getCommandGroup().name());
assertEquals("Test", command.getThreadPoolKey().name());
assertTrue(command.getExecutionEvents().contains(HystrixEventType.SUCCESS));
// assert properties
assertEquals(110, command.getProperties().executionTimeoutInMilliseconds().get().intValue());
assertEquals(false, command.getProperties().executionIsolationThreadInterruptOnTimeout().get());
HystrixThreadPoolProperties properties = getThreadPoolProperties(command);
assertEquals(30, (int) properties.coreSize().get());
assertEquals(101, (int) properties.maxQueueSize().get());
assertEquals(2, (int) properties.keepAliveTimeMinutes().get());
assertEquals(15, (int) properties.queueSizeRejectionThreshold().get());
assertEquals(1440, (int) properties.metricsRollingStatisticalWindowInMilliseconds().get());
assertEquals(12, (int) properties.metricsRollingStatisticalWindowBuckets().get());
}
use of com.netflix.hystrix.HystrixThreadPoolProperties in project Hystrix by Netflix.
the class BasicFallbackDefaultPropertiesTest method testFallbackInheritsThreadPollProperties.
@Test
public void testFallbackInheritsThreadPollProperties() {
service.commandWithFallbackInheritsDefaultProperties();
com.netflix.hystrix.HystrixInvokableInfo fallbackCommand = getHystrixCommandByKey("fallbackInheritsDefaultProperties");
HystrixThreadPoolProperties properties = getThreadPoolProperties(fallbackCommand);
assertEquals(123, properties.maxQueueSize().get().intValue());
}
use of com.netflix.hystrix.HystrixThreadPoolProperties in project Hystrix by Netflix.
the class BasicFallbackDefaultPropertiesTest method testCommandOverridesDefaultPropertiesWithFallbackInheritsDefaultProperties.
@Test
public void testCommandOverridesDefaultPropertiesWithFallbackInheritsDefaultProperties() {
service.commandOverridesDefaultPropertiesWithFallbackInheritsDefaultProperties();
com.netflix.hystrix.HystrixInvokableInfo fallbackCommand = getHystrixCommandByKey("fallbackInheritsDefaultProperties");
HystrixThreadPoolProperties properties = getThreadPoolProperties(fallbackCommand);
assertEquals("DefaultGroupKey", fallbackCommand.getCommandGroup().name());
assertEquals("DefaultThreadPoolKey", fallbackCommand.getThreadPoolKey().name());
assertEquals(456, fallbackCommand.getProperties().executionTimeoutInMilliseconds().get().intValue());
assertEquals(123, properties.maxQueueSize().get().intValue());
}
Aggregations