You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Magesh Umasankar <um...@apache.org> on 2002/04/05 23:26:37 UTC

AntTest Test Failure: WinNT 4.0, JDK 1.3.0_02, 1.4.0_b92

This exception occurs in WinNT, using JDK 1.4, but not on 1.3...
I didn't see this happening on FreeBSD.

==========================
    [junit] Testcase:
testLogfilePlacement(org.apache.tools.ant.taskdefs.AntTest
):      Caused an ERROR
    [junit] null
    [junit] java.lang.NoSuchMethodError
    [junit]     at
org.apache.tools.ant.taskdefs.AntTest.testLogfilePlacement(An
tTest.java:221)
    [junit]     at java.lang.reflect.Method.invoke(Native Method)
    [junit]     at junit.framework.TestCase.runTest(TestCase.java:166)
    [junit]     at junit.framework.TestCase.runBare(TestCase.java:140)
    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit]     at
junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit]     at junit.framework.TestResult.run(TestResult.java:109)
    [junit]     at junit.framework.TestCase.run(TestCase.java:131)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
run(JUnitTestRunner.java:265)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eInVM(JUnitTask.java:670)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:459)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:436)
    [junit]     at org.apache.tools.ant.Task.perform(Task.java:313)
    [junit]     at org.apache.tools.ant.Target.execute(Target.java:309)
    [junit]     at org.apache.tools.ant.Target.performTasks(Target.java:334)
    [junit]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1176)

    [junit]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1118
)
    [junit]     at org.apache.tools.ant.Main.runBuild(Main.java:573)
    [junit]     at org.apache.tools.ant.Main.start(Main.java:179)
    [junit]     at org.apache.tools.ant.Main.main(Main.java:201)
    [junit]
    [junit]
==========================

When I change the getProject().*** calls to reference
project.*** in the testLogfilePlacement method, surprisingly,
I get a little further, but I get the following failure on JDK 1.4.
If I leave it as getProject() itself, I still get this error on
JDK 1.3.  When I execute it in JDK 1.2.2, I get this error, but
against the file test2.log.

==========================
    [junit] Testcase:
testLogfilePlacement(org.apache.tools.ant.taskdefs.AntTest
):      Caused an ERROR
    [junit] Unable to delete file
D:\cvsroot\Projects\jakarta-ant\src\etc\testca
ses\taskdefs\test1.log
    [junit]
D:\cvsroot\Projects\jakarta-ant\src\etc\testcases\taskdefs\ant.xml:6
: Unable to delete file
D:\cvsroot\Projects\jakarta-ant\src\etc\testcases\taskde
fs\test1.log
    [junit]     at
org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:272)

    [junit]     at org.apache.tools.ant.Task.perform(Task.java:313)
    [junit]     at org.apache.tools.ant.Target.execute(Target.java:309)
    [junit]     at org.apache.tools.ant.Target.performTasks(Target.java:334)
    [junit]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1176)

    [junit]     at
org.apache.tools.ant.BuildFileTest.executeTarget(BuildFileTes
t.java:187)
    [junit]     at
org.apache.tools.ant.taskdefs.AntTest.tearDown(AntTest.java:8
2)
    [junit]     at junit.framework.TestCase.runBare(TestCase.java:143)
    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit]     at
junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit]     at junit.framework.TestResult.run(TestResult.java:109)
    [junit]     at junit.framework.TestCase.run(TestCase.java:131)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
run(JUnitTestRunner.java:265)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eInVM(JUnitTask.java:670)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:459)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:436)
    [junit]     at org.apache.tools.ant.Task.perform(Task.java:313)
    [junit]     at org.apache.tools.ant.Target.execute(Target.java:309)
    [junit]     at org.apache.tools.ant.Target.performTasks(Target.java:334)
    [junit]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1176)

    [junit]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1118
)
    [junit]     at org.apache.tools.ant.Main.runBuild(Main.java:573)
    [junit]     at org.apache.tools.ant.Main.start(Main.java:179)
    [junit]     at org.apache.tools.ant.Main.main(Main.java:201)
    [junit]
==========================

Cheers,
Magesh

**********************************************
*  You are asking for big trouble and a big  *
*  bill when lawyers are the only ones who   *
*  understand the law.                       *
**********************************************


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: AntTest Test Failure: WinNT 4.0, JDK 1.3.0_02, 1.4.0_b92

Posted by Stephane Bailliez <sb...@apache.org>.
----- Original Message -----
From: "Magesh Umasankar" <um...@apache.org>
To: "Ant Developers List" <an...@jakarta.apache.org>
Sent: Friday, April 05, 2002 11:26 PM
Subject: AntTest Test Failure: WinNT 4.0, JDK 1.3.0_02, 1.4.0_b92


> This exception occurs in WinNT, using JDK 1.4, but not on 1.3...
> I didn't see this happening on FreeBSD.

FWIW at work, I have had very strange behavior with Velocity and context
tools running with JDK 1.4 (this is a Turbine/Velocity based webapp). I did
not have time to look into it as JDK 1.4 is not our target but was related
to introspection (roughly it is a hashmap that is put into the velocity
context and a
#foreach  iterates over all values but it is like all these values are null
(while they are not)). This is nothing fancy but it happens only with JDK
1.4 and works perfectly with JDK 1.3

I suspect there possibly are some reflection regressions in JDK 1.4 due to
the rewrite of a lot of methods for performance reasons but it is only a
guess.





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: AntTest Test Failure: WinNT 4.0, JDK 1.3.0_02, 1.4.0_b92

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 8 Apr 2002, Magesh Umasankar <um...@apache.org> wrote:

> We should perhaps add something like this to Project.java:
> 
> private boolean isLogFileUsed;

This meant that all BuildLoggers would have to check the value,
basically duplicating the same code in all BuildLogger
implementations.  Not nice.

> How would you do that without having a handle to
> the open file stream object?

A finally clause in Main.start and Ant.execute that knows whether a
logfile has been used and closes it.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: AntTest Test Failure: WinNT 4.0, JDK 1.3.0_02, 1.4.0_b92

Posted by Magesh Umasankar <um...@apache.org>.
From: "Stefan Bodewig" <bo...@apache.org>


> On Fri, 5 Apr 2002, Magesh Umasankar <um...@apache.org> wrote:
> 
> > Seems like the created log files are
> > not being closed
> 
> This is not only in <ant*>, Ant itself doesn't close the logfile
> either if you invoke it with -logfile.
> 
> BuildLoggers don't know whether they print to the console or a file,
> so they cannot simply close the streams in buildFinished.  

We should perhaps add something like this to Project.java:

private boolean isLogFileUsed;

public boolean isLogFileUsed() {
  return isLogFileUsed;
}

public void setLogFileUsed(boolean b) {
  isLogFileUsed = b;
}

setLogFileUsed(true) must be invoked whenever
logfile is being used.

BuildLogger's buildFinished's parameter BuildEvent 
has a handle to the Project instance from which
it can find out if the stream is to be closed or
not.

> This means we need to take care of it from the 
> outside.

How would you do that without having a handle to
the open file stream object?

> 
> Stefan
> 

Cheers,
Magesh

*********************************************
*  When in doubt, mumble; when in trouble,  *
*  delegate; when in charge, ponder.        *
*                          - James H. Boren *
*********************************************



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: AntTest Test Failure: WinNT 4.0, JDK 1.3.0_02, 1.4.0_b92

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 5 Apr 2002, Magesh Umasankar <um...@apache.org> wrote:

> Seems like the created log files are
> not being closed

This is not only in <ant*>, Ant itself doesn't close the logfile
either if you invoke it with -logfile.

BuildLoggers don't know whether they print to the console or a file,
so they cannot simply close the streams in buildFinished.  This means
we need to take care of it from the outside.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: AntTest Test Failure: WinNT 4.0, JDK 1.3.0_02, 1.4.0_b92

Posted by Magesh Umasankar <um...@apache.org>.
From: "Magesh Umasankar" <um...@apache.org>


> The second part of the failure (failure while deleting
> test1.log, test2.log, test3.log and test4.log) is
> consistently repeatable - the first failure
> vanished when I did a second bootstrap/build/test!

Seems like the created log files are
not being closed leading to this problem
on Windows (and other OSes that don't allow
deletion of 'open' files).


Cheers,
Magesh

***************************
*  Nil Magnum Nisi Bonum  *
***************************



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: AntTest Test Failure: WinNT 4.0, JDK 1.3.0_02, 1.4.0_b92

Posted by Magesh Umasankar <um...@apache.org>.
The second part of the failure (failure while deleting
test1.log, test2.log, test3.log and test4.log) is
consistently repeatable - the first failure
vanished when I did a second bootstrap/build/test!

Cheers,
Magesh

***********************************************
*  Yawn: The only time some married men ever  *
*  get to open their mouth.                   *
***********************************************

----- Original Message -----
From: "Magesh Umasankar" <um...@apache.org>
To: "Ant Developers List" <an...@jakarta.apache.org>
Sent: Friday, April 05, 2002 4:26 PM
Subject: AntTest Test Failure: WinNT 4.0, JDK 1.3.0_02, 1.4.0_b92


> This exception occurs in WinNT, using JDK 1.4, but not on 1.3...
> I didn't see this happening on FreeBSD.
>
> ==========================
>     [junit] Testcase:
> testLogfilePlacement(org.apache.tools.ant.taskdefs.AntTest
> ):      Caused an ERROR
>     [junit] null
>     [junit] java.lang.NoSuchMethodError
>     [junit]     at
> org.apache.tools.ant.taskdefs.AntTest.testLogfilePlacement(An
> tTest.java:221)
>     [junit]     at java.lang.reflect.Method.invoke(Native Method)
>     [junit]     at junit.framework.TestCase.runTest(TestCase.java:166)
>     [junit]     at junit.framework.TestCase.runBare(TestCase.java:140)
>     [junit]     at
junit.framework.TestResult$1.protect(TestResult.java:106)
>     [junit]     at
> junit.framework.TestResult.runProtected(TestResult.java:124)
>     [junit]     at junit.framework.TestResult.run(TestResult.java:109)
>     [junit]     at junit.framework.TestCase.run(TestCase.java:131)
>     [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
> run(JUnitTestRunner.java:265)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
> eInVM(JUnitTask.java:670)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
> e(JUnitTask.java:459)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
> e(JUnitTask.java:436)
>     [junit]     at org.apache.tools.ant.Task.perform(Task.java:313)
>     [junit]     at org.apache.tools.ant.Target.execute(Target.java:309)
>     [junit]     at
org.apache.tools.ant.Target.performTasks(Target.java:334)
>     [junit]     at
> org.apache.tools.ant.Project.executeTarget(Project.java:1176)
>
>     [junit]     at
> org.apache.tools.ant.Project.executeTargets(Project.java:1118
> )
>     [junit]     at org.apache.tools.ant.Main.runBuild(Main.java:573)
>     [junit]     at org.apache.tools.ant.Main.start(Main.java:179)
>     [junit]     at org.apache.tools.ant.Main.main(Main.java:201)
>     [junit]
>     [junit]
> ==========================
>
> When I change the getProject().*** calls to reference
> project.*** in the testLogfilePlacement method, surprisingly,
> I get a little further, but I get the following failure on JDK 1.4.
> If I leave it as getProject() itself, I still get this error on
> JDK 1.3.  When I execute it in JDK 1.2.2, I get this error, but
> against the file test2.log.
>
> ==========================
>     [junit] Testcase:
> testLogfilePlacement(org.apache.tools.ant.taskdefs.AntTest
> ):      Caused an ERROR
>     [junit] Unable to delete file
> D:\cvsroot\Projects\jakarta-ant\src\etc\testca
> ses\taskdefs\test1.log
>     [junit]
> D:\cvsroot\Projects\jakarta-ant\src\etc\testcases\taskdefs\ant.xml:6
> : Unable to delete file
> D:\cvsroot\Projects\jakarta-ant\src\etc\testcases\taskde
> fs\test1.log
>     [junit]     at
> org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:272)
>
>     [junit]     at org.apache.tools.ant.Task.perform(Task.java:313)
>     [junit]     at org.apache.tools.ant.Target.execute(Target.java:309)
>     [junit]     at
org.apache.tools.ant.Target.performTasks(Target.java:334)
>     [junit]     at
> org.apache.tools.ant.Project.executeTarget(Project.java:1176)
>
>     [junit]     at
> org.apache.tools.ant.BuildFileTest.executeTarget(BuildFileTes
> t.java:187)
>     [junit]     at
> org.apache.tools.ant.taskdefs.AntTest.tearDown(AntTest.java:8
> 2)
>     [junit]     at junit.framework.TestCase.runBare(TestCase.java:143)
>     [junit]     at
junit.framework.TestResult$1.protect(TestResult.java:106)
>     [junit]     at
> junit.framework.TestResult.runProtected(TestResult.java:124)
>     [junit]     at junit.framework.TestResult.run(TestResult.java:109)
>     [junit]     at junit.framework.TestCase.run(TestCase.java:131)
>     [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
> run(JUnitTestRunner.java:265)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
> eInVM(JUnitTask.java:670)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
> e(JUnitTask.java:459)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
> e(JUnitTask.java:436)
>     [junit]     at org.apache.tools.ant.Task.perform(Task.java:313)
>     [junit]     at org.apache.tools.ant.Target.execute(Target.java:309)
>     [junit]     at
org.apache.tools.ant.Target.performTasks(Target.java:334)
>     [junit]     at
> org.apache.tools.ant.Project.executeTarget(Project.java:1176)
>
>     [junit]     at
> org.apache.tools.ant.Project.executeTargets(Project.java:1118
> )
>     [junit]     at org.apache.tools.ant.Main.runBuild(Main.java:573)
>     [junit]     at org.apache.tools.ant.Main.start(Main.java:179)
>     [junit]     at org.apache.tools.ant.Main.main(Main.java:201)
>     [junit]
> ==========================
>
> Cheers,
> Magesh
>
> **********************************************
> *  You are asking for big trouble and a big  *
> *  bill when lawyers are the only ones who   *
> *  understand the law.                       *
> **********************************************
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>