2 * ************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 * ***********************************************************************
32 // import java.io.File;
38 public class JPEGEvaluator
extends EnhancedComplexTestCase
41 public String
[] getTestMethodNames()
43 return new String
[]{"EvaluateResult"};
49 public void EvaluateResult()
51 GlobalLogWriter
.set(log
);
52 ParameterHelper aParam
= new ParameterHelper(param
);
54 // aParam.getTestParameters().put("current_ok_status", -1);
56 // run through all documents found in Inputpath
57 foreachResultCreateHTML(aParam
);
60 public void checkOneFile(String _sDocument
, String _sResult
, ParameterHelper _aParams
) throws OfficeException
62 // throw new UnsupportedOperationException("Not supported yet.");
65 String sBasename
= FileHelper
.getBasename(_sDocument
);
66 String sResultIniFile
= _sDocument
+ ".ini";
67 // File aFile = new File(sResultIniFile);
68 // assure("Result file doesn't exists " + sResultIniFile, aFile.exists());
74 // IniFile aResultIniFile = new IniFile(sResultIniFile);
75 // int nPages = aResultIniFile.getIntValue("global", "pages", 0);
76 // for (int i=0;i<nPages;i++)
78 // String sCurrentPage = "page" + String.valueOf(i + 1);
79 // int nPercent = aResultIniFile.getIntValue(sCurrentPage, "percent", -1);
84 // else if (nPercent <= 5)
94 // assure("Error: document doesn't contains pages", nPages > 0);
96 HTMLResult aOutputter
= new HTMLResult(_sResult
, sBasename
+ ".html" );
97 aOutputter
.header(_sResult
);
98 aOutputter
.indexSection(sBasename
);
100 IniFile aResultIniFile
= new IniFile(sResultIniFile
);
101 String sStatusRunThrough
= aResultIniFile
.getValue("global", "state");
102 String sStatusMessage
= aResultIniFile
.getValue("global", "info");
104 // // TODO: this information has to come out of the ini files
105 // String sStatusRunThrough = "PASSED, ";
106 // String sPassed = "OK";
108 // String sStatusMessage = "From " + nPages + " page(s) are: ";
109 // String sGood = "";
111 // String sUgly = "";
115 // sGood = " good:=" + good;
116 // sStatusMessage += sGood;
120 // sBad = " bad:=" + bad;
121 // sStatusMessage += sBad;
125 // sUgly = " ugly:=" + ugly;
126 // sStatusMessage += sUgly;
137 // sPassed = "FAILED";
143 // sPassed = "NEED A LOOK";
150 // sStatusRunThrough += sPassed;
151 // aResultIniFile.insertValue("global", "state", sStatusRunThrough);
152 // aResultIniFile.insertValue("global", "info", sStatusMessage);
153 // aResultIniFile.close();
155 String sHTMLFile
= _aParams
.getHTMLPrefix(); // "http://so-gfxcmp-lin/gfxcmp_ui/cw.php?inifile=";
156 sHTMLFile
+= _sDocument
+ ".ini";
157 aOutputter
.indexLine(sHTMLFile
, sBasename
, sStatusRunThrough
, sStatusMessage
);
159 // IniFile aIniFile = new IniFile(_sDocument);