Package com.netflix.hystrix.strategy.concurrency

Examples of com.netflix.hystrix.strategy.concurrency.HystrixRequestContext.shutdown()


                    .getAllExecutedCommands().iterator().next();
            assertEquals("GetUserCommand", command.getCommandKey().name());
            // confirm that it was a COLLAPSED command execution
            assertTrue(command.getExecutionEvents().contains(HystrixEventType.COLLAPSED));
        } finally {
            context.shutdown();
        }
    }

    public static class UserService {
View Full Code Here


            // assert the command thread pool key name is the we're expecting
            assertEquals("CommandTestAsync", command.getThreadPoolKey().name());
            // it was successful
            assertTrue(command.getExecutionEvents().contains(HystrixEventType.SUCCESS));
        } finally {
            context.shutdown();
        }
    }

    @Test
    public void testGetUserSync() {
View Full Code Here

            assertEquals("getUserSync", command.getCommandKey().name());
            assertEquals("UserGroup", command.getCommandGroup().name());
            assertEquals("UserGroup", command.getThreadPoolKey().name());
            assertTrue(command.getExecutionEvents().contains(HystrixEventType.SUCCESS));
        } finally {
            context.shutdown();
        }
    }

    public static class UserService {
View Full Code Here

            getUserByIdCommand = getLastExecutedCommand();
            // this is the second time we've executed this command with
            // the same value so it should return from cache
            assertTrue(getUserByIdCommand.isResponseFromCache());
        } finally {
            context.shutdown();
        }

        // start a new request context
        context = HystrixRequestContext.initializeContext();
        try {
View Full Code Here

            assertEquals("1", user.getId());
            // this is a new request context so this
            // should not come from cache
            assertFalse(getUserByIdCommand.isResponseFromCache());
        } finally {
            context.shutdown();
        }
    }

    private HystrixExecutableInfo getLastExecutedCommand() {
        Collection<HystrixExecutableInfo<?>> executedCommands =
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.