geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r502813 - /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy
Date Sat, 03 Feb 2007 00:41:02 GMT
Author: jdillon
Date: Fri Feb  2 16:41:01 2007
New Revision: 502813

URL: http://svn.apache.org/viewvc?view=rev&rev=502813
Log:
Add helper to get relevant details from a TestResult

Added:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy
  (with props)

Added: 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=auto&rev=502813
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy
(added)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy
Fri Feb  2 16:41:01 2007
@@ -0,0 +1,80 @@
+/*
+ * 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 java.text.SimpleDateFormat
+
+import gbuild.system.LogSupport
+
+import org.apache.commons.lang.time.DurationFormatUtils
+
+/**
+ * Test case provides convenience access to test result details.
+ */
+class TestCase extends LogSupport
+{
+    // Parses out dates formated like: Thu Feb 01 00:24:56 PST 2007
+    static final DATE_FORMAT = new SimpleDateFormat('EEE MMM dd HH:mm:ss z yyyy')
+    
+    def result
+    
+    def TestCase(result) {
+        assert result
+        
+        this.result = result
+    }
+    
+    String getClassName() {
+        return result.testdescription['classname']
+    }
+    
+    String getTestName() {
+        return result.testdescription['testName']
+    }
+    
+    String getName() {
+        return "$className#$testName"
+    }
+    
+    Date getStarted() {
+        return DATE_FORMAT.parse(result.testresult['start'])
+    }
+    
+    Date getEnded() {
+        return DATE_FORMAT.parse(result.testresult['end'])
+    }
+    
+    long getTime() {
+        return ended.time - started.time
+    }
+    
+    String getDuration() {
+        return DurationFormatUtils.formatDurationHMS(time)
+    }
+    
+    def getStatus() {
+        return result.status
+    }
+}
+

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestCase.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message