testng-team / testng

TestNG testing framework
https://testng.org
Apache License 2.0
1.98k stars 1.02k forks source link

Test invoked twice when implements abstract method from parameterized parent. #765

Closed sixtysecond closed 7 years ago

sixtysecond commented 9 years ago

Expected behavior: test should execute once

Actual behavior: test is executed twice

Code sample to duplicate:

https://github.com/sixtysecond/testng-bug

package foo;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

public class DuplicateCallsTest extends TestTemplate<Integer> {

    int i = 0;

    @Test(dataProvider = "testParameters")
    public void callExecuteTest(Integer testParameters)
            throws Exception {

        System.out.println(i);
        i++;
        System.out.println(testParameters);
    }

    @DataProvider(name = "testParameters")
    public Object[][] getOnboardingTestParameters() {
        return new Object[][] {
                { new Integer(4) }

        };
    }
}
package foo;

public abstract class TestTemplate<T> {

    public abstract void callExecuteTest(T testParameters) throws Exception;

}
bit-cracker007 commented 7 years ago

Why no response yet? Is this relatable to: https://github.com/cbeust/testng/issues/1340 ?

juherr commented 7 years ago

Why no response yet?

Because nobody had the time to have a look on it.

Is this relatable to: #1340 ?

Not at all.