NetBeans Forums

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

NB Platform Test Infrastructure Tutorial - problem with jUnit

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



Joined: 31 Oct 2011
Posts: 43
Location: Prague, Czech Republic

PostPosted: Fri Nov 11, 2011 12:18 pm    Post subject: NB Platform Test Infrastructure Tutorial - problem with jUnit Reply with quote

Hi, I have tried to find the solution here, but any topics concerning jUnit, did not help me. I have NetBeans IDE 7.0.1 and JDK 1.7.

I was trying to do NB Platform Test Infrastructure Tutorial from here http://platform.netbeans.org/tutorials/nbm-test.html, but I had to stop on 3rd point. The button Resolve is disabled.

I have tried to check all the needed modules, but IDE can't find the jUnit.
I also tried on NB module on some class file choose Tools->Create JUnit test, but it leads to the similar problem, the tests seem to have incorrect imports.

But I successfully did the tutorial JUnit intro on Java app (http://netbeans.org/kb/docs/java/junit-intro.html). The difference is that this is Java app, not the NetBeans app and module.

So, how could I make and run JUnit tests for my NetBeans platform application?

(I am beginner into NetBeans, but I quickly read through The Definitive Guide and some tutorials)

EDIT: I found a halfway solution, I added the JUnit jar file in module properties as Wrapped JARs. This way, I can run the tests and have no red flafs in Project explorer, but I get some warnings at compiling (like that it cannot distinguish the annotations etc.). I will see if it is ok for now and I can programm my app now ignoring these warnings, or not.
Back to top
vsitnikov



Joined: 01 Nov 2011
Posts: 9

PostPosted: Thu Nov 17, 2011 10:27 am    Post subject: Re: NB Platform Test Infrastructure Tutorial - problem with jUnit Reply with quote

Hi Mvek
I encountered the same problem - my conclusion is that JUnit module is not installed automaticaly. I've installed it manually (at my work we have several NB 7.0.1 installations and I just copied required files to my instalation and restart NB)

These files are
${install.dir}\platform\modules\org-netbeans-libs-junit4.jar
${install.dir}\platform\modules\ext\junit-4.8.2.jar

I've attached them.

After all you should see JUnit in your suite library tab


To completely solve the problem
in your suite's project.xml the following lines must appear


NB adds them automatically when you creates a new JUnit test

Hope this help!
Regards, Vladimir



junit-4.8.2.jar
 Description:

Download
 Filename:  junit-4.8.2.jar
 Filesize:  231.78 KB
 Downloaded:  338 Time(s)


org-netbeans-libs-junit4.jar
 Description:

Download
 Filename:  org-netbeans-libs-junit4.jar
 Filesize:  3.94 KB
 Downloaded:  302 Time(s)

Back to top
Mvek



Joined: 31 Oct 2011
Posts: 43
Location: Prague, Czech Republic

PostPosted: Mon Dec 26, 2011 12:51 pm    Post subject: Reply with quote

Thank you very much for help. It seems working. I have been for a while away, so I got back to the programming this week.

(Now I have bigger issue - find out, how to test Groovy classes)
Back to top
jjazzboss



Joined: 21 Feb 2011
Posts: 27
Location: France

PostPosted: Tue Jan 17, 2012 4:03 pm    Post subject: Reply with quote

Thank you, worked for me too !
Back to top
deric



Joined: 05 Nov 2008
Posts: 4

PostPosted: Wed Jan 25, 2012 3:25 pm    Post subject: Reply with quote

in 7.1 there's no package JUnit in Platform module. I did a fresh install of Netbeans 7.1 (after deleting ~/.netbeans folder), I installed JUnit from the installer. After first startup netbeans was downloading JUnit package again and wrote that installation was sucessfull. However when I checked plugins and JUnit 1.1 was not installed. So, I installed it. In Netbeans Platform project I've added NB JUnit from harness module. It gives me this error message:

Quote:
Module NB JUnit in harness depends on module JUnit from Maven but requests an incompatible specification version.


However the project works without satisfing this dependency. Why the heck is it there? When I include NB JUnit in one of the submodules the whole build crashes. I don't understand why there are so many issues with JUnit library Sad I'm using 32bit ubuntu with java 1.6
Back to top
Cush1978



Joined: 15 Sep 2008
Posts: 216

PostPosted: Wed Mar 07, 2012 9:07 pm    Post subject: Reply with quote

No help here, but I'm seeing the same thing after migrating to NB 7.1.1 (from 7.0).
Back to top
Mvek



Joined: 31 Oct 2011
Posts: 43
Location: Prague, Czech Republic

PostPosted: Fri Mar 09, 2012 12:41 pm    Post subject: Reply with quote

I don't know, if new installation (different directory, but without uninstalling older) could take even those steps that were suggested above from my old installation (I agreed to import settings from previous found version). But the JUnit seems working fine now.

But I read in the Definitive Guide to NB Platform 7.1 that you have to install NetBeans (well specifically the JUnit) into folder, where it has write rights. Which is not the Progam Files in Windows 7.
I did it, I installed it to created C:\Programs and then tried. Maybe it helps.
Back to top
vsitnikov



Joined: 01 Nov 2011
Posts: 9

PostPosted: Sun Mar 11, 2012 5:25 pm    Post subject: Reply with quote

Mvek wrote:
I don't know, if new installation (different directory, but without uninstalling older) could take even those steps that were suggested above from my old installation (I agreed to import settings from previous found version). But the JUnit seems working fine now.

But I read in the Definitive Guide to NB Platform 7.1 that you have to install NetBeans (well specifically the JUnit) into folder, where it has write rights. Which is not the Progam Files in Windows 7.
I did it, I installed it to created C:\Programs and then tried. Maybe it helps.

Yes! I found the same problem at home on my Windows 7. I've tried removing settings, reinstalling netbeans only installing Netbeans into another folder helped to turn on JUnit test in my Netbeans Platform application. Thank you very much!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform 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