aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSimon Pepping <spepping@apache.org>2011-01-14 12:58:53 +0000
committerSimon Pepping <spepping@apache.org>2011-01-14 12:58:53 +0000
commit1eaae07e7db29a870d7dd037083a3e0fc9f7dc8c (patch)
treeed323cef97a5b32384b914229211a5e79cbcb9e9 /test
parent4c8a18e4a5e33f473150b9e2f4a91461cb67cce9 (diff)
downloadxmlgraphics-fop-1eaae07e7db29a870d7dd037083a3e0fc9f7dc8c.tar.gz
xmlgraphics-fop-1eaae07e7db29a870d7dd037083a3e0fc9f7dc8c.zip
Fix deprecation warnings; add some type safety
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1058988 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/java/org/apache/fop/traits/BorderPropsTestCase.java3
-rw-r--r--test/java/org/apache/fop/util/ColorUtilTestCase.java10
2 files changed, 7 insertions, 6 deletions
diff --git a/test/java/org/apache/fop/traits/BorderPropsTestCase.java b/test/java/org/apache/fop/traits/BorderPropsTestCase.java
index be7714ba2..e142a4358 100644
--- a/test/java/org/apache/fop/traits/BorderPropsTestCase.java
+++ b/test/java/org/apache/fop/traits/BorderPropsTestCase.java
@@ -23,6 +23,7 @@ import java.awt.Color;
import junit.framework.TestCase;
+import org.apache.xmlgraphics.java2d.color.ColorSpaces;
import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace;
import org.apache.fop.fo.Constants;
@@ -50,7 +51,7 @@ public class BorderPropsTestCase extends TestCase {
assertEquals(b1, b2);
float[] cmyk = new float[] {1.0f, 1.0f, 0.5f, 1.0f};
- DeviceCMYKColorSpace cmykCs = DeviceCMYKColorSpace.getInstance();
+ DeviceCMYKColorSpace cmykCs = ColorSpaces.getDeviceCMYKColorSpace();
float[] rgb = cmykCs.toRGB(cmyk);
col = ColorExt.createFromFoRgbIcc(rgb[0], rgb[1], rgb[2],
"#CMYK", null, cmykCs, cmyk);
diff --git a/test/java/org/apache/fop/util/ColorUtilTestCase.java b/test/java/org/apache/fop/util/ColorUtilTestCase.java
index aefd2a76a..c2fb0fbc9 100644
--- a/test/java/org/apache/fop/util/ColorUtilTestCase.java
+++ b/test/java/org/apache/fop/util/ColorUtilTestCase.java
@@ -24,7 +24,7 @@ import java.awt.color.ColorSpace;
import junit.framework.TestCase;
-import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace;
+import org.apache.xmlgraphics.java2d.color.ColorSpaces;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.FopFactory;
@@ -156,7 +156,7 @@ public class ColorUtilTestCase extends TestCase {
assertEquals(255, colActual.getRed());
assertEquals(255, colActual.getGreen());
assertEquals(0, colActual.getBlue());
- assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace());
+ assertEquals(ColorSpaces.getDeviceCMYKColorSpace(), colActual.getColorSpace());
float[] comps = colActual.getColorComponents(null);
assertEquals(4, comps.length);
assertEquals(0f, comps[0], 0);
@@ -171,7 +171,7 @@ public class ColorUtilTestCase extends TestCase {
assertEquals(248, colActual.getRed());
assertEquals(199, colActual.getGreen());
assertEquals(172, colActual.getBlue());
- assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace());
+ assertEquals(ColorSpaces.getDeviceCMYKColorSpace(), colActual.getColorSpace());
comps = colActual.getColorComponents(null);
assertEquals(0.0274f, comps[0], 0.001);
assertEquals(0.2196f, comps[1], 0.001);
@@ -185,7 +185,7 @@ public class ColorUtilTestCase extends TestCase {
assertEquals(255, colActual.getRed());
assertEquals(255, colActual.getGreen());
assertEquals(0, colActual.getBlue());
- assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace());
+ assertEquals(ColorSpaces.getDeviceCMYKColorSpace(), colActual.getColorSpace());
comps = colActual.getColorComponents(null);
assertEquals(4, comps.length);
assertEquals(0f, comps[0], 0);
@@ -200,7 +200,7 @@ public class ColorUtilTestCase extends TestCase {
assertEquals(127, colActual.getRed());
assertEquals(127, colActual.getGreen());
assertEquals(127, colActual.getBlue());
- assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace());
+ assertEquals(ColorSpaces.getDeviceCMYKColorSpace(), colActual.getColorSpace());
comps = colActual.getColorComponents(null);
assertEquals(4, comps.length);
assertEquals(0f, comps[0], 0);