You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2006/11/13 11:08:21 UTC
svn commit: r474225 [2/2] - in /xmlgraphics/fop/trunk: ./
src/java/org/apache/fop/apps/ src/java/org/apache/fop/area/
src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/expr/
src/java/org/apache/fop/fo/flow/ src/java/org/apache/fop/fo/pagination/ s...
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java?view=diff&rev=474225&r1=474224&r2=474225
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java Mon Nov 13 02:08:19 2006
@@ -38,18 +38,18 @@
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);
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/TraitColorTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/TraitColorTestCase.java?view=diff&rev=474225&r1=474224&r2=474225
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/TraitColorTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/TraitColorTestCase.java Mon Nov 13 02:08:19 2006
@@ -37,14 +37,14 @@
*/
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 @@
* @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 @@
* @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);
}
Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/color_1.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/color_1.xml?view=auto&rev=474225
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/color_1.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/color_1.xml Mon Nov 13 02:08:19 2006
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks colors.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Gladiator">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:declarations>
+ <fo:color-profile src="../../../src/java/org/apache/fop/pdf/sRGB Color Space Profile.icm" color-profile-name="sRGB"/>
+ <fo:color-profile src="nonexistent.icc" color-profile-name="unknown"/>
+ </fo:declarations>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block color="red">color "red"</fo:block>
+ <fo:block color="rgb(255,128,0)">color "rgb(255,128,0)"</fo:block>
+ <fo:block color="rgb(100%,50%,0%)">color "rgb(100%,50%,0%)"</fo:block>
+ <fo:block color="rgb-icc(100%,50%,0%, sRGB, 1, 0.5, 0)">color "rgb-icc(100%,50%,0%, sRGB, 1, 0.5, 0)"</fo:block>
+ <fo:block color="rgb-icc(0%,100%,0%, unknown, 1, 0.5, 0)">color "rgb-icc(0%,100%,0%, unknown, 1, 0.5, 0)"</fo:block>
+ <fo:block color="cmyk(0%,0%,20%,40%)">color "cmyk(0%,0%,20%,40%)" (Khaki)</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!-- Check page -->
+ <eval expected="#ff0000" xpath="//block[1]//text/@color"/>
+ <eval expected="#ff8000" xpath="//block[2]//text/@color"/>
+ <eval expected="#ff8000" xpath="//block[3]//text/@color"/>
+ <eval expected="fop-rgb-icc(1.0,0.5,0.0,sRGB,"../../../src/java/org/apache/fop/pdf/sRGB Color Space Profile.icm",1.0,0.5,0.0)" xpath="//block[4]//text/@color"/>
+ <eval expected="#00ff00" xpath="//block[5]//text/@color"/>
+ <eval expected="cmyk(0.0,0.0,0.2,0.4)" xpath="//block[6]//text/@color"/>
+ </checks>
+</testcase>
Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/color_1.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/color_1.xml
------------------------------------------------------------------------------
svn:keywords = Id
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org