W3C home > Mailing lists > Public > public-mobileok-checker@w3.org > March 2007

Re: Another draft of test framework

From: Shadi Abou-Zahra <shadi@w3.org>
Date: Thu, 01 Mar 2007 20:24:10 +0100
Message-ID: <45E7285A.1060107@w3.org>
To: Sean Owen <srowen@google.com>
Cc: public-mobileok-checker@w3.org

Hi Sean,

Just as an fyi, the EARL code looks good for the current EARL WD. There 
has been a minor change in "Web Content" class though. An upcoming Last 
Call WD is expected later this month, here is a sneak preview of the 
Editor's Draft under discussion by ERT WG:
  - <http://www.w3.org/WAI/ER/EARL10/WD-EARL10-Schema-20070226>

Regards,
   Shadi


Sean Owen wrote:
> Here's another cut at a test framework. It exposes intermediate test
> states in the HTTP-in-RDF vocab, and results in the EARL vocab, per my
> ACTION. Also per my ACTION I'm offering this overview of the code for
> discussion as we need to decide whether this is roughly OK as a
> starting point or not.
> 
> Attached is source, a sample of the intermediate output XML at the
> moment, and a sample of the EARL results.
> 
> 
> All code is in package org.w3c.mwi.mobileok.basic. Depends on Java 5,
> Commons Codec, Commons HttpClient, Commons Logging.
> 
> 
> THE PUBLIC API
> 
> Tester
> This is the top-level abstraction which runs the test. It can be
> constructed to operate on a file, a URI, or can be given the HTTP
> response body and headers directly. It exposes a runTests() method
> that runs everything, or, runTest() which runs just one test.
> 
> TestType
> Just an enum of all test types.
> 
> TestResults
> TestResult
> Returned by runTests() and runTest() respectively, and encapsulate the
> results of many tests and one test, respectively. TestResults includes
> many TestResult instances. These objects include test outcome,
> warnings, and information.
> 
> TestOutcome
> Just an enum of PASS and FAIL, the two test outcomes
> 
> TestException
> Throw if something goes wrong in the tester -- that is, not just that
> there was an error accessing the document but that something is wrong
> with the tester.
> 
> 
> NON-PUBLIC INTERNALS
> 
> TestImplementation
> AbstractTestImplementation
> There's an implementation of TestImplementation for each mobileOK
> basic test, and AbstractTestImplementation fills the usual role of
> holding bits of logic common to implementations.
> 
> TestContext
> Packages all the details of the preprocessing done by Tester, like the
> results of retrieving the resource, for all implementations to use.
> 
> HTTPResource
> HTTPTextResource
> Encapsulates an HTTP request, its execution, and the response.
> HTTPTextResource just extends this to try to treat the body as text
> and make it available as a String
> 
> CachingTest, etc.
> Implementations for particular mobileOK basic tests.
> 
> 
> SAMPLE USAGE IN JAVA
> ... which just prints results to System.out
> 
>         final Tester tester = new Tester(new URI("http://foobar.com"));
>         final TestResults results = tester.runTests();
> 
>         final TransformerFactory tFactory = 
> TransformerFactory.newInstance();
>         final StreamResult result = new StreamResult(System.out);
>         tFactory.newTransformer().transform(new
> DOMSource(results.getIntermediateResultsDOM()), result);
>         tFactory.newTransformer().transform(new
> DOMSource(results.getTestResultsDOM()), result);

-- 
Shadi Abou-Zahra     Web Accessibility Specialist for Europe |
Chair & Staff Contact for the Evaluation and Repair Tools WG |
World Wide Web Consortium (W3C)           http://www.w3.org/ |
Web Accessibility Initiative (WAI),   http://www.w3.org/WAI/ |
WAI-TIES Project,                http://www.w3.org/WAI/TIES/ |
Evaluation and Repair Tools WG,    http://www.w3.org/WAI/ER/ |
2004, Route des Lucioles - 06560,  Sophia-Antipolis - France |
Voice: +33(0)4 92 38 50 64          Fax: +33(0)4 92 38 78 22 |
Received on Thursday, 1 March 2007 19:25:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:13:02 GMT