The version that compiles does have a legal classname. I was trying to get a
more meaningful compile error message than "missing {" and forgot to change
the name back when i posted. It's an intriguing point none-the-less about
the usefulness of the error messages.
I ran 3 more tests. Conclusion any attempt to use junit fails regardless of
version and testng works.
Changed pom back to version to 3.8.1
Used new legal java file:
package com.mycompany.app;
import junit.framework.*;
public class TestMe extends TestCase {
public void testAdd() {
int num1 = 3;
int num2 = 2;
int total = 5;
int sum = 0;
sum = Math.add(num1, num2);
assertEquals(sum, total);
}
}
MAVEN ERROR: Cannot find symbol
**********************************************
Changed the pom back to a testng dependency with just this test file:
package com.mycompany.app;
import java.util.*;
import org.testng.Assert;
import org.testng.annotations.*;
public class TestNGCollection {
private Collection collection;
@BeforeClass
public void oneTimeSetUp() {
// one-time initialization code
System.out.println("@BeforeClass - oneTimeSetUp");
}
@AfterClass
public void oneTimeTearDown() {
// one-time cleanup code
System.out.println("@AfterClass - oneTimeTearDown");
}
@BeforeMethod
public void setUp() {
collection = new ArrayList();
System.out.println("@BeforeMethod - setUp");
}
@AfterMethod
public void tearDown() {
collection.clear();
System.out.println("@AfterMethod - tearDown");
}
@Test
public void testEmptyCollection() {
Assert.assertEquals(collection.isEmpty(),true);
System.out.println("@Test - testEmptyCollection");
}
@Test
public void testOneItemCollection() {
collection.add("itemA");
Assert.assertEquals(collection.size(),1);
System.out.println("@Test - testOneItemCollection");
}
}
Compiles and runs happily
--
View this message in context:
http://maven.40175.n5.nabble.com/Junit-ignored-by-Maven-tp5497051p5498427.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]