Skip to content

Commit ece23d1

Browse files
committed
addressing comments - find jar path for assertj
1 parent 0930e5f commit ece23d1

File tree

1 file changed

+18
-12
lines changed
  • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util

1 file changed

+18
-12
lines changed

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestClassUtil.java

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,44 @@
2121
import java.io.File;
2222

2323
import org.apache.hadoop.fs.viewfs.ViewFileSystem;
24-
import org.apache.log4j.Logger;
25-
import org.junit.Test;
2624

27-
import static org.assertj.core.api.Assertions.assertThat;
25+
import org.assertj.core.api.Assertions;
26+
import org.junit.Test;
2827

2928
public class TestClassUtil {
29+
3030
@Test(timeout=10000)
3131
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)
3536
.isNotNull();
3637
File jarFile = new File(containingJar);
37-
assertThat(jarFile)
38+
Assertions
39+
.assertThat(jarFile)
3840
.describedAs("Containing jar %s", jarFile)
3941
.exists();
40-
assertThat(jarFile.getName())
42+
Assertions
43+
.assertThat(jarFile.getName())
4144
.describedAs("Containing jar name %s", jarFile.getName())
42-
.matches("reload4j.*[.]jar");
45+
.matches("assertj-core.*[.]jar");
4346
}
4447

4548
@Test(timeout = 10000)
4649
public void testFindContainingClass() {
4750
String classFileLocation = ClassUtil.findClassLocation(ViewFileSystem.class);
48-
assertThat(classFileLocation)
51+
Assertions
52+
.assertThat(classFileLocation)
4953
.describedAs("Class path for %s", ViewFileSystem.class)
5054
.isNotNull();
5155
File classFile = new File(classFileLocation);
52-
assertThat(classFile)
56+
Assertions
57+
.assertThat(classFile)
5358
.describedAs("Containing class file %s", classFile)
5459
.exists();
55-
assertThat(classFile.getName())
60+
Assertions
61+
.assertThat(classFile.getName())
5662
.describedAs("Containing class file name %s", classFile.getName())
5763
.matches("ViewFileSystem.class");
5864
}

0 commit comments

Comments
 (0)