< prev index next >

tests/system/src/test/java/test/com/sun/javafx/css/StylesheetWithSecurityManagerTest.java

Print this page




  80         Color base = null;
  81         for(Rule rule : stylesheet.getRules()) {
  82             for (Selector s : rule.getSelectors()) {
  83                 if (s.applies(styleable)) {
  84                     for(Declaration decl : rule.getDeclarations()) {
  85                         if ("-fx-base".equals(decl.getProperty())) {
  86                             base = (Color)decl.getParsedValue().convert(null);
  87                         }
  88                     }
  89                 }
  90             }
  91         }
  92         assertNotNull(base);
  93         Color expected = Color.web("#ececec");
  94         assertEquals(expected.getRed(), base.getGreen(), 1E-6);
  95         assertEquals(expected.getGreen(), base.getGreen(), 1E-6);
  96         assertEquals(expected.getBlue(), base.getBlue(), 1E-6);
  97     }
  98 
  99     @Test

 100     public void testRT_38395_the_sequel() throws Exception {
 101 
 102         System.setSecurityManager(new TestSecurityManager());
 103         Stylesheet stylesheet = StyleManager.loadStylesheet("test/com/sun/javafx/css/StylesheetTest.css");
 104         assertNotNull(stylesheet);
 105 
 106         Color hoverBase = null;
 107         for(Rule rule : stylesheet.getRules()) {
 108             for (Selector s : rule.getSelectors()) {
 109                 if (s.applies(styleable)) {
 110                     for(Declaration decl : rule.getDeclarations()) {
 111                         if ("-fx-hover-base".equals(decl.getProperty())) {
 112                             hoverBase = (Color)decl.getParsedValue().convert(null);
 113                         }
 114                     }
 115                 }
 116             }
 117         }
 118         assertNotNull(hoverBase);
 119         assertEquals(Color.YELLOW.getRed(), hoverBase.getRed(), 1E-6);


  80         Color base = null;
  81         for(Rule rule : stylesheet.getRules()) {
  82             for (Selector s : rule.getSelectors()) {
  83                 if (s.applies(styleable)) {
  84                     for(Declaration decl : rule.getDeclarations()) {
  85                         if ("-fx-base".equals(decl.getProperty())) {
  86                             base = (Color)decl.getParsedValue().convert(null);
  87                         }
  88                     }
  89                 }
  90             }
  91         }
  92         assertNotNull(base);
  93         Color expected = Color.web("#ececec");
  94         assertEquals(expected.getRed(), base.getGreen(), 1E-6);
  95         assertEquals(expected.getGreen(), base.getGreen(), 1E-6);
  96         assertEquals(expected.getBlue(), base.getBlue(), 1E-6);
  97     }
  98 
  99     @Test
 100     @Ignore("8149999")
 101     public void testRT_38395_the_sequel() throws Exception {
 102 
 103         System.setSecurityManager(new TestSecurityManager());
 104         Stylesheet stylesheet = StyleManager.loadStylesheet("test/com/sun/javafx/css/StylesheetTest.css");
 105         assertNotNull(stylesheet);
 106 
 107         Color hoverBase = null;
 108         for(Rule rule : stylesheet.getRules()) {
 109             for (Selector s : rule.getSelectors()) {
 110                 if (s.applies(styleable)) {
 111                     for(Declaration decl : rule.getDeclarations()) {
 112                         if ("-fx-hover-base".equals(decl.getProperty())) {
 113                             hoverBase = (Color)decl.getParsedValue().convert(null);
 114                         }
 115                     }
 116                 }
 117             }
 118         }
 119         assertNotNull(hoverBase);
 120         assertEquals(Color.YELLOW.getRed(), hoverBase.getRed(), 1E-6);
< prev index next >