Class TestArtifactRegistry
java.lang.Object
dev.getelements.elements.sdk.test.TestArtifactRegistry
A helper class to find the test artifacts in the project. Not intended to be used outside the SDK integration
tests. This searches the current working directory for "test-element-artifacts" and works it way upward until
it can find a set of test artifacts.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
copyArtifactTo
(TestElementArtifact artifact, Path destination) Copies the specified artifact to the path.void
copyBundleTo
(TestElementBundle bundle, Path destination) Copies all artifacts in the bundle to the specified directory.findArtifactPath
(TestElementArtifact artifact) Finds the Path of the artifact with the artifact name.findBundlePath
(TestElementBundle bundle) Finds the Path of the bundle with the bundle name.findJarUrl
(TestElementArtifact artifact) Finds the URL of the artifact with the artifact name.static boolean
isArtifact
(String artifactName, String jarFile) Tests the jar file name for the artifact name.void
unpackArtifact
(TestElementArtifact artifact, Path destinationDirectory) Unpacks the artifact into the destination directory.
-
Constructor Details
-
TestArtifactRegistry
public TestArtifactRegistry()
-
-
Method Details
-
isArtifact
Tests the jar file name for the artifact name.- Parameters:
artifactName
- the artifact namejarFile
- the jar file name- Returns:
- the artifact name
-
findJarUrl
Finds the URL of the artifact with the artifact name.- Parameters:
artifact
- the artifact name- Returns:
- the URL of the artifact
- Throws:
NoSuchElementException
- if the artifact wasn't found
-
findBundlePath
Finds the Path of the bundle with the bundle name.- Parameters:
bundle
- the artifact- Returns:
- the Path of the artifact
- Throws:
NoSuchElementException
- if the artifact wasn't found
-
findArtifactPath
Finds the Path of the artifact with the artifact name.- Parameters:
artifact
- the artifact- Returns:
- the Path of the artifact
- Throws:
NoSuchElementException
- if the artifact wasn't found
-
copyBundleTo
Copies all artifacts in the bundle to the specified directory.- Parameters:
bundle
- the bundledestination
- the bundle destination- Throws:
NoSuchElementException
- if the artifact wasn't found
-
copyArtifactTo
Copies the specified artifact to the path. If the destination path is a directory it will be copied into that directory. Otherwise, it will be copied to the destination exactly as it is.- Parameters:
artifact
- the artifact namedestination
- the artifact destination- Throws:
NoSuchElementException
- if the artifact wasn't foundIOException
-
unpackArtifact
Unpacks the artifact into the destination directory.- Parameters:
artifact
- the artifact namedestinationDirectory
- the destination directory
-