You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/02/03 02:04:35 UTC
svn commit: r502819 - in
/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report:
TestCase.groovy TestSuite.groovy
Author: jdillon
Date: Fri Feb 2 17:04:34 2007
New Revision: 502819
URL: http://svn.apache.org/viewvc?view=rev&rev=502819
Log:
Adding helper to deal with collecting status from a list of test cases
Added:
geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestSuite.groovy (with props)
Modified:
geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy
Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy?view=diff&rev=502819&r1=502818&r2=502819
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy (original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy Fri Feb 2 17:04:34 2007
@@ -30,7 +30,7 @@
import org.apache.commons.lang.time.DurationFormatUtils
/**
- * Test case provides convenience access to test result details.
+ * Provides convenience access to test result details.
*/
class TestCase extends LogSupport
{
Added: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestSuite.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestSuite.groovy?view=auto&rev=502819
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestSuite.groovy (added)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestSuite.groovy Fri Feb 2 17:04:34 2007
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package gbuild.config.projects.Geronimo_CTS.report
+
+import gbuild.system.LogSupport
+
+import org.apache.commons.lang.time.DurationFormatUtils
+
+/**
+ * Provides convenience access to the details of one or more test cases.
+ */
+class TestSuite extends LogSupport
+{
+ SortedMap testCases = new TreeMap()
+
+ long passCount = 0
+
+ long failureCount = 0
+
+ long errorCount = 0
+
+ long time
+
+ def TestSuite(List testCases) {
+ assert testCases
+ assert testCases.size() > 0
+
+ testCases.each { testCase ->
+ if (testCase.status.passed) {
+ passCount++
+ }
+ if (testCase.status.failed) {
+ failureCount++
+ }
+ if (testCase.status.error) {
+ errorCount++
+ }
+
+ time += testCase.time
+
+ this.testCases[testCase.name, testCase]
+ }
+ }
+
+ long getCount() {
+ return passCount + failureCount + errorCount
+ }
+
+ String getDuration() {
+ return DurationFormatUtils.formatDurationHMS(time)
+ }
+
+ boolean getPassed() {
+ return failureCount + errorCount == 0
+ }
+
+ double getSuccessRate() {
+ return passCount * 100 / count
+ }
+}
+
Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestSuite.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestSuite.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestSuite.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain