1 /* 2 * Copyright (c) 2014, 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 package test.css.controls.api.styles; 26 27 import javafx.css.CssMetaData; 28 import java.util.Map; 29 import java.util.Set; 30 import javafx.scene.Node; 31 import javafx.scene.control.*; 32 import javafx.scene.layout.*; 33 import javafx.scene.chart.*; 34 import javafx.scene.shape.*; 35 import javafx.scene.web.*; 36 import javafx.scene.image.*; 37 import javafx.scene.text.*; 38 import javafx.scene.*; 39 import org.junit.Assert; 40 import org.junit.BeforeClass; 41 import org.junit.Test; 42 import org.jemmy.fx.Root; 43 import org.jemmy.action.GetAction; 44 import client.test.Keywords; 45 import com.sun.javafx.scene.control.skin.*; 46 import javafx.scene.paint.Paint; 47 import javafx.geometry.Insets; 48 import com.sun.javafx.scene.layout.region.RepeatStruct; 49 import com.sun.javafx.scene.layout.region.BorderImageSlices; 50 51 52 /** 53 * Generation test 54 * @author sergey.lugovoy@oracle.com 55 */ 56 public class StylesListViewTest extends BaseStyleNodeTest { 57 58 @Override 59 Node getControl() { 60 return new GetAction<Node>() { 61 @Override 62 public void run(Object... os) throws Exception { 63 ListView control = new ListView(); 64 control.setSkin(new ListViewSkin(control)); 65 setResult(control); 66 } 67 }.dispatch(Root.ROOT.getEnvironment()); 68 } 69 70 @Test 71 public void testfxorientation () { 72 Set<String> styleNames = getStyleNames(); 73 Assert.assertNotNull(styleNames); 74 Assert.assertTrue(styleNames.contains("-fx-orientation")); 75 Map<String, CssMetaData> styles = getStyles(); 76 CssMetaData data = styles.get("-fx-orientation"); 77 Assert.assertEquals(data.getInitialValue(getControl()), javafx.geometry.Orientation.VERTICAL); 78 } 79 80 81 }