use of java.security.CodeSource in project pinpoint by naver.
the class AbstractPinpointPluginTestSuite method resolveTestClassLocation.
private String resolveTestClassLocation(Class<?> testClass) {
CodeSource codeSource = testClass.getProtectionDomain().getCodeSource();
URL testClassLocation = codeSource.getLocation();
return toPathString(testClassLocation);
}
use of java.security.CodeSource in project pinpoint by naver.
the class DependencyGraph method currentWorkingDir.
private String currentWorkingDir() {
CodeSource codeSource = this.getClass().getProtectionDomain().getCodeSource();
URL location = codeSource.getLocation();
String dir = location.getPath();
return dir;
}
use of java.security.CodeSource in project pinpoint by naver.
the class JarProfilerPluginClassInjectorTest method getSampleJar.
private URL getSampleJar(Class clazz) {
final CodeSource codeSource = clazz.getProtectionDomain().getCodeSource();
final URL location = codeSource.getLocation();
logger.debug("url:{}", location);
return location;
}
use of java.security.CodeSource in project pinpoint by naver.
the class AgentDirBaseClassPathResolverTest method getClassLocation.
private static String getClassLocation(Class<?> clazz) {
CodeSource codeSource = clazz.getProtectionDomain().getCodeSource();
URL location = codeSource.getLocation();
logger.debug("codeSource.getLocation:{}", location);
File file = FileUtils.toFile(location);
return file.getPath();
}
use of java.security.CodeSource in project powermock by powermock.
the class AgentInitialization method getPathToJarFileContainingThisClass.
private String getPathToJarFileContainingThisClass() {
CodeSource codeSource = AgentInitialization.class.getProtectionDomain().getCodeSource();
if (codeSource == null) {
return null;
}
// URI is needed to deal with spaces and non-ASCII characters
URI jarFileURI;
try {
jarFileURI = codeSource.getLocation().toURI();
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
return new File(jarFileURI).getPath();
}
Aggregations