1 /* 2 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 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.javafx.stage; 27 28 import java.util.ArrayList; 29 import java.util.Collection; 30 import java.util.List; 31 import javafx.stage.Popup; 32 33 import org.junit.Ignore; 34 import org.junit.runner.RunWith; 35 import org.junit.runners.Parameterized; 36 import org.junit.runners.Parameterized.Parameters; 37 38 import test.com.sun.javafx.test.PropertiesTestBase; 39 import test.com.sun.javafx.test.objects.TestGroup; 40 import test.com.sun.javafx.test.objects.TestNode; 41 import test.com.sun.javafx.test.objects.TestScene; 42 import test.com.sun.javafx.test.objects.TestStage; 43 44 @Ignore ("This test is basically invalidated with the new design and needs to be rewritten") 45 @RunWith(Parameterized.class) 46 public final class Popup_parentWindow_Test extends PropertiesTestBase { 47 48 @Parameters 49 public static Collection<Object> data() { 50 final List<Object> configurations = new ArrayList<Object>(); 51 52 TestObjects to; 53 54 to = new TestObjects(); 55 configurations.add( 56 config(to.testPopup, 57 "owner", to.testStage1, to.testStage2)); 58 59 to = new TestObjects(); 60 configurations.add( 61 config(to.testPopup, 62 "owner", to.testScene1, to.testScene2)); 63 64 to = new TestObjects(); 65 configurations.add( 66 config(to.testPopup, 67 "owner", to.testRoot1, to.testRoot2)); 68 69 to = new TestObjects(); 70 configurations.add( 71 config(to.testPopup, 72 "owner", to.testNode1, to.testNode2)); 73 74 // to = new TestObjects(); 75 // to.testPopup.setParent(to.testScene1); 76 // configurations.add( 77 // config(to.testScene1, 78 // "_window", to.testStage1, to.testStage2, 79 // to.testPopup, 80 // "parentWindow", to.testStage1, to.testStage2)); 81 // 82 // to = new TestObjects(); 83 // to.testPopup.setParent(to.testNode1); 84 // configurations.add( 85 // config(to.testScene1, 86 // "_window", to.testStage1, to.testStage2, 87 // to.testPopup, 88 // "parentWindow", to.testStage1, to.testStage2)); 89 90 // Configuration extcfg; 91 // 92 // to = new TestObjects(); 93 // to.testPopup.setParent(to.testNode1); 94 // extcfg = new Configuration(to.testRoot1, 95 // "_scene", to.testScene1, to.testScene2, 96 // to.testPopup, 97 // "parentWindow", to.testStage1, 98 // to.testStage2); 99 // extcfg.setAllowMultipleNotifications(true); 100 // configurations.add(new Object[] { extcfg }); 101 102 // to = new TestObjects(); 103 // to.testPopup.setParent(to.testNode1); 104 // extcfg = new Configuration(to.testNode1, 105 // "_parent", to.testRoot1, to.testRoot2, 106 // to.testPopup, 107 // "parentWindow", to.testStage1, 108 // to.testStage2); 109 // extcfg.setAllowMultipleNotifications(true); 110 // configurations.add(new Object[] { extcfg }); 111 112 return configurations; 113 } 114 115 public Popup_parentWindow_Test(final Configuration configuration) { 116 super(configuration); 117 118 } 119 120 private static final class TestObjects { 121 public final Popup testPopup; 122 public final TestNode testNode1; 123 public final TestNode testNode2; 124 public final TestGroup testRoot1; 125 public final TestGroup testRoot2; 126 public final TestScene testScene1; 127 public final TestScene testScene2; 128 public final TestStage testStage1; 129 public final TestStage testStage2; 130 131 public TestObjects() { 132 testRoot1 = new TestGroup("ROOT_1"); 133 testRoot2 = new TestGroup("ROOT_2"); 134 135 testNode1 = new TestNode("NODE_1"); 136 testNode2 = new TestNode("NODE_2"); 137 138 testRoot1.getChildren().add(testNode1); 139 testRoot2.getChildren().add(testNode2); 140 141 testScene1 = new TestScene("SCENE_1", testRoot1); 142 testScene2 = new TestScene("SCENE_2", testRoot2); 143 144 testStage1 = new TestStage("STAGE_1"); 145 testStage2 = new TestStage("STAGE_2"); 146 147 testStage1.setScene(testScene1); 148 testStage2.setScene(testScene2); 149 150 testPopup = new Popup(); 151 } 152 153 } 154 }