NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Maven, Unit tests, and NetBeans 6.7

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Nephthys76



Joined: 16 Jul 2009
Posts: 1

PostPosted: Thu Jul 16, 2009 6:08 pm    Post subject: Maven, Unit tests, and NetBeans 6.7 Reply with quote

I just upgraded to NetBeans 6.7. I am running it on Ubuntu 9.04 (Jaunty Jackelope).

When I am viewing a JUnit class, I used to be able to run just that file (shift-F6) -- but I cannot do so any longer. The option is also greyed out on the menu. Why is this? I can still run the test by going to the class I am testing and running "test" (ctrl-F6), but I like to have both options available so I don't have to unnecessarily switch between files.

That is just annoying... but more troublesome is that my tests always fail because the context is unaware of some environment variables that my test Spring context file refers to. I have tried several different ways to get those variables into my global options for running tests, but to no avail. The only way I got it to work was to add the properties to the test target in each individual project. This is far too cumbersome for me as I have over 30 projects and new ones are added on a regular basis. Additionally, doing this adds config files to my directory, and I have to mark each one to be ignored by SVN.

I don't remember how I declared these variables to 6.5, but I know I didn't do it on an individual project basis. (I had to re-install Ubuntu, so I don't have reference)

Any help on either or both of my unit test issues would be awesome!

Thanks,
Tonya
Back to top
mkleint
Posted via mailing list.





PostPosted: Fri Jul 17, 2009 7:49 am    Post subject: Maven, Unit tests, and NetBeans 6.7 Reply with quote

Nephthys76 wrote:
Quote:
I just upgraded to NetBeans 6.7. I am running it on Ubuntu 9.04 (Jaunty Jackelope).



When I am viewing a JUnit class, I used to be able to run just that file (shift-F6) -- but I cannot do so any longer. The option is also greyed out on the menu. Why is this? I can still run the test by going to the class I am testing and running "test" (ctrl-F6), but I like to have both options available so I don't have to unnecessarily switch between files.


There's "test file" action, it works the same on Foo.java and
FooTest.java. Previosly (in 6.5) you had to execute "test file" in
Foo.java and "Run file" in FooTest.java. Now you have the same action
and same shortcut. Previosly you could not execute classes with main
method in test source roots either.

Quote:

That is just annoying... but more troublesome is that my tests always fail because the context is unaware of some environment variables that my test Spring context file refers to. I have tried several different ways to get those variables into my global options for running tests, but to no avail. The only way I got it to work was to add the properties to the test target in each individual project. This is far too cumbersome for me as I have over 30 projects and new ones are added on a regular basis. Additionally, doing this adds config files to my directory, and I have to mark each one to be ignored by SVN.



might be a bug. You can turn off Compile on Save in the project to see
if things improved. in any case, probably worth filing as bug, if you
have a test case project, even better.

Milos
Quote:
I don't remember how I declared these variables to 6.5, but I know I didn't do it on an individual project basis. (I had to re-install Ubuntu, so I don't have reference)



Any help on either or both of my unit test issues would be awesome!



Thanks,

Tonya




Back to top
Masteraco



Joined: 28 Oct 2010
Posts: 1

PostPosted: Thu Oct 28, 2010 2:03 pm    Post subject: Reply with quote

Hi,

Don“t know if this post still alive but my simple solution was to rename the
C:\Archivos de programa\glassfish-3.0.1\glassfish\modules\ant.jar to ant_any.jar
Then the junit test works fine.

I am usin Netbeans 6.9.1

Hope this help someone out there
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo