1 package test.groupbug;
2 
3 import org.testng.Assert;
4 import org.testng.annotations.Test;
5 import org.testng.collections.Lists;
6 
7 import test.BaseTest;
8 
9 import java.util.Arrays;
10 import java.util.List;
11 
12 public class GroupBugTest extends BaseTest {
13 
14   static List<String> passed = Lists.newArrayList();
15 
16   @Test(groups = "broken",
17       description = "Comment out dependsOnGroups in ITCaseOne will fix the ordering, that's the bug")
shouldOrderByClass()18   public void shouldOrderByClass() {
19     passed.clear();
20     addClass(ITCaseOne.class);
21     addClass(ITCaseTwo.class);
22     run();
23     List<String> expected = Arrays.asList(
24         "one1", "one2", "two1", "two2"
25     );
26     Assert.assertEquals(passed, expected);
27   }
28 }
29