28
28
import org .exist .xquery .value .IntegerValue ;
29
29
import org .exist .xquery .value .Sequence ;
30
30
import org .junit .Test ;
31
- import org .w3c .dom .Node ;
32
- import org .xmlunit .builder .Input ;
33
- import org .xmlunit .util .Convert ;
34
31
35
32
import javax .xml .transform .Source ;
36
33
34
+ import static org .exist .test .DiffMatcher .docSource ;
35
+ import static org .exist .test .DiffMatcher .elemSource ;
37
36
import static org .exist .test .XQueryAssertions .assertThatXQResult ;
38
37
import static org .exist .test .XQueryAssertions .assertXQStaticError ;
38
+ import static org .exist .test .XQueryAssertions .assertXQResultIdentical ;
39
39
import static org .exist .test .XQueryAssertions .assertXQResultSimilar ;
40
40
import static org .hamcrest .Matchers .equalTo ;
41
41
@@ -95,7 +95,7 @@ public void immediateLambdaWithDocumentAndDoubleSlash() throws EXistException, P
95
95
" <result>{ $f($d) }</result>" ;
96
96
final Either <XPathException , Sequence > actual = executeQuery (query );
97
97
98
- assertXQResultSimilar (expected , actual );
98
+ assertXQResultIdentical (expected , actual );
99
99
}
100
100
101
101
@ Test
@@ -108,7 +108,7 @@ public void immediateLambdaWithDocumentAndSlash() throws EXistException, Permiss
108
108
" $f($d)" ;
109
109
final Either <XPathException , Sequence > actual = executeQuery (query );
110
110
111
- assertXQResultSimilar (expected , actual );
111
+ assertXQResultIdentical (expected , actual );
112
112
}
113
113
114
114
@ Test
@@ -133,28 +133,4 @@ public void topLevelAbsolutePath() throws EXistException, PermissionDeniedExcept
133
133
134
134
assertThatXQResult (actual , equalTo (expected ));
135
135
}
136
-
137
- /**
138
- * Creates an Document6 Source form an XML String.
139
- *
140
- * @param str a string representation of XML.
141
- *
142
- * @return a Document Source.
143
- */
144
- private static Source docSource (final String str ) {
145
- return Input .fromString (str ).build ();
146
- }
147
-
148
- /**
149
- * Creates an Element Source form an XML String.
150
- *
151
- * @param str a string representation of XML.
152
- *
153
- * @return an Element Source.
154
- */
155
- private static Source elemSource (final String str ) {
156
- final Node documentNode = Convert .toNode (docSource (str ));
157
- final Node firstElement = documentNode .getFirstChild ();
158
- return Input .fromNode (firstElement ).build ();
159
- }
160
136
}
0 commit comments