vhardy 01/10/22 02:26:17 Modified: test-sources/org/apache/batik/test/svg BERenderingTest.java ParametrizedRenderingAccuracyTest.java PreconfiguredRenderingTest.java SVGRenderingAccuracyTest.java SamplesRenderingTest.java Log: SVGRenderingAccuracyTest now saves candidate reference image in 'candidate-ref' sub-directory (along with candidate-variation and accepted-variation) sub-directories when the reference image cannot be opened. This makes the task of reviewing new test images easier. Revision Changes Path 1.2 +16 -1 xml-batik/test-sources/org/apache/batik/test/svg/BERenderingTest.java Index: BERenderingTest.java =================================================================== RCS file: /home/cvs/xml-batik/test-sources/org/apache/batik/test/svg/BERenderingTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BERenderingTest.java 2001/10/17 14:50:45 1.1 +++ BERenderingTest.java 2001/10/22 09:26:17 1.2 @@ -13,7 +13,7 @@ * directory. * * @author <a href="[EMAIL PROTECTED]">Vincent Hardy</a> - * @version $Id: BERenderingTest.java,v 1.1 2001/10/17 14:50:45 vhardy Exp $ + * @version $Id: BERenderingTest.java,v 1.2 2001/10/22 09:26:17 vhardy Exp $ */ public class BERenderingTest extends PreconfiguredRenderingTest { public static final String SVG_URL_PREFIX @@ -37,6 +37,13 @@ public static final String SAVE_VARIATION_SUFFIX = "candidate-variation/"; + public static final String SAVE_CANDIDATE_REFERENCE_PREFIX + = "test-references/svgbe/"; + + public static final String SAVE_CANDIDATE_REFERENCE_SUFFIX + = "candidate-reference/"; + + protected String getSVGURLPrefix(){ return SVG_URL_PREFIX; } @@ -63,6 +70,14 @@ protected String getSaveVariationSuffix(){ return SAVE_VARIATION_SUFFIX; + } + + protected String getCandidateReferencePrefix(){ + return SAVE_CANDIDATE_REFERENCE_PREFIX; + } + + protected String getCandidateReferenceSuffix(){ + return SAVE_CANDIDATE_REFERENCE_SUFFIX; } 1.2 +11 -1 xml-batik/test-sources/org/apache/batik/test/svg/ParametrizedRenderingAccuracyTest.java Index: ParametrizedRenderingAccuracyTest.java =================================================================== RCS file: /home/cvs/xml-batik/test-sources/org/apache/batik/test/svg/ParametrizedRenderingAccuracyTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ParametrizedRenderingAccuracyTest.java 2001/10/16 10:38:10 1.1 +++ ParametrizedRenderingAccuracyTest.java 2001/10/22 09:26:17 1.2 @@ -21,7 +21,7 @@ * to the SVG file. * * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Hardy</a> - * @version $Id: ParametrizedRenderingAccuracyTest.java,v 1.1 2001/10/16 10:38:10 vhardy Exp $ + * @version $Id: ParametrizedRenderingAccuracyTest.java,v 1.2 2001/10/22 09:26:17 vhardy Exp $ */ public class ParametrizedRenderingAccuracyTest extends SamplesRenderingTest { @@ -63,6 +63,7 @@ setVariationURL(buildVariationURL(dirNfile[0], dirNfile[1])); setSaveVariation(new File(buildSaveVariationFile(dirNfile[0], dirNfile[1]))); + setCandidateReference(new File(buildCandidateReferenceFile(dirNfile[0], dirNfile[1]))); } /** @@ -91,6 +92,15 @@ */ public String buildSaveVariationFile(String svgDir, String svgFile){ return getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + parameter + PNG_EXTENSION; + } + + /** + * Gives a chance to the subclass to control the construction + * of the candidateReference URL, which is built as: + * getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + parameter + PNG_EXTENSION + */ + public String buildCandidateReferenceFile(String svgDir, String svgFile){ + return getCandidateReferencePrefix() + svgDir + getCandidateReferenceSuffix() + svgFile + parameter + PNG_EXTENSION; } } 1.3 +15 -1 xml-batik/test-sources/org/apache/batik/test/svg/PreconfiguredRenderingTest.java Index: PreconfiguredRenderingTest.java =================================================================== RCS file: /home/cvs/xml-batik/test-sources/org/apache/batik/test/svg/PreconfiguredRenderingTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PreconfiguredRenderingTest.java 2001/10/19 11:26:01 1.2 +++ PreconfiguredRenderingTest.java 2001/10/22 09:26:17 1.3 @@ -15,7 +15,7 @@ * rules for the various configuration parameters. * * @author <a href="[EMAIL PROTECTED]">Vincent Hardy</a> - * @version $Id: PreconfiguredRenderingTest.java,v 1.2 2001/10/19 11:26:01 vhardy Exp $ + * @version $Id: PreconfiguredRenderingTest.java,v 1.3 2001/10/22 09:26:17 vhardy Exp $ */ public abstract class PreconfiguredRenderingTest extends SVGRenderingAccuracyTest { /** @@ -44,6 +44,7 @@ setVariationURL(buildVariationURL(dirNfile[0], dirNfile[1])); setSaveVariation(new File(buildSaveVariationFile(dirNfile[0], dirNfile[1]))); + setCandidateReference(new File(buildCandidateReferenceFile(dirNfile[0],dirNfile[1]))); } /** @@ -108,6 +109,19 @@ protected abstract String getSaveVariationPrefix(); protected abstract String getSaveVariationSuffix(); + + /** + * Gives a chance to the subclass to control the construction + * of the candidateReference URL, which is built as: + * getCandidatereferencePrefix() + svgDir + getCandidatereferenceSuffix() + svgFile + PNG_EXTENSION + */ + public String buildCandidateReferenceFile(String svgDir, String svgFile){ + return getCandidateReferencePrefix() + svgDir + getCandidateReferenceSuffix() + svgFile + PNG_EXTENSION; + } + + protected abstract String getCandidateReferencePrefix(); + + protected abstract String getCandidateReferenceSuffix(); protected String[] breakSVGFile(String svgFile){ 1.18 +31 -2 xml-batik/test-sources/org/apache/batik/test/svg/SVGRenderingAccuracyTest.java Index: SVGRenderingAccuracyTest.java =================================================================== RCS file: /home/cvs/xml-batik/test-sources/org/apache/batik/test/svg/SVGRenderingAccuracyTest.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- SVGRenderingAccuracyTest.java 2001/10/19 11:37:13 1.17 +++ SVGRenderingAccuracyTest.java 2001/10/22 09:26:17 1.18 @@ -64,7 +64,7 @@ * all pixel values are the same). * * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Hardy</a> - * @version $Id: SVGRenderingAccuracyTest.java,v 1.17 2001/10/19 11:37:13 vhardy Exp $ + * @version $Id: SVGRenderingAccuracyTest.java,v 1.18 2001/10/22 09:26:17 vhardy Exp $ */ public class SVGRenderingAccuracyTest extends AbstractTest { /** @@ -249,6 +249,13 @@ protected File saveVariation; /** + * The File where the candidate reference + * should be saved if there is not candidate reference + * or if it cannot be opened. + */ + protected File candidateReference; + + /** * Temporary directory */ protected static File tempDirectory; @@ -356,6 +363,17 @@ } /** + * See {@link #candidateReference} + */ + public void setCandidateReference(File candidateReference){ + this.candidateReference = candidateReference; + } + + public File getCandidateReference(){ + return candidateReference; + } + + /** * Returns this <tt>Test</tt>'s name. The name is the * URL of the SVG being rendered. */ @@ -479,7 +497,18 @@ new Object[]{refImgURL.toString(), e.getMessage()})) }); report.setPassed(false); - tmpFile.delete(); + // Try and save tmp file as a candidate variation + boolean deleteTmp = true; + if (candidateReference != null){ + if (candidateReference.exists()){ + candidateReference.delete(); + } + deleteTmp = tmpFile.renameTo(candidateReference); + } + + if (deleteTmp){ + tmpFile.delete(); + } return report; } 1.2 +17 -1 xml-batik/test-sources/org/apache/batik/test/svg/SamplesRenderingTest.java Index: SamplesRenderingTest.java =================================================================== RCS file: /home/cvs/xml-batik/test-sources/org/apache/batik/test/svg/SamplesRenderingTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SamplesRenderingTest.java 2001/10/16 10:38:10 1.1 +++ SamplesRenderingTest.java 2001/10/22 09:26:17 1.2 @@ -12,7 +12,7 @@ * Preconfigured test for SVG files under the xml-batik directory. * * @author <a href="[EMAIL PROTECTED]">Vincent Hardy</a> - * @version $Id: SamplesRenderingTest.java,v 1.1 2001/10/16 10:38:10 vhardy Exp $ + * @version $Id: SamplesRenderingTest.java,v 1.2 2001/10/22 09:26:17 vhardy Exp $ */ public class SamplesRenderingTest extends PreconfiguredRenderingTest { public static final String SVG_URL_PREFIX @@ -36,6 +36,14 @@ public static final String SAVE_VARIATION_SUFFIX = "candidate-variation/"; + public static final String SAVE_CANDIDATE_REFERENCE_PREFIX + = "test-references/"; + + public static final String SAVE_CANDIDATE_REFERENCE_SUFFIX + = "candidate-reference/"; + + + protected String getSVGURLPrefix(){ return SVG_URL_PREFIX; } @@ -62,6 +70,14 @@ protected String getSaveVariationSuffix(){ return SAVE_VARIATION_SUFFIX; + } + + protected String getCandidateReferencePrefix(){ + return SAVE_CANDIDATE_REFERENCE_PREFIX; + } + + protected String getCandidateReferenceSuffix(){ + return SAVE_CANDIDATE_REFERENCE_SUFFIX; }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]