The method is a fine idea but it would not meet my needs since my code looks
like this:

    public void testJavaExtDirDoesNotExist() {
        String saveJavaExtDirs = SystemUtils.JAVA_EXT_DIRS;
        try {
            String testJavaExtDirs = "...";
            System.setProperty("java.ext.dirs", testJavaExtDirs);
            // The real test starts here...
        } finally {
            System.setProperty("java.ext.dirs", saveJavaExtDirs);
        }
    }

And would perhaps be "prettier" if I could do:

SystemUtils.setJavaExtDirs(saveJavaExtDirs);

Instead of:

System.setProperty("java.ext.dirs", saveJavaExtDirs);

Gary

> -----Original Message-----
> From: Todd V. Jonker [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 13:52
> To: Jakarta Commons Developers List
> Subject: Re: [lang][proposal] SystemUtils property out of sync problem;
> add set methods.
> 
> Gary,
> 
> Would it meet testing needs to add a reloadSystemProperties() method that
> test-code can call after tweaking things?  It seems like that would make
> testing easy without cluttering SystemUtils with setters (that perhaps
> shouldn't be used otherwise).
> 
> 
> .T.
> 
> On Fri, 13 Feb 2004 23:11:43 -0000, "Stephen Colebourne"
> <[EMAIL PROTECTED]> said:
> > From: "Gary Gregory" <[EMAIL PROTECTED]>
> > > > Do people really change these values? (other than in tests, which
> kinda
> > > > don't count...)
> > >
> > > My feeling is that is does not matter what /kind/ of call site uses
> (for
> > > example) SystemUtils, whether it is application code or unit test
> code. My
> > > application, in general terms, is the client/customer. What matters is
> > that
> > > [lang] provides the services that make my job of writing code
> > > easier/better/faster.
> >
> > The point I'm really driving at is where the limits of [lang] lie. There
> > is
> > no technical difficulty (other than its a bit boring) of adding get and
> > set
> > methods for each system property in addition to the constants. The
> > question
> > is whether it serves a big enough need.
> >
> > Maybe there is a large need to change environment variables, but I just
> > feel
> > a little unconvinced. Consider me -0 I guess.
> >
> > Stephen
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to