30
30
import java .io .Writer ;
31
31
import java .nio .ByteBuffer ;
32
32
import java .nio .charset .Charset ;
33
-
34
- import junit .framework .Assert ;
35
-
36
33
import org .apache .lucene .document .Document ;
34
+ import static org .junit .Assert .assertEquals ;
37
35
import org .junit .Test ;
38
36
39
37
public class TextAnalyzerTest {
@@ -56,19 +54,19 @@ public void defaultEncoding() throws IOException {
56
54
new TestableTextAnalyzer ().analyze (new Document (),
57
55
getStreamSource ("hello" .getBytes ()), null );
58
56
59
- Assert . assertEquals (defaultEncoding , encoding );
57
+ assertEquals (defaultEncoding , encoding );
60
58
61
- Assert . assertEquals ("hello" , contents );
59
+ assertEquals ("hello" , contents );
62
60
}
63
61
64
62
@ Test
65
63
public void resetsStreamOnShortInput () throws IOException {
66
64
new TestableTextAnalyzer ().analyze (new Document (),
67
65
getStreamSource ("hi" .getBytes ()), null );
68
66
69
- Assert . assertEquals (defaultEncoding , encoding );
67
+ assertEquals (defaultEncoding , encoding );
70
68
71
- Assert . assertEquals ("hi" , contents );
69
+ assertEquals ("hi" , contents );
72
70
}
73
71
74
72
@ Test
@@ -77,8 +75,8 @@ public void utf8WithBOM() throws IOException {
77
75
new TestableTextAnalyzer ().analyze (new Document (),
78
76
getStreamSource (buffer ), null );
79
77
80
- Assert . assertEquals ("hello" , contents );
81
- Assert . assertEquals ("UTF8" , encoding );
78
+ assertEquals ("hello" , contents );
79
+ assertEquals ("UTF8" , encoding );
82
80
}
83
81
84
82
@ Test
@@ -90,9 +88,9 @@ public void utf16WithBOM() throws IOException {
90
88
new TestableTextAnalyzer ().analyze (new Document (),
91
89
getStreamSource (bytes ), null );
92
90
93
- Assert . assertEquals ("UTF-16" , encoding );
91
+ assertEquals ("UTF-16" , encoding );
94
92
95
- Assert . assertEquals ("hello" , contents );
93
+ assertEquals ("hello" , contents );
96
94
}
97
95
98
96
@ Test
@@ -110,9 +108,9 @@ public void utf16WithBOMAlternate() throws IOException {
110
108
new TestableTextAnalyzer ().analyze (new Document (),
111
109
getStreamSource (bytes ), null );
112
110
113
- Assert . assertEquals ("UTF-16" , encoding );
111
+ assertEquals ("UTF-16" , encoding );
114
112
115
- Assert . assertEquals ("hello" , contents );
113
+ assertEquals ("hello" , contents );
116
114
}
117
115
118
116
public class TestableTextAnalyzer extends TextAnalyzer {
0 commit comments