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.com.sun.javafx.scene.layout.region; 27 28 import javafx.geometry.Insets; 29 import javafx.scene.layout.BackgroundFill; 30 import javafx.scene.paint.Color; 31 import org.junit.Test; 32 33 import java.util.HashMap; 34 35 import static org.junit.Assert.assertEquals; 36 import static org.junit.Assert.assertFalse; 37 import static org.junit.Assert.assertTrue; 38 39 /** 40 * Tests for the BackgroundFill class 41 */ 42 public class BackgroundFillTest { 43 44 @Test public void valuesAreSetCorrectly() { 45 // BackgroundFill obj = new BackgroundFill(Color.ORANGE, 1, 2, 3, 4, new Insets(20)); 46 // assertEquals(Color.ORANGE, obj.getFill()); 47 // assertEquals(1, obj.getTopLeftCornerRadius(), 0); 48 // assertEquals(2, obj.getTopRightCornerRadius(), 0); 49 // assertEquals(3, obj.getBottomRightCornerRadius(), 0); 50 // assertEquals(4, obj.getBottomLeftCornerRadius(), 0); 51 // assertEquals(new Insets(20), obj.getOffsets()); 52 } 53 54 @Test public void hashingReturnsSameObject() { 55 // HashMap<BackgroundFill, String> map = new HashMap<BackgroundFill, String>(); 56 // BackgroundFill obj = new BackgroundFill(Color.ORANGE, 1, 2, 3, 4, new Insets(20)); 57 // map.put(obj, "YES"); 58 // assertEquals("YES", map.get(obj)); 59 // 60 // BackgroundFill equivalent = new BackgroundFill(Color.ORANGE, 1, 2, 3, 4, new Insets(20)); 61 // assertEquals("YES", map.get(equivalent)); 62 // 63 // BackgroundFill different = new BackgroundFill(Color.ORANGE, 1, /*different!*/3, 3, 4, new Insets(20)); 64 // assertFalse(map.containsKey(different)); 65 } 66 67 @Test public void equality() { 68 // BackgroundFill obj = new BackgroundFill(Color.ORANGE, 1, 2, 3, 4, new Insets(20)); 69 // BackgroundFill equivalent = new BackgroundFill(Color.ORANGE, 1, 2, 3, 4, new Insets(20)); 70 // assertTrue(obj.equals(equivalent)); 71 // 72 // BackgroundFill different = new BackgroundFill(Color.ORANGE, 1, /*different!*/3, 3, 4, new Insets(20)); 73 // assertFalse(obj.equals(different)); 74 } 75 }