Index: org/apache/harmony/harness/plugins/TestHandler.java =================================================================== --- org/apache/harmony/harness/plugins/TestHandler.java (revision 547074) +++ org/apache/harmony/harness/plugins/TestHandler.java (working copy) @@ -262,40 +262,42 @@ if (theTestIR.getTestID() == null) { throw new SAXException(methodLogPrefix - + "The attribute 'ID' test is null"); + + "The attribute 'ID' of test is null"); } if (theTestIR.getTestID() == "") { throw new SAXException(methodLogPrefix - + "The attribute 'ID' test is empty"); + + "The attribute 'ID' of test is empty"); } if (theTestIR.getRunnerID() == null) { throw new SAXException( methodLogPrefix - + "The attribute 'ID' of element 'Runner' in this test is null"); + + "The attribute 'ID' of element 'Runner' of test " + + theTestIR.getTestID() + " is null"); } if (theTestIR.getRunnerID() == "") { throw new SAXException( methodLogPrefix - + "The attribute 'ID' of element 'Runner' in this test is empty"); + + "The attribute 'ID' of element 'Runner' of test " + + theTestIR.getTestID() + " is empty"); } if (theTestIR.getProperty("date-of-creation") == null || theTestIR.getProperty("date-of-creation").trim() == "") { - log.add(Level.WARNING, methodLogPrefix - + "The attribute 'date-of-creation' of test '" + log.add(Level.INFO, methodLogPrefix + + "The attribute 'date-of-creation' of the test '" + theTestIR.getTestID() + "' is absent or empty"); } if (theTestIR.getProperty("Description") == null || theTestIR.getProperty("Description").trim() == "") { - log.add(Level.WARNING, methodLogPrefix - + "The element 'Description' of test '" + log.add(Level.INFO, methodLogPrefix + + "The element 'Description' of the test '" + theTestIR.getTestID() + "' is absent or empty"); } if (theTestIR.getProperty((Object)"copyrights") == null || ((ArrayList)theTestIR.getProperty((Object)"copyrights")) .size() <= 0) { - //log.add(Level.WARNING, methodLogPrefix - // + "There are not elements 'Copyright' of test '" - // + theTestIR.getTestID() + "'"); + //log.add(Level.INFO, methodLogPrefix + // + "The elements 'Copyright' of test '" + // + theTestIR.getTestID() + "' is empty"); } else { boolean empty = false; for (int i = 0; i < ((ArrayList)theTestIR @@ -305,16 +307,16 @@ empty = true; } if (empty) - log.add(Level.WARNING, methodLogPrefix - + "There are empty elements 'Copyright' of test '" - + theTestIR.getTestID() + "'"); + log.add(Level.INFO, methodLogPrefix + + "The element 'Copyright' of the test '" + + theTestIR.getTestID() + "' is empty"); } if (theTestIR.getProperty((Object)"authors") == null || ((ArrayList)theTestIR.getProperty((Object)"authors")) .size() <= 0) { - log.add(Level.WARNING, methodLogPrefix - + "There are not elements 'Author' of test '" - + theTestIR.getTestID() + "'"); + log.add(Level.INFO, methodLogPrefix + + "The element 'Author' of the test '" + + theTestIR.getTestID() + "' is empty"); } else { boolean empty = false; for (int i = 0; i < ((ArrayList)theTestIR @@ -324,16 +326,16 @@ empty = true; } if (empty) - log.add(Level.WARNING, methodLogPrefix - + "There are empty elements 'Author' of test '" + log.add(Level.INFO, methodLogPrefix + + "There are empty elements 'Author' in the test '" + theTestIR.getTestID() + "'"); } if (theTestIR.getProperty((Object)"sources") == null || ((ArrayList)theTestIR.getProperty((Object)"sources")) .size() <= 0) { - log.add(Level.WARNING, methodLogPrefix - + "There are not elements 'Source' of test '" - + theTestIR.getTestID() + "'"); + log.add(Level.INFO, methodLogPrefix + + "The element 'Source' of the test '" + + theTestIR.getTestID() + "' is absent"); } else { for (int i = 0; i < ((ArrayList)theTestIR .getProperty((Object)"sources")).size(); i++) { @@ -341,11 +343,11 @@ .getProperty((Object)"sources")).get(i)); if (src == null) { log.add(Level.INFO, methodLogPrefix - + "incorrect element 'Source' of test '" + + "incorrect element 'Source' of the test '" + theTestIR.getTestID() + "'"); } else if (src.trim() == "") { log.add(Level.INFO, methodLogPrefix - + "empty element 'Source' of test '" + + "empty element 'Source' of the test '" + theTestIR.getTestID() + "'"); } } @@ -357,8 +359,8 @@ empty = true; } if (empty) - log.add(Level.WARNING, methodLogPrefix - + "There are empty elements 'Keyword' of test '" + log.add(Level.INFO, methodLogPrefix + + "There are empty elements 'Keyword' in the test '" + theTestIR.getTestID() + "'"); } if (((ArrayList)theTestIR.getModifications()).size() > 0) { @@ -380,16 +382,16 @@ if (emptyDate) log .add( - Level.WARNING, + Level.INFO, methodLogPrefix - + "There are empty attributes 'date' of element 'Modification' in test '" + + "There are empty attributes 'date' of element 'Modification' in the test '" + theTestIR.getTestID() + "'"); if (emptyAuthor) log .add( - Level.WARNING, + Level.INFO, methodLogPrefix - + "There are empty attributes 'author' of element 'Modification' in test '" + + "There are empty attributes 'author' of element 'Modification' in the test '" + theTestIR.getTestID() + "'"); } } Index: org/apache/harmony/harness/plugins/StoreRes.java =================================================================== --- org/apache/harmony/harness/plugins/StoreRes.java (revision 547074) +++ org/apache/harmony/harness/plugins/StoreRes.java (working copy) @@ -72,10 +72,10 @@ protected final int[] errVal = cfg.getRepError(); protected final int[] merVal = cfg.getRepModErr(); - String xmlVersion; - String[][] maps; + protected String xmlVersion; + protected String[][] maps; - private String repSuffix = Constants.RESULTS_EXT; + protected String repSuffix = Constants.RESULTS_EXT; public StoreRes() { final String methodLogPrefix = MessageInfo.MSG_PREFIX + classID @@ -317,11 +317,11 @@ * default, do nothing */ protected String convertOutToSpecificFormat(String[] data) { - String tmpVal = "
"; + tmpVal = tmpVal + "]]>"; return tmpVal; } Index: org/apache/harmony/harness/Main.java =================================================================== --- org/apache/harmony/harness/Main.java (revision 547074) +++ org/apache/harmony/harness/Main.java (working copy) @@ -1183,6 +1183,10 @@ + "Create Selector: OK"); startSynChannel(); + //preload classes + new ProcDestroy(null); + new ThreadDestroy(null); + if (cfgM.getLocalM() == REMOTE) { // || getExecM() == SAME) { clients = new MCPool(); (new RRunner()).start(); @@ -1276,6 +1280,10 @@ internalLog.add(Level.CONFIG, methodLogPrefix + "Can't close communication server: " + cs[i] + " " + e); + } catch (Error e) { + internalLog.add(Level.CONFIG, methodLogPrefix + + "Can't close communication server: " + cs[i] + + " " + e, e); } } internalLog.add(Level.CONFIG, methodLogPrefix @@ -1295,6 +1303,9 @@ } catch (Exception e) { internalLog.add(Level.CONFIG, methodLogPrefix + "Can't close synchronization server: " + e); + } catch (Error e) { + internalLog.add(Level.WARNING, methodLogPrefix + + "Can't close synchronization server: " + e, e); } internalLog.add(Level.CONFIG, methodLogPrefix + "Close sync channel: OK "); @@ -1308,6 +1319,9 @@ } catch (Exception e) { internalLog.add(Level.CONFIG, methodLogPrefix + "Can't close mcore: " + clients.get(i) + " " + e); + } catch (Error e) { + internalLog.add(Level.CONFIG, methodLogPrefix + + "Can't close mcore: " + clients.get(i) + " " + e, e); } } internalLog.add(Level.CONFIG, methodLogPrefix @@ -1336,6 +1350,10 @@ } catch (InterruptedException ie) { //do noting } + } catch (Error ior) { + internalLog.add(Level.SEVERE, methodLogPrefix + + "Process to destroy: " + proc + + "\nNote, some processes can hang up"); } internalLog.add(Level.CONFIG, methodLogPrefix + "Process was destroyed : OK " + proc); Index: org/apache/harmony/harness/ReportTool/StoreResAsJU.java =================================================================== --- org/apache/harmony/harness/ReportTool/StoreResAsJU.java (revision 0) +++ org/apache/harmony/harness/ReportTool/StoreResAsJU.java (revision 0) @@ -0,0 +1,284 @@ +/* + * Copyright 2007 The Apache Software Foundation or its licensors, as applicable + * Licensed 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. + */ +package org.apache.harmony.harness.ReportTool; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.logging.Level; + +import org.apache.harmony.harness.Constants; +import org.apache.harmony.harness.MessageInfo; +import org.apache.harmony.harness.TResIR; +import org.apache.harmony.harness.Util; +import org.apache.harmony.harness.plugins.StoreRes; + +public class StoreResAsJU extends StoreRes { + + public static final int SHORT_MSG_LEN = 1000; + + private static final String classID = "StoreResAsJU"; + + static final String DATA_TOKEN = "@@to_replace@@"; + + public StoreResAsJU() { + super(); + super.repSuffix = ".xml"; + } + + public boolean add(TResIR test) { + final String methodLogPrefix = MessageInfo.MSG_PREFIX + classID + + "\tadd(): "; + try { + // add result to reporter module. + if (rep != null) { + String fileName; + fileName = "TEST-" + + test.getTestID().replace(Constants.INTERNAL_FILE_SEP_C, + '.'); + rep.addResult(fileName + repSuffix, test.getExecStat()); + } + if (resStore == null) { + log.add(Level.INFO, methodLogPrefix + + "Can not store the result. Please, check your settings."); + return false; + } + //some service information + String path = ""; + String srcPath = ""; + String msg = convertOutToSpecificFormat(test.getOutMsg()); + String testInfo = convertInfoToSpecificFormat(test + .getTestSpecificInfo()); + String resultMsg = " (UNKNOWN)"; + String tmpVal; + String cmd = convertCmdToSpecificFormat(test.getExecCmd()); + String time = " "; + String[] srcNames = null; + int testStatus = test.getExecStat(); + if (msg == null) { + msg = ""; + } else { + msg = sortByTimestamp(msg); + } + if (testInfo == null) { + testInfo = ""; + } + // note: this result is parsed by result parser which expect the + // digit before the whitespace + int errors = 0; + int failures = 0; + boolean status_defined = false; + int tests = 1; + String resMsg = ""; + for (int i = 0; i < pasVal.length; i++) { + if (testStatus == pasVal[i]) { + resultMsg = " (PASSED)"; + status_defined = true; + } + } + for (int i = 0; i < fldVal.length; i++) { + if (testStatus == fldVal[i]) { + resultMsg = " (FAILED)"; + failures++; + resMsg = "