2 * ************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2008 by Sun Microsystems, Inc.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * $RCSfile: JPEGEvaluator.java,v $
11 * $Revision: 1.1.2.4 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 * ***********************************************************************
35 // import java.io.File;
41 public class JPEGEvaluator
extends EnhancedComplexTestCase
44 public String
[] getTestMethodNames()
46 return new String
[]{"EvaluateResult"};
52 public void EvaluateResult()
54 GlobalLogWriter
.set(log
);
55 ParameterHelper aParam
= new ParameterHelper(param
);
57 // run through all documents found in Inputpath
58 foreachResultCreateHTML(aParam
);
61 public void checkOneFile(String _sDocument
, String _sResult
, ParameterHelper _aParams
) throws OfficeException
63 // throw new UnsupportedOperationException("Not supported yet.");
66 String sBasename
= FileHelper
.getBasename(_sDocument
);
67 String sResultIniFile
= _sDocument
+ ".ini";
68 // File aFile = new File(sResultIniFile);
69 // assure("Result file doesn't exists " + sResultIniFile, aFile.exists());
75 // IniFile aResultIniFile = new IniFile(sResultIniFile);
76 // int nPages = aResultIniFile.getIntValue("global", "pages", 0);
77 // for (int i=0;i<nPages;i++)
79 // String sCurrentPage = "page" + String.valueOf(i + 1);
80 // int nPercent = aResultIniFile.getIntValue(sCurrentPage, "percent", -1);
85 // else if (nPercent <= 5)
95 // assure("Error: document doesn't contains pages", nPages > 0);
97 HTMLResult aOutputter
= new HTMLResult(_sResult
, sBasename
+ ".html" );
98 aOutputter
.header(_sResult
);
99 aOutputter
.indexSection(sBasename
);
101 IniFile aResultIniFile
= new IniFile(sResultIniFile
);
102 String sStatusRunThrough
= aResultIniFile
.getValue("global", "state");
103 String sStatusMessage
= aResultIniFile
.getValue("global", "info");
105 // // TODO: this information has to come out of the ini files
106 // String sStatusRunThrough = "PASSED, ";
107 // String sPassed = "OK";
109 // String sStatusMessage = "From " + nPages + " page(s) are: ";
110 // String sGood = "";
112 // String sUgly = "";
116 // sGood = " good:=" + good;
117 // sStatusMessage += sGood;
121 // sBad = " bad:=" + bad;
122 // sStatusMessage += sBad;
126 // sUgly = " ugly:=" + ugly;
127 // sStatusMessage += sUgly;
138 // sPassed = "FAILED";
144 // sPassed = "NEED A LOOK";
151 // sStatusRunThrough += sPassed;
152 // aResultIniFile.insertValue("global", "state", sStatusRunThrough);
153 // aResultIniFile.insertValue("global", "info", sStatusMessage);
154 // aResultIniFile.close();
156 String sHTMLFile
= _aParams
.getHTMLPrefix(); // "http://so-gfxcmp-lin/gfxcmp_ui/cw.php?inifile=";
157 sHTMLFile
+= _sDocument
+ ".ini";
158 aOutputter
.indexLine(sHTMLFile
, sBasename
, sStatusRunThrough
, sStatusMessage
);
160 // IniFile aIniFile = new IniFile(_sDocument);