modules/controls/src/test/java/javafx/scene/control/AccordionTest.java

Print this page
rev 9250 : 8134762: Refactor Javafx graphics module tests for clear separation of tests
Reviewed-by:


   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 javafx.scene.control;
  27 
  28 import com.sun.javafx.application.PlatformImpl;
  29 import com.sun.javafx.pgstub.StubToolkit;
  30 import com.sun.javafx.scene.control.infrastructure.ControlTestUtils;
  31 import com.sun.javafx.scene.control.infrastructure.KeyEventFirer;
  32 import com.sun.javafx.tk.Toolkit;
  33 import javafx.scene.Scene;
  34 import javafx.scene.layout.StackPane;
  35 import javafx.stage.Stage;
  36 import javafx.beans.property.SimpleObjectProperty;
  37 import javafx.beans.value.ObservableValue;
  38 import javafx.scene.input.KeyCode;
  39 
  40 import org.junit.Before;
  41 import org.junit.Test;
  42 
  43 import static org.junit.Assert.*;

  44 
  45 /**
  46  */
  47 public class AccordionTest {    
  48     private Accordion accordion;
  49     private Toolkit tk;
  50     private Scene scene;
  51     private Stage stage;
  52     private StackPane root;    
  53     
  54     @Before public void setup() {
  55         tk = (StubToolkit)Toolkit.getToolkit();//This step is not needed (Just to make sure StubToolkit is loaded into VM)
  56         accordion = new Accordion();
  57         root = new StackPane();
  58         scene = new Scene(root);
  59         stage = new Stage();
  60         stage.setScene(scene);
  61     }
  62 
  63     /*********************************************************************




   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 javafx.scene.control;
  27 
  28 import com.sun.javafx.application.PlatformImpl;

  29 import com.sun.javafx.scene.control.infrastructure.ControlTestUtils;
  30 import com.sun.javafx.scene.control.infrastructure.KeyEventFirer;
  31 import com.sun.javafx.tk.Toolkit;
  32 import javafx.scene.Scene;
  33 import javafx.scene.layout.StackPane;
  34 import javafx.stage.Stage;
  35 import javafx.beans.property.SimpleObjectProperty;
  36 import javafx.beans.value.ObservableValue;
  37 import javafx.scene.input.KeyCode;
  38 
  39 import org.junit.Before;
  40 import org.junit.Test;
  41 
  42 import static org.junit.Assert.*;
  43 import test.com.sun.javafx.pgstub.StubToolkit;
  44 
  45 /**
  46  */
  47 public class AccordionTest {    
  48     private Accordion accordion;
  49     private Toolkit tk;
  50     private Scene scene;
  51     private Stage stage;
  52     private StackPane root;    
  53     
  54     @Before public void setup() {
  55         tk = (StubToolkit)Toolkit.getToolkit();//This step is not needed (Just to make sure StubToolkit is loaded into VM)
  56         accordion = new Accordion();
  57         root = new StackPane();
  58         scene = new Scene(root);
  59         stage = new Stage();
  60         stage.setScene(scene);
  61     }
  62 
  63     /*********************************************************************