lwjgl test: fix build exceed timeout

experimental
Kirill Vainer 9 years ago
parent 3d82f5c459
commit 961bf92734
  1. 14
      jme3-lwjgl/src/test/java/com/jme3/app/LwjglAppTest.java

@ -30,6 +30,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.jme3.app;
import com.jme3.renderer.RenderManager;
import com.jme3.system.JmeContext;
import java.awt.GraphicsEnvironment;
@ -69,15 +70,19 @@ public class LwjglAppTest {
app.setLostFocusBehavior(LostFocusBehavior.Disabled);
// start the application - simple init / update will be called once.
app.start(type, true); assert app.isStarted();
app.start(type, true);
assert app.isStarted();
// stop the application, wait a bit, then start it again.
app.stop(true); assert !app.isStarted();
app.stop(true);
assert !app.isStarted();
Thread.sleep(100);
app.start(type, true); assert app.isStarted();
app.stop(true); assert !app.isStarted();
app.start(type, true);
assert app.isStarted();
app.stop(true);
assert !app.isStarted();
// make sure each method was called twice.
assertEquals(2, simpleInitAppInvocations.get());
@ -98,6 +103,7 @@ public class LwjglAppTest {
@Test
public void testOffscreenSurface() throws InterruptedException {
assumeFalse(GraphicsEnvironment.isHeadless());
doStopStart(new TestApp(), JmeContext.Type.OffscreenSurface);
}

Loading…
Cancel
Save