< prev index next >

tests/system/src/test/java/test/com/sun/javafx/application/SceneGraphThreadCommon.java

Print this page
rev 9491 : 8145203: Refactor systemTests for clear separation of tests
Reviewed-by: kcr


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.javafx.application;
  27 
  28 import java.util.concurrent.Callable;
  29 import java.util.concurrent.CountDownLatch;
  30 import java.util.concurrent.TimeUnit;
  31 import java.util.concurrent.atomic.AtomicReference;
  32 import javafx.application.Application;
  33 import javafx.application.Platform;
  34 import javafx.geometry.Pos;
  35 import javafx.scene.Group;
  36 import javafx.scene.Node;
  37 import javafx.scene.Scene;
  38 import javafx.scene.control.Button;
  39 import javafx.scene.control.ContextMenu;
  40 import javafx.scene.control.Label;
  41 import javafx.scene.control.Tooltip;
  42 import javafx.scene.layout.StackPane;
  43 import javafx.scene.shape.Circle;
  44 import javafx.scene.shape.Rectangle;
  45 import javafx.stage.Stage;
  46 import junit.framework.AssertionFailedError;
  47 import org.junit.AfterClass;
  48 import util.Util;
  49 
  50 import static org.junit.Assert.*;
  51 import static util.Util.TIMEOUT;
  52 
  53 /**
  54  * Unit tests for scene graph construction on a background thread
  55  */
  56 public class SceneGraphThreadCommon {
  57 
  58     // Sleep time showing/hiding window in milliseconds
  59     private static final int SLEEP_TIME = 1000;
  60 
  61     // Latch indicating that the start method has been called
  62     private static final CountDownLatch launchLatch = new CountDownLatch(1);
  63 
  64     // Completion latch indicating that the launch method has returned
  65     private static final CountDownLatch doneLatch = new CountDownLatch(1);
  66 
  67     // Callable to create the node in question on the init thread
  68     static volatile Callable<Node> initCallable;
  69 
  70     // Singleton Application instance
  71     static MyApp myApp;




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package test.com.sun.javafx.application;
  27 
  28 import java.util.concurrent.Callable;
  29 import java.util.concurrent.CountDownLatch;
  30 import java.util.concurrent.TimeUnit;
  31 import java.util.concurrent.atomic.AtomicReference;
  32 import javafx.application.Application;
  33 import javafx.application.Platform;
  34 import javafx.geometry.Pos;
  35 import javafx.scene.Group;
  36 import javafx.scene.Node;
  37 import javafx.scene.Scene;
  38 import javafx.scene.control.Button;
  39 import javafx.scene.control.ContextMenu;
  40 import javafx.scene.control.Label;
  41 import javafx.scene.control.Tooltip;
  42 import javafx.scene.layout.StackPane;
  43 import javafx.scene.shape.Circle;
  44 import javafx.scene.shape.Rectangle;
  45 import javafx.stage.Stage;
  46 import junit.framework.AssertionFailedError;
  47 import org.junit.AfterClass;
  48 import test.util.Util;
  49 
  50 import static org.junit.Assert.*;
  51 import static test.util.Util.TIMEOUT;
  52 
  53 /**
  54  * Unit tests for scene graph construction on a background thread
  55  */
  56 public class SceneGraphThreadCommon {
  57 
  58     // Sleep time showing/hiding window in milliseconds
  59     private static final int SLEEP_TIME = 1000;
  60 
  61     // Latch indicating that the start method has been called
  62     private static final CountDownLatch launchLatch = new CountDownLatch(1);
  63 
  64     // Completion latch indicating that the launch method has returned
  65     private static final CountDownLatch doneLatch = new CountDownLatch(1);
  66 
  67     // Callable to create the node in question on the init thread
  68     static volatile Callable<Node> initCallable;
  69 
  70     // Singleton Application instance
  71     static MyApp myApp;


< prev index next >