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.scene.layout;
27
28 import javafx.geometry.Side;
29 import org.junit.Test;
30
31 import static org.junit.Assert.*;
32
33 /**
34 */
35 public class BackgroundPositionTest {
36 @Test public void valuesAreCorrectAfterConstruction() {
37 BackgroundPosition pos = new BackgroundPosition(Side.LEFT, 10, false, Side.TOP, 20, false);
38
39 assertEquals(Side.LEFT, pos.getHorizontalSide());
40 assertEquals(10, pos.getHorizontalPosition(), 0);
41 assertEquals(false, pos.isHorizontalAsPercentage());
42 assertEquals(Side.TOP, pos.getVerticalSide());
43 assertEquals(20, pos.getVerticalPosition(), 0);
44 assertEquals(false, pos.isVerticalAsPercentage());
45 }
46
47 @Test public void valuesAreCorrectAfterConstruction2() {
48 BackgroundPosition pos = new BackgroundPosition(Side.RIGHT, 10, true, Side.BOTTOM, 20, true);
|
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.scene.layout;
27
28 import javafx.geometry.Side;
29 import javafx.scene.layout.BackgroundPosition;
30 import org.junit.Test;
31
32 import static org.junit.Assert.*;
33
34 /**
35 */
36 public class BackgroundPositionTest {
37 @Test public void valuesAreCorrectAfterConstruction() {
38 BackgroundPosition pos = new BackgroundPosition(Side.LEFT, 10, false, Side.TOP, 20, false);
39
40 assertEquals(Side.LEFT, pos.getHorizontalSide());
41 assertEquals(10, pos.getHorizontalPosition(), 0);
42 assertEquals(false, pos.isHorizontalAsPercentage());
43 assertEquals(Side.TOP, pos.getVerticalSide());
44 assertEquals(20, pos.getVerticalPosition(), 0);
45 assertEquals(false, pos.isVerticalAsPercentage());
46 }
47
48 @Test public void valuesAreCorrectAfterConstruction2() {
49 BackgroundPosition pos = new BackgroundPosition(Side.RIGHT, 10, true, Side.BOTTOM, 20, true);
|