assertEquals(500, command.getProperties().executionTimeoutInMilliseconds().get().intValue()); assertEquals(true, command.getProperties().executionTimeoutEnabled().get().booleanValue()); assertEquals(false, command.getProperties().executionIsolationThreadInterruptOnTimeout().get().booleanValue()); assertEquals(10, command.getProperties().executionIsolationSemaphoreMaxConcurrentRequests().get().intValue()); assertEquals(15, command.getProperties().fallbackIsolationSemaphoreMaxConcurrentRequests().get().intValue());
@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(35, (int) properties.maximumSize().get()); assertEquals(true, properties.getAllowMaximumSizeToDivergeFromCoreSize().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()); }
commandProperties.executionIsolationSemaphoreMaxConcurrentRequests().get(), commandProperties.executionIsolationStrategy().get(), commandProperties.executionIsolationThreadInterruptOnTimeout().get(), commandProperties.executionIsolationThreadPoolKeyOverride().get(), commandProperties.executionTimeoutEnabled().get(),
json.writeBooleanField("propertyValue_executionIsolationThreadInterruptOnTimeout", commandProperties.executionIsolationThreadInterruptOnTimeout().get()); json.writeStringField("propertyValue_executionIsolationThreadPoolKeyOverride", commandProperties.executionIsolationThreadPoolKeyOverride().get()); json.writeNumberField("propertyValue_executionIsolationSemaphoreMaxConcurrentRequests", commandProperties.executionIsolationSemaphoreMaxConcurrentRequests().get());
json.writeNumberField("propertyValue_executionIsolationThreadTimeoutInMilliseconds", commandProperties.executionTimeoutInMilliseconds().get()); json.writeNumberField("propertyValue_executionTimeoutInMilliseconds", commandProperties.executionTimeoutInMilliseconds().get()); json.writeBooleanField("propertyValue_executionIsolationThreadInterruptOnTimeout", commandProperties.executionIsolationThreadInterruptOnTimeout().get()); json.writeStringField("propertyValue_executionIsolationThreadPoolKeyOverride", commandProperties.executionIsolationThreadPoolKeyOverride().get()); json.writeNumberField("propertyValue_executionIsolationSemaphoreMaxConcurrentRequests", commandProperties.executionIsolationSemaphoreMaxConcurrentRequests().get());
json.writeNumberField("propertyValue_executionIsolationThreadTimeoutInMilliseconds", commandProperties.executionTimeoutInMilliseconds().get()); json.writeNumberField("propertyValue_executionTimeoutInMilliseconds", commandProperties.executionTimeoutInMilliseconds().get()); json.writeBooleanField("propertyValue_executionIsolationThreadInterruptOnTimeout", commandProperties.executionIsolationThreadInterruptOnTimeout().get()); json.writeStringField("propertyValue_executionIsolationThreadPoolKeyOverride", commandProperties.executionIsolationThreadPoolKeyOverride().get()); json.writeNumberField("propertyValue_executionIsolationSemaphoreMaxConcurrentRequests", commandProperties.executionIsolationSemaphoreMaxConcurrentRequests().get());
json.writeNumberField("propertyValue_executionIsolationThreadTimeoutInMilliseconds", commandProperties.executionTimeoutInMilliseconds().get()); json.writeNumberField("propertyValue_executionTimeoutInMilliseconds", commandProperties.executionTimeoutInMilliseconds().get()); json.writeBooleanField("propertyValue_executionIsolationThreadInterruptOnTimeout", commandProperties.executionIsolationThreadInterruptOnTimeout().get()); json.writeStringField("propertyValue_executionIsolationThreadPoolKeyOverride", commandProperties.executionIsolationThreadPoolKeyOverride().get()); json.writeNumberField("propertyValue_executionIsolationSemaphoreMaxConcurrentRequests", commandProperties.executionIsolationSemaphoreMaxConcurrentRequests().get());
commandProperties.executionIsolationSemaphoreMaxConcurrentRequests().get(), commandProperties.executionIsolationStrategy().get(), commandProperties.executionIsolationThreadInterruptOnTimeout().get(), commandProperties.executionIsolationThreadPoolKeyOverride().get(), commandProperties.executionTimeoutEnabled().get(),