5

How can I configure Netbeans to call Maven Failsafe to run a specific integration test?

I know the Maven command to do this is 'mvn -Dit.test=MyClassIT verify' I also know how to configure 'actions' in Netbeans Project properties.

My problems are:

  • Netbeans sometimes runs the action (and calls Maven), and sometimes just uses its own compiler and test runner. Don't know how to tell it to use which. Bizarre
  • Netbeans adds "Test" to the class name. Instead it should add "IT". But the bizarre part is that there's nothing in the action that defines this behavior. The action just passes the class name.
  • I don't want to override the normal Test File and Debug Test File actions, because I need those for normal tests. But custom actions only appear in the Project's 'Custom' context menu, and not for any individual file! So they're unusuable. It would also be nice if I could make toolbar buttons for them.
  • If the planets align correctly and Netbeans issues the right command, Maven is launched with correct settings, but the debugger doesn't work

Using Netbeans 7.1 and Netbeans Dev 201201260600

John Yeary
  • 1,112
  • 22
  • 45
Aleksandr Dubinsky
  • 22,436
  • 15
  • 82
  • 99

1 Answers1

0

If you right click on a project, theres a 'custom' option with as only one child option 'goals'. You can use it to run custom mvn commands; also notice that old commands are kept, so you don't need to type it every time.

lpinto.eu
  • 2,077
  • 4
  • 21
  • 45
  • This is quicker than creating a custom action for each integration test, but it would still be much nicer if a custom action could be invoked per-file, not per-project. Also, will the debugger work if I do this? – Aleksandr Dubinsky Dec 21 '12 at 07:50
  • I am not sure on how netbeans starts the debug mode. As last resort you can always add a "debug activation flag" and then point netbeans debugger to the port you specified. – lpinto.eu Dec 21 '12 at 11:25