@@ -37,29 +37,6 @@ public SurefireStaxHandler(UnitTestIndex index) {
37
37
this .index = index ;
38
38
}
39
39
40
- public void stream (SMHierarchicCursor rootCursor ) throws XMLStreamException {
41
- SMInputCursor testSuite = rootCursor .constructDescendantCursor (new ElementFilter ("testsuite" ));
42
- SMEvent testSuiteEvent ;
43
- for (testSuiteEvent = testSuite .getNext (); testSuiteEvent != null ; testSuiteEvent = testSuite .getNext ()) {
44
- if (testSuiteEvent .compareTo (SMEvent .START_ELEMENT ) == 0 ) {
45
- String testSuiteClassName = testSuite .getAttrValue ("name" );
46
- if (StringUtils .contains (testSuiteClassName , "$" )) {
47
- // test suites for inner classes are ignored
48
- return ;
49
- }
50
- SMInputCursor testCase = testSuite .childCursor (new ElementFilter ("testcase" ));
51
- SMEvent event ;
52
- for (event = testCase .getNext (); event != null ; event = testCase .getNext ()) {
53
- if (event .compareTo (SMEvent .START_ELEMENT ) == 0 ) {
54
- String testClassName = getClassname (testCase , testSuiteClassName );
55
- UnitTestClassReport classReport = index .index (testClassName );
56
- parseTestCase (testCase , classReport );
57
- }
58
- }
59
- }
60
- }
61
- }
62
-
63
40
private static String getClassname (SMInputCursor testCaseCursor ,
64
41
String defaultClassname ) throws XMLStreamException {
65
42
String testClassName = testCaseCursor .getAttrValue ("classname" );
@@ -136,4 +113,27 @@ private static String getTestCaseName(SMInputCursor testCaseCursor) throws XMLSt
136
113
}
137
114
return name ;
138
115
}
116
+
117
+ public void stream (SMHierarchicCursor rootCursor ) throws XMLStreamException {
118
+ SMInputCursor testSuite = rootCursor .constructDescendantCursor (new ElementFilter ("testsuite" ));
119
+ SMEvent testSuiteEvent ;
120
+ for (testSuiteEvent = testSuite .getNext (); testSuiteEvent != null ; testSuiteEvent = testSuite .getNext ()) {
121
+ if (testSuiteEvent .compareTo (SMEvent .START_ELEMENT ) == 0 ) {
122
+ String testSuiteClassName = testSuite .getAttrValue ("name" );
123
+ if (StringUtils .contains (testSuiteClassName , "$" )) {
124
+ // test suites for inner classes are ignored
125
+ return ;
126
+ }
127
+ SMInputCursor testCase = testSuite .childCursor (new ElementFilter ("testcase" ));
128
+ SMEvent event ;
129
+ for (event = testCase .getNext (); event != null ; event = testCase .getNext ()) {
130
+ if (event .compareTo (SMEvent .START_ELEMENT ) == 0 ) {
131
+ String testClassName = getClassname (testCase , testSuiteClassName );
132
+ UnitTestClassReport classReport = index .index (testClassName );
133
+ parseTestCase (testCase , classReport );
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
139
}
0 commit comments