|
21 | 21 | import java.io.File; |
22 | 22 |
|
23 | 23 | import org.apache.hadoop.fs.viewfs.ViewFileSystem; |
24 | | -import org.apache.log4j.Logger; |
25 | | -import org.junit.Test; |
26 | 24 |
|
27 | | -import static org.assertj.core.api.Assertions.assertThat; |
| 25 | +import org.assertj.core.api.Assertions; |
| 26 | +import org.junit.Test; |
28 | 27 |
|
29 | 28 | public class TestClassUtil { |
| 29 | + |
30 | 30 | @Test(timeout=10000) |
31 | 31 | public void testFindContainingJar() { |
32 | | - String containingJar = ClassUtil.findContainingJar(Logger.class); |
33 | | - assertThat(containingJar) |
34 | | - .describedAs("Containing jar for %s", Logger.class) |
| 32 | + String containingJar = ClassUtil.findContainingJar(Assertions.class); |
| 33 | + Assertions |
| 34 | + .assertThat(containingJar) |
| 35 | + .describedAs("Containing jar for %s", Assertions.class) |
35 | 36 | .isNotNull(); |
36 | 37 | File jarFile = new File(containingJar); |
37 | | - assertThat(jarFile) |
| 38 | + Assertions |
| 39 | + .assertThat(jarFile) |
38 | 40 | .describedAs("Containing jar %s", jarFile) |
39 | 41 | .exists(); |
40 | | - assertThat(jarFile.getName()) |
| 42 | + Assertions |
| 43 | + .assertThat(jarFile.getName()) |
41 | 44 | .describedAs("Containing jar name %s", jarFile.getName()) |
42 | | - .matches("reload4j.*[.]jar"); |
| 45 | + .matches("assertj-core.*[.]jar"); |
43 | 46 | } |
44 | 47 |
|
45 | 48 | @Test(timeout = 10000) |
46 | 49 | public void testFindContainingClass() { |
47 | 50 | String classFileLocation = ClassUtil.findClassLocation(ViewFileSystem.class); |
48 | | - assertThat(classFileLocation) |
| 51 | + Assertions |
| 52 | + .assertThat(classFileLocation) |
49 | 53 | .describedAs("Class path for %s", ViewFileSystem.class) |
50 | 54 | .isNotNull(); |
51 | 55 | File classFile = new File(classFileLocation); |
52 | | - assertThat(classFile) |
| 56 | + Assertions |
| 57 | + .assertThat(classFile) |
53 | 58 | .describedAs("Containing class file %s", classFile) |
54 | 59 | .exists(); |
55 | | - assertThat(classFile.getName()) |
| 60 | + Assertions |
| 61 | + .assertThat(classFile.getName()) |
56 | 62 | .describedAs("Containing class file name %s", classFile.getName()) |
57 | 63 | .matches("ViewFileSystem.class"); |
58 | 64 | } |
|
0 commit comments