Package gov.nasa.arc.mct.util.condition

Examples of gov.nasa.arc.mct.util.condition.Condition


        final AbstractButton button = TestUtilities.findDescendantButtonWithText(dlg, "Close");
        assertNotNull(button);
       
        TestUtilities.setVisible(dlg, true);
       
        Condition.waitForCondition(5000, new Condition() {
            public boolean getValue() {return dlg.isVisible();}
        });
        assertTrue(dlg.isVisible());
       
        TestUtilities.doClick(button);
       
        Condition.waitForCondition(5000, new Condition() {
            public boolean getValue() {return !dlg.isVisible();}
        });
        assertTrue(!dlg.isVisible());
    }
View Full Code Here


        EventQueue.invokeAndWait(new Runnable() {
            public void run() {
                frame.setVisible(false);
            }
        });
        Condition.waitForCondition(5000, new Condition() {
            public boolean getValue() {return !frame.isVisible();}
        });
       
        EventQueue.invokeAndWait(new Runnable() {
            public void run() {
                frame.dispose();
            }
        });
        Condition.waitForCondition(5000, new Condition() {
            public boolean getValue() {return !frame.isDisplayable();}
        });

    }
View Full Code Here

    }

    @Test
    public void testListener() {
        myHousing.setVisible(true);
        Condition.waitForCondition(5000, new Condition() {
            public boolean getValue() {return myHousing.isVisible();}
        });
        assertTrue(myHousing.isVisible());
        WindowListener listener = myHousing.getWindowListener();
        WindowEvent event = new WindowEvent(myHousing, WindowEvent.WINDOW_CLOSING);
        listener.windowClosing(event);
        myHousing.setVisible(false);
        Condition.waitForCondition(10000, new Condition() {
            public boolean getValue() {return !myHousing.isVisible();}
        });
        assertFalse(myHousing.isVisible());
    }
View Full Code Here

    assertTrue(true, "Condition timed out");
  }
 
  @Test
  public void testChangingCondition() throws Exception {
    Condition cond = new Condition() {
      private int intValue = 10;
     
      public boolean getValue() {
        return (--intValue <= 0);
      }
    };
   
    Condition.waitForCondition(5000L, cond);
    assertTrue(cond.getValue());
  }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.util.condition.Condition

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.