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 StylesAccordionTest extends BaseStyleNodeTest {
  57 
  58     @Override
  59     Node getControl() {
  60         return new GetAction<Node>() {
  61             @Override
  62             public void run(Object... os) throws Exception {
  63                 Accordion control = new Accordion();
  64                 control.setSkin(new AccordionSkin(control));
  65                 setResult(control);
  66             }
  67         }.dispatch(Root.ROOT.getEnvironment());
  68     }
  69 
  70     @Test
  71     public void testfxblendmode () {
  72         Set<String> styleNames = getStyleNames();
  73         Assert.assertNotNull(styleNames);
  74         Assert.assertTrue(styleNames.contains("-fx-blend-mode"));
  75         Map<String, CssMetaData> styles = getStyles();
  76         CssMetaData data = styles.get("-fx-blend-mode");
  77         Assert.assertEquals(data.getInitialValue(getControl()), null);
  78     }
  79 
  80     @Test
  81     public void testfxcursor () {
  82         Set<String> styleNames = getStyleNames();
  83         Assert.assertNotNull(styleNames);
  84         Assert.assertTrue(styleNames.contains("-fx-cursor"));
  85         Map<String, CssMetaData> styles = getStyles();
  86         CssMetaData data = styles.get("-fx-cursor");
  87         Assert.assertEquals(data.getInitialValue(getControl()), null);
  88     }
  89 
  90     @Test
  91     public void testfxeffect () {
  92         Set<String> styleNames = getStyleNames();
  93         Assert.assertNotNull(styleNames);
  94         Assert.assertTrue(styleNames.contains("-fx-effect"));
  95         Map<String, CssMetaData> styles = getStyles();
  96         CssMetaData data = styles.get("-fx-effect");
  97         Assert.assertEquals(data.getInitialValue(getControl()), null);
  98     }
  99 
 100     @Test
 101     public void testfxopacity () {
 102         Set<String> styleNames = getStyleNames();
 103         Assert.assertNotNull(styleNames);
 104         Assert.assertTrue(styleNames.contains("-fx-opacity"));
 105         Map<String, CssMetaData> styles = getStyles();
 106         CssMetaData data = styles.get("-fx-opacity");
 107         Assert.assertEquals(data.getInitialValue(getControl()), 1.0);
 108     }
 109 
 110     @Test
 111     public void testfxrotate () {
 112         Set<String> styleNames = getStyleNames();
 113         Assert.assertNotNull(styleNames);
 114         Assert.assertTrue(styleNames.contains("-fx-rotate"));
 115         Map<String, CssMetaData> styles = getStyles();
 116         CssMetaData data = styles.get("-fx-rotate");
 117         Assert.assertEquals(data.getInitialValue(getControl()), 0.0);
 118     }
 119 
 120     @Test
 121     public void testfxscalex () {
 122         Set<String> styleNames = getStyleNames();
 123         Assert.assertNotNull(styleNames);
 124         Assert.assertTrue(styleNames.contains("-fx-scale-x"));
 125         Map<String, CssMetaData> styles = getStyles();
 126         CssMetaData data = styles.get("-fx-scale-x");
 127         Assert.assertEquals(data.getInitialValue(getControl()), 1.0);
 128     }
 129 
 130     @Test
 131     public void testfxscaley () {
 132         Set<String> styleNames = getStyleNames();
 133         Assert.assertNotNull(styleNames);
 134         Assert.assertTrue(styleNames.contains("-fx-scale-y"));
 135         Map<String, CssMetaData> styles = getStyles();
 136         CssMetaData data = styles.get("-fx-scale-y");
 137         Assert.assertEquals(data.getInitialValue(getControl()), 1.0);
 138     }
 139 
 140     @Test
 141     public void testfxscalez () {
 142         Set<String> styleNames = getStyleNames();
 143         Assert.assertNotNull(styleNames);
 144         Assert.assertTrue(styleNames.contains("-fx-scale-z"));
 145         Map<String, CssMetaData> styles = getStyles();
 146         CssMetaData data = styles.get("-fx-scale-z");
 147         Assert.assertEquals(data.getInitialValue(getControl()), 1.0);
 148     }
 149 
 150     @Test
 151     public void testfxskin () {
 152         Set<String> styleNames = getStyleNames();
 153         Assert.assertNotNull(styleNames);
 154         Assert.assertTrue(styleNames.contains("-fx-skin"));
 155         Map<String, CssMetaData> styles = getStyles();
 156         CssMetaData data = styles.get("-fx-skin");
 157         Assert.assertEquals(data.getInitialValue(getControl()), null);
 158     }
 159 
 160     @Test
 161     public void testfxtranslatex () {
 162         Set<String> styleNames = getStyleNames();
 163         Assert.assertNotNull(styleNames);
 164         Assert.assertTrue(styleNames.contains("-fx-translate-x"));
 165         Map<String, CssMetaData> styles = getStyles();
 166         CssMetaData data = styles.get("-fx-translate-x");
 167         Assert.assertEquals(data.getInitialValue(getControl()), 0.0);
 168     }
 169 
 170     @Test
 171     public void testfxtranslatey () {
 172         Set<String> styleNames = getStyleNames();
 173         Assert.assertNotNull(styleNames);
 174         Assert.assertTrue(styleNames.contains("-fx-translate-y"));
 175         Map<String, CssMetaData> styles = getStyles();
 176         CssMetaData data = styles.get("-fx-translate-y");
 177         Assert.assertEquals(data.getInitialValue(getControl()), 0.0);
 178     }
 179 
 180     @Test
 181     public void testfxtranslatez () {
 182         Set<String> styleNames = getStyleNames();
 183         Assert.assertNotNull(styleNames);
 184         Assert.assertTrue(styleNames.contains("-fx-translate-z"));
 185         Map<String, CssMetaData> styles = getStyles();
 186         CssMetaData data = styles.get("-fx-translate-z");
 187         Assert.assertEquals(data.getInitialValue(getControl()), 0.0);
 188     }
 189 
 190     @Test
 191     public void testvisibility () {
 192         Set<String> styleNames = getStyleNames();
 193         Assert.assertNotNull(styleNames);
 194         Assert.assertTrue(styleNames.contains("visibility"));
 195         Map<String, CssMetaData> styles = getStyles();
 196         CssMetaData data = styles.get("visibility");
 197         Assert.assertEquals(data.getInitialValue(getControl()), true);
 198     }
 199 
 200 
 201 }
--- EOF ---