# HG changeset patch # User akolarkunnu # Date 1518785855 -19800 # Node ID 149647adb6332b1272bef843e9e482b28670c1a7 # Parent 1fc095fa0cd791ae7764485c1a7ee6bc8df90fce 8197549: Implement a new method similar to waitState() on Operator which run the check on event queue Reviewed-by: serb diff -r 1fc095fa0cd7 -r 149647adb633 test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/Operator.java --- a/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/Operator.java Fri Feb 16 18:17:34 2018 +0530 +++ b/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/Operator.java Fri Feb 16 18:27:35 2018 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -718,6 +718,25 @@ } } + /** + * Waits a state specified by a ComponentChooser instance on EDT queue. + * + * @param state a ComponentChooser defining the state criteria. + * @throws TimeoutExpiredException if the state has not achieved in a value + * defined by {@code "ComponentOperator.WaitStateTimeout"} + */ + public void waitStateOnQueue(final ComponentChooser state) { + waitState((comp) -> { + return (boolean) (queueTool.invokeSmoothly( + new QueueTool.QueueAction("checkComponent") { + @Override + public final Object launch() throws Exception { + return state.checkComponent(comp); + } + })); + }); + } + //////////////////////////////////////////////////////// //Mapping // ////////////////////////////////////////////////////////