Skip to content
This repository was archived by the owner on Nov 21, 2017. It is now read-only.

@AfterGroups method does not wait finishing of test, which uses dataprovider #112

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Create test class, with methods anotated by 
@BeforeGroups,@AfterGroups,@DataProvider and @Test

import java.util.*;

import org.testng.annotations.*;

public class TestAfterGroups {

    private static final String GROUP_NAME = "test_group";
    private static final String DATAPROVIDER = "dataProvider";

    @BeforeGroups(groups = { GROUP_NAME })
    public void beforeGroups() {
        System.err.println("Before group");
    }

    @AfterGroups(groups = { GROUP_NAME })
    public void afterGroups() {
        System.err.println("After group");
    }

    @Test(groups = { GROUP_NAME }, dataProvider = DATAPROVIDER)
    public void test(int i) {
        System.err.println("test " + i);
    }

    @DataProvider(name = DATAPROVIDER)
    public static Iterator<Object[]> dp() {
        List<Object[]> resultList = new ArrayList<Object[]>();
        for (int i = 0; i < 5; i++) {
            resultList.add(new Object[] { i });
        }
        return resultList.iterator();

    }
}

What is the expected output? What do you see instead?

expected output:
Before group
test 0
test 1
test 2
test 3
test 4
After group

actual output:
Before group
test 0
After group
test 1
test 2
test 3
test 4

What version of the product are you using? On what operating system?
testng - 6.8.5, OS - Windows Server 2008

Please provide any additional information below.


Original issue reported on code.google.com by Vladimir...@gmail.com on 10 Jun 2013 at 3:56

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions