Author: mareshkau
Date: 2008-01-08 13:59:01 -0500 (Tue, 08 Jan 2008)
New Revision: 5529
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/JBIDE-1484.jsp
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/ImportProvider.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/TestJsfUtil.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentTest.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfJbideTest.java
Log:
junit code adjustment
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2008-01-08
18:55:16 UTC (rev 5528)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2008-01-08
18:59:01 UTC (rev 5529)
@@ -15,6 +15,7 @@
org.jboss.tools.common.text.ext,
org.jboss.tools.common.model,
org.jboss.tools.vpe.xulrunner,
- org.mozilla.xpcom
+ org.mozilla.xpcom,
+ org.jboss.tools.jsf.vpe.ui.test;visibility:=reexport
Eclipse-LazyStart: true
Bundle-ClassPath: jsf-test.jar
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/JBIDE-1484.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/JBIDE-1484.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/JBIDE-1484.jsp 2008-01-08
18:59:01 UTC (rev 5529)
@@ -0,0 +1,14 @@
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+
+<html>
+ <head>
+ </head>
+ <body>
+ <f:view>
+ <h:commandButton id="1" value=""></h:commandButton>
+ <h:commandButton id="2"></h:commandButton>
+ <h:commandButton id="2"
value="test"></h:commandButton>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file
Deleted:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/ImportProvider.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/ImportProvider.java 2008-01-08
18:55:16 UTC (rev 5528)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/ImportProvider.java 2008-01-08
18:59:01 UTC (rev 5529)
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.jsf.test;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
-import org.eclipse.ui.wizards.datatransfer.IImportStructureProvider;
-
-/**
- * @author sdzmitrovich
- *
- */
-public class ImportProvider implements IImportStructureProvider {
-
- /**
- * list of files which will not be imported
- */
- List unimportedFiles = new ArrayList();
-
- /**
- * Creates an instance of <code>ImportProvider</code>.
- */
- public ImportProvider() {
- super();
- }
-
- /*
- * (non-Javadoc) Method declared on IImportStructureProvider
- */
- public List getChildren(Object element) {
- File folder = (File) element;
- String[] children = folder.list();
- int childrenLength = children == null ? 0 : children.length;
- List result = new ArrayList(childrenLength);
-
- for (int i = 0; i < childrenLength; i++) {
- if (!unimportedFiles.contains(children[i]))
- result.add(new File(folder, children[i]));
- }
-
- return result;
- }
-
- /*
- * (non-Javadoc) Method declared on IImportStructureProvider
- */
- public InputStream getContents(Object element) {
- try {
- return new FileInputStream((File) element);
- } catch (FileNotFoundException e) {
- IDEWorkbenchPlugin.log(e.getLocalizedMessage(), e);
- return null;
- }
- }
-
- /*
- * (non-Javadoc) Method declared on IImportStructureProvider
- */
- public String getFullPath(Object element) {
- return ((File) element).getPath();
- }
-
- /*
- * (non-Javadoc) Method declared on IImportStructureProvider
- */
- public String getLabel(Object element) {
-
- // Get the name - if it is empty then return the path as it is a file
- // root
- File file = (File) element;
- String name = file.getName();
- if (name.length() == 0) {
- return file.getPath();
- }
- return name;
- }
-
- /*
- * (non-Javadoc) Method declared on IImportStructureProvider
- */
- public boolean isFolder(Object element) {
- return ((File) element).isDirectory();
- }
-
- public List getUnimportedFiles() {
- return unimportedFiles;
- }
-
- public void setUnimportedFiles(List unimportedFiles) {
- this.unimportedFiles = unimportedFiles;
- }
-
-}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-01-08
18:55:16 UTC (rev 5528)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-01-08
18:59:01 UTC (rev 5529)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.test;
+import org.eclipse.core.runtime.CoreException;
+
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -22,25 +24,13 @@
public class JsfAllTests {
- private final static String TEST_PROJECT_PATH = "/jsfTest";
-
- private static void prepareTests() {
-
- TestJsfUtil.importJsfPages(JsfTestPlugin.getPluginResourcePath()
- + TEST_PROJECT_PATH);
-
- }
-
public static Test suite() {
- // prepare tests
- prepareTests();
TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); //
$NON-NLS-1$
// $JUnit-BEGIN$
-
suite.addTestSuite(JsfComponentTest.class);
suite.addTestSuite(JsfJbideTest.class);
-
+ //cleanUpTests();
// $JUnit-END$
return suite;
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentTest.java 2008-01-08
18:55:16 UTC (rev 5528)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentTest.java 2008-01-08
18:59:01 UTC (rev 5529)
@@ -10,16 +10,8 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.test;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.vpe.ui.test.VpeTest;
/**
* Class for testing all jsf components
@@ -27,45 +19,15 @@
* @author sdzmitrovich
*
*/
-public class JsfComponentTest extends TestCase implements ILogListener {
+public class JsfComponentTest extends VpeTest {
- private final static String EDITOR_ID =
"org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"; // $NON-NLS-1$
- // $NON-NLS-1$
-
- // check warning log
- private final static boolean checkWarning = false;
- private Throwable exception;
-
+ //import project name
+ private static final String IMPORT_PROJECT_NAME = "jsfTest";
+
public JsfComponentTest(String name) {
- super(name);
+ super(name,IMPORT_PROJECT_NAME,JsfTestPlugin.getPluginResourcePath());
}
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- *
- * @see TestCase#setUp()
- */
-
- protected void setUp() throws Exception {
- super.setUp();
-
- Platform.addLogListener(this);
- }
-
- /**
- * Perform post-test cleanup.
- *
- * @throws Exception
- *
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- Platform.removeLogListener(this);
- }
-
/*
* JSF HTML test cases
*/
@@ -250,44 +212,4 @@
public void testView() throws PartInitException, Throwable {
performTestForJsfComponent("components/view.jsp"); // $NON-NLS-1$
}
-
- private void performTestForJsfComponent(String componentPage)
- throws PartInitException, Throwable {
- TestJsfUtil.waitForJobs();
-
- exception = null;
-
- IFile file = (IFile) TestJsfUtil.getComponentPath(componentPage);
-
- IEditorInput input = new FileEditorInput(file);
-
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .openEditor(input, EDITOR_ID, true);
-
- TestJsfUtil.waitForJobs();
- TestJsfUtil.delay(3000);
-
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeAllEditors(true);
-
- if (exception != null) {
- throw exception;
- }
- }
-
- public void logging(IStatus status, String plugin) {
- switch (status.getSeverity()) {
- case IStatus.ERROR:
- exception = status.getException();
- break;
- case IStatus.WARNING:
- if (checkWarning)
- exception = status.getException();
- break;
- default:
- break;
- }
-
- }
-
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfJbideTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfJbideTest.java 2008-01-08
18:55:16 UTC (rev 5528)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfJbideTest.java 2008-01-08
18:59:01 UTC (rev 5529)
@@ -14,81 +14,39 @@
import java.util.ArrayList;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.vpe.editor.VpeController;
-import org.jboss.tools.vpe.editor.VpeEditorPart;
import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNamedNodeMap;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
-
/**
* Class for testing all jsf bugs
*
* @author sdzmitrovich
*
*/
-public class JsfJbideTest extends TestCase implements ILogListener {
+public class JsfJbideTest extends VpeTest {
- private final static String EDITOR_ID =
"org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"; // $NON-NLS-1$
// type of input tag
private static final String ATTR_TYPE_VALUE = "radio";
+
+ //import project name
+
+ private static final String IMPORT_PROJECT_NAME = "jsfTest";
- // check warning log
- private final static boolean checkWarning = false;
-
- private Throwable exception;
-
public JsfJbideTest(String name) {
- super(name);
+ super(name,IMPORT_PROJECT_NAME,JsfTestPlugin.getPluginResourcePath());
}
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- *
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception {
-
- super.setUp();
-
- Platform.addLogListener(this);
-
- closeEditors();
- }
-
- /**
- * Perform post-test cleanup.
- *
- * @throws Exception
- *
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
-
- super.tearDown();
-
- Platform.removeLogListener(this);
-
- closeEditors();
- }
-
/*
* JBIDE's test cases
*/
@@ -108,13 +66,13 @@
public void testJBIDE_1467() throws PartInitException, Throwable {
// wait
- TestJsfUtil.waitForJobs();
+ TestUtil.waitForJobs();
// set exception
- exception = null;
+ setException(null);
// get test page path
- IFile file = (IFile) TestJsfUtil
- .getComponentPath("JBIDE/1467/JBIDE-1467.jsp");
+ IFile file = (IFile) TestUtil
+ .getComponentPath("JBIDE/1467/JBIDE-1467.jsp",getImportProjectName());
IEditorInput input = new FileEditorInput(file);
@@ -122,7 +80,7 @@
JSPMultiPageEditor part = openEditor(input);
// get dom document
- nsIDOMDocument document = getVpePageSource(part);
+ nsIDOMDocument document = getVpeVisualDocument(part);
nsIDOMElement element = document.getDocumentElement();
if (element != null) {
@@ -143,8 +101,8 @@
}
// check exception
- if (exception != null) {
- throw exception;
+ if (getException() != null) {
+ throw getException();
}
}
@@ -175,15 +133,15 @@
public void testJBIDE_1501() throws PartInitException, Throwable {
// wait
- TestJsfUtil.waitForJobs();
+ TestUtil.waitForJobs();
// set exception
- exception = null;
+ setException(null);
// _____1st Part____//
// get test page path
- IFile file = (IFile) TestJsfUtil
- .getComponentPath("JBIDE/1501/JBIDE-1501_multiple.jsp");
+ IFile file = (IFile) TestUtil
+ .getComponentPath("JBIDE/1501/JBIDE-1501_multiple.jsp",getImportProjectName());
IEditorInput input = new FileEditorInput(file);
@@ -191,7 +149,7 @@
JSPMultiPageEditor part = openEditor(input);
// get dom document
- nsIDOMDocument document = getVpePageSource(part);
+ nsIDOMDocument document = getVpeVisualDocument(part);
assertNotNull(document);
// get dom element
@@ -223,8 +181,8 @@
// _____2nd Part____//
// get test page path
- file = (IFile) TestJsfUtil
- .getComponentPath("JBIDE/1501/JBIDE-1501_size.jsp");
+ file = (IFile) TestUtil
+ .getComponentPath("JBIDE/1501/JBIDE-1501_size.jsp",getImportProjectName());
input = new FileEditorInput(file);
@@ -232,7 +190,7 @@
part = openEditor(input);
// get dom document
- document = getVpePageSource(part);
+ document = getVpeVisualDocument(part);
assertNotNull(document);
// get dom element
@@ -265,8 +223,8 @@
}
// check exception
- if (exception != null) {
- throw exception;
+ if (getException() != null) {
+ throw getException();
}
}
@@ -345,78 +303,4 @@
}
- /**
- * close all opened editors
- */
- private void closeEditors() {
-
- // wait
- TestJsfUtil.waitForJobs();
-
- // close
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeAllEditors(true);
-
- }
-
- /**
- * Open JSPMultiPageEditor editor
- *
- * @param input
- * @return
- * @throws PartInitException
- */
- private JSPMultiPageEditor openEditor(IEditorInput input)
- throws PartInitException {
-
- // get editor
- JSPMultiPageEditor part = (JSPMultiPageEditor) PlatformUI
- .getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .openEditor(input, EDITOR_ID, true);
-
- // wait for jobs
- TestJsfUtil.waitForJobs();
- // wait full initialization of vpe
- TestJsfUtil.delay(3000);
-
- return part;
-
- }
-
- /**
- * get xulrunner source page
- *
- * @param part -
- * JSPMultiPageEditor
- * @return nsIDOMDocument
- */
- private nsIDOMDocument getVpePageSource(JSPMultiPageEditor part) {
-
- VpeEditorPart visualEditor = (VpeEditorPart) part.getVisualEditor();
- VpeController vpeController = visualEditor.getController();
-
- // get xulRunner editor
- XulRunnerEditor xulRunnerEditor = vpeController.getXulRunnerEditor();
-
- // get dom document
- nsIDOMDocument document = xulRunnerEditor.getDOMDocument();
-
- return document;
- }
-
- public void logging(IStatus status, String plugin) {
- switch (status.getSeverity()) {
- case IStatus.ERROR:
- exception = status.getException();
- break;
- case IStatus.WARNING:
- if (checkWarning)
- exception = status.getException();
- break;
- default:
- break;
- }
-
- }
-
}
Deleted:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/TestJsfUtil.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/TestJsfUtil.java 2008-01-08
18:55:16 UTC (rev 5528)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/TestJsfUtil.java 2008-01-08
18:59:01 UTC (rev 5529)
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.jsf.vpe.jsf.test;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IOverwriteQuery;
-import org.eclipse.ui.wizards.datatransfer.ImportOperation;
-
-/**
- * Class for importing project from jar file
- *
- * @author sdzmitrovich
- *
- */
-public class TestJsfUtil {
- private static final String PROJECT_NAME = "JsfTest"; // $NON-NLS-1$
- private static final String COMPONENTS_PATH = "WebContent/pages"; //
$NON-NLS-1$
-
- @SuppressWarnings("restriction")
- static void importJsfPages(String path) {
-
- if (ResourcesPlugin.getWorkspace().getRoot().findMember(
- TestJsfUtil.PROJECT_NAME) != null) {
- waitForJobs();
-
- try {
- removeProject();
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- PROJECT_NAME);
-
- try {
-
- IOverwriteQuery overwrite = new IOverwriteQuery() {
- public String queryOverwrite(String pathString) {
- return ALL;
- }
- };
-
- ImportProvider importProvider = new ImportProvider();
-
- // need to remove from imported project "svn" files
- List<String> unimportedFiles = new ArrayList<String>();
- unimportedFiles.add(".svn");
-
- importProvider.setUnimportedFiles(unimportedFiles);
-
- // create import operation
- ImportOperation importOp = new ImportOperation(project
- .getFullPath(), new File(path), importProvider, overwrite);
-
- // import files just to project folder ( without old structure )
- importOp.setCreateContainerStructure(false);
-
- importOp.setContext(PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getShell());
-
- // run import
- importOp.run(new NullProgressMonitor());
-
- } catch (InvocationTargetException ite) {
- JsfTestPlugin.getPluginLog().logError(ite.getCause());
- } catch (InterruptedException ie) {
- JsfTestPlugin.getPluginLog().logError(ie);
- }
- }
-
- /**
- *
- * @return
- * @throws CoreException
- */
- static IResource getComponentPath(String componentPage)
- throws CoreException {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- PROJECT_NAME);
- if (project != null) {
- return project.getFolder(COMPONENTS_PATH).findMember(componentPage);
-
- }
-
- return null;
- }
-
- /**
- *
- * @throws CoreException
- */
- static void removeProject() throws CoreException {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- PROJECT_NAME);
- if (project != null) {
- project.delete(IResource.ALWAYS_DELETE_PROJECT_CONTENT,
- new NullProgressMonitor());
- }
- }
-
- /**
- * Process UI input but do not return for the specified time interval.
- *
- * @param waitTimeMillis
- * the number of milliseconds
- */
- public static void delay(long waitTimeMillis) {
- Display display = Display.getCurrent();
- if (display != null) {
- long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
- while (System.currentTimeMillis() < endTimeMillis) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.update();
- }
- // Otherwise, perform a simple sleep.
- else {
- try {
- Thread.sleep(waitTimeMillis);
- } catch (InterruptedException e) {
- // Ignored.
- }
- }
- }
-
- /**
- * Wait until all background tasks are complete.
- */
- public static void waitForJobs() {
- while (Job.getJobManager().currentJob() != null)
- delay(5000);
- }
-
-}