I am using JDK1.4 assert statements in TestNG test. When I try to compile the
test using Maven 2.0 (mvn test-compile), it doesn't recognize assert
statement and give compilation failure : 
"BasicTest.java:[28,15] ';' expected "
on the following code.

public void basicTest() {
int cnt = getCount();
assert cnt > 0 : "COUNT NOT GREATER THAN ZERO";
}

Surefire enables the assertion by default so I don't need to specify it in
POM surefire plugin configuration. But I did try that too but it's still not
working.

Here's part of my POM
<project>
...
<build>
<sourceDirectory>src/</sourceDirectory>
<plugins> 
<plugin> 
<groupId>org.apache.maven.plugins</groupId> 
<artifactId>maven-surefire- 
plugin</artifactId> 
<configuration>
<groups>basic</groups> 
</configuration> 
</plugin> 
</plugins> 
</build>
...
</project>

Not sure why it's failing. Please help? Thanks
(I am able to compile the code using javac command)
 
-- 
View this message in context: 
http://www.nabble.com/Maven-TestNG-with-JDK-1.4---Asserts-not-working-tf2371315.html#a6606185
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to