1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.filter.test.internal; |
21 |
|
|
22 |
|
import java.io.File; |
23 |
|
import java.io.IOException; |
24 |
|
|
25 |
|
import org.apache.commons.io.FileUtils; |
26 |
|
import org.apache.commons.io.IOUtils; |
27 |
|
import org.junit.Assert; |
28 |
|
|
29 |
|
|
30 |
|
@version |
31 |
|
@since |
32 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
33 |
|
public class StringFileAssertComparator implements FileAssertComparator |
34 |
|
{ |
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
35 |
0 |
@Override... |
36 |
|
public void assertEquals(String message, File expected, File actual) throws IOException |
37 |
|
{ |
38 |
0 |
String expectedString = FileUtils.readFileToString(expected, "UTF8"); |
39 |
0 |
String actualString = FileUtils.readFileToString(actual, "UTF8"); |
40 |
|
|
41 |
0 |
Assert.assertEquals(message, expectedString, actualString); |
42 |
|
} |
43 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
44 |
0 |
@Override... |
45 |
|
public void assertEquals(String message, byte[] expected, byte[] actual) throws IOException |
46 |
|
{ |
47 |
0 |
String expectedString = IOUtils.toString(expected, "UTF8"); |
48 |
0 |
String actualString = IOUtils.toString(actual, "UTF8"); |
49 |
|
|
50 |
0 |
Assert.assertEquals(message, expectedString, actualString); |
51 |
|
} |
52 |
|
} |