NetBeans Forums

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

running single junit test on maven project fails

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



Joined: 15 Dec 2009
Posts: 1

PostPosted: Tue Dec 15, 2009 3:32 pm    Post subject: running single junit test on maven project fails Reply with quote

I use NB6.8 (very good IDE, nice job), have a maven project and encounter the following problem:

Calling "Test File"/"Debug Test File" on a single test class fails.
It seems not to be using maven but prints "Testsuite: <classname>" to the console before starting the test (which fails).

If I go to the project properties -> Actions, select the "Test File" Action and add any properties to "Set Properties" it suddenly works for one time.
It then prints the following to the console before starting the test (which succeeds):

NetBeans: Executing 'D:\apache-maven-2.0.9\bin\mvn.bat -Dtest=<classname> -Dnetbeans.execution=true test-compile surefire:test'
NetBeans: JAVA_HOME=C:\Program Files\Java\jdk1.6.0_10
Scanning for projects...
Searching repository for plugin with prefix: 'surefire'.
------------------------------------------------------------------------
Building <projectname>
task-segment: [test-compile, surefire:test]
------------------------------------------------------------------------
[resources:resources]
Using 'UTF-8' encoding to copy filtered resources.
Copying 95 resources
Copying 9 resources
[compiler:compile]
Compiling 34 source files to <targetclassesdirectory>
[resources:testResources]
Using 'UTF-8' encoding to copy filtered resources.
Copying 5 resources
Copying 86 resources
Copying 3 resources
[compiler:testCompile]
Nothing to compile - all classes are up to date
[surefire:test]
Surefire report directory: <target\surefire-reportsdirectory>

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running <classname>
Back to top
pgwiazda



Joined: 11 Feb 2011
Posts: 2

PostPosted: Fri Feb 11, 2011 7:10 am    Post subject: Reply with quote

It looks like this is a "Compile on save" problem. I've changed this option in project properties->build->compile to "For application execution only" and it works.

More here : http://forums.netbeans.org/viewtopic.php?p=97653
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