changeset 10920:9c4d93d56f75

8198602: [TestBug] test.javafx.css.StylesheetTest logs IllegalArgumentException Reviewed-by: kcr, aghaisas
author arapte
date Fri, 11 May 2018 13:22:34 +0530
parents a9c1ee0bc270
children a533bdce49bf
files modules/javafx.graphics/src/test/java/test/javafx/css/StylesheetTest.java
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.graphics/src/test/java/test/javafx/css/StylesheetTest.java	Thu May 10 10:32:22 2018 +0530
+++ b/modules/javafx.graphics/src/test/java/test/javafx/css/StylesheetTest.java	Fri May 11 13:22:34 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,6 +77,8 @@
 public class StylesheetTest {
 
     String testURL = null;
+    final String EXPECTED_WARNING = "EXPECTED WARNING: This is a negative test"
+        + " to verify loop detection in CSS. A Loop detected warning message is expected.";
 
     public StylesheetTest() {
         testURL = getClass().getResource("HonorDeveloperSettingsTest_UA.css").toExternalForm();
@@ -320,6 +322,8 @@
             // reset fill
             ((StyleableProperty<Paint>)rect.fillProperty()).applyStyle(null, null);
 
+            System.err.println(EXPECTED_WARNING);
+
             // loop in style!
             rect.setStyle("-fx-base: -fx-fill; -fx-fill: -fx-base;");
             root.applyCss();
@@ -355,6 +359,8 @@
             // reset fill
             ((StyleableProperty<Paint>)rect.fillProperty()).applyStyle(null, null);
 
+            System.err.println(EXPECTED_WARNING);
+
             // loop in style!
             rect.setStyle("-fx-base: -fx-color; -fx-color: -fx-base; -fx-fill: radial-gradient(radius 100%, red, -fx-color);");
 
@@ -396,6 +402,8 @@
             // reset fill
             ((StyleableProperty<Paint>)rect.fillProperty()).applyStyle(null, null);
 
+            System.err.println(EXPECTED_WARNING);
+
             // loop in style
             root.setStyle("-fx-base: -fx-color;");
 
@@ -431,6 +439,8 @@
             // reset fill
             ((StyleableProperty<Paint>)rect.fillProperty()).applyStyle(null, null);
 
+            System.err.println(EXPECTED_WARNING);
+
             // loop in style!
             root.setStyle("-fx-base: -fx-fill;");
             rect.setStyle("-fx-fill: radial-gradient(radius 100%, derive(-fx-base, -25%), derive(-fx-base, 25%));");