パッケージ com.kazurayam.unittest
クラス CodeSourcePathElementsUnderProjectDirectory
java.lang.Object
com.kazurayam.unittest.CodeSourcePathElementsUnderProjectDirectory
This class gives a categorical name to the part
"build/classes/java/test/"
in a URL string
of CodeSource object of a Java class, like
"file:/Users/kazurayam/github/unittest-helper/preliminary-study/build/classes/java/test/"
.
The CodeSourcePathElementUnderProjectDirectory (CSPEUPD for short) is dependent on the environment
in which the class runs.
import java.net.URL;
import java.security.CodeSource;
import java.security.ProjectionDomain;
import org.testng.annotation.Test;
public class S3FindingCodeSource() {
@Test
public void getLocationWhereTisClassIsFound() {
ProtectionDomain pd = this.getClass().getProtectionDomain();
CodeSource cs = pd.getCodeSource();
URL url = cs.getLocation();
System.out.println("codeSource URL=" + url.toString());
}
}
This will print something like this:
codeSource URL=file:/Users/kazurayam/github/unittest-helper/preliminary-study/build/classes/java/test/
I call file:/Users/kazurayam/github/unittest-helper/preliminary-study/
as the "Project Directory",
build/classes/java/test/
as the "CodeSource Path Elements Under Project Directory".-
フィールドの概要
修飾子とタイプフィールド説明 -
コンストラクタの概要
コンストラクタ説明copy constructorCodeSourcePathElementsUnderProjectDirectory
(String pathElement, String... more) CodeSourcePathElementsUnderProjectDirectory
(List<String> cspeupdStringList) -
メソッドの概要
-
フィールド詳細
-
MAVEN_TEST
-
GRADLE_JAVA_TEST
-
GRADLE_JAVA_FUNCTIONALTEST
-
GRADLE_GROOVY_TEST
-
GRADLE_GROOVY_FUNCTIONALTEST
-
GRADLE_KOTLIN_TEST
-
GRADLE_KOTLIN_FUNCTIONALTEST
-
-
コンストラクタの詳細
-
CodeSourcePathElementsUnderProjectDirectory
-
CodeSourcePathElementsUnderProjectDirectory
-
CodeSourcePathElementsUnderProjectDirectory
public CodeSourcePathElementsUnderProjectDirectory(CodeSourcePathElementsUnderProjectDirectory source) copy constructor
-
-
メソッドの詳細