< prev index next >

functional/FXCssTests/test/test/css/controls/api/styles/StylesAnchorPaneTest.java

Print this page
rev 338 : 8165238: [TEST BUG] FXCssAutomated StylesRegionTest/testfxborderimagewidth fails with array comparison
Summary: Tests were expecting incorrect values, changed that values to fx8 defaults.


  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 StylesAnchorPaneTest extends BaseStyleNodeTest {
  57 
  58     @Override
  59     Node getControl() {
  60         return new GetAction<Node>() {
  61             @Override
  62             public void run(Object... os) throws Exception {
  63                 AnchorPane control = new AnchorPane();
  64 
  65                 setResult(control);


 189         Assert.assertTrue(checkBorderImageSlices((BorderImageSlices[]) data.getInitialValue(getControl()), new BorderImageSlices[]{new BorderImageSlices(new BorderWidths(1.0,1.0,1.0,1.0,true,true,true,true),false)}));
 190     }
 191 
 192     @Test
 193     public void testfxborderimagesource () {
 194         Set<String> styleNames = getStyleNames();
 195         Assert.assertNotNull(styleNames);
 196         Assert.assertTrue(styleNames.contains("-fx-border-image-source"));
 197         Map<String, CssMetaData> styles = getStyles();
 198         CssMetaData data = styles.get("-fx-border-image-source");
 199         Assert.assertEquals(data.getInitialValue(getControl()), null);
 200     }
 201 
 202     @Test
 203     public void testfxborderimagewidth () {
 204         Set<String> styleNames = getStyleNames();
 205         Assert.assertNotNull(styleNames);
 206         Assert.assertTrue(styleNames.contains("-fx-border-image-width"));
 207         Map<String, CssMetaData> styles = getStyles();
 208         CssMetaData data = styles.get("-fx-border-image-width");
 209         Assert.assertArrayEquals((BorderWidths[])data.getInitialValue(getControl()), new BorderWidths[]{new BorderWidths(0, 0, 0, 0)});
 210     }
 211 
 212     @Test
 213     public void testfxborderinsets () {
 214         Set<String> styleNames = getStyleNames();
 215         Assert.assertNotNull(styleNames);
 216         Assert.assertTrue(styleNames.contains("-fx-border-insets"));
 217         Map<String, CssMetaData> styles = getStyles();
 218         CssMetaData data = styles.get("-fx-border-insets");
 219         Assert.assertArrayEquals((Insets[])data.getInitialValue(getControl()), null);
 220     }
 221 
 222     @Test
 223     public void testfxborderradius () {
 224         Set<String> styleNames = getStyleNames();
 225         Assert.assertNotNull(styleNames);
 226         Assert.assertTrue(styleNames.contains("-fx-border-radius"));
 227         Map<String, CssMetaData> styles = getStyles();
 228         CssMetaData data = styles.get("-fx-border-radius");
 229         Assert.assertEquals(data.getInitialValue(getControl()), null);




  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.layout.*;






  32 import org.junit.Assert;

  33 import org.junit.Test;
  34 import org.jemmy.fx.Root;
  35 import org.jemmy.action.GetAction;


  36 import javafx.scene.paint.Paint;
  37 import javafx.geometry.Insets;
  38 import com.sun.javafx.scene.layout.region.RepeatStruct;
  39 import com.sun.javafx.scene.layout.region.BorderImageSlices;
  40 
  41 
  42 /**
  43  * Generation test
  44  * @author sergey.lugovoy@oracle.com
  45  */
  46 public class StylesAnchorPaneTest extends BaseStyleNodeTest {
  47 
  48     @Override
  49     Node getControl() {
  50         return new GetAction<Node>() {
  51             @Override
  52             public void run(Object... os) throws Exception {
  53                 AnchorPane control = new AnchorPane();
  54 
  55                 setResult(control);


 179         Assert.assertTrue(checkBorderImageSlices((BorderImageSlices[]) data.getInitialValue(getControl()), new BorderImageSlices[]{new BorderImageSlices(new BorderWidths(1.0,1.0,1.0,1.0,true,true,true,true),false)}));
 180     }
 181 
 182     @Test
 183     public void testfxborderimagesource () {
 184         Set<String> styleNames = getStyleNames();
 185         Assert.assertNotNull(styleNames);
 186         Assert.assertTrue(styleNames.contains("-fx-border-image-source"));
 187         Map<String, CssMetaData> styles = getStyles();
 188         CssMetaData data = styles.get("-fx-border-image-source");
 189         Assert.assertEquals(data.getInitialValue(getControl()), null);
 190     }
 191 
 192     @Test
 193     public void testfxborderimagewidth () {
 194         Set<String> styleNames = getStyleNames();
 195         Assert.assertNotNull(styleNames);
 196         Assert.assertTrue(styleNames.contains("-fx-border-image-width"));
 197         Map<String, CssMetaData> styles = getStyles();
 198         CssMetaData data = styles.get("-fx-border-image-width");
 199         Assert.assertArrayEquals((BorderWidths[])data.getInitialValue(getControl()), DEFAULT_WIDTHS);
 200     }
 201 
 202     @Test
 203     public void testfxborderinsets () {
 204         Set<String> styleNames = getStyleNames();
 205         Assert.assertNotNull(styleNames);
 206         Assert.assertTrue(styleNames.contains("-fx-border-insets"));
 207         Map<String, CssMetaData> styles = getStyles();
 208         CssMetaData data = styles.get("-fx-border-insets");
 209         Assert.assertArrayEquals((Insets[])data.getInitialValue(getControl()), null);
 210     }
 211 
 212     @Test
 213     public void testfxborderradius () {
 214         Set<String> styleNames = getStyleNames();
 215         Assert.assertNotNull(styleNames);
 216         Assert.assertTrue(styleNames.contains("-fx-border-radius"));
 217         Map<String, CssMetaData> styles = getStyles();
 218         CssMetaData data = styles.get("-fx-border-radius");
 219         Assert.assertEquals(data.getInitialValue(getControl()), null);


< prev index next >