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 StylesCellTest extends BaseStyleNodeTest {
57
58 @Override
59 Node getControl() {
60 return new GetAction<Node>() {
61 @Override
62 public void run(Object... os) throws Exception {
63 Cell control = new Cell();
64 setResult(control);
65 }
66 }.dispatch(Root.ROOT.getEnvironment());
67 }
68
69 @Test
70 public void testfxalignment () {
71 Set<String> styleNames = getStyleNames();
72 Assert.assertNotNull(styleNames);
73 Assert.assertTrue(styleNames.contains("-fx-alignment"));
74 Map<String, CssMetaData> styles = getStyles();
75 CssMetaData data = styles.get("-fx-alignment");
76 Assert.assertEquals(data.getInitialValue(getControl()), javafx.geometry.Pos.CENTER_LEFT);
77 }
78
79 @Test
80 public void testfxblendmode () {
81 Set<String> styleNames = getStyleNames();
82 Assert.assertNotNull(styleNames);
83 Assert.assertTrue(styleNames.contains("-fx-blend-mode"));
84 Map<String, CssMetaData> styles = getStyles();
85 CssMetaData data = styles.get("-fx-blend-mode");
86 Assert.assertEquals(data.getInitialValue(getControl()), null);
87 }
88
89 @Test
90 public void testfxcellsize () {
91 Set<String> styleNames = getStyleNames();
92 Assert.assertNotNull(styleNames);
93 Assert.assertTrue(styleNames.contains("-fx-cell-size"));
94 Map<String, CssMetaData> styles = getStyles();
95 CssMetaData data = styles.get("-fx-cell-size");
96 Assert.assertEquals(data.getInitialValue(getControl()), "15");
97 }
98
99 @Test
100 public void testfxcontentdisplay () {
101 Set<String> styleNames = getStyleNames();
102 Assert.assertNotNull(styleNames);
103 Assert.assertTrue(styleNames.contains("-fx-content-display"));
104 Map<String, CssMetaData> styles = getStyles();
105 CssMetaData data = styles.get("-fx-content-display");
106 Assert.assertEquals(data.getInitialValue(getControl()), javafx.scene.control.ContentDisplay.LEFT);
107 }
108
109 @Test
110 public void testfxcursor () {
111 Set<String> styleNames = getStyleNames();
112 Assert.assertNotNull(styleNames);
113 Assert.assertTrue(styleNames.contains("-fx-cursor"));
114 Map<String, CssMetaData> styles = getStyles();
115 CssMetaData data = styles.get("-fx-cursor");
116 Assert.assertEquals(data.getInitialValue(getControl()), null);
|
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.text.*;
33 import org.junit.Assert;
34 import org.junit.Test;
35 import org.jemmy.fx.Root;
36 import org.jemmy.action.GetAction;
37 import javafx.geometry.Insets;
38
39
40 /**
41 * Generation test
42 * @author sergey.lugovoy@oracle.com
43 */
44 public class StylesCellTest extends BaseStyleNodeTest {
45
46 @Override
47 Node getControl() {
48 return new GetAction<Node>() {
49 @Override
50 public void run(Object... os) throws Exception {
51 Cell control = new Cell();
52 setResult(control);
53 }
54 }.dispatch(Root.ROOT.getEnvironment());
55 }
56
57 @Test
58 public void testfxalignment () {
59 Set<String> styleNames = getStyleNames();
60 Assert.assertNotNull(styleNames);
61 Assert.assertTrue(styleNames.contains("-fx-alignment"));
62 Map<String, CssMetaData> styles = getStyles();
63 CssMetaData data = styles.get("-fx-alignment");
64 Assert.assertEquals(data.getInitialValue(getControl()), javafx.geometry.Pos.CENTER_LEFT);
65 }
66
67 @Test
68 public void testfxblendmode () {
69 Set<String> styleNames = getStyleNames();
70 Assert.assertNotNull(styleNames);
71 Assert.assertTrue(styleNames.contains("-fx-blend-mode"));
72 Map<String, CssMetaData> styles = getStyles();
73 CssMetaData data = styles.get("-fx-blend-mode");
74 Assert.assertEquals(data.getInitialValue(getControl()), null);
75 }
76
77 @Test
78 public void testfxcontentdisplay () {
79 Set<String> styleNames = getStyleNames();
80 Assert.assertNotNull(styleNames);
81 Assert.assertTrue(styleNames.contains("-fx-content-display"));
82 Map<String, CssMetaData> styles = getStyles();
83 CssMetaData data = styles.get("-fx-content-display");
84 Assert.assertEquals(data.getInitialValue(getControl()), javafx.scene.control.ContentDisplay.LEFT);
85 }
86
87 @Test
88 public void testfxcursor () {
89 Set<String> styleNames = getStyleNames();
90 Assert.assertNotNull(styleNames);
91 Assert.assertTrue(styleNames.contains("-fx-cursor"));
92 Map<String, CssMetaData> styles = getStyles();
93 CssMetaData data = styles.get("-fx-cursor");
94 Assert.assertEquals(data.getInitialValue(getControl()), null);
|