Return-Path: Delivered-To: apmail-ws-tuscany-commits-archive@locus.apache.org Received: (qmail 59251 invoked from network); 3 Feb 2008 07:03:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Feb 2008 07:03:21 -0000 Received: (qmail 12724 invoked by uid 500); 3 Feb 2008 07:03:13 -0000 Delivered-To: apmail-ws-tuscany-commits-archive@ws.apache.org Received: (qmail 12689 invoked by uid 500); 3 Feb 2008 07:03:13 -0000 Mailing-List: contact tuscany-commits-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tuscany-dev@ws.apache.org Delivered-To: mailing list tuscany-commits@ws.apache.org Received: (qmail 12680 invoked by uid 99); 3 Feb 2008 07:03:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2008 23:03:13 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Feb 2008 07:02:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D05C21A9832; Sat, 2 Feb 2008 23:02:44 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r617960 - in /incubator/tuscany/java/sca/modules/host-webapp: ./ src/main/java/org/apache/tuscany/sca/host/webapp/ src/main/java/org/apache/tuscany/sca/host/webapp/junit/ Date: Sun, 03 Feb 2008 07:02:44 -0000 To: tuscany-commits@ws.apache.org From: rfeng@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080203070244.D05C21A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rfeng Date: Sat Feb 2 23:02:42 2008 New Revision: 617960 URL: http://svn.apache.org/viewvc?rev=617960&view=rev Log: Add a filter to run junit test cases in the web app for requests on /junit Added: incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/ incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/WebTestRunner.java (with props) incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java (with props) Modified: incubator/tuscany/java/sca/modules/host-webapp/pom.xml incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java Modified: incubator/tuscany/java/sca/modules/host-webapp/pom.xml URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-webapp/pom.xml?rev=617960&r1=617959&r2=617960&view=diff ============================================================================== --- incubator/tuscany/java/sca/modules/host-webapp/pom.xml (original) +++ incubator/tuscany/java/sca/modules/host-webapp/pom.xml Sat Feb 2 23:02:42 2008 @@ -49,6 +49,12 @@ + junit + junit + 4.2 + + + javax.servlet servlet-api 2.4 Modified: incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java?rev=617960&r1=617959&r2=617960&view=diff ============================================================================== --- incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java (original) +++ incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java Sat Feb 2 23:02:42 2008 @@ -32,6 +32,8 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; +import org.apache.tuscany.sca.host.webapp.junit.WebTestRunner; + /** * A servlet filter that forwards service requests to the servlets registered with * the Tuscany ServletHost. @@ -41,34 +43,41 @@ //private static final Logger logger = Logger.getLogger(WebAppServletHost.class.getName()); private WebAppServletHost servletHost; + private WebTestRunner testRunner = new WebTestRunner(); public void init(final FilterConfig config) throws ServletException { + testRunner.init(config); // TODO: must be a better way to get this than using a static servletHost = WebAppServletHost.getInstance(); - + // Initialize the servlet host servletHost.init(new ServletConfig() { public String getInitParameter(String name) { return config.getInitParameter(name); } + public Enumeration getInitParameterNames() { return config.getInitParameterNames(); } + public ServletContext getServletContext() { return config.getServletContext(); } + public String getServletName() { return config.getFilterName(); } }); } - + public void destroy() { + testRunner.destroy(); WebAppServletHost.getInstance().destroy(); } - public void doFilter(ServletRequest request, ServletResponse response, javax.servlet.FilterChain chain) throws IOException ,ServletException { + public void doFilter(ServletRequest request, ServletResponse response, javax.servlet.FilterChain chain) + throws IOException, ServletException { // Get the servlet path HttpServletRequest httpRequest = (HttpServletRequest)request; @@ -79,19 +88,29 @@ if (path == null) { path = "/"; } - + + if (testRunner.isJunitEnabled()) { + // This request is to run the test cases + // The path is /junit or /junit? + if (path.equals("/junit")) { + testRunner.doFilter(request, response, chain); + return; + } + } + // Get a request dispatcher for the servlet mapped to that path RequestDispatcher dispatcher = servletHost.getRequestDispatcher(path); if (dispatcher != null) { // Let the dispatcher forward the request to the servlet dispatcher.forward(request, response); - + } else { - + // Proceed down the filter chain chain.doFilter(request, response); - + } } + } Added: incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/WebTestRunner.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/WebTestRunner.java?rev=617960&view=auto ============================================================================== --- incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/WebTestRunner.java (added) +++ incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/WebTestRunner.java Sat Feb 2 23:02:42 2008 @@ -0,0 +1,197 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.tuscany.sca.host.webapp.junit; + +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.jar.JarEntry; +import java.util.jar.JarInputStream; +import java.util.regex.Pattern; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import junit.framework.JUnit4TestAdapter; +import junit.framework.TestResult; +import junit.textui.TestRunner; + +/** + * @version $Rev$ $Date$ + */ +public class WebTestRunner implements Filter { + private static final String JUNIT_TESTS_PATTERN = "junit.tests.pattern"; + private static final String JUNIT_TESTS_JAR = "junit.tests.jar"; + private static final String JUNIT_ENABLED = "junit.enabled"; + private static final String TESTCASE_PATTERN = ".*TestCase"; + private static final String TESTS_JAR = "/WEB-INF/test-lib/junit-tests.jar"; + + private ServletContext context; + private boolean junitEnabled = true; + + private List findTestCases(String testJarPath) throws IOException { + String filter = context.getInitParameter(JUNIT_TESTS_PATTERN); + if (filter == null) { + filter = TESTCASE_PATTERN; + } + Pattern pattern = Pattern.compile(filter); + InputStream in = context.getResourceAsStream(testJarPath); + List tests = new ArrayList(); + if (in != null) { + JarInputStream jar = new JarInputStream(in); + try { + JarEntry entry = null; + + while ((entry = jar.getNextJarEntry()) != null) { + String name = entry.getName(); + + if (name.endsWith(".class")) { + String className = name.substring(0, name.length() - 6).replace('/', '.'); + if (pattern.matcher(className).matches()) { + tests.add(className); + } + } + } + } catch (EOFException e) { + } finally { + if (jar != null) { + try { + jar.close(); + } catch (IOException e) { + } + } + } + + } + return tests; + } + + public void destroy() { + } + + private List allTestCases; + private ClassLoader testClassLoader; + + private void init() throws IOException { + testClassLoader = Thread.currentThread().getContextClassLoader(); + allTestCases = new ArrayList(); + String testsJar = context.getInitParameter(JUNIT_TESTS_JAR); + if (testsJar == null) { + testsJar = TESTS_JAR; + } + URL url = context.getResource(testsJar); + if (url != null) { + allTestCases = findTestCases(testsJar); + if (!testsJar.startsWith("/WEB-INF/lib/")) { + // Create a new classloader to load the test jar + testClassLoader = new URLClassLoader(new URL[] {url}, testClassLoader); + } + } + } + + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, + ServletException { + + HttpServletRequest req = (HttpServletRequest)request; + String query = req.getQueryString(); + PrintStream ps = new PrintStream(response.getOutputStream()); + + List testCases = null; + // ClassLoader cl = Thread.currentThread().getContextClassLoader(); + if (query == null || "ALL".equals(query)) { + testCases = this.allTestCases; + } else { + String[] tests = query.split(","); + testCases = Arrays.asList(tests); + } + + int errors = 0; + int failures = 0; + int runs = 0; + response.setContentType("application/xml"); + ps.println(""); + ps.println("<" + XMLFormatter.TESTSUITES + ">"); + for (String testClass : testCases) { + Class test = null; + try { + test = Class.forName(testClass, false, testClassLoader); + } catch (ClassNotFoundException e) { + String st = XMLFormatter.exceptionToString(e); + st = XMLFormatter.escape(st); + ps.println(st); + // ps.close(); + throw new ServletException(e); + } + final XMLFormatter formatter = new XMLFormatter(); + TestRunner runner = new TestRunner() { + protected TestResult createTestResult() { + TestResult result = new TestResult(); + result.addListener(formatter); + return result; + } + }; + long startTime = System.currentTimeMillis(); + TestResult result = runner.doRun(new JUnit4TestAdapter(test)); + runs += result.runCount(); + failures += result.failureCount(); + errors += result.errorCount(); + long endTime = System.currentTimeMillis(); + formatter.setTotalDuration(endTime - startTime); + ps.println(formatter.toXML(result)); + } + ps.println(""); + ((HttpServletResponse)response).addIntHeader("junit.errors", errors); + ((HttpServletResponse)response).addIntHeader("junit.failures", failures); + ((HttpServletResponse)response).addIntHeader("junit.runs", runs); + // ps.close(); + } + + public void init(FilterConfig config) throws ServletException { + context = config.getServletContext(); + // Check if the /junit path should be allowed + String param = context.getInitParameter(JUNIT_ENABLED); + if (param != null && param.trim().equals("false")) { + junitEnabled = false; + } + try { + init(); + } catch (IOException e) { + throw new ServletException(e); + } + } + + public boolean isJunitEnabled() { + return junitEnabled; + } + +} Propchange: incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/WebTestRunner.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/WebTestRunner.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java?rev=617960&view=auto ============================================================================== --- incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java (added) +++ incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java Sat Feb 2 23:02:42 2008 @@ -0,0 +1,442 @@ +/* + * ======================================================================== + * + * Copyright 2001-2005 The Apache Software Foundation. + * + * 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.tuscany.sca.host.webapp.junit; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringReader; +import java.io.StringWriter; +import java.text.NumberFormat; +import java.util.Locale; + +import junit.framework.AssertionFailedError; +import junit.framework.Test; +import junit.framework.TestFailure; +import junit.framework.TestListener; +import junit.framework.TestResult; + +/** + * Format the test results in XML. + * + * @version $Id: XMLFormatter.java 239169 2005-05-05 09:21:54Z vmassol $ + */ +public class XMLFormatter implements TestListener { + /** + * Errors attribute for testsuite elements + */ + public static final String ATTR_ERRORS = "errors"; + + /** + * Failures attribute for testsuite elements + */ + public static final String ATTR_FAILURES = "failures"; + + /** + * Message attribute for failure elements (message of the exception) + */ + public static final String ATTR_MESSAGE = "message"; + + /** + * Name attribute for property, testcase and testsuite elements + */ + public static final String ATTR_NAME = "name"; + + /** + * Tests attribute for testsuite elements (number of tests executed) + */ + public static final String ATTR_TESTS = "tests"; + + /** + * Time attribute for testcase and testsuite elements + */ + public static final String ATTR_TIME = "time"; + + /** + * Type attribute for failure and error elements + */ + public static final String ATTR_TYPE = "type"; + + /** + * Default stack filter patterns. + */ + private static final String[] DEFAULT_STACK_FILTER_PATTERNS = + new String[] {"junit.framework.TestCase", "junit.framework.TestResult", "junit.framework.TestSuite", + "junit.framework.Assert.", // don't filter AssertionFailure + "java.lang.reflect.Method.invoke("}; + + /** + * The error element (for a test case) + */ + public static final String ERROR = "error"; + + /** + * The failure element (for a test case) + */ + public static final String FAILURE = "failure"; + + /** + * A single testcase element + */ + public static final String TESTCASE = "testcase"; + + /** + * A single test suite results. + */ + public static final String TESTSUITE = "testsuite"; + + /** + * Root element for all test suites. + */ + public static final String TESTSUITES = "testsuites"; + + /** + * Returns the stack trace of an exception as String. + * + * @param theThrowable the exception from which to extract the stack trace + * as a String + * @return the exception stack trace as a String + */ + public static String exceptionToString(Throwable theThrowable) { + return exceptionToString(theThrowable, null); + } + + /** + * Returns the stack trace of an exception as String, optionally filtering + * out line from the stack trac + * + * @param theThrowable the exception from which to extract the stack trace + * as a String + * @param theFilterPatterns Array containing a list of patterns to filter + * out from the stack trace + * @return the exception stack trace as a String + */ + public static String exceptionToString(Throwable theThrowable, String[] theFilterPatterns) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + + theThrowable.printStackTrace(pw); + String stackTrace = sw.toString(); + return filterStackTrace(stackTrace, theFilterPatterns); + } + + /** + * + * + * @param theLine The line to check + * @param theFilterPatterns The patterns to filter out + * @return boolean Whether the specified line should be filtered from the + * stack trace + */ + public static boolean filterLine(String theLine, String[] theFilterPatterns) { + for (int i = 0; i < theFilterPatterns.length; i++) { + if (theLine.indexOf(theFilterPatterns[i]) > 0) { + return true; + } + } + return false; + } + + /** + * + * + * @param theStackTrace The original, unfiltered stack trace + * @param theFilterPatterns The patterns to filter out + * @return The filtered stack trace + */ + static String filterStackTrace(String theStackTrace, String[] theFilterPatterns) { + if ((theFilterPatterns == null) || (theFilterPatterns.length == 0) || (theStackTrace == null)) { + return theStackTrace; + } + + StringWriter stringWriter = new StringWriter(); + PrintWriter printWriter = new PrintWriter(stringWriter); + StringReader stringReader = new StringReader(theStackTrace); + BufferedReader bufferedReader = new BufferedReader(stringReader); + + String line; + try { + while ((line = bufferedReader.readLine()) != null) { + if (!filterLine(line, theFilterPatterns)) { + printWriter.println(line); + } + } + } catch (IOException e) { + return theStackTrace; + } + return stringWriter.toString(); + } + + /** + * Replaces a character in a string by a substring. + * + * @param theBaseString the base string in which to perform replacements + * @param theChar the char to look for + * @param theNewString the string with which to replace the char + * @return the string with replacements done or null if the input string + * was null + */ + public static String replace(String theBaseString, char theChar, String theNewString) { + if (theBaseString == null) { + return null; + } + + int pos = theBaseString.indexOf(theChar); + if (pos < 0) { + return theBaseString; + } + + int lastPos = 0; + StringBuffer result = new StringBuffer(); + while (pos > -1) { + result.append(theBaseString.substring(lastPos, pos)); + result.append(theNewString); + + lastPos = pos + 1; + pos = theBaseString.indexOf(theChar, lastPos); + } + + if (lastPos < theBaseString.length()) { + result.append(theBaseString.substring(lastPos)); + } + + return result.toString(); + } + + /** + * Escapes reserved XML characters. + * + * @param theString the string to escape + * @return the escaped string + */ + public static String escape(String theString) { + String newString; + + // It is important to replace the "&" first as the other replacements + // also introduces "&" chars ... + newString = replace(theString, '&', "&"); + + newString = replace(newString, '<', "<"); + newString = replace(newString, '>', ">"); + newString = replace(newString, '\"', """); + + return newString; + } + + /** + * XML string containing executed test case results + */ + private StringBuffer currentTestCaseResults = new StringBuffer(); + + /** + * Current test failure (XML string) : failure or error. + */ + private String currentTestFailure; + + /** + * Time current test was started + */ + private long currentTestStartTime; + + /** + * The number format used to convert durations into strings. Don't use the + * default locale for that, because the resulting string needs to use + * dotted decimal notation for an XSLT transformation to work correctly. + */ + private NumberFormat durationFormat = NumberFormat.getInstance(Locale.US); + + /** + * The name of the test suite class. + */ + private String suiteClassName; + + /** + * Duration it took to execute all the tests. + */ + private long totalDuration; + + /** + * Event called by the base test runner when the test fails with an error. + * + * @param theTest the test object that failed + * @param theThrowable the exception that was thrown + */ + public void addError(Test theTest, Throwable theThrowable) { + TestFailure failure = new TestFailure(theTest, theThrowable); + StringBuffer xml = new StringBuffer(); + + xml.append("<" + XMLFormatter.ERROR + + " " + + XMLFormatter.ATTR_MESSAGE + + "=\"" + + escape(failure.thrownException().getMessage()) + + "\" " + + XMLFormatter.ATTR_TYPE + + "=\"" + + failure.thrownException().getClass().getName() + + "\">"); + xml.append(escape(XMLFormatter.exceptionToString(failure.thrownException(), DEFAULT_STACK_FILTER_PATTERNS))); + xml.append(""); + + this.currentTestFailure = xml.toString(); + } + + /** + * Event called by the base test runner when the test fails with a failure. + * + * @param theTest the test object that failed + * @param theError the exception that was thrown + */ + public void addFailure(Test theTest, AssertionFailedError theError) { + TestFailure failure = new TestFailure(theTest, theError); + StringBuffer xml = new StringBuffer(); + + xml.append("<" + XMLFormatter.FAILURE + + " " + + XMLFormatter.ATTR_MESSAGE + + "=\"" + + escape(failure.thrownException().getMessage()) + + "\" " + + XMLFormatter.ATTR_TYPE + + "=\"" + + failure.thrownException().getClass().getName() + + "\">"); + xml.append(escape(XMLFormatter.exceptionToString(failure.thrownException(), DEFAULT_STACK_FILTER_PATTERNS))); + xml.append(""); + + this.currentTestFailure = xml.toString(); + } + + /** + * Event called by the base test runner when the test ends. + * + * @param theTest the test object being executed + */ + public void endTest(Test theTest) { + StringBuffer xml = new StringBuffer(); + String duration = getDurationAsString(System.currentTimeMillis() - this.currentTestStartTime); + + xml.append("<" + XMLFormatter.TESTCASE + " " + XMLFormatter.ATTR_NAME + "=\"" + theTest + "\" " + XMLFormatter.ATTR_TIME + "=\"" + duration + "\">"); + + if (this.currentTestFailure != null) { + xml.append(this.currentTestFailure); + } + + xml.append(""); + + this.currentTestCaseResults.append(xml.toString()); + } + + /** + * Comvert a duration expressed as a long into a string. + * + * @param theDuration the duration to convert to string + * @return the total duration as a string + */ + private String getDurationAsString(long theDuration) { + return durationFormat.format((double)theDuration / 1000); + } + + /** + * @return the suite class name + */ + public String getSuiteClassName() { + return this.suiteClassName; + } + + /** + * @return the total duration as a string + */ + public String getTotalDurationAsString() { + return getDurationAsString(this.totalDuration); + } + + /** + * Sets the suite class name that was executed. + * + * @param theSuiteClassName the suite class name + */ + public void setSuiteClassName(String theSuiteClassName) { + this.suiteClassName = theSuiteClassName; + } + + /** + * Sets the duration it took to execute all the tests. + * + * @param theDuration the time it took + */ + public void setTotalDuration(long theDuration) { + this.totalDuration = theDuration; + } + + /** + * Event called by the base test runner when the test starts. + * + * @param theTest the test object being executed + */ + public void startTest(Test theTest) { + this.currentTestStartTime = System.currentTimeMillis(); + this.currentTestFailure = null; + } + + /** + * Formats the test result as an XML string. + * + * @param theResult the test result object + * @return the XML string representation of the test results + */ + public String toXML(TestResult theResult) { + StringBuffer xml = new StringBuffer(); + + // xml.append(""); + + // xml.append("<" + TESTSUITES + ">"); + + xml.append("<" + XMLFormatter.TESTSUITE + + " " + + XMLFormatter.ATTR_NAME + + "=\"" + + getSuiteClassName() + + "\" " + + XMLFormatter.ATTR_TESTS + + "=\"" + + theResult.runCount() + + "\" " + + XMLFormatter.ATTR_FAILURES + + "=\"" + + theResult.failureCount() + + "\" " + + XMLFormatter.ATTR_ERRORS + + "=\"" + + theResult.errorCount() + + "\" " + + XMLFormatter.ATTR_TIME + + "=\"" + + getTotalDurationAsString() + + "\">"); + + xml.append(this.currentTestCaseResults.toString()); + + xml.append(""); + // xml.append(""); + + return xml.toString(); + } +} Propchange: incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/junit/XMLFormatter.java ------------------------------------------------------------------------------ svn:keywords = Rev Date --------------------------------------------------------------------- To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org For additional commands, e-mail: tuscany-commits-help@ws.apache.org