Including statements in ant

I want to enable the approval tool in ant . In my ant build.xml I set the following, trying to include statements.

<project> ... <assertions> <enable/> </assertions> </project>

I put the statement in a junit file that includes only one function,

 testAssertions() { assert false; } 

when you run ant statement fails. How to enable a statement in this parameter?

+4
source share
2 answers

It looks like your <assertions> is a child of a <project> , is that correct?

I assume that you are running the test using the <junit> ant task. If so, create a subassembly <assertions><enable/></assertions> that the child <junit> should execute.

+9
source

To enable the statements, I edited nbproject/project.properties and changed

 # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= 

to

 run.jvmargs=\ -ea 

After this, statements were included when I executed ant run .

0
source

All Articles