I'm having trouble debugging test classes when using TestNG Factories. It seems like, when in Debug mode, you can only debug as far as the factory class.
In the following example, it's possible to debug in WebTestFactory and impossible in WebTest.
Factory class:
public class WebTestFactory {
@Factory
public Object[] createInstances() {
Object[] result = new Object[10];
for (int i = 0; i < 10; i++) {
result[i] = new WebTest(i * 10);
return result;
}
}
Test class:
public class WebTest {
// **** BREAKPOINTS IMPOSSIBLE HERE ****
private int m_numberOfTimes;
public WebTest(int numberOfTimes) {
m_numberOfTimes = numberOfTimes;
}
@Test
public void testServer() {
for (int i = 0; i < m_numberOfTimes; i++) {
}
}
}
EDIT: Additional info: My current project structure is that the test class and the factory are in different projects. The Factory is in the project from which I run my tests, and the test class is in an external jar.
EDIT: It's not a TestNG problem. Just Eclipse going crazy again!