문제

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)

도움이 되었습니까?

해결책

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

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top