mirror of https://github.com/alibaba/arthas.git
Bugfix: PackageInternalsFinder support file path with white space and Unicode characters (#1921)
parent
dee70a88c5
commit
4be365e2ba
@ -0,0 +1,33 @@
|
||||
package com.taobao.arthas.compiler;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.tools.JavaFileObject;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* description: PackageInternalsFinderTest <br>
|
||||
* date: 2021/9/23 12:55 下午 <br>
|
||||
* author: zzq0324 <br>
|
||||
* version: 1.0 <br>
|
||||
*/
|
||||
public class PackageInternalsFinderTest {
|
||||
|
||||
@Test
|
||||
public void testFilePathContainWhitespace() throws IOException {
|
||||
PackageInternalsFinder finder = new PackageInternalsFinder(this.getClass().getClassLoader());
|
||||
List<JavaFileObject> fileObjectList= finder.find("file/test folder");
|
||||
|
||||
Assert.assertEquals(fileObjectList.size(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFilePathContainChineseCharacter() throws IOException {
|
||||
PackageInternalsFinder finder = new PackageInternalsFinder(this.getClass().getClassLoader());
|
||||
List<JavaFileObject> fileObjectList= finder.find("file/测试目录");
|
||||
|
||||
Assert.assertEquals(fileObjectList.size(), 0);
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
This is a test file, it's name contains white space.
|
@ -0,0 +1 @@
|
||||
This is a test file, it's name contains chinese character.
|
Loading…
Reference in New Issue