3

I am working on a Netbeans Platform RCP application.

I use jmock in my unit tests and I have created a Library Wrapper Module to import the necessary libraries.

The Module has an section named 'Libraries' and another section named 'Unit Test Libraries'.

I hoped that I could add the JMock Library Wrapper to the 'Unit Test Libraries', however when I run the unit tests I get the error 'package org.jmock does not exist'.

If I import the JMock Library Wrapper in to the main 'Libraries' element then it works, but this feels wrong.

Maven allows me to specify unit-test only dependencies, and I assumed that NetBeans Platform did the same. Should this be possible? Am I doing something wrong? Should I resign myself to a run-time dependency on the unit-test libraries (ugh).

Ben Hammond
  • 705
  • 1
  • 7
  • 20

2 Answers2

0

I experienced the same issue. After doing a "Clean and Build All" on the project (not the module), everything worked fine.

Eric Levine
  • 13,536
  • 5
  • 49
  • 49
0

Using library wrappers as test dependencies ought to work; in fact this is how JUnit itself is packaged. Try a clean build as previously suggested.

Jesse Glick
  • 24,539
  • 10
  • 90
  • 112