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 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 StylesProgressBarTest extends BaseStyleNodeTest { 57 58 @Override 59 Node getControl() { 60 return new GetAction<Node>() { 61 @Override 62 public void run(Object... os) throws Exception { 63 ProgressBar control = new ProgressBar(); 64 control.setSkin(new ProgressBarSkin(control)); 65 setResult(control); 66 } 67 }.dispatch(Root.ROOT.getEnvironment()); 68 } 69 70 @Test 71 public void testfxindeterminatebaranimationtime () { 72 Set<String> styleNames = getStyleNames(); 73 Assert.assertNotNull(styleNames); 74 Assert.assertTrue(styleNames.contains("-fx-indeterminate-bar-animation-time")); 75 Map<String, CssMetaData> styles = getStyles(); 76 CssMetaData data = styles.get("-fx-indeterminate-bar-animation-time"); 77 Assert.assertEquals(data.getInitialValue(getControl()), 2.0); 78 } 79 80 @Test 81 public void testfxindeterminatebarescape () { 82 Set<String> styleNames = getStyleNames(); 83 Assert.assertNotNull(styleNames); 84 Assert.assertTrue(styleNames.contains("-fx-indeterminate-bar-escape")); 85 Map<String, CssMetaData> styles = getStyles(); 86 CssMetaData data = styles.get("-fx-indeterminate-bar-escape"); 87 Assert.assertEquals(data.getInitialValue(getControl()), true); 88 } 89 90 @Test 91 public void testfxindeterminatebarflip () { 92 Set<String> styleNames = getStyleNames(); 93 Assert.assertNotNull(styleNames); 94 Assert.assertTrue(styleNames.contains("-fx-indeterminate-bar-flip")); 95 Map<String, CssMetaData> styles = getStyles(); 96 CssMetaData data = styles.get("-fx-indeterminate-bar-flip"); 97 Assert.assertEquals(data.getInitialValue(getControl()), true); 98 } 99 100 @Test 101 public void testfxindeterminatebarlength () { 102 Set<String> styleNames = getStyleNames(); 103 Assert.assertNotNull(styleNames); 104 Assert.assertTrue(styleNames.contains("-fx-indeterminate-bar-length")); 105 Map<String, CssMetaData> styles = getStyles(); 106 CssMetaData data = styles.get("-fx-indeterminate-bar-length"); 107 Assert.assertEquals(data.getInitialValue(getControl()), 60.0); 108 } 109 110 111 }