diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-11-13 10:08:19 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-11-13 10:08:19 +0000 |
commit | a625241b1f303263e20c221b6059082140603867 (patch) | |
tree | 1b93f85fff796eb8e1d90391257c409a203afdee /test/java | |
parent | 3c09dd0bd232edd1c8a988dac28f2d9f6124a009 (diff) | |
download | xmlgraphics-fop-a625241b1f303263e20c221b6059082140603867.tar.gz xmlgraphics-fop-a625241b1f303263e20c221b6059082140603867.zip |
Bugzilla #40729:
Support for the rgb-icc() function and for a proprietary cmyk() function (for device CMYK colors only through the PDF renderer so far).
Submitted by: Peter Coppens <pc.subscriptions.at.gmail.com>
Patch slightly modified to comply with our Java conventions, plus some minor editing.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@474225 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
-rw-r--r-- | test/java/org/apache/fop/traits/BorderPropsTestCase.java | 6 | ||||
-rw-r--r-- | test/java/org/apache/fop/traits/TraitColorTestCase.java | 13 |
2 files changed, 9 insertions, 10 deletions
diff --git a/test/java/org/apache/fop/traits/BorderPropsTestCase.java b/test/java/org/apache/fop/traits/BorderPropsTestCase.java index e6988d423..2dea98b13 100644 --- a/test/java/org/apache/fop/traits/BorderPropsTestCase.java +++ b/test/java/org/apache/fop/traits/BorderPropsTestCase.java @@ -38,18 +38,18 @@ public class BorderPropsTestCase extends TestCase { public void testSerialization() throws Exception { Color col = new Color(1.0f, 1.0f, 0.5f, 1.0f); //Normalize: Avoid false alarms due to color conversion (rounding) - col = ColorUtil.parseColorString(ColorUtil.colorTOsRGBString(col)); + col = ColorUtil.parseColorString(null, ColorUtil.colorToString(col)); BorderProps b1 = new BorderProps(Constants.EN_DOUBLE, 1250, col, BorderProps.COLLAPSE_OUTER); String ser = b1.toString(); - BorderProps b2 = BorderProps.valueOf(ser); + BorderProps b2 = BorderProps.valueOf(null, ser); assertEquals(b1, b2); b1 = new BorderProps(Constants.EN_INSET, 9999, col, BorderProps.SEPARATE); ser = b1.toString(); - b2 = BorderProps.valueOf(ser); + b2 = BorderProps.valueOf(null, ser); assertEquals(b1, b2); } diff --git a/test/java/org/apache/fop/traits/TraitColorTestCase.java b/test/java/org/apache/fop/traits/TraitColorTestCase.java index 70c2fdd09..90f73dcc3 100644 --- a/test/java/org/apache/fop/traits/TraitColorTestCase.java +++ b/test/java/org/apache/fop/traits/TraitColorTestCase.java @@ -37,14 +37,14 @@ public class TraitColorTestCase extends TestCase { */ public void testSerialization() throws Exception { Color col = new Color(1.0f, 1.0f, 0.5f, 1.0f); - String s = ColorUtil.colorTOsRGBString(col); + String s = ColorUtil.colorToString(col); //This is what the old color spit out. Now it is 80 due to rounding //assertEquals("#ffff7f", s); assertEquals("#ffff80", s); col = new Color(1.0f, 0.0f, 0.0f, 0.8f); - s = ColorUtil.colorTOsRGBString(col); + s = ColorUtil.colorToString(col); assertEquals("#ff0000cc", s); } @@ -53,13 +53,13 @@ public class TraitColorTestCase extends TestCase { * @throws Exception if an error occurs */ public void testDeserialization() throws Exception { - Color col = ColorUtil.parseColorString("#ffff7f"); + Color col = ColorUtil.parseColorString(null, "#ffff7f"); assertEquals(255, col.getRed()); assertEquals(255, col.getGreen()); assertEquals(127, col.getBlue()); assertEquals(255, col.getAlpha()); - col = ColorUtil.parseColorString("#ff0000cc"); + col = ColorUtil.parseColorString(null, "#ff0000cc"); assertEquals(255, col.getRed()); assertEquals(0, col.getGreen()); assertEquals(0, col.getBlue()); @@ -71,9 +71,8 @@ public class TraitColorTestCase extends TestCase { * @throws Exception if an error occurs */ public void testEquals() throws Exception { - Color col1 = ColorUtil.parseColorString("#ff0000cc"); - Color col2 = ColorUtil.parseColorString("#ff0000cc"); - assertTrue(col1 != col2); + Color col1 = ColorUtil.parseColorString(null, "#ff0000cc"); + Color col2 = ColorUtil.parseColorString(null, "#ff0000cc"); assertEquals(col1, col2); } |