| View previous topic :: View next topic |
| Author |
Message |
Mvek
Joined: 31 Oct 2011 Posts: 43 Location: Prague, Czech Republic
|
Posted: Fri Nov 11, 2011 12:18 pm Post subject: NB Platform Test Infrastructure Tutorial - problem with jUnit |
|
|
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
|
Posted: Thu Nov 17, 2011 10:27 am Post subject: Re: NB Platform Test Infrastructure Tutorial - problem with jUnit |
|
|
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
| Description: |
|
 Download |
| Filename: |
junit-4.8.2.jar |
| Filesize: |
231.78 KB |
| Downloaded: |
338 Time(s) |
| 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
|
Posted: Mon Dec 26, 2011 12:51 pm Post subject: |
|
|
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
|
Posted: Tue Jan 17, 2012 4:03 pm Post subject: |
|
|
| Thank you, worked for me too !
|
|
| Back to top |
|
 |
deric
Joined: 05 Nov 2008 Posts: 4
|
Posted: Wed Jan 25, 2012 3:25 pm Post subject: |
|
|
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 I'm using 32bit ubuntu with java 1.6
|
|
| Back to top |
|
 |
Cush1978
Joined: 15 Sep 2008 Posts: 216
|
Posted: Wed Mar 07, 2012 9:07 pm Post subject: |
|
|
| 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
|
Posted: Fri Mar 09, 2012 12:41 pm Post subject: |
|
|
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
|
Posted: Sun Mar 11, 2012 5:25 pm Post subject: |
|
|
| 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 |
|
 |
|