cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean O'Callaghan" <SEA...@progress.com>
Subject RE: svn commit: r723778 - in /cxf/trunk/common/common/src: main/java/org/apache/cxf/helpers/FileUtils.java test/java/org/apache/cxf/helpers/FileUtilsTest.java
Date Fri, 05 Dec 2008 16:56:45 GMT
Good point Dan, will do so.
thanks,

Seán.



> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: 05 December 2008 16:55
> To: dev@cxf.apache.org
> Cc: Sean O'Callaghan
> Subject: Re: svn commit: r723778 - in /cxf/trunk/common/common/src:
> main/java/org/apache/cxf/helpers/FileUtils.java
> test/java/org/apache/cxf/helpers/FileUtilsTest.java
> 
> 
> 
> Sean,
> 
> 
> On Friday 05 December 2008 11:02:52 am seanoc@apache.org wrote:
> > +public class FileUtilsTest extends Assert {
> > +
> > +
> > +    @Test
> > +    public void testTempIODirExists() throws Exception {
> > +
> > +        try {
> > +            System.setProperty("java.io.tmpdir", "dummy");
> > +            FileUtils.createTempFile("foo", "bar");
> > +        } catch (RuntimeException e) {
> > +            assertTrue(e.toString().contains("please set 
> java.io.tempdir
> > to an existing directory")); +        }
> > +    }
> > +}
> 
> Most likely, you should get the original java.io.tmpdir value 
> and restore it 
> in a finally block.   I'm not sure what would happen if your 
> test runs before 
> other tests as the tmpdir value would then point to a 
> non-existent location.   
> Restoring it to the previous value should prevent any strange issues.
> 
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> 
Mime
View raw message