Skip to content

Commit

Permalink
add test case special jar
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyb1990 committed Nov 15, 2022
1 parent 75199df commit 0b80283
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.List;
import java.util.regex.Pattern;

import com.alibaba.jvm.sandbox.api.routing.RoutingExt;
import com.alibaba.jvm.sandbox.api.routing.RoutingInfo;
import com.alibaba.jvm.sandbox.api.routing.RoutingInfo.Type;
import com.alibaba.jvm.sandbox.core.classloader.SpecialRoutingHandler.RoutingYaml;
Expand All @@ -23,23 +22,13 @@
*/
public class SpecialRoutingHandlerTest {

private final static Pattern API_JAR_FILE_PATTERN = Pattern.compile("sandbox-api-.*.jar");

File jarFile = null;

@Before
public void before() {
File path = new File(
RoutingExt.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile();
assertNotNull(path);
File[] files = path.listFiles();
assertNotNull(files);
for (File file : files) {
if (API_JAR_FILE_PATTERN.matcher(file.getName()).matches()) {
jarFile = file;
break;
}
}
URL resource = SpecialRoutingHandler.class.getResource("/lib/sandbox-api-1.4.0-for-qatest.jar");
assertNotNull(resource);
jarFile = new File(resource.getPath());
assertNotNull(jarFile);
}

Expand Down
Binary file not shown.

0 comments on commit 0b80283

Please sign in to comment.