0
votes

I have a test market with @Test annotaion. But when I run the test case, it shows me that Tests run: 0, Failures: 0, Skips: 0 I am running test cases from within eclipse. I have testng plugin installed in eclipse.

TestClass Code:

 public class ModelledEventBus  {

        ModelledEventBusOperator dummyOperator = new ModelledEventBusOperator();

        /**
         * Dummy Test Case to show the interworkings of TAF classes
         */
        @VUsers(vusers = { 1, 10, 100 })
        @Test(dataProvider = "dummyTestData", dataProviderClass = ModelledEventBusTestDataProvider.class)
        public void dummyTestCase(String stringToPrint) {
            setTestcase("TC-DUMMY", "Dummy Test Case");
            setTestInfo("Testing " + stringToPrint);
            assertEquals(dummyOperator.operate(stringToPrint),
                    dummyOperator.expected());
        }
}

attributes inside @Test are custom.

public class ModelledEventBusTestDataProvider {



    // Dummy Test Data Provider Code generated to show interworkings of TAF Classes
    @DataProvider(name="dymmyTestData")
    public static String[][] dummyTestData(){
            String[][] result = {{"First String"},{"Second String"}};
            return result;
    }

}

TestNG version:6.8.0

2
show ur code..and how are you running it (right click run as testng?) what version of testng plugin?niharika_neo
Hi niharika_neo, I have edited the question to add the details. Please let me know if you need any more details.Raman
can you also put the code for the dataprovider.niharika_neo
Hi niharika_neo, I have edited the question to add the DataProvider. Please let me know if you need any more detailsRaman
I did try your code out, it works for me. Can you increase the verbosity level and check.niharika_neo

2 Answers

0
votes

Your dataprovider name has a typo.

@Test(dataProvider = "dummyTestData", dataProviderClass = ModelledEventBusTestDataProvider.class)
        public void dummyTestCase(String stringToPrint) {

 @DataProvider(name="dymmyTestData")
    public static String[][] dummyTestData(){

One is d*u*mmyTestData and other d*y*mmyTestData.

0
votes

I created the suite.xml file and it is running now. I am not quite sure what exactly the problem was, but I have a running test case now.