Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   NetBeans/StrutsTestCase - strange error message (http://www.velocityreviews.com/forums/t725036-netbeans-strutstestcase-strange-error-message.html)

Tim Slattery 06-08-2010 03:28 PM

NetBeans/StrutsTestCase - strange error message
 
I've used StrutsTestCase (an extension of JUnit version 3) to test a
Struts Action object in NetBeans 6.8. It works - from logging
statements in the code I can see that the test runs all the way
through, returns to my object that extends MockStrutsTestCase, and
successfully performs the verifyForward statement.

The "Test Results" page shows a red bar and "No test passed". But in
the "Output" pane, it says "Tests run: 1, Failures: 0, Errors: 0, Time
elapsed: 0.656 sec". What causes the "Test Results" pane to report
failure is this message in the Output pane:

WARNING: multiple versions of ant detected in path for junit

jar:file:/D:/Program%20Files/NetBeans%206.8/java3/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
and
jar:file:/D:/bea10/modules/org.apache.ant_1.6.5/lib/ant.jar!/org/apache/tools/ant/Project.class

Both these libraries exist on my machine. I have no clue why NB is
finding the bea10 library. Opening a console window and showing
CLASSPATH yields only:

CLASSPATH=C:\WINNT\Profiles\SLATTERY_T\.vmwebclien t\Java\Lib\vmi660.jar

which doesn't seem to have anything to do with this. So WTF is going
on"?

--
Tim Slattery
Slattery_T@bls.gov
http://members.cox.net/slatteryt

John B. Matthews 06-08-2010 08:40 PM

Re: NetBeans/StrutsTestCase - strange error message
 
In article <6bos069g2sjrhsnb61842d9j4nfol9p1o6@4ax.com>,
Tim Slattery <Slattery_T@bls.gov> wrote:

> ... NetBeans 6.8 ...
>
> WARNING: multiple versions of ant detected in path for junit
> ...
> So WTF is going on"?


There's a lot of possibilities:

NetBeans' Options > Miscellaneous > Ant
Tools > Libraries
java.ext.dirs
nbproject/project.properties
~/.netbeans/6.8/var/cache

Not long ago, NetBeans began insisting that it couldn't show me the
javadoc for certain specific classes in java.*. It turns out that
something in cache was persuading NB to compile those classes instead of
using the library versions. I suspect operator error, but rm -rf ended
the dispute.

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Tim Slattery 06-09-2010 01:11 PM

Re: NetBeans/StrutsTestCase - strange error message
 
"John B. Matthews" <nospam@nospam.invalid> wrote:

>In article <6bos069g2sjrhsnb61842d9j4nfol9p1o6@4ax.com>,
> Tim Slattery <Slattery_T@bls.gov> wrote:
>
>> ... NetBeans 6.8 ...
>>
>> WARNING: multiple versions of ant detected in path for junit
>> ...
>> So WTF is going on"?

>
>There's a lot of possibilities:
>
>NetBeans' Options > Miscellaneous > Ant
>Tools > Libraries
>java.ext.dirs
>nbproject/project.properties
>~/.netbeans/6.8/var/cache


Thanks, but...

Options|Miscellaneous|Ant

No "Tools" or "Libraries". There's an "Ant Home:" box, large boxes for
"Classpath" (empty) and Properties (build.compiler.emacs=true). three
checkboxes and buttons to add/remove/rearrange things in the Classpath
box.

The "Ant Home" box points to the "ant" subdirectory within Netbeans.

--
Tim Slattery
Slattery_T@bls.gov
http://members.cox.net/slatteryt

Lew 06-09-2010 10:18 PM

Re: NetBeans/StrutsTestCase - strange error message
 
John B. Matthews wrote:
>> There's a lot of possibilities:
>>
>> NetBeans' Options> Miscellaneous> Ant
>> Tools> Libraries
>> java.ext.dirs
>> nbproject/project.properties
>> ~/.netbeans/6.8/var/cache


Tim Slattery wrote:
> Thanks, but...
>
> Options|Miscellaneous|Ant
>
> No "Tools" or "Libraries". There's an "Ant Home:" box, large boxes for


John listed five separate possibilities. In NB 6.8 the "Tools" menu pad is
not within the "Ant" menu. I assure you there is a "Tools" menu pad in NB.
Right there in plain sight, two positions to the left of the "Help" menu pad
on the far right. See it?

> "Classpath" (empty) and Properties (build.compiler.emacs=true). three
> checkboxes and buttons to add/remove/rearrange things in the Classpath
> box.
>
> The "Ant Home" box points to the "ant" subdirectory within Netbeans.


Try looking where John suggested.

For reference, "java.ext.dirs" is set externally with a "-D" command. The
"nbproject/project.properties" file is in your project subdirectory. The
"cache" subdirectory is literally at the location John mentioned.

--
Lew

John B. Matthews 06-10-2010 01:07 AM

Re: NetBeans/StrutsTestCase - strange error message
 
In article <hup3ub$d3l$1@news.albasani.net>, Lew <noone@lewscanon.com>
wrote:

> John B. Matthews wrote:
> >> There's a lot of possibilities:
> >>
> >> NetBeans' Options > Miscellaneous > Ant
> >> Tools > Libraries
> >> java.ext.dirs
> >> nbproject/project.properties
> >> ~/.netbeans/6.8/var/cache

>
> Tim Slattery wrote:
> > Thanks, but...
> >
> > Options|Miscellaneous|Ant
> >
> > No "Tools" or "Libraries". There's an "Ant Home:" box, large boxes for

>
> John listed five separate possibilities.


Lew: Thank you for clarifying that.

> In NB 6.8 the "Tools" menu pad is not within the "Ant" menu. I
> assure you there is a "Tools" menu pad in NB. Right there in plain
> sight, two positions to the left of the "Help" menu pad on the far
> right. See it?


Tim: You're looking for "bea10". The same information in the Tools >
Libraries menu is found in ~/.netbeans/6.8/build.properties (or the
Windows equivalent).

> > "Classpath" (empty) and Properties (build.compiler.emacs=true).
> > three checkboxes and buttons to add/remove/rearrange things in the
> > Classpath box.
> >
> > The "Ant Home" box points to the "ant" subdirectory within
> > Netbeans.


Tim: No "bea10"?

> Try looking where John suggested.
>
> For reference, "java.ext.dirs" is set externally with a "-D" command.


Lew: Good point. I usually search the directories found in the
corresponding system property, but those can change.

<http://java.sun.com/javase/6/docs/api/java/lang/System.html#getProperties()>

> The "nbproject/project.properties" file is in your project
> subdirectory. The "cache" subdirectory is literally at the location
> John mentioned.


Tim: Deleting the entire cache seems harmless on my platform, but I
don't know about Windows.

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>


All times are GMT. The time now is 04:33 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.