Question

Does anyone know how to enableassertions during testing? I'm trying to use buildr to for a lucene based project and I get the following exception:

[junit] Test class requires enabled assertions, enable globally (-ea) or for Solr/Lucene subpackages only:

I've tried from the command line:

JAVA_OPTS=-ea buildr

and putting the following in my buildfile:

ENV['JAVA_OPTS'] ||= '-enableAssertions'

I'm using the java version of buildr (1.4.12)

Was it helpful?

Solution

ugh, 2 seconds after submitting this I figured out the solution:

  test.using :java_args => [ '-ea' ]

OTHER TIPS

I had same issue with SOLR and eclipse, solution is exactly the same.

In package explorer right click on project: Run As->Run Configurations...->JUnit->ProjectName->Arguments(second tab)->VM arguments

Type in :-ea

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top