This is an automated email from the ASF dual-hosted git repository.
jtulach pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 926febe All visual library tests need to run in AWT event queue
926febe is described below
commit 926febe35298e40535f8903153c237d16efc1905
Author: Jaroslav Tulach <[email protected]>
AuthorDate: Sat Dec 30 12:38:50 2017 +0100
All visual library tests need to run in AWT event queue
---
.../visual/apichanges/AnimatorListenerTest.java | 65 +++++++++++++---------
.../modules/visual/framework/VisualTestCase.java | 5 ++
2 files changed, 43 insertions(+), 27 deletions(-)
diff --git
a/api.visual/test/unit/src/org/netbeans/modules/visual/apichanges/AnimatorListenerTest.java
b/api.visual/test/unit/src/org/netbeans/modules/visual/apichanges/AnimatorListenerTest.java
index fd63ed2..8a2b8bc 100644
---
a/api.visual/test/unit/src/org/netbeans/modules/visual/apichanges/AnimatorListenerTest.java
+++
b/api.visual/test/unit/src/org/netbeans/modules/visual/apichanges/AnimatorListenerTest.java
@@ -39,12 +39,46 @@ public class AnimatorListenerTest extends VisualTestCase {
super (name);
}
+ @Override
+ protected boolean runInEQ() {
+ return false;
+ }
+
@RandomlyFails
- public void testAnimatorListener () {
+ public void testAnimatorListener () throws InterruptedException,
InvocationTargetException {
+ Scene[] scene = { null };
+ SwingUtilities.invokeAndWait (new Runnable() {
+ @Override
+ public void run () {
+ scene[0] = initScene();
+ }
+ });
+
+ final JFrame[] frame = new JFrame[1];
+ SwingUtilities.invokeAndWait (new Runnable() {
+ @Override
+ public void run () {
+ frame[0] = showFrame (scene[0]);
+ }
+ });
+
+ Thread.sleep (2000);
+
+ SwingUtilities.invokeAndWait (new Runnable() {
+ @Override
+ public void run () {
+ frame[0].setVisible (false);
+ frame[0].dispose ();
+ }
+ });
+
+ compareReferenceFiles ();
+ }
+
+ private Scene initScene() {
final Scene scene = new Scene ();
Widget widget = new Widget (scene);
scene.addChild (widget);
-
AnimatorListener listener = new AnimatorListener() {
public void animatorStarted (AnimatorEvent event) {
getRef ().println ("Animator started");
@@ -61,36 +95,13 @@ public class AnimatorListenerTest extends VisualTestCase {
}
public void animatorPostTick (AnimatorEvent event) {
if (event.getProgress () >= 1.0)
- getRef ().println ("Animator post-tick: " + event.getProgress
());
+ getRef ().println ("Animator post-tick: " +
event.getProgress ());
}
};
scene.getSceneAnimator ().getPreferredLocationAnimator
().addAnimatorListener (listener);
widget.setPreferredLocation (new Point (0, 0));
scene.getSceneAnimator ().animatePreferredLocation (widget, new Point
(100, 100));
-
- final JFrame[] frame = new JFrame[1];
- try {
- SwingUtilities.invokeAndWait (new Runnable() {
- public void run () {
- frame[0] = showFrame (scene);
- }
- });
-
- Thread.sleep (2000);
-
- SwingUtilities.invokeAndWait (new Runnable() {
- public void run () {
- frame[0].setVisible (false);
- frame[0].dispose ();
- }
- });
- } catch (InterruptedException e) {
- throw new AssertionError (e);
- } catch (InvocationTargetException e) {
- throw new AssertionError (e);
- }
-
- compareReferenceFiles ();
+ return scene;
}
}
diff --git
a/api.visual/test/unit/src/org/netbeans/modules/visual/framework/VisualTestCase.java
b/api.visual/test/unit/src/org/netbeans/modules/visual/framework/VisualTestCase.java
index 7e3631d..98b9fc2 100644
---
a/api.visual/test/unit/src/org/netbeans/modules/visual/framework/VisualTestCase.java
+++
b/api.visual/test/unit/src/org/netbeans/modules/visual/framework/VisualTestCase.java
@@ -48,6 +48,11 @@ public class VisualTestCase extends NbTestCase {
super(testName);
}
+ @Override
+ protected boolean runInEQ() {
+ return true;
+ }
+
/**
* Shows a frame for a scene and wait until it shown on a screen. View
size is [400,300].
* @param scene the scene
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists