mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
fe89155a04
Adding lesfurets test framwork improvements via helper classes
25 lines
696 B
Groovy
25 lines
696 B
Groovy
#!groovy
|
|
package util
|
|
|
|
import com.lesfurets.jenkins.unit.global.lib.SourceRetriever
|
|
|
|
/**
|
|
* Retrieves the shared lib sources of the current project which are expected to be
|
|
* at the default location "./vars".
|
|
*/
|
|
|
|
class ProjectSource implements SourceRetriever {
|
|
|
|
private def sourceDir = new File('.')
|
|
|
|
/*
|
|
* None of the parameters provided in the signature are used in the use-case of that retriever.
|
|
*/
|
|
List<URL> retrieve(String repository, String branch, String targetPath) {
|
|
if (sourceDir.exists()) {
|
|
return [sourceDir.toURI().toURL()]
|
|
}
|
|
throw new IllegalStateException("Directory $sourceDir.path does not exists!")
|
|
}
|
|
}
|