869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * The contents of this file are subject to the terms
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * of the Common Development and Distribution License
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * (the License). You may not use this file except in
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * compliance with the License.
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * You can obtain a copy of the License at
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * See the License for the specific language governing
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * permission and limitations under the License.
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * When distributing Covered Code, include this CDDL
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * Header Notice in each file and include the License file
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * If applicable, add the following below the CDDL Header,
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * with the fields enclosed by brackets [] replaced by
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * your own identifying information:
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * $Id: UnittestLog.java,v 1.1 2009/08/19 05:41:03 veiming Exp $
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster * Logging the test activities.
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster public static synchronized List flush(String datestamp) {
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster private static void writeToFile(String datestamp) {
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster String basedir = SystemProperties.get(SystemProperties.CONFIG_PATH) +
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster SystemProperties.get(Constants.AM_SERVICES_DEPLOYMENT_DESCRIPTOR);
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster for (Iterator i = buffer.iterator(); i.hasNext(); ) {
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster writeToFile(basedir + "/unittest/" + datestamp, buff.toString());
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster private static void writeToFile(String fileName, String content) {
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster //No handling requried
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster //No handling requried
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster public static synchronized void logMessage(String msg) {
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster public static synchronized void logError(String msg) {
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster buffer.add("<font color=\"red\">ERROR: " + msg + "</font>");
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster public static synchronized void logError(String err, Throwable e) {
869a36e2649ae064c98063cf1e55198488d78d12Allan Foster buffer.add("<font color=\"red\">ERROR: " + err + " exception: " +