public static GlassFishV3ServerNode checkServerShown() { JTreeOperator tree = new RuntimeTabOperator().getRootNode().tree(); long oldValue = tree.getTimeouts().getTimeout("JTreeOperator.WaitNextNodeTimeout"); tree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", 1); GlassFishV3ServerNode result = null; try { result = GlassFishV3ServerNode.invoke(); } catch (TimeoutExpiredException e) { } finally { tree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", oldValue); } return result; }
public Timeouts getTimeouts() { Timeouts timeouts = operator.getTimeouts(); Timeouts times = timeouts.cloneThis(); times.setTimeout("Waiter.WaitingTime", timeouts.getTimeout(timeout)); return times; } }
public static void waitToAvoidInstability(int time) { try { eventTool.getTimeouts().setTimeout("EventTool.WaitNoEventTimeout", Math.max(600, time)); eventTool.waitNoEvent(time); } catch (TimeoutExpiredException e) { // Ignore } } }
private static Object waitFor(Waitable action) { Waiter waiter = new Waiter(action); waiter.getTimeouts().setTimeout("Waiter.WaitingTime", 120000); try { return waiter.waitAction(null); } catch (InterruptedException ex) { throw new JemmyException(action.getDescription() + " has been " + "interrupted.", ex); } } }
public static GlassFishV2ServerNode checkServerShown() { JTreeOperator tree = new RuntimeTabOperator().getRootNode().tree(); long oldValue = tree.getTimeouts().getTimeout("JTreeOperator.WaitNextNodeTimeout"); tree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", 1); GlassFishV2ServerNode result = null; try { result = GlassFishV2ServerNode.invoke(); } catch(TimeoutExpiredException e) { } finally { tree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", oldValue); } return result; }
private static Object waitFor(Waitable action) { Waiter waiter = new Waiter(action); waiter.getTimeouts().setTimeout("Waiter.WaitingTime", 120000); try { return waiter.waitAction(null); } catch (InterruptedException ex) { throw new JemmyException(action.getDescription() + " has been " + "interrupted.", ex); } } }
JTreeOperator runtimeTree = rto.tree(); long oldTimeout = runtimeTree.getTimeouts().getTimeout("JTreeOperator.WaitNextNodeTimeout"); runtimeTree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", 6000); runtimeTree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", oldTimeout);
/** * get a JDialogOperator object if it is open * * @param title * the Dialog title * @param secondsToWait * how many seconds to wait for the dialog to appear * @return */ public JDialogOperator getDialogIfExists(String title, int secondsToWait) { DialogWaiter waiter = new DialogWaiter(); waiter.getTimeouts().setTimeout("DialogWaiter.WaitDialogTimeout", secondsToWait * 1000); JDialogOperator dialog; try { waiter.waitDialog(new ComponentChooserHelper(title)); dialog = new JDialogOperator(new ComponentChooserHelper(title)); } catch (Exception e) { return null; } return dialog; }
JTreeOperator runtimeTree = rto.tree(); long oldTimeout = runtimeTree.getTimeouts().getTimeout("JTreeOperator.WaitNextNodeTimeout"); runtimeTree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", 6000); new JButtonOperator(addServerInstanceDialog, finishButtonCaption).push(); runtimeTree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", oldTimeout); return GlassFishV3ServerNode.invoke();