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 org.junit.Test; 29 30 /** 31 * Tests for the BackgroundImage class 32 */ 33 public class BackgroundImageTest { 34 35 @Test public void dummy() { } 36 37 // @Test public void valuesAreSetCorrectly() { 38 // Image image = new Image("http://dummyUrl", true); 39 // BackgroundImage obj = new BackgroundImage(image, Repeat.SPACE, Repeat.ROUND, 40 // 1, 2, 3, 4, 5, 6, true, false, true, false, true, false); 41 // 42 // assertEquals(image, obj.getImage()); 43 // assertEquals(Repeat.SPACE, obj.getRepeatX()); 44 // assertEquals(Repeat.ROUND, obj.getRepeatY()); 45 // assertEquals(1, obj.getTop(), 0); 46 // assertEquals(2, obj.getRight(), 0); 47 // assertEquals(3, obj.getBottom(), 0); 48 // assertEquals(4, obj.getLeft(), 0); 49 // assertEquals(5, obj.getWidth(), 0); 50 // assertEquals(6, obj.getHeight(), 0); 51 // assertTrue(obj.isProportionalHPos()); 52 // assertFalse(obj.isProportionalVPos()); 53 // assertTrue(obj.isProportionalWidth()); 54 // assertFalse(obj.isProportionalHeight()); 55 // assertTrue(obj.isContain()); 56 // assertFalse(obj.isCover()); 57 // } 58 // 59 // @Test public void valuesAreSetCorrectly2() { 60 // Image image = new Image("http://dummyUrl", true); 61 // BackgroundImage obj = new BackgroundImage(image, Repeat.SPACE, Repeat.ROUND, 62 // 1, 2, 3, 4, 5, 6, false, true, false, true, false, true); 63 // 64 // assertEquals(image, obj.getImage()); 65 // assertEquals(Repeat.SPACE, obj.getRepeatX()); 66 // assertEquals(Repeat.ROUND, obj.getRepeatY()); 67 // assertEquals(1, obj.getTop(), 0); 68 // assertEquals(2, obj.getRight(), 0); 69 // assertEquals(3, obj.getBottom(), 0); 70 // assertEquals(4, obj.getLeft(), 0); 71 // assertEquals(5, obj.getWidth(), 0); 72 // assertEquals(6, obj.getHeight(), 0); 73 // assertFalse(obj.isProportionalHPos()); 74 // assertTrue(obj.isProportionalVPos()); 75 // assertFalse(obj.isProportionalWidth()); 76 // assertTrue(obj.isProportionalHeight()); 77 // assertFalse(obj.isContain()); 78 // assertTrue(obj.isCover()); 79 // } 80 // 81 // @Test public void hashingReturnsSameObject() { 82 // Map map = new HashMap(); 83 // Image image = new Image("http://dummyUrl", true); 84 // BackgroundImage obj = new BackgroundImage(image, Repeat.SPACE, Repeat.ROUND, 85 // 1, 2, 3, 4, 5, 6, true, false, true, false, true, false); 86 // map.put(obj, "YES"); 87 // assertEquals("YES", map.get(obj)); 88 // 89 // BackgroundImage equivalent = new BackgroundImage(image, Repeat.SPACE, Repeat.ROUND, 90 // 1, 2, 3, 4, 5, 6, true, false, true, false, true, false); 91 // assertEquals("YES", map.get(equivalent)); 92 // 93 // BackgroundImage different = new BackgroundImage(image, Repeat.SPACE, Repeat.ROUND, 94 // 1, 2, 3, 4, 5, 6, false, true, false, true, false, true); 95 // assertFalse(map.containsKey(different)); 96 // } 97 // 98 // @Test public void equality() { 99 // Image image = new Image("http://dummyUrl", true); 100 // BackgroundImage obj = new BackgroundImage(image, Repeat.SPACE, Repeat.ROUND, 101 // 1, 2, 3, 4, 5, 6, true, false, true, false, true, false); 102 // 103 // BackgroundImage equivalent = new BackgroundImage(image, Repeat.SPACE, Repeat.ROUND, 104 // 1, 2, 3, 4, 5, 6, true, false, true, false, true, false); 105 // 106 // assertEquals(obj, equivalent); 107 // 108 // BackgroundImage different = new BackgroundImage(image, Repeat.SPACE, Repeat.ROUND, 109 // 1, 2, 3, 4, 5, 6, false, true, false, true, false, true); 110 // assertFalse(obj.equals(different)); 111 // } 112 }