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