commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <>
Subject Re: [SCXML] test should fail if serialisation work dir cannot be created
Date Mon, 05 Jan 2009 22:11:05 GMT
On Mon, Jan 5, 2009 at 3:52 PM, sebb <> wrote:
> On 05/01/2009, Rahul Akolkar <> wrote:
>> On Mon, Jan 5, 2009 at 7:57 AM, sebb <> wrote:
>>  > SCXMLTestHelper currently allows the test to continue if it cannot
>>  > create the serialisation work directory.
>>  >
>>  > Given that it now fails the test if it cannot create/read the
>>  > serialisation files, it seems to me that directory creation failure
>>  > should also cause the test to fail.
>>  >
>>  > WDYT?
>>  >
>> <snip/>
>>  Confused by the predicate in 2nd para since in case of NSEs the test continues.
> The test does not continue if the file cannot be created/written.
>>  WRT the directory creation, if you'd rather have the build fail if
>>  creation fails, there would ideally be a nice message stating the
>>  problem (rather than a generic x failures and y errors kind of thing)
> I was thinking of throwing an IOException("Failed to create
> serialisation work directory",e).
> However it's going to be a pretty unlikely occurrence - indeed I'm not
> sure why the check is needed at all as failure to create the directory
> would cause an IO error on the file creation which follows.

I went looking through the svn log since I don't recollect its
origins, and I think it had to do with failures when running the tests
outside Maven. The only thing I see is cases where we can't assume the
existence of the parent 'target' directory -- which has been fixed by
changing the mkdir() call to mkdirs(). At this point, I agree the
check is not needed.

>>  and additonally, there'd be a build time switch that allows folks to
>>  say "we don't care about serialization" which would cause the build to
>>  succeed (this could also help the NSE catches you are looking at
>>  eliminating -- all NSEs could then cause tests to error out by
>>  default). So maybe the approach of providing such a switch helps both
>>  cases we're discussing.
> Not sure I know how to do that in Maven. Why not do a single test for
> NSE and skip any further serialisation tests if the the initial test
> fails?

You mean single JUnit test? That'll cause the build to fail on JDKs
like Sun 1.4 (unless the tests are skipped), which seems suboptimal
given its an optional feature users may not need and an environment
configuration, rather than code, issue. When I weight the pros and
cons of a build failure vs. current outcome (warnings to console) in
this context, the latter seems better to me.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message