changeset 1709:722aeb6b5389

Fixed broken test: new converters were missing from StyleConverter
author rbair
date Sat, 01 Sep 2012 08:57:07 -0700
parents ea1a2cb36e32
children 36010eb79a4f
files javafx-ui-common/src/com/sun/javafx/css/StyleConverter.java javafx-ui-common/test/unit/com/sun/javafx/css/StyleConverterTest.java
diffstat 2 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleConverter.java	Fri Aug 31 17:19:36 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleConverter.java	Sat Sep 01 08:57:07 2012 -0700
@@ -30,11 +30,9 @@
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
-
 import javafx.scene.text.Font;
-
 import com.sun.javafx.css.converters.EnumConverter;
-import java.util.List;
+import com.sun.javafx.css.converters.PaintConverter;
 
 /**
  * Converter converts ParsedValue<F,T> from type F to type T.
@@ -176,6 +174,10 @@
             styleConverter = com.sun.javafx.css.converters.PaintConverter.LinearGradientConverter.getInstance();
         }  else if (com.sun.javafx.css.converters.PaintConverter.RadialGradientConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.PaintConverter.RadialGradientConverter.getInstance();
+        }  else if (PaintConverter.ImagePatternConverter.class == converterClass) {
+            styleConverter = PaintConverter.ImagePatternConverter.getInstance();
+        }  else if (PaintConverter.RepeatingImagePatternConverter.class == converterClass) {
+            styleConverter = PaintConverter.RepeatingImagePatternConverter.getInstance();
 
         }  else if (com.sun.javafx.css.converters.SizeConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.SizeConverter.getInstance();
--- a/javafx-ui-common/test/unit/com/sun/javafx/css/StyleConverterTest.java	Fri Aug 31 17:19:36 2012 -0700
+++ b/javafx-ui-common/test/unit/com/sun/javafx/css/StyleConverterTest.java	Sat Sep 01 08:57:07 2012 -0700
@@ -49,16 +49,16 @@
         for (int i = 0; i < files.length; i++) {
             if (files[i].isFile()) {
                 String name = files[i].getName();
-		if (! name.endsWith("class")) continue;
-		try {
+                if (! name.endsWith("class")) continue;
+                try {
                     // strip .class
                     name = (name.substring(0, name.length()-6));
                     name = (pkgPrefix != null) ? pkgPrefix.concat(".").concat(name) : name;
                     Class cl = Class.forName(name, false, loader);
                     if (converterClass.isAssignableFrom(cl)) converterClassList.add(cl);
-		} catch (Exception any) {
+                } catch (Exception any) {
                     System.out.println(any.toString());
-		}
+                }
             } else if (files[i].isDirectory()) {
                 String pkg =
                     (pkgPrefix != null) ? pkgPrefix.concat(".").concat(files[i].getName()) : files[i].getName();
@@ -69,8 +69,7 @@
 
     @Test
     public void testGetInstance_Class_ForAllInstancesOfStyleConverter() {
-
-	try {
+        try {
             converterClass = Class.forName("com.sun.javafx.css.StyleConverter");
             loader = converterClass.getClassLoader();
             URL url = converterClass.getClassLoader().getResource("");
@@ -88,8 +87,8 @@
                     assertNotNull(cl.getName(), result);
                 }
             }
-	} catch(Exception any) {
+        } catch(Exception any) {
             fail(any.toString());
-	}
+        }
     }
 }
\ No newline at end of file