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

ACTION-515: configuration

From: Sean Owen <srowen@google.com>
Date: Sun, 17 Jun 2007 23:55:05 -0400
Message-ID: <e920a71c0706172055n54bdbedfi36f6bf4267089d43@mail.gmail.com>
To: public-mobileok-checker <public-mobileok-checker@w3.org>

So I added "TesterConfiguration", which is kind of a strange class.
The requirement here was to implement some kind of configuration
object which merely holds different parameters. That part is easy --
just a fancy Map -- but the other requirement was to figure out a way
to avoid passing it to every single class and method. I implemented
this as a per-thread singleton, which will work but is not really
pleasant for my tastes. One sets configuration with
TesterConfiguration.setConfiguration() before running tests, and
retrieves configuration in any line of code with
TesterConfiguration.getConfiguration(). The singleton is per-thread,
meaning this will store and hold a separate value per thread (see
java.lang.ThreadLocal). So this mostly assumes that exactly one thread
will manage each test. It's convenient, if a little hacky, so let's
see how well it serves us.

Received on Monday, 18 June 2007 03:55:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:18 UTC