You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by js...@apache.org on 2004/10/06 21:08:18 UTC
svn commit: rev 53893 - in incubator/beehive/trunk/controls/test: . infra/gtlf infra/tch tools/tch/src/java/org/apache/beehive/test/tools/tch/logger tools/tch/src/java/org/apache/beehive/test/tools/tch/util/gtlf
Author: jsong
Date: Wed Oct 6 12:08:16 2004
New Revision: 53893
Added:
incubator/beehive/trunk/controls/test/infra/gtlf/gtlf-config-2.0.dtd
Modified:
incubator/beehive/trunk/controls/test/build.xml
incubator/beehive/trunk/controls/test/infra/tch/tchx.jar
incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/logger/GTLFLogger.java
incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/util/gtlf/GTLFEntityResolver.java
Log:
Fix for CR196256: GTLF DTD file needs to be accessible to the world. By default, TCH will use a DTD located on the Apache server. I've also added an option to use a local DTD file if the user cannot reach the Apache site: set -Dgtlf.dtd.use.remote=false
Contributed by Joe Pemberton
Modified: incubator/beehive/trunk/controls/test/build.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/build.xml (original)
+++ incubator/beehive/trunk/controls/test/build.xml Wed Oct 6 12:08:16 2004
@@ -297,6 +297,10 @@
<gethostname/> <!-- set ${hostname} -->
+ <property name="gtlf.dtd.use.remote" value="true"/>
+ <property name="gtlf.dtd.remote" value="http://svn.apache.org/viewcvs.cgi/incubator/beehive/trunk/controls/test/infra/gtlf/gtlf-config-2.0.dtd?root=Apache-SVN"/>
+ <property name="gtlf.dtd.local" value="infra/gtlf/gtlf-config-2.0.dtd"/>
+
<property name="test.hostname" value="${hostname}" />
<property name="test.hostname.port" value="8080" /> <!-- tomcat default port -->
<property name="test-suite" value="${mantis.srcgen.dir}/root.xml"/>
@@ -315,6 +319,9 @@
<sysproperty key="TEST_HOSTNAME" value="${test.hostname}" />
<sysproperty key="TEST_HOSTNAME_PORT" value="${test.hostname.port}" />
+ <sysproperty key="gtlf.dtd.use.remote" value="${gtlf.dtd.use.remote}"/>
+ <sysproperty key="gtlf.dtd.remote" value="${gtlf.dtd.remote}"/>
+ <sysproperty key="gtlf.dtd.local" value="${gtlf.dtd.local}"/>
</tch>
<ant antfile="${controls.test.infra.dir}/tch/runtime/build.xml" target="generate-html-log" dir="${basedir}">
Added: incubator/beehive/trunk/controls/test/infra/gtlf/gtlf-config-2.0.dtd
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/infra/gtlf/gtlf-config-2.0.dtd Wed Oct 6 12:08:16 2004
@@ -0,0 +1,183 @@
+<!-- testlog.dtd -->
+
+<!ELEMENT description (#PCDATA)>
+
+<!-- Environment Section -->
+<!ELEMENT env-attribute EMPTY>
+<!ATTLIST env-attribute
+ name CDATA #REQUIRED
+ value CDATA #REQUIRED
+>
+
+<!-- Don't worry about the attributes -->
+<!ELEMENT environment (env-attribute+)>
+<!ATTLIST environment
+ hosttype CDATA #IMPLIED
+ primary (TRUE|FALSE) "TRUE"
+>
+
+<!-- Output Files -->
+<!-- Don't worry about this element -->
+<!ELEMENT output-files EMPTY>
+<!ATTLIST output-files
+ filetype CDATA "OUTPUTLOG"
+ url CDATA #REQUIRED
+>
+
+
+<!-- Test Case Section -->
+
+<!--
+ One per test result, this is the metadata about the test case
+ testcasename For javatest, this classname.methodname
+ testunit Grouping for test cases (one level only), not scoped by any other variable
+ testpath descriptive value, path to the testfile (if there is one)
+ qaowner If used, must map to a user within the system
+-->
+<!ELEMENT test-case (description?)>
+<!ATTLIST test-case
+ testcasename CDATA #REQUIRED
+ testunit CDATA #IMPLIED
+ testpath CDATA #IMPLIED
+ qaowner CDATA #IMPLIED
+>
+
+
+<!-- Result Section -->
+
+<!-- Any kind of output about a test result, might include error info and stack trace -->
+<!ELEMENT output-details (#PCDATA)>
+
+<!-- errorname Either a logical name for the error, or possibly just an exception name -->
+<!ELEMENT execution-output (output-details?)>
+<!ATTLIST execution-output
+ errorname CDATA #IMPLIED
+>
+
+<!-- Ignore except for manual tests -->
+<!ELEMENT reviewer-comments (#PCDATA)>
+
+<!-- Contains optional information about re-running failed tests -->
+<!ELEMENT test-replication (info?,command-line)>
+
+<!--
+ Newline delimited name=value pairs, used for test point
+ definition and comparison, therefore format should be consistent (e.g. sorted)
+-->
+<!ELEMENT test-parameters (#PCDATA)>
+
+
+<!-- Test Replication section -->
+
+<!-- Any useful information about re-running this test -->
+<!ELEMENT info (#PCDATA)>
+
+<!-- Optional command lines for re-running failed tests -->
+<!ELEMENT command-line (unix,win?)>
+<!ELEMENT unix (#PCDATA)>
+<!ELEMENT win (#PCDATA)>
+
+
+<!--
+ Directly below the document element, this is the primary node for a given test in a run.
+ Note that it may include many elements
+ reviewstate Don't use non-default values except ANALYZED for manual tests
+ exectime Time at which the test started, java.sql.Timestamp.toString() escape format
+ duration In milliseconds
+ crlist comma separated WebClarify CR numbers
+ analyzer The user who should analyze this result,
+ If used, must map to a user within the system
+
+ result These are the different types of outcomes for a test.
+ TIMEOUT = test timed out
+ ABORT = some sort of test initialization failed
+ FRAMEABORT = the test framework failed to do something required for this test
+ SKIP = test was skipped due to a framework decision (e.g. required test failed, require utility had problems)
+ FAILURE = test failed
+ SUCCESS = test passed
+
+ isdone This should be removed, ignore for now
+ logicalname Name to easily identify an execution point within a test run
+ resultinfo Additional information provided about a test result (e.g. benchmark data, etc.)
+-->
+<!ELEMENT test-result (test-case, environment*, test-parameters?, execution-output?, reviewer-comments?, test-replication?, output-files*)>
+<!ATTLIST test-result
+ reviewstate (ASSIGNED|EXECUTED|ANALYZED) "EXECUTED"
+ exectime CDATA #REQUIRED
+ duration CDATA #IMPLIED
+ crlist CDATA #IMPLIED
+ analyzer CDATA #IMPLIED
+ result (TIMEOUT|ABORT|FRAMEABORT|SKIP|FAILURE|SUCCESS|TEST_NOT_FOUND) #REQUIRED
+ isdone (TRUE|FALSE) "TRUE"
+ logicalname CDATA #IMPLIED
+ resultinfo CDATA #IMPLIED
+>
+
+
+<!--
+ Header Information : Meta-Data about a Test Run
+ checksum Expected number of tests for a given import into Sapphire
+ resultcount Expected number of tests for this GTLF file
+ execaccount OS user who executed this run
+ execdate java.sql.Timestamp.toString() for when this test run began
+ harnesstype Descriptive field for the test harness / framework used to run the tests
+ importinfo Never used, supposed to have generic information about an import
+ testruntype This is used to classify a test run across the product
+ referencedPrimaryRunId This if present would signify that the run is secondary and value corresponds to the primary run; in case its null it means its a primary run
+-->
+<!ELEMENT header-info EMPTY>
+<!ATTLIST header-info
+ checksum CDATA #IMPLIED
+ resultcount CDATA #IMPLIED
+ execaccount CDATA #REQUIRED
+ execdate CDATA #REQUIRED
+ harnesstype CDATA #REQUIRED
+ importinfo CDATA #IMPLIED
+ testruntype CDATA #IMPLIED
+ referencedPrimaryRunId CDATA #IMPLIED
+>
+
+<!--
+ Harness Specific Data : To be reused by the harness
+ processconfig The path to the file which is used for process management by some test frameworks
+-->
+<!ELEMENT harness-info EMPTY>
+<!ATTLIST harness-info
+ processconfig CDATA #IMPLIED
+>
+
+<!--
+ Outermost Element : Defines a Test Run
+ runid Unique id for the run across Sapphire. Use the supplied utility.
+ testtype
+ release Must correspond to a release in the system.
+ load Must correspond to a load in the system, for this release.
+ branch Must correspond to a p4 branch in the system.
+ string A Sapphire semantic for frequency of execution.
+ Must be either 1, 2, 3, or 4. Roughly,
+ 1 = more than once per day, like a continuous build and test
+ 2 = nightly
+ 3 = weekly
+ 4 = once per load
+ changenumber p4 change number at which this this run occurred
+ analyzer Must correspond to a user in the system.
+ This can be overridden per test result
+ hostname
+ toptestfile The filename (not full path) of the top testfile.
+ This used to help distinguish between runs, along with testruntype
+-->
+<!ELEMENT test-log (environment?, output-files*, header-info, harness-info?, test-result+)>
+<!ATTLIST test-log
+ runid CDATA #REQUIRED
+ testtype (AUTOMATED|MANUAL) #REQUIRED
+ release CDATA #REQUIRED
+ load CDATA #REQUIRED
+ branch CDATA #IMPLIED
+ string CDATA #REQUIRED
+ changenumber CDATA #IMPLIED
+ analyzer CDATA #IMPLIED
+ hostname CDATA #IMPLIED
+ toptestfile CDATA #IMPLIED
+ runmodifier CDATA #IMPLIED
+>
+
Modified: incubator/beehive/trunk/controls/test/infra/tch/tchx.jar
==============================================================================
Binary files. No diff available.
Modified: incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/logger/GTLFLogger.java
==============================================================================
--- incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/logger/GTLFLogger.java (original)
+++ incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/logger/GTLFLogger.java Wed Oct 6 12:08:16 2004
@@ -30,7 +30,7 @@
"<!DOCTYPE "
+ TEST_LOG_ELEMENT
+ " PUBLIC \"-//BEA Systems, Inc.//DTD GTLF 1.0//EN\""
- + " \"http://sapphire.beasys.com/docs/downloads/gtlf-config-2-0.dtd\">";
+ + " \"http://incubator.apache.org/beehive/gtlf-config-2.0.dtd\">";
public static final SimpleDateFormat XML_LOG_DATEFORMAT =
new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
@@ -169,14 +169,36 @@
protected String getStartXMLLog() throws LoggerRuntimeException
{
StringBuffer buf = new StringBuffer();
+
// Allow for override of dtd url
- String sapphire_server_url= System.getProperty("sapphire.server.URL");
- String dtd_ref = (sapphire_server_url == null ?
+ String use_remote = System.getProperty("gtlf.dtd.use.remote");
+ String dtd_ref;
+ // If gtlf.dtd.use.remote is not set or is true, then use the remote dtd
+ if ( use_remote == null || use_remote.toLowerCase().equals("true") )
+ {
+ String remote_dtd = System.getProperty("gtlf.dtd.remote");
+ dtd_ref = ( ( remote_dtd == null ) ?
DEFAULT_DTD_REF : "<!DOCTYPE " + TEST_LOG_ELEMENT
+ " PUBLIC \"-//BEA Systems, Inc.//DTD GTLF 1.0//EN\""
- + " \"" + sapphire_server_url
- + "/docs/downloads/gtlf-config-2-0.dtd\">");
-
+ + " \"" + remote_dtd + "\">");
+ }else{
+ String local_dtd = System.getProperty("gtlf.dtd.local");
+ if (local_dtd == null)
+ {
+ System.out.println("WARNING: gtlf.dtd.local is not set, so using default: ./gtlf-config-2.0.dtd");
+ System.out.println(" If this file does not exist, you may experience unexpected errors.");
+ System.out.println(" To prevent any such errors, please set gtlf.dtd.local to a relative");
+ System.out.println(" path to the GTLF DTD file.");
+ dtd_ref= "<!DOCTYPE " + TEST_LOG_ELEMENT
+ + " PUBLIC \"-//BEA Systems, Inc.//DTD GTLF 1.0//EN\""
+ + " \"gtlf-config-2.0.dtd\">";
+ }else{
+ dtd_ref= "<!DOCTYPE " + TEST_LOG_ELEMENT
+ + " PUBLIC \"-//BEA Systems, Inc.//DTD GTLF 1.0//EN\""
+ + " \"" + local_dtd + "\">";
+ }
+ }
+
buf
.append("<?xml version=\"1.0\"?>")
.append(sep)
Modified: incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/util/gtlf/GTLFEntityResolver.java
==============================================================================
--- incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/util/gtlf/GTLFEntityResolver.java (original)
+++ incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/util/gtlf/GTLFEntityResolver.java Wed Oct 6 12:08:16 2004
@@ -11,15 +11,15 @@
{
public static String REMOTE_GTLF_DTD_V10 =
- "http://sapphire.beasys.com/docs/downloads/gtlf-config-1-0.dtd";
+ "http://blah.beasys.com/docs/downloads/gtlf-config-1-0.dtd";
public static String LOCAL_GTLF_DTD_V10 = "gtlf-config-1-0.dtd";
public static String REMOTE_GTLF_DTD_V20 =
- "http://sapphire.beasys.com/docs/downloads/gtlf-config-2-0.dtd";
+ "http://blah.beasys.com/docs/downloads/gtlf-config-2-0.dtd";
public static String LOCAL_GTLF_DTD_V20 = "gtlf-config-2-0.dtd";
public static String REMOTE_VALID_VALUES_DTD_V10 =
- "http://sapphire.beasys.com/docs/downloads/valid-values-1-0.dtd";
+ "http://blah.beasys.com/docs/downloads/valid-values-1-0.dtd";
public static String LOCAL_VALID_VALUES_DTD_V10 = "valid-values-1-0.dtd";
private static Map mappings = new HashMap();