src/nl/knokko/gui/testing/GuiTestHelper.java
/**
	 * Checks if the specified image is currently shown. If the image is not shown,
	 * this method will keep trying for a while until the image is shown. If the
	 * image is still not shown after the retrying, a TestException will be thrown.
	 * 
	 * @param image The image that should be shown at the moment
	 */
Checks if the specified image is currently shown. If the image is not shown,
this method will keep trying for a while until the image is shown. If the
image is still not shown after the retrying, a TestException will be thrown.

@param image The image that should be shown at the moment
Checks if the specified image is currently shown . If the image is not shown this method will keep trying for a while until the image is shown . If the image is still not shown after the retrying a TestException will be thrown . @param image The image that should be shown at the moment
public void assertImageShown(BufferedImage image) {
		for (int counter = 0; counter < 256; counter++) {
			try {
				GuiComponent main = window.getMainComponent();
				if (main instanceof ImageShowingComponent) {
					Collection<BufferedImage> images = ((ImageShowingComponent) main).getShownImages();
					for (BufferedImage bi : images) {
						if (compareImages(image, bi)) {
							return;
						}
					}
				}
				System.out.println("delay a while in assertImageShown");
				delay(delayTime);
			} catch (ConcurrentModificationException concurrency) {
				System.out.println("delay a while in catch assertImageShown");
				delay(delayTime);
			}
		}
		throw new TestException("The image is not shown");
	}
public void assertImageShown ( BufferedImage image ) { for ( int counter = 0 ; counter < 256 ; counter ++ ) { try { GuiComponent main = window . getMainComponent ( ) ; if ( main instanceof ImageShowingComponent ) { Collection < BufferedImage > images = ( ( ImageShowingComponent ) main ) . getShownImages ( ) ; for ( BufferedImage bi : images ) { if ( compareImages ( image , bi ) ) { return ; } } } System . out . println ( "delay a while in assertImageShown" ) ; delay ( delayTime ) ; } catch ( ConcurrentModificationException concurrency ) { System . out . println ( "delay a while in catch assertImageShown" ) ; delay ( delayTime ) ; } } throw new TestException ( "The image is not shown" ) ; }
Checks if the specified image is currently shown.
Checks if the specified image is currently shown .
// The application has been adding components while we were iterating // Give it some extra time