public void waitForServiceAvailable(String... links) { for (String link : links) { TestContext ctx = testCreate(1); this.registerForServiceAvailability(ctx.getCompletion(), link); ctx.await(); } }
/** * Login to one of the node in the node group. * * The nodes in the node group should have same auth policy in order for the login to work * seamlessly on all nodes. * * @return auth token */ public static String login(TestNodeGroupManager nodeGroup, String username, String password) { ServiceHost peer = nodeGroup.getHost(); return login(peer, username, password, true); }
/** * Attempt to login one of the host in the node group, and expect it to fail. */ public static void loginExpectFailure(TestNodeGroupManager nodeGroup, String username, String password) { ServiceHost peer = nodeGroup.getHost(); loginExpectFailure(peer, username, password); }
public CompletionHandler getSuccessOrFailureCompletion() { return (o, e) -> { completeIteration(); }; }
/** * Consider using {@link #fail(Throwable)}. * This method exists for backward compatibility, and may be deprecated/deleted in future. */ public void failIteration(Throwable e) { fail(e); }
/** * Login and set the auth token to be used by {@link TestRequestSender}. * * NOTE: * Auth token is only used by {@link TestRequestSender}. * * @return auth token */ public static String loginAndSetToken(TestNodeGroupManager nodeGroup, String username, String password) { ServiceHost peer = nodeGroup.getHost(); String authToken = login(peer, username, password); TestRequestSender.setAuthToken(authToken); return authToken; }
public static void waitFor(Duration waitDuration, WaitHandler wh) { waitFor(new WaitConfig().setDuration(waitDuration), wh, () -> "waitFor timed out"); }
/** * Inject user identity into operation context. * * @param userServicePath user document link */ public AuthorizationContext assumeIdentity(String userServicePath) throws GeneralSecurityException { return assumeIdentity(userServicePath, null); }
public static void executeSafely(ExecutableBlock block) { try { block.execute(); } catch (Throwable throwable) { throwsUnchecked(throwable); } } }
public static String loginAndSetToken(ServiceHost host, String username, String password) { String authToken = login(host, username, password); TestRequestSender.setAuthToken(authToken); return authToken; }
private TestRequestSender getTestRequestSender() { ServiceHost peer = getHost(); return new TestRequestSender(peer); }
public void joinNodesAndVerifyConvergence(String customGroupPath, int hostCount, int memberCount, Map<URI, EnumSet<NodeOption>> expectedOptionsPerNode) throws Throwable { joinNodesAndVerifyConvergence(customGroupPath, hostCount, memberCount, expectedOptionsPerNode, true); }
public void waitForServiceAvailable(String... links) { for (String link : links) { TestContext ctx = testCreate(1); this.registerForServiceAvailability(ctx.getCompletion(), link); ctx.await(); } }
/** * Login and set the auth token to be used by {@link TestRequestSender}. * * NOTE: * Auth token is only used by {@link TestRequestSender}. * * @return auth token */ public static String loginAndSetToken(TestNodeGroupManager nodeGroup, String username, String password) { ServiceHost peer = nodeGroup.getHost(); String authToken = login(peer, username, password); TestRequestSender.setAuthToken(authToken); return authToken; }
public static void waitFor(Duration waitDuration, WaitHandler wh, String timeoutMessage) { waitFor(new WaitConfig().setDuration(waitDuration), wh, () -> timeoutMessage); }
/** * Login to one of the node in the node group. * * The nodes in the node group should have same auth policy in order for the login to work * seamlessly on all nodes. * * @return auth token */ public static String login(TestNodeGroupManager nodeGroup, String username, String password) { ServiceHost peer = nodeGroup.getHost(); return login(peer, username, password, true); }
/** * Attempt to login one of the host in the node group, and expect it to fail. */ public static void loginExpectFailure(TestNodeGroupManager nodeGroup, String username, String password) { ServiceHost peer = nodeGroup.getHost(); loginExpectFailure(peer, username, password); }
public static void executeSafely(ExecutableBlock block) { try { block.execute(); } catch (Throwable throwable) { throwsUnchecked(throwable); } } }
public static String loginAndSetToken(ServiceHost host, String username, String password) { String authToken = login(host, username, password); TestRequestSender.setAuthToken(authToken); return authToken; }
private TestRequestSender getTestRequestSender() { ServiceHost peer = getHost(); return new TestRequestSender(peer); }