Package org.eclipse.swtbot.swt.finder.waits

Examples of org.eclipse.swtbot.swt.finder.waits.DefaultCondition


     * @param connection
     *      the connection
     */
    public void waitForConnectionClosed( final Connection connection )
    {
        new SWTWorkbenchBot().waitUntil( new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return !connection.getConnectionWrapper().isConnected();
            }
View Full Code Here


     * Waits until the watched job is done.
     */
    public void waitUntilDone()
    {
        SWTBot bot = new SWTBot();
        bot.waitUntil( new DefaultCondition()
        {

            public boolean test() throws Exception
            {
                if ( done.get() )
View Full Code Here

    }


    public void waitForConnection( final String connectionName )
    {
        bot.waitUntil( new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                for ( SWTBotTreeItem item : getConnectionsTree().getAllItems() )
                {
View Full Code Here

            }
        } );

        if ( wait )
        {
            bot.waitUntil( new DefaultCondition()
            {
                public boolean test() throws Exception
                {
                    //                    if ( nextNode != null )
                    //                    {
View Full Code Here

    private void select( final SWTBotTreeItem entry )
    {
        if ( !bot.tree().isEnabled() )
        {
            bot.waitUntil( new DefaultCondition()
            {

                public boolean test() throws Exception
                {
                    return bot.tree().isEnabled();
View Full Code Here

        final Matcher<MenuItem> matcher = WidgetMatcherFactory.allOf(WidgetMatcherFactory.widgetOfType(MenuItem.class), withMnemonic);
        final ContextMenuFinder menuFinder = new FirstContextMenuFinder(tree);
       
        final List<MenuItem> items = new ArrayList<MenuItem>();

        new SWTBot().waitUntil(new DefaultCondition() {
            public String getFailureMessage() {
                return "Could not find context menu with text: " + text; //$NON-NLS-1$
            }

            public boolean test() throws Exception {
View Full Code Here

   * @return the tree item with the specified text.
   * @throws WidgetNotFoundException if the node was not found.
   */
  private SWTBotTreeItem getTreeItem(final String nodeText) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find node with text " + nodeText; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

   *
   * @param timeout the timeout in ms.
   * @throws TimeoutException if the condition does not evaluate to true after {@code timeout}ms milliseconds.
   */
  public static void waitForDisplayToAppear(long timeout) {
    waitUntil(new DefaultCondition() {

      public String getFailureMessage() {
        return "Could not find a display"; //$NON-NLS-1$
      }

View Full Code Here

  //TODO: move into some Assert class
  protected void assertEventMatches(final SWTBotText listeners, String expected) {
    expected = expected.replaceAll("time=-?\\d+", "time=SOME_TIME_AGO").replaceAll("x=\\d+", "x=X_CO_ORDINATE").replaceAll("y=\\d+", "y=Y_CO_ORDINATE");
    final Matcher<String> matcher = containsString(expected);
    bot.waitUntil(new DefaultCondition() {

      private String  text;

      public boolean test() throws Exception {
        text = listeners.getText();
View Full Code Here

  @Test
  public void waits5SecondsAndFailsForFailingCondition() throws Exception {
    final long begin = System.currentTimeMillis();
    try {
      bot.waitUntil(new DefaultCondition() {
        public boolean test() throws Exception {
          return false;
        }

        public String getFailureMessage() {
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.waits.DefaultCondition

Copyright © 2018 www.massapicom. 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.