diff options
Diffstat (limited to 'qadevOOo/runner/convwatch/ConvWatch.java')
-rw-r--r-- | qadevOOo/runner/convwatch/ConvWatch.java | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/qadevOOo/runner/convwatch/ConvWatch.java b/qadevOOo/runner/convwatch/ConvWatch.java index 76dc3522d2e0..138dcef519c0 100644 --- a/qadevOOo/runner/convwatch/ConvWatch.java +++ b/qadevOOo/runner/convwatch/ConvWatch.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,7 +36,7 @@ import convwatch.StatusHelper; import helper.URLHelper; import java.io.File; -public class ConvWatch +public class ConvWatch { String getBuildID_FromFile(String _sInfoFile) @@ -50,13 +50,13 @@ public class ConvWatch return sBuildID; } /** - * Check if given document (_sAbsoluteInputFile) and it's postscript representation (_sAbsoluteReferenceFile) produce + * Check if given document (_sAbsoluteInputFile) and it's postscript representation (_sAbsoluteReferenceFile) produce * the same output like the StarOffice / OpenOffice.org which is accessable with XMultiServiceFactory. * Here a simple graphically difference check is run through. * * Hint: In the OutputPath all needed files will create, there must * be very much space. It's not possible to say how much. - * One page need up to 800kb as jpeg. + * One page need up to 800kb as jpeg. * Sample: If a document contains 2 pages, we need 2*800kb for prn * output and 2*800kb for ps output and 2*800kb for it's difference * output. So up to 4800kb or 4.8mb. @@ -65,12 +65,12 @@ public class ConvWatch * * It's also absolutlly impossible to say, how much time this functions consume. */ - + StatusHelper[] createPostscriptStartCheck(GraphicalTestArguments _aGTA, String _sOutputPath, String _sAbsoluteInputFile, String _sAbsoluteReferenceFile) throws ConvWatchCancelException { -// TODO: some more checks +// TODO: some more checks if (! FileHelper.exists(_sAbsoluteInputFile)) { @@ -88,7 +88,7 @@ public class ConvWatch File aAbsoluteReferenceFile = new File(_sAbsoluteReferenceFile); if (aAbsoluteReferenceFile.isDirectory()) - { + { String sBasename = FileHelper.getBasename(_sAbsoluteInputFile); String sNameNoSuffix = FileHelper.getNameNoSuffix(sBasename); String sAbsoluteReferenceFileInfo = _sAbsoluteReferenceFile + fs + sNameNoSuffix + ".info"; @@ -115,8 +115,8 @@ public class ConvWatch throw new ConvWatchCancelException("createPostscriptStartCheck: Given reference directory: '" + _sAbsoluteReferenceFile + "' does not exist."); } } - - + + boolean bAbsoluteReferenceFile = true; if (! FileHelper.exists(_sAbsoluteReferenceFile)) { @@ -130,7 +130,7 @@ public class ConvWatch throw new ConvWatchCancelException("createPostscriptStartCheck: Given reference file: " + _sAbsoluteReferenceFile + " does not exist."); } } - + FileHelper.makeDirectories("", _sOutputPath); // runner.convwatch.compare(); @@ -139,10 +139,10 @@ public class ConvWatch String sInputFile = FileHelper.getBasename(_sAbsoluteInputFile); // System.out.println("InputFile: " + sInputFile); - + String sInputFileNoSuffix = FileHelper.getNameNoSuffix(sInputFile); // System.out.println("BasenameNoSuffix: " + sInputFileNoSuffix); - + String sAbsoluteOutputFile = _sOutputPath + fs + sInputFile; String sAbsoluteOutputFileURL = URLHelper.getFileURLFromSystemPath(sAbsoluteOutputFile); @@ -154,7 +154,7 @@ public class ConvWatch String sAbsolutePrintFile = _sOutputPath + fs + sPostScriptFile; String sAbsolutePrintFileURL = URLHelper.getFileURLFromSystemPath(sAbsolutePrintFile); - + // System.out.println("AbsoluteInputFileURL: " + sAbsoluteInputFileURL); // System.out.println("AbsoluteOutputFileURL: " + sAbsoluteOutputFileURL); // System.out.println("AbsolutePrintFileURL: " + sAbsolutePrintFileURL); @@ -163,7 +163,7 @@ public class ConvWatch OfficePrint.printToFile(_aGTA, sAbsoluteInputFileURL, sAbsoluteOutputFileURL, sAbsolutePrintFileURL); // wait(2); - + if (! FileHelper.exists(sAbsolutePrintFile)) { throw new ConvWatchCancelException("createPostscriptStartCheck: Printed file " + sAbsolutePrintFile + " does not exist."); @@ -181,16 +181,16 @@ public class ConvWatch throw new ConvWatchCancelException("createPostscriptStartCheck: Given reference file: " + _sAbsoluteReferenceFile + " does not exist, after try to copy."); } } - + PRNCompare a = new PRNCompare(); String sInputPath = FileHelper.getPath(_sAbsoluteInputFile); String sReferencePath = FileHelper.getPath(_sAbsoluteReferenceFile); // String sReferenceFile = FileHelper.getBasename(sAbsoluteReferenceFile); - + // System.out.println("InputPath: " + sInputPath); // System.out.println("sReferencePath: " + sReferencePath); // System.out.println("sReferenceFile: " + sReferenceFile); - + a.setInputPath( sInputPath ); a.setReferencePath( sReferencePath ); a.setOutputPath( _sOutputPath ); @@ -213,7 +213,7 @@ public class ConvWatch a.setMaxPages(9999); } } - + a.setResolutionInDPI(_aGTA.getResolutionInDPI()); a.setBorderMove(_aGTA.getBorderMove()); a.setDocumentType(_aGTA.getDocumentType()); @@ -223,7 +223,7 @@ public class ConvWatch _aGTA.setBorderMove(a.getBorderMove()); return aList; } - + // ----------------------------------------------------------------------------- // This creates a status for exact on document static boolean createINIStatus(StatusHelper[] aList, String _sFilenamePrefix, String _sOutputPath, String _sAbsoluteInputFile, String _sBuildID, String _sRefBuildID) @@ -235,14 +235,14 @@ public class ConvWatch // String sHTMLFile = _sFilenamePrefix + sNameNoSuffix + ".html"; // HTMLOutputter HTMLoutput = HTMLOutputter.create(_sOutputPath, sHTMLFile, "", ""); // HTMLoutput.header(sNameNoSuffix); -// TODO: version info was fine +// TODO: version info was fine // HTMLoutput.checkSection(sBasename); // Status end String sINIFile = _sFilenamePrefix + sNameNoSuffix + ".ini"; INIOutputter INIoutput = INIOutputter.create(_sOutputPath, sINIFile, "", ""); INIoutput.createHeader(); -// TODO: version info was fine +// TODO: version info was fine INIoutput.writeSection("global"); INIoutput.writeValue("pages", String.valueOf(aList.length)); @@ -256,7 +256,7 @@ public class ConvWatch { INIoutput.writeSection("page" + String.valueOf(i + 1)); // list start at point 0, but this is page 1 and so on... current_page = (i + 1) aList[i].printStatus(); - + boolean bCurrentResult = true; // result over exact one page int nCurrentDiffStatus = aList[i].nDiffStatus; @@ -294,7 +294,7 @@ public class ConvWatch INIoutput.close(); return bResultIsOk; } - + // ----------------------------------------------------------------------------- static void createINIStatus_DiffDiff(StatusHelper[] aDiffDiffList, String _sFilenamePrefix, String _sOutputPath, String _sAbsoluteInputFile, String _sBuildID) @@ -330,7 +330,7 @@ public class ConvWatch // HTMLoutput.close(); INIoutput.close(); } - + // ----------------------------------------------------------------------------- @@ -355,7 +355,7 @@ public class ConvWatch } return bResultIsOk; } - + // ----------------------------------------------------------------------------- public static boolean checkDiffDiff(GraphicalTestArguments _aGTA, String _sOutputPath, String _sAbsoluteInputFile, String _sAbsoluteReferenceFile, @@ -396,7 +396,7 @@ public class ConvWatch String sSourceFile1 = sDiffBasename; String sSourcePath2 = _sAbsoluteDiffPath; String sSourceFile2 = sDiffBasename; - + StatusHelper aCurrentStatus = aCompare.checkDiffDiff(_sOutputPath, sSourcePath1, sSourceFile1, sSourcePath2, sSourceFile2); boolean bCurrentResult = (aCurrentStatus.nDiffStatus == StatusHelper.DIFF_NO_DIFFERENCES); // logic: nDiff==0 = true if there is no difference bDiffIsOk &= bCurrentResult; @@ -417,7 +417,7 @@ public class ConvWatch } return bDiffIsOk; } - + // public static void main( String[] argv ) // { // PRNCompare a = new PRNCompare(); @@ -425,7 +425,7 @@ public class ConvWatch // a.setDocFile( "1_Gov.ppt"); // a.setReferencePath( "/cws/so-cwsserv06/qadev18/SRC680/src.m47/convwatch.keep/input/msoffice/xp/PowerPoint"); // a.setReferenceFile( "1_Gov.prn" ); - // + // // a.setOutputPath( "/tmp/convwatch_java"); // a.setPostScriptFile("1_Gov.ps" ); // } |