1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-05 15:15:44 +02:00

Merge branch 'master' into pr/cleanWorktreeCheck

This commit is contained in:
Christopher Fenner 2018-11-07 11:47:56 +01:00 committed by GitHub
commit 33758e0e81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 121 additions and 121 deletions

View File

@ -25,7 +25,7 @@ class StepTestTemplateTest extends BasePipelineTest {
@Test @Test
void testStepTestTemplate() throws Exception { void testStepTestTemplate() throws Exception {
jsr.step.call() jsr.step.stepTestTemplate()
// asserts // asserts
assertTrue(true) assertTrue(true)
assertJobStatusSuccess() assertJobStatusSuccess()

View File

@ -43,7 +43,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishWithDefaultSettings() throws Exception { void testPublishWithDefaultSettings() throws Exception {
jsr.step.call(script: nullScript) jsr.step.checksPublishResults(script: nullScript)
assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null) assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null)
// ensure nothing else is published // ensure nothing else is published
@ -56,7 +56,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishForJavaWithDefaultSettings() throws Exception { void testPublishForJavaWithDefaultSettings() throws Exception {
jsr.step.call(script: nullScript, pmd: true, cpd: true, findbugs: true, checkstyle: true) jsr.step.checksPublishResults(script: nullScript, pmd: true, cpd: true, findbugs: true, checkstyle: true)
assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null) assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null)
assertTrue("PmdPublisher options not set", publisherStepOptions['PmdPublisher'] != null) assertTrue("PmdPublisher options not set", publisherStepOptions['PmdPublisher'] != null)
@ -74,7 +74,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishForJavaScriptWithDefaultSettings() throws Exception { void testPublishForJavaScriptWithDefaultSettings() throws Exception {
jsr.step.call(script: nullScript, eslint: true) jsr.step.checksPublishResults(script: nullScript, eslint: true)
assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null) assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null)
assertTrue("WarningsPublisher options not set", publisherStepOptions['WarningsPublisher'] != null) assertTrue("WarningsPublisher options not set", publisherStepOptions['WarningsPublisher'] != null)
@ -92,7 +92,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishForPythonWithDefaultSettings() throws Exception { void testPublishForPythonWithDefaultSettings() throws Exception {
jsr.step.call(script: nullScript, pylint: true) jsr.step.checksPublishResults(script: nullScript, pylint: true)
assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null) assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null)
assertTrue("WarningsPublisher options not set", publisherStepOptions['WarningsPublisher'] != null) assertTrue("WarningsPublisher options not set", publisherStepOptions['WarningsPublisher'] != null)
@ -111,7 +111,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishNothing() throws Exception { void testPublishNothing() throws Exception {
jsr.step.call(script: nullScript, aggregation: false) jsr.step.checksPublishResults(script: nullScript, aggregation: false)
// ensure nothing is published // ensure nothing is published
assertTrue("AnalysisPublisher options not empty", publisherStepOptions['AnalysisPublisher'] == null) assertTrue("AnalysisPublisher options not empty", publisherStepOptions['AnalysisPublisher'] == null)
@ -124,7 +124,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishNothingExplicitFalse() throws Exception { void testPublishNothingExplicitFalse() throws Exception {
jsr.step.call(script: nullScript, pmd: false) jsr.step.checksPublishResults(script: nullScript, pmd: false)
assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null) assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null)
// ensure nothing else is published // ensure nothing else is published
@ -137,7 +137,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishNothingImplicitTrue() throws Exception { void testPublishNothingImplicitTrue() throws Exception {
jsr.step.call(script: nullScript, pmd: [:]) jsr.step.checksPublishResults(script: nullScript, pmd: [:])
// ensure pmd is not published // ensure pmd is not published
assertTrue("PmdPublisher options not set", publisherStepOptions['PmdPublisher'] != null) assertTrue("PmdPublisher options not set", publisherStepOptions['PmdPublisher'] != null)
@ -145,7 +145,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishNothingExplicitActiveFalse() throws Exception { void testPublishNothingExplicitActiveFalse() throws Exception {
jsr.step.call(script: nullScript, pmd: [active: false]) jsr.step.checksPublishResults(script: nullScript, pmd: [active: false])
// ensure pmd is not published // ensure pmd is not published
assertTrue("PmdPublisher options not empty", publisherStepOptions['PmdPublisher'] == null) assertTrue("PmdPublisher options not empty", publisherStepOptions['PmdPublisher'] == null)
@ -154,7 +154,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishWithChangedStepDefaultSettings() throws Exception { void testPublishWithChangedStepDefaultSettings() throws Exception {
// pmd has been set to active: true in step configuration // pmd has been set to active: true in step configuration
jsr.step.call(script: [commonPipelineEnvironment: [ jsr.step.checksPublishResults(script: [commonPipelineEnvironment: [
configuration: [steps: [checksPublishResults: [pmd: [active: true]]]] configuration: [steps: [checksPublishResults: [pmd: [active: true]]]]
]]) ]])
@ -169,7 +169,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishWithCustomPattern() throws Exception { void testPublishWithCustomPattern() throws Exception {
jsr.step.call(script: nullScript, eslint: [pattern: 'my-fancy-file.ext'], pmd: [pattern: 'this-is-not-a-patter.xml']) jsr.step.checksPublishResults(script: nullScript, eslint: [pattern: 'my-fancy-file.ext'], pmd: [pattern: 'this-is-not-a-patter.xml'])
assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null) assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null)
assertTrue("PmdPublisher options not set", publisherStepOptions['PmdPublisher'] != null) assertTrue("PmdPublisher options not set", publisherStepOptions['PmdPublisher'] != null)
@ -186,7 +186,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishWithArchive() throws Exception { void testPublishWithArchive() throws Exception {
jsr.step.call(script: nullScript, archive: true, eslint: true, pmd: true, cpd: true, findbugs: true, checkstyle: true) jsr.step.checksPublishResults(script: nullScript, archive: true, eslint: true, pmd: true, cpd: true, findbugs: true, checkstyle: true)
assertTrue("ArchivePatterns number not correct", archiveStepPatterns.size() == 5) assertTrue("ArchivePatterns number not correct", archiveStepPatterns.size() == 5)
assertTrue("ArchivePatterns contains no PMD pattern", archiveStepPatterns.contains('**/target/pmd.xml')) assertTrue("ArchivePatterns contains no PMD pattern", archiveStepPatterns.contains('**/target/pmd.xml'))
@ -198,7 +198,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishWithPartialArchive() throws Exception { void testPublishWithPartialArchive() throws Exception {
jsr.step.call(script: nullScript, archive: true, eslint: [archive: false], pmd: true, cpd: true, findbugs: true, checkstyle: true) jsr.step.checksPublishResults(script: nullScript, archive: true, eslint: [archive: false], pmd: true, cpd: true, findbugs: true, checkstyle: true)
assertTrue("ArchivePatterns number not correct", archiveStepPatterns.size() == 4) assertTrue("ArchivePatterns number not correct", archiveStepPatterns.size() == 4)
assertTrue("ArchivePatterns contains no PMD pattern", archiveStepPatterns.contains('**/target/pmd.xml')) assertTrue("ArchivePatterns contains no PMD pattern", archiveStepPatterns.contains('**/target/pmd.xml'))
@ -211,7 +211,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishWithDefaultThresholds() throws Exception { void testPublishWithDefaultThresholds() throws Exception {
jsr.step.call(script: nullScript, pmd: true) jsr.step.checksPublishResults(script: nullScript, pmd: true)
assertTrue("AnalysisPublisher options not set", assertTrue("AnalysisPublisher options not set",
publisherStepOptions['AnalysisPublisher'] != null) publisherStepOptions['AnalysisPublisher'] != null)
@ -245,7 +245,7 @@ class ChecksPublishResultsTest extends BasePiperTest {
@Test @Test
void testPublishWithThresholds() throws Exception { void testPublishWithThresholds() throws Exception {
jsr.step.call(script: nullScript, aggregation: [thresholds: [fail: [high: '10']]], pmd: true) jsr.step.checksPublishResults(script: nullScript, aggregation: [thresholds: [fail: [high: '10']]], pmd: true)
assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null) assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null)
assertTrue("PmdPublisher options not set", publisherStepOptions['PmdPublisher'] != null) assertTrue("PmdPublisher options not set", publisherStepOptions['PmdPublisher'] != null)

View File

@ -24,7 +24,7 @@ class DurationMeasureTest extends BasePiperTest {
@Test @Test
void testDurationMeasurement() throws Exception { void testDurationMeasurement() throws Exception {
def bodyExecuted = false def bodyExecuted = false
jsr.step.call(script: nullScript, measurementName: 'test') { jsr.step.durationMeasure(script: nullScript, measurementName: 'test') {
bodyExecuted = true bodyExecuted = true
} }
assertTrue(nullScript.commonPipelineEnvironment.getPipelineMeasurement('test') != null) assertTrue(nullScript.commonPipelineEnvironment.getPipelineMeasurement('test') != null)

View File

@ -55,7 +55,7 @@ class InfluxWriteDataTest extends BasePiperTest {
void testInfluxWriteDataWithDefault() throws Exception { void testInfluxWriteDataWithDefault() throws Exception {
nullScript.commonPipelineEnvironment.setArtifactVersion('1.2.3') nullScript.commonPipelineEnvironment.setArtifactVersion('1.2.3')
jsr.step.call(script: nullScript) jsr.step.influxWriteData(script: nullScript)
assertTrue(loggingRule.log.contains('Artifact version: 1.2.3')) assertTrue(loggingRule.log.contains('Artifact version: 1.2.3'))
@ -74,7 +74,7 @@ class InfluxWriteDataTest extends BasePiperTest {
void testInfluxWriteDataNoInflux() throws Exception { void testInfluxWriteDataNoInflux() throws Exception {
nullScript.commonPipelineEnvironment.setArtifactVersion('1.2.3') nullScript.commonPipelineEnvironment.setArtifactVersion('1.2.3')
jsr.step.call(script: nullScript, influxServer: '') jsr.step.influxWriteData(script: nullScript, influxServer: '')
assertEquals(0, stepMap.size()) assertEquals(0, stepMap.size())
@ -87,7 +87,7 @@ class InfluxWriteDataTest extends BasePiperTest {
@Test @Test
void testInfluxWriteDataNoArtifactVersion() throws Exception { void testInfluxWriteDataNoArtifactVersion() throws Exception {
jsr.step.call(script: nullScript) jsr.step.influxWriteData(script: nullScript)
assertEquals(0, stepMap.size()) assertEquals(0, stepMap.size())
assertEquals(0, fileMap.size()) assertEquals(0, fileMap.size())

View File

@ -50,7 +50,7 @@ public class MtaBuildTest extends BasePiperTest {
@Test @Test
void environmentPathTest() { void environmentPathTest() {
jsr.step.call(script: nullScript, buildTarget: 'NEO') jsr.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
assert jscr.shell.find { c -> c.contains('PATH=./node_modules/.bin:/usr/bin')} assert jscr.shell.find { c -> c.contains('PATH=./node_modules/.bin:/usr/bin')}
} }
@ -59,7 +59,7 @@ public class MtaBuildTest extends BasePiperTest {
@Test @Test
void sedTest() { void sedTest() {
jsr.step.call(script: nullScript, buildTarget: 'NEO') jsr.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
assert jscr.shell.find { c -> c =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" "mta.yaml"$/} assert jscr.shell.find { c -> c =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" "mta.yaml"$/}
} }
@ -68,7 +68,7 @@ public class MtaBuildTest extends BasePiperTest {
@Test @Test
void mtarFilePathFromCommonPipelineEnviromentTest() { void mtarFilePathFromCommonPipelineEnviromentTest() {
jsr.step.call(script: nullScript, jsr.step.mtaBuild(script: nullScript,
buildTarget: 'NEO') buildTarget: 'NEO')
def mtarFilePath = nullScript.commonPipelineEnvironment.getMtarFilePath() def mtarFilePath = nullScript.commonPipelineEnvironment.getMtarFilePath()
@ -79,7 +79,7 @@ public class MtaBuildTest extends BasePiperTest {
@Test @Test
void mtaJarLocationAsParameterTest() { void mtaJarLocationAsParameterTest() {
jsr.step.call(script: nullScript, mtaJarLocation: '/mylocation/mta/mta.jar', buildTarget: 'NEO') jsr.step.mtaBuild(script: nullScript, mtaJarLocation: '/mylocation/mta/mta.jar', buildTarget: 'NEO')
assert jscr.shell.find { c -> c.contains('-jar /mylocation/mta/mta.jar --mtar')} assert jscr.shell.find { c -> c.contains('-jar /mylocation/mta/mta.jar --mtar')}
@ -94,7 +94,7 @@ public class MtaBuildTest extends BasePiperTest {
jryr.registerYaml('mta.yaml', { throw new FileNotFoundException() }) jryr.registerYaml('mta.yaml', { throw new FileNotFoundException() })
thrown.expect(FileNotFoundException) thrown.expect(FileNotFoundException)
jsr.step.call(script: nullScript, buildTarget: 'NEO') jsr.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
} }
@ -106,7 +106,7 @@ public class MtaBuildTest extends BasePiperTest {
jryr.registerYaml('mta.yaml', badMtaYaml()) jryr.registerYaml('mta.yaml', badMtaYaml())
jsr.step.call(script: nullScript, buildTarget: 'NEO') jsr.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
} }
@ -118,7 +118,7 @@ public class MtaBuildTest extends BasePiperTest {
jryr.registerYaml('mta.yaml', noIdMtaYaml() ) jryr.registerYaml('mta.yaml', noIdMtaYaml() )
jsr.step.call(script: nullScript, buildTarget: 'NEO') jsr.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
} }
@ -127,7 +127,7 @@ public class MtaBuildTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getVersionWithEnvVars(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getVersionWithEnvVars(m) })
jsr.step.call(script: nullScript, buildTarget: 'NEO') jsr.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
assert jscr.shell.find { c -> c.contains("-jar /env/mta/mta.jar --mtar")} assert jscr.shell.find { c -> c.contains("-jar /env/mta/mta.jar --mtar")}
assert jlr.log.contains("SAP Multitarget Application Archive Builder file '/env/mta/mta.jar' retrieved from environment.") assert jlr.log.contains("SAP Multitarget Application Archive Builder file '/env/mta/mta.jar' retrieved from environment.")
@ -140,7 +140,7 @@ public class MtaBuildTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[mtaJarLocation: '/config/mta/mta.jar']]] nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[mtaJarLocation: '/config/mta/mta.jar']]]
jsr.step.call(script: nullScript, jsr.step.mtaBuild(script: nullScript,
buildTarget: 'NEO') buildTarget: 'NEO')
assert jscr.shell.find(){ c -> c.contains("-jar /config/mta/mta.jar --mtar")} assert jscr.shell.find(){ c -> c.contains("-jar /config/mta/mta.jar --mtar")}
@ -152,7 +152,7 @@ public class MtaBuildTest extends BasePiperTest {
@Test @Test
void mtaJarLocationFromDefaultStepConfigurationTest() { void mtaJarLocationFromDefaultStepConfigurationTest() {
jsr.step.call(script: nullScript, jsr.step.mtaBuild(script: nullScript,
buildTarget: 'NEO') buildTarget: 'NEO')
assert jscr.shell.find(){ c -> c.contains("-jar mta.jar --mtar")} assert jscr.shell.find(){ c -> c.contains("-jar mta.jar --mtar")}
@ -164,7 +164,7 @@ public class MtaBuildTest extends BasePiperTest {
@Test @Test
void buildTargetFromParametersTest() { void buildTargetFromParametersTest() {
jsr.step.call(script: nullScript, buildTarget: 'NEO') jsr.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
assert jscr.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')} assert jscr.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
} }
@ -175,7 +175,7 @@ public class MtaBuildTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[buildTarget: 'NEO']]] nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[buildTarget: 'NEO']]]
jsr.step.call(script: nullScript) jsr.step.mtaBuild(script: nullScript)
assert jscr.shell.find(){ c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')} assert jscr.shell.find(){ c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
} }
@ -183,7 +183,7 @@ public class MtaBuildTest extends BasePiperTest {
@Test @Test
void canConfigureDockerImage() { void canConfigureDockerImage() {
jsr.step.call(script: nullScript, dockerImage: 'mta-docker-image:latest') jsr.step.mtaBuild(script: nullScript, dockerImage: 'mta-docker-image:latest')
assert 'mta-docker-image:latest' == jder.dockerParams.dockerImage assert 'mta-docker-image:latest' == jder.dockerParams.dockerImage
} }
@ -191,7 +191,7 @@ public class MtaBuildTest extends BasePiperTest {
@Test @Test
void canConfigureDockerOptions() { void canConfigureDockerOptions() {
jsr.step.call(script: nullScript, dockerOptions: 'something') jsr.step.mtaBuild(script: nullScript, dockerOptions: 'something')
assert 'something' == jder.dockerParams.dockerOptions assert 'something' == jder.dockerParams.dockerOptions
} }
@ -201,7 +201,7 @@ public class MtaBuildTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.defaultConfiguration = [steps:[mtaBuild:[buildTarget: 'NEO']]] nullScript.commonPipelineEnvironment.defaultConfiguration = [steps:[mtaBuild:[buildTarget: 'NEO']]]
jsr.step.call(script: nullScript) jsr.step.mtaBuild(script: nullScript)
assert jscr.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')} assert jscr.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
} }
@ -210,7 +210,7 @@ public class MtaBuildTest extends BasePiperTest {
@Test @Test
void extensionFromParametersTest() { void extensionFromParametersTest() {
jsr.step.call(script: nullScript, buildTarget: 'NEO', extension: 'param_extension') jsr.step.mtaBuild(script: nullScript, buildTarget: 'NEO', extension: 'param_extension')
assert jscr.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO --extension=param_extension build')} assert jscr.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO --extension=param_extension build')}
} }
@ -221,7 +221,7 @@ public class MtaBuildTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[buildTarget: 'NEO', extension: 'config_extension']]] nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[buildTarget: 'NEO', extension: 'config_extension']]]
jsr.step.call(script: nullScript) jsr.step.mtaBuild(script: nullScript)
assert jscr.shell.find(){ c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO --extension=config_extension build')} assert jscr.shell.find(){ c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO --extension=config_extension build')}
} }

View File

@ -85,7 +85,7 @@ class NeoDeployTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123') nullScript.commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123')
nullScript.commonPipelineEnvironment.configuration = [:] nullScript.commonPipelineEnvironment.configuration = [:]
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName, archivePath: archiveName,
neoCredentialsId: 'myCredentialsId' neoCredentialsId: 'myCredentialsId'
) )
@ -103,7 +103,7 @@ class NeoDeployTest extends BasePiperTest {
@Test @Test
void straightForwardTestConfigViaConfiguration() { void straightForwardTestConfigViaConfiguration() {
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName, archivePath: archiveName,
neoCredentialsId: 'myCredentialsId' neoCredentialsId: 'myCredentialsId'
) )
@ -127,7 +127,7 @@ class NeoDeployTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.configuration = [steps:[neoDeploy: [host: 'configuration-frwk.deploy.host.com', nullScript.commonPipelineEnvironment.configuration = [steps:[neoDeploy: [host: 'configuration-frwk.deploy.host.com',
account: 'configurationFrwkUser123']]] account: 'configurationFrwkUser123']]]
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName, archivePath: archiveName,
neoCredentialsId: 'myCredentialsId' neoCredentialsId: 'myCredentialsId'
) )
@ -145,7 +145,7 @@ class NeoDeployTest extends BasePiperTest {
@Test @Test
void archivePathFromCPETest() { void archivePathFromCPETest() {
nullScript.commonPipelineEnvironment.setMtarFilePath('archive.mtar') nullScript.commonPipelineEnvironment.setMtarFilePath('archive.mtar')
jsr.step.call(script: nullScript) jsr.step.neoDeploy(script: nullScript)
Assert.assertThat(jscr.shell, Assert.assertThat(jscr.shell,
new CommandLineMatcher().hasProlog("#!/bin/bash \"/opt/neo/tools/neo.sh\" deploy-mta") new CommandLineMatcher().hasProlog("#!/bin/bash \"/opt/neo/tools/neo.sh\" deploy-mta")
@ -155,7 +155,7 @@ class NeoDeployTest extends BasePiperTest {
@Test @Test
void archivePathFromParamsHasHigherPrecedenceThanCPETest() { void archivePathFromParamsHasHigherPrecedenceThanCPETest() {
nullScript.commonPipelineEnvironment.setMtarFilePath('archive2.mtar') nullScript.commonPipelineEnvironment.setMtarFilePath('archive2.mtar')
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: "archive.mtar") archivePath: "archive.mtar")
Assert.assertThat(jscr.shell, Assert.assertThat(jscr.shell,
@ -169,7 +169,7 @@ class NeoDeployTest extends BasePiperTest {
thrown.expect(CredentialNotFoundException) thrown.expect(CredentialNotFoundException)
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName, archivePath: archiveName,
neoCredentialsId: 'badCredentialsId' neoCredentialsId: 'badCredentialsId'
) )
@ -179,7 +179,7 @@ class NeoDeployTest extends BasePiperTest {
@Test @Test
void credentialsIdNotProvidedTest() { void credentialsIdNotProvidedTest() {
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName archivePath: archiveName
) )
@ -199,7 +199,7 @@ class NeoDeployTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getVersionWithPath(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getVersionWithPath(m) })
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName archivePath: archiveName
) )
@ -214,7 +214,7 @@ class NeoDeployTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getVersionWithPath(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getVersionWithPath(m) })
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName, archivePath: archiveName,
neoCredentialsId: 'myCredentialsId', neoCredentialsId: 'myCredentialsId',
neoHome: '/param/neo' neoHome: '/param/neo'
@ -229,7 +229,7 @@ class NeoDeployTest extends BasePiperTest {
@Test @Test
void neoHomeFromEnvironmentTest() { void neoHomeFromEnvironmentTest() {
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName archivePath: archiveName
) )
@ -246,7 +246,7 @@ class NeoDeployTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.configuration = [steps:[neoDeploy: [host: 'test.deploy.host.com', account: 'trialuser123', neoHome: '/config/neo']]] nullScript.commonPipelineEnvironment.configuration = [steps:[neoDeploy: [host: 'test.deploy.host.com', account: 'trialuser123', neoHome: '/config/neo']]]
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName archivePath: archiveName
) )
@ -262,7 +262,7 @@ class NeoDeployTest extends BasePiperTest {
thrown.expect(Exception) thrown.expect(Exception)
thrown.expectMessage('Archive path not configured (parameter "archivePath").') thrown.expectMessage('Archive path not configured (parameter "archivePath").')
jsr.step.call(script: nullScript) jsr.step.neoDeploy(script: nullScript)
} }
@ -272,7 +272,7 @@ class NeoDeployTest extends BasePiperTest {
thrown.expect(AbortException) thrown.expect(AbortException)
thrown.expectMessage('Archive cannot be found') thrown.expectMessage('Archive cannot be found')
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: 'wrongArchiveName') archivePath: 'wrongArchiveName')
} }
@ -285,13 +285,13 @@ class NeoDeployTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.configuration = [:] nullScript.commonPipelineEnvironment.configuration = [:]
jsr.step.call(script: nullScript, archivePath: archiveName) jsr.step.neoDeploy(script: nullScript, archivePath: archiveName)
} }
@Test @Test
void mtaDeployModeTest() { void mtaDeployModeTest() {
jsr.step.call(script: nullScript, archivePath: archiveName, deployMode: 'mta') jsr.step.neoDeploy(script: nullScript, archivePath: archiveName, deployMode: 'mta')
Assert.assertThat(jscr.shell, Assert.assertThat(jscr.shell,
new CommandLineMatcher().hasProlog("#!/bin/bash \"/opt/neo/tools/neo.sh\" deploy-mta") new CommandLineMatcher().hasProlog("#!/bin/bash \"/opt/neo/tools/neo.sh\" deploy-mta")
@ -307,7 +307,7 @@ class NeoDeployTest extends BasePiperTest {
@Test @Test
void warFileParamsDeployModeTest() { void warFileParamsDeployModeTest() {
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
applicationName: 'testApp', applicationName: 'testApp',
runtime: 'neo-javaee6-wp', runtime: 'neo-javaee6-wp',
runtimeVersion: '2.125', runtimeVersion: '2.125',
@ -333,7 +333,7 @@ class NeoDeployTest extends BasePiperTest {
@Test @Test
void warFileParamsDeployModeRollingUpdateTest() { void warFileParamsDeployModeRollingUpdateTest() {
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: warArchiveName, archivePath: warArchiveName,
deployMode: 'warParams', deployMode: 'warParams',
applicationName: 'testApp', applicationName: 'testApp',
@ -358,7 +358,7 @@ class NeoDeployTest extends BasePiperTest {
@Test @Test
void warPropertiesFileDeployModeTest() { void warPropertiesFileDeployModeTest() {
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: warArchiveName, archivePath: warArchiveName,
deployMode: 'warPropertiesFile', deployMode: 'warPropertiesFile',
propertiesFile: propertiesFileName, propertiesFile: propertiesFileName,
@ -379,7 +379,7 @@ class NeoDeployTest extends BasePiperTest {
@Test @Test
void warPropertiesFileDeployModeRollingUpdateTest() { void warPropertiesFileDeployModeRollingUpdateTest() {
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: warArchiveName, archivePath: warArchiveName,
deployMode: 'warPropertiesFile', deployMode: 'warPropertiesFile',
propertiesFile: propertiesFileName, propertiesFile: propertiesFileName,
@ -403,7 +403,7 @@ class NeoDeployTest extends BasePiperTest {
thrown.expect(Exception) thrown.expect(Exception)
thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR applicationName') thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR applicationName')
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: warArchiveName, archivePath: warArchiveName,
deployMode: 'warParams', deployMode: 'warParams',
runtime: 'neo-javaee6-wp', runtime: 'neo-javaee6-wp',
@ -417,7 +417,7 @@ class NeoDeployTest extends BasePiperTest {
thrown.expect(Exception) thrown.expect(Exception)
thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR runtime') thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR runtime')
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: warArchiveName, archivePath: warArchiveName,
applicationName: 'testApp', applicationName: 'testApp',
deployMode: 'warParams', deployMode: 'warParams',
@ -430,7 +430,7 @@ class NeoDeployTest extends BasePiperTest {
thrown.expect(Exception) thrown.expect(Exception)
thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR runtimeVersion') thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR runtimeVersion')
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: warArchiveName, archivePath: warArchiveName,
applicationName: 'testApp', applicationName: 'testApp',
deployMode: 'warParams', deployMode: 'warParams',
@ -443,7 +443,7 @@ class NeoDeployTest extends BasePiperTest {
thrown.expect(Exception) thrown.expect(Exception)
thrown.expectMessage("[neoDeploy] Invalid deployMode = 'illegalMode'. Valid 'deployMode' values are: [mta, warParams, warPropertiesFile]") thrown.expectMessage("[neoDeploy] Invalid deployMode = 'illegalMode'. Valid 'deployMode' values are: [mta, warParams, warPropertiesFile]")
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: warArchiveName, archivePath: warArchiveName,
deployMode: 'illegalMode', deployMode: 'illegalMode',
applicationName: 'testApp', applicationName: 'testApp',
@ -459,7 +459,7 @@ class NeoDeployTest extends BasePiperTest {
thrown.expect(Exception) thrown.expect(Exception)
thrown.expectMessage("[neoDeploy] Invalid vmSize = 'illegalVM'. Valid 'vmSize' values are: [lite, pro, prem, prem-plus].") thrown.expectMessage("[neoDeploy] Invalid vmSize = 'illegalVM'. Valid 'vmSize' values are: [lite, pro, prem, prem-plus].")
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: warArchiveName, archivePath: warArchiveName,
deployMode: 'warParams', deployMode: 'warParams',
applicationName: 'testApp', applicationName: 'testApp',
@ -475,7 +475,7 @@ class NeoDeployTest extends BasePiperTest {
thrown.expect(Exception) thrown.expect(Exception)
thrown.expectMessage("[neoDeploy] Invalid warAction = 'illegalWARAction'. Valid 'warAction' values are: [deploy, rolling-update].") thrown.expectMessage("[neoDeploy] Invalid warAction = 'illegalWARAction'. Valid 'warAction' values are: [deploy, rolling-update].")
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: warArchiveName, archivePath: warArchiveName,
deployMode: 'warParams', deployMode: 'warParams',
applicationName: 'testApp', applicationName: 'testApp',
@ -490,7 +490,7 @@ class NeoDeployTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'configPropsUser123') nullScript.commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'configPropsUser123')
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName, archivePath: archiveName,
deployHost: "my.deploy.host.com" deployHost: "my.deploy.host.com"
) )
@ -503,7 +503,7 @@ class NeoDeployTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'configPropsUser123') nullScript.commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'configPropsUser123')
jsr.step.call(script: nullScript, jsr.step.neoDeploy(script: nullScript,
archivePath: archiveName, archivePath: archiveName,
host: "my.deploy.host.com", host: "my.deploy.host.com",
deployAccount: "myAccount" deployAccount: "myAccount"
@ -600,7 +600,7 @@ class NeoDeployTest extends BasePiperTest {
this.opts.add(new MapEntry(key, value)) this.opts.add(new MapEntry(key, value))
return this return this
} }
CommandLineMatcher hasArgument(String arg) { CommandLineMatcher hasArgument(String arg) {
this.args.add(arg) this.args.add(arg)
return this return this

View File

@ -44,7 +44,7 @@ class PipelineExecuteTest extends BasePiperTest {
@Test @Test
void straightForwardTest() { void straightForwardTest() {
jsr.step.call(repoUrl: "https://test.com/myRepo.git") jsr.step.pipelineExecute(repoUrl: "https://test.com/myRepo.git")
assert load == "Jenkinsfile" assert load == "Jenkinsfile"
assert checkoutParameters.branch == 'master' assert checkoutParameters.branch == 'master'
assert checkoutParameters.repoUrl == "https://test.com/myRepo.git" assert checkoutParameters.repoUrl == "https://test.com/myRepo.git"
@ -55,7 +55,7 @@ class PipelineExecuteTest extends BasePiperTest {
@Test @Test
void parameterizeTest() { void parameterizeTest() {
jsr.step.call(repoUrl: "https://test.com/anotherRepo.git", jsr.step.pipelineExecute(repoUrl: "https://test.com/anotherRepo.git",
branch: 'feature', branch: 'feature',
path: 'path/to/Jenkinsfile', path: 'path/to/Jenkinsfile',
credentialsId: 'abcd1234') credentialsId: 'abcd1234')
@ -73,6 +73,6 @@ class PipelineExecuteTest extends BasePiperTest {
thrown.expect(Exception) thrown.expect(Exception)
thrown.expectMessage("ERROR - NO VALUE AVAILABLE FOR repoUrl") thrown.expectMessage("ERROR - NO VALUE AVAILABLE FOR repoUrl")
jsr.step.call() jsr.step.pipelineExecute()
} }
} }

View File

@ -26,7 +26,7 @@ class PipelineStashFilesAfterBuildTest extends BasePiperTest {
searchTerm -> searchTerm ->
return false return false
}) })
jsr.step.call( jsr.step.pipelineStashFilesAfterBuild(
script: nullScript, script: nullScript,
juStabUtils: utils juStabUtils: utils
) )
@ -42,7 +42,7 @@ class PipelineStashFilesAfterBuildTest extends BasePiperTest {
searchTerm -> searchTerm ->
return true return true
}) })
jsr.step.call( jsr.step.pipelineStashFilesAfterBuild(
script: nullScript, script: nullScript,
juStabUtils: utils, juStabUtils: utils,
runCheckmarx: true runCheckmarx: true
@ -59,7 +59,7 @@ class PipelineStashFilesAfterBuildTest extends BasePiperTest {
searchTerm -> searchTerm ->
return true return true
}) })
jsr.step.call( jsr.step.pipelineStashFilesAfterBuild(
script: [commonPipelineEnvironment: [configuration: [steps: [executeCheckmarxScan: [checkmarxProject: 'TestProject']]]]], script: [commonPipelineEnvironment: [configuration: [steps: [executeCheckmarxScan: [checkmarxProject: 'TestProject']]]]],
juStabUtils: utils, juStabUtils: utils,
) )

View File

@ -24,7 +24,7 @@ class PipelineStashFilesBeforeBuildTest extends BasePiperTest {
@Test @Test
void testStashBeforeBuildNoOpa() { void testStashBeforeBuildNoOpa() {
jsr.step.call(script: nullScript, juStabUtils: utils) jsr.step.pipelineStashFilesBeforeBuild(script: nullScript, juStabUtils: utils)
// asserts // asserts
assertEquals('mkdir -p gitmetadata', jscr.shell[0]) assertEquals('mkdir -p gitmetadata', jscr.shell[0])
@ -44,7 +44,7 @@ class PipelineStashFilesBeforeBuildTest extends BasePiperTest {
@Test @Test
void testStashBeforeBuildOpa() { void testStashBeforeBuildOpa() {
jsr.step.call(script: nullScript, juStabUtils: utils, runOpaTests: true) jsr.step.pipelineStashFilesBeforeBuild(script: nullScript, juStabUtils: utils, runOpaTests: true)
// asserts // asserts
assertThat(jlr.log, containsString('Stash content: buildDescriptor')) assertThat(jlr.log, containsString('Stash content: buildDescriptor'))

View File

@ -43,7 +43,7 @@ public class PrepareDefaultValuesTest extends BasePiperTest {
@Test @Test
public void testDefaultPipelineEnvironmentOnly() { public void testDefaultPipelineEnvironmentOnly() {
jsr.step.call(script: nullScript) jsr.step.prepareDefaultValues(script: nullScript)
assert DefaultValueCache.getInstance().getDefaultValues().size() == 1 assert DefaultValueCache.getInstance().getDefaultValues().size() == 1
assert DefaultValueCache.getInstance().getDefaultValues().default == 'config' assert DefaultValueCache.getInstance().getDefaultValues().default == 'config'
@ -55,7 +55,7 @@ public class PrepareDefaultValuesTest extends BasePiperTest {
def instance = DefaultValueCache.createInstance([key:'value']) def instance = DefaultValueCache.createInstance([key:'value'])
// existing instance is dropped in case a custom config is provided. // existing instance is dropped in case a custom config is provided.
jsr.step.call(script: nullScript, customDefaults: 'custom.yml') jsr.step.prepareDefaultValues(script: nullScript, customDefaults: 'custom.yml')
// this check is for checking we have another instance // this check is for checking we have another instance
assert ! instance.is(DefaultValueCache.getInstance()) assert ! instance.is(DefaultValueCache.getInstance())
@ -72,7 +72,7 @@ public class PrepareDefaultValuesTest extends BasePiperTest {
def instance = DefaultValueCache.createInstance([key:'value']) def instance = DefaultValueCache.createInstance([key:'value'])
jsr.step.call(script: nullScript) jsr.step.prepareDefaultValues(script: nullScript)
assert instance.is(DefaultValueCache.getInstance()) assert instance.is(DefaultValueCache.getInstance())
assert DefaultValueCache.getInstance().getDefaultValues().size() == 1 assert DefaultValueCache.getInstance().getDefaultValues().size() == 1
@ -86,13 +86,13 @@ public class PrepareDefaultValuesTest extends BasePiperTest {
thrown.expect(hudson.AbortException.class) thrown.expect(hudson.AbortException.class)
thrown.expectMessage('No such library resource not_found could be found') thrown.expectMessage('No such library resource not_found could be found')
jsr.step.call(script: nullScript, customDefaults: 'not_found') jsr.step.prepareDefaultValues(script: nullScript, customDefaults: 'not_found')
} }
@Test @Test
public void testDefaultPipelineEnvironmentWithCustomConfigReferencedAsString() { public void testDefaultPipelineEnvironmentWithCustomConfigReferencedAsString() {
jsr.step.call(script: nullScript, customDefaults: 'custom.yml') jsr.step.prepareDefaultValues(script: nullScript, customDefaults: 'custom.yml')
assert DefaultValueCache.getInstance().getDefaultValues().size() == 2 assert DefaultValueCache.getInstance().getDefaultValues().size() == 2
assert DefaultValueCache.getInstance().getDefaultValues().default == 'config' assert DefaultValueCache.getInstance().getDefaultValues().default == 'config'
@ -102,7 +102,7 @@ public class PrepareDefaultValuesTest extends BasePiperTest {
@Test @Test
public void testDefaultPipelineEnvironmentWithCustomConfigReferencedAsList() { public void testDefaultPipelineEnvironmentWithCustomConfigReferencedAsList() {
jsr.step.call(script: nullScript, customDefaults: ['custom.yml']) jsr.step.prepareDefaultValues(script: nullScript, customDefaults: ['custom.yml'])
assert DefaultValueCache.getInstance().getDefaultValues().size() == 2 assert DefaultValueCache.getInstance().getDefaultValues().size() == 2
assert DefaultValueCache.getInstance().getDefaultValues().default == 'config' assert DefaultValueCache.getInstance().getDefaultValues().default == 'config'
@ -112,7 +112,7 @@ public class PrepareDefaultValuesTest extends BasePiperTest {
@Test @Test
public void testAssertNoLogMessageInCaseOfNoAdditionalConfigFiles() { public void testAssertNoLogMessageInCaseOfNoAdditionalConfigFiles() {
jsr.step.call(script: nullScript) jsr.step.prepareDefaultValues(script: nullScript)
assert ! jlr.log.contains("Loading configuration file 'default_pipeline_environment.yml'") assert ! jlr.log.contains("Loading configuration file 'default_pipeline_environment.yml'")
} }
@ -120,7 +120,7 @@ public class PrepareDefaultValuesTest extends BasePiperTest {
@Test @Test
public void testAssertLogMessageInCaseOfMoreThanOneConfigFile() { public void testAssertLogMessageInCaseOfMoreThanOneConfigFile() {
jsr.step.call(script: nullScript, customDefaults: ['custom.yml']) jsr.step.prepareDefaultValues(script: nullScript, customDefaults: ['custom.yml'])
assert jlr.log.contains("Loading configuration file 'default_pipeline_environment.yml'") assert jlr.log.contains("Loading configuration file 'default_pipeline_environment.yml'")
assert jlr.log.contains("Loading configuration file 'custom.yml'") assert jlr.log.contains("Loading configuration file 'custom.yml'")

View File

@ -55,7 +55,7 @@ class SetupCommonPipelineEnvironmentTest extends BasePiperTest {
return path.endsWith('.pipeline/config.yml') return path.endsWith('.pipeline/config.yml')
}) })
jsr.step.call(script: nullScript, utils: getSWAMockedUtils()) jsr.step.setupCommonPipelineEnvironment(script: nullScript, utils: getSWAMockedUtils())
assertEquals(Boolean.FALSE.toString(), swaOldConfigUsed) assertEquals(Boolean.FALSE.toString(), swaOldConfigUsed)
assertEquals('.pipeline/config.yml', usedConfigFile) assertEquals('.pipeline/config.yml', usedConfigFile)
@ -71,7 +71,7 @@ class SetupCommonPipelineEnvironmentTest extends BasePiperTest {
return path.endsWith('.pipeline/config.properties') return path.endsWith('.pipeline/config.properties')
}) })
jsr.step.call(script: nullScript, utils: getSWAMockedUtils()) jsr.step.setupCommonPipelineEnvironment(script: nullScript, utils: getSWAMockedUtils())
assertEquals(Boolean.TRUE.toString(), swaOldConfigUsed) assertEquals(Boolean.TRUE.toString(), swaOldConfigUsed)
assertEquals('.pipeline/config.properties', usedConfigFile) assertEquals('.pipeline/config.properties', usedConfigFile)

View File

@ -35,7 +35,7 @@ class ToolValidateTest extends BasePiperTest {
thrown.expect(IllegalArgumentException) thrown.expect(IllegalArgumentException)
thrown.expectMessage("The parameter 'home' can not be null or empty.") thrown.expectMessage("The parameter 'home' can not be null or empty.")
jsr.step.call(tool: 'java') jsr.step.toolValidate(tool: 'java')
} }
@Test @Test
@ -44,7 +44,7 @@ class ToolValidateTest extends BasePiperTest {
thrown.expect(IllegalArgumentException) thrown.expect(IllegalArgumentException)
thrown.expectMessage("The parameter 'home' can not be null or empty.") thrown.expectMessage("The parameter 'home' can not be null or empty.")
jsr.step.call(tool: 'java', home: '') jsr.step.toolValidate(tool: 'java', home: '')
} }
@Test @Test
@ -55,7 +55,7 @@ class ToolValidateTest extends BasePiperTest {
thrown.expect(IllegalArgumentException) thrown.expect(IllegalArgumentException)
thrown.expectMessage("The parameter 'tool' can not be null or empty.") thrown.expectMessage("The parameter 'tool' can not be null or empty.")
jsr.step.call(tool: null, home: home) jsr.step.toolValidate(tool: null, home: home)
} }
@Test @Test
@ -66,7 +66,7 @@ class ToolValidateTest extends BasePiperTest {
thrown.expect(IllegalArgumentException) thrown.expect(IllegalArgumentException)
thrown.expectMessage("The parameter 'tool' can not be null or empty.") thrown.expectMessage("The parameter 'tool' can not be null or empty.")
jsr.step.call(tool: '', home: home) jsr.step.toolValidate(tool: '', home: home)
} }
@Test @Test
@ -77,7 +77,7 @@ class ToolValidateTest extends BasePiperTest {
thrown.expect(AbortException) thrown.expect(AbortException)
thrown.expectMessage("The tool 'test' is not supported.") thrown.expectMessage("The tool 'test' is not supported.")
jsr.step.call(tool: 'test', home: home) jsr.step.toolValidate(tool: 'test', home: home)
} }
@Test @Test
@ -88,7 +88,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getNoVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getNoVersion(m) })
jsr.step.call(tool: 'java', home: home) jsr.step.toolValidate(tool: 'java', home: home)
} }
@Test @Test
@ -99,7 +99,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getNoVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getNoVersion(m) })
jsr.step.call(tool: 'mta', home: home) jsr.step.toolValidate(tool: 'mta', home: home)
} }
@Test @Test
@ -110,7 +110,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getNoVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getNoVersion(m) })
jsr.step.call(tool: 'neo', home: home) jsr.step.toolValidate(tool: 'neo', home: home)
} }
@Test @Test
@ -121,7 +121,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getNoVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getNoVersion(m) })
jsr.step.call(tool: 'cm', home: home) jsr.step.toolValidate(tool: 'cm', home: home)
} }
@Test @Test
@ -132,7 +132,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getIncompatibleVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getIncompatibleVersion(m) })
jsr.step.call(tool: 'java', home: home) jsr.step.toolValidate(tool: 'java', home: home)
} }
@Test @Test
@ -143,7 +143,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getIncompatibleVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getIncompatibleVersion(m) })
jsr.step.call(tool: 'mta', home: home) jsr.step.toolValidate(tool: 'mta', home: home)
} }
@Test @Test
@ -155,7 +155,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getIncompatibleVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getIncompatibleVersion(m) })
binding.setVariable('tool', 'cm') binding.setVariable('tool', 'cm')
jsr.step.call(tool: 'cm', home: home) jsr.step.toolValidate(tool: 'cm', home: home)
} }
@Test @Test
@ -163,7 +163,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getVersion(m) })
jsr.step.call(tool: 'java', home: home) jsr.step.toolValidate(tool: 'java', home: home)
assert jlr.log.contains('Verifying Java version 1.8.0 or compatible version.') assert jlr.log.contains('Verifying Java version 1.8.0 or compatible version.')
assert jlr.log.contains('Java version 1.8.0 is installed.') assert jlr.log.contains('Java version 1.8.0 is installed.')
@ -174,7 +174,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getVersion(m) })
jsr.step.call(tool: 'mta', home: home) jsr.step.toolValidate(tool: 'mta', home: home)
assert jlr.log.contains('Verifying SAP Multitarget Application Archive Builder version 1.0.6 or compatible version.') assert jlr.log.contains('Verifying SAP Multitarget Application Archive Builder version 1.0.6 or compatible version.')
assert jlr.log.contains('SAP Multitarget Application Archive Builder version 1.0.6 is installed.') assert jlr.log.contains('SAP Multitarget Application Archive Builder version 1.0.6 is installed.')
@ -185,7 +185,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getVersion(m) })
jsr.step.call(tool: 'neo', home: home) jsr.step.toolValidate(tool: 'neo', home: home)
} }
@Test @Test
@ -193,7 +193,7 @@ class ToolValidateTest extends BasePiperTest {
helper.registerAllowedMethod('sh', [Map], { Map m -> getVersion(m) }) helper.registerAllowedMethod('sh', [Map], { Map m -> getVersion(m) })
jsr.step.call(tool: 'cm', home: home) jsr.step.toolValidate(tool: 'cm', home: home)
assert jlr.log.contains('Verifying Change Management Command Line Interface version 0.0.1 or compatible version.') assert jlr.log.contains('Verifying Change Management Command Line Interface version 0.0.1 or compatible version.')
assert jlr.log.contains('Change Management Command Line Interface version 0.0.1 is installed.') assert jlr.log.contains('Change Management Command Line Interface version 0.0.1 is installed.')

View File

@ -69,7 +69,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
} }
} }
jsr.step.call(script: nullScript, developmentSystemId: '001', cmUtils: cm) jsr.step.transportRequestCreate(script: nullScript, developmentSystemId: '001', cmUtils: cm)
} }
@Test @Test
@ -78,7 +78,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
thrown.expect(IllegalArgumentException) thrown.expect(IllegalArgumentException)
thrown.expectMessage("ERROR - NO VALUE AVAILABLE FOR developmentSystemId") thrown.expectMessage("ERROR - NO VALUE AVAILABLE FOR developmentSystemId")
jsr.step.call(script: nullScript, changeDocumentId: '001') jsr.step.transportRequestCreate(script: nullScript, changeDocumentId: '001')
} }
@Test @Test
@ -101,7 +101,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
thrown.expect(AbortException) thrown.expect(AbortException)
thrown.expectMessage("Exception message.") thrown.expectMessage("Exception message.")
jsr.step.call(script: nullScript, changeDocumentId: '001', developmentSystemId: '001', cmUtils: cm) jsr.step.transportRequestCreate(script: nullScript, changeDocumentId: '001', developmentSystemId: '001', cmUtils: cm)
} }
@Test @Test
@ -127,7 +127,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
} }
} }
def transportId = jsr.step.call(script: nullScript, changeDocumentId: '001', developmentSystemId: '001', cmUtils: cm) def transportId = jsr.step.transportRequestCreate(script: nullScript, changeDocumentId: '001', developmentSystemId: '001', cmUtils: cm)
assert transportId == '001' assert transportId == '001'
assert result == [changeId: '001', assert result == [changeId: '001',
@ -166,7 +166,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
} }
} }
def transportId = jsr.step.call(script: nullScript, def transportId = jsr.step.transportRequestCreate(script: nullScript,
transportType: 'W', transportType: 'W',
targetSystem: 'XYZ', targetSystem: 'XYZ',
description: 'desc', description: 'desc',
@ -191,7 +191,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
jlr.expect('[INFO] Change management integration intentionally switched off.') jlr.expect('[INFO] Change management integration intentionally switched off.')
jsr.step.call(script: nullScript, jsr.step.transportRequestCreate(script: nullScript,
changeManagement: [type: 'NONE']) changeManagement: [type: 'NONE'])
} }
} }

View File

@ -62,7 +62,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
thrown.expect(IllegalArgumentException) thrown.expect(IllegalArgumentException)
thrown.expectMessage("Change document id not provided (parameter: 'changeDocumentId' or via commit history).") thrown.expectMessage("Change document id not provided (parameter: 'changeDocumentId' or via commit history).")
jsr.step.call(script: nullScript, transportRequestId: '001', cmUtils: cm) jsr.step.transportRequestRelease(script: nullScript, transportRequestId: '001', cmUtils: cm)
} }
@Test @Test
@ -80,7 +80,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
thrown.expect(IllegalArgumentException) thrown.expect(IllegalArgumentException)
thrown.expectMessage("Transport request id not provided (parameter: 'transportRequestId' or via commit history).") thrown.expectMessage("Transport request id not provided (parameter: 'transportRequestId' or via commit history).")
jsr.step.call(script: nullScript, changeDocumentId: '001', cmUtils: cm) jsr.step.transportRequestRelease(script: nullScript, changeDocumentId: '001', cmUtils: cm)
} }
@Test @Test
@ -102,7 +102,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
} }
} }
jsr.step.call(script: nullScript, changeDocumentId: '001', transportRequestId: '001', cmUtils: cm) jsr.step.transportRequestRelease(script: nullScript, changeDocumentId: '001', transportRequestId: '001', cmUtils: cm)
} }
@Test @Test
@ -130,7 +130,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
} }
} }
jsr.step.call(script: nullScript, changeDocumentId: '001', transportRequestId: '002', cmUtils: cm) jsr.step.transportRequestRelease(script: nullScript, changeDocumentId: '001', transportRequestId: '002', cmUtils: cm)
assert receivedParams == [type: BackendType.SOLMAN, assert receivedParams == [type: BackendType.SOLMAN,
changeId: '001', changeId: '001',
@ -145,7 +145,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
jlr.expect('[INFO] Change management integration intentionally switched off.') jlr.expect('[INFO] Change management integration intentionally switched off.')
jsr.step.call(script: nullScript, jsr.step.transportRequestRelease(script: nullScript,
changeManagement: [type: 'NONE']) changeManagement: [type: 'NONE'])
} }
} }

View File

@ -73,7 +73,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
} }
} }
jsr.step.call(script: nullScript, transportRequestId: '001', applicationId: 'app', filePath: '/path', cmUtils: cm) jsr.step.transportRequestUploadFile(script: nullScript, transportRequestId: '001', applicationId: 'app', filePath: '/path', cmUtils: cm)
} }
@Test @Test
@ -93,7 +93,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
thrown.expect(IllegalArgumentException) thrown.expect(IllegalArgumentException)
thrown.expectMessage("Transport request id not provided (parameter: 'transportRequestId' or via commit history).") thrown.expectMessage("Transport request id not provided (parameter: 'transportRequestId' or via commit history).")
jsr.step.call(script: nullScript, changeDocumentId: '001', applicationId: 'app', filePath: '/path', cmUtils: cm) jsr.step.transportRequestUploadFile(script: nullScript, changeDocumentId: '001', applicationId: 'app', filePath: '/path', cmUtils: cm)
} }
@Test @Test
@ -106,7 +106,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
thrown.expect(IllegalArgumentException) thrown.expect(IllegalArgumentException)
thrown.expectMessage("ERROR - NO VALUE AVAILABLE FOR applicationId") thrown.expectMessage("ERROR - NO VALUE AVAILABLE FOR applicationId")
jsr.step.call(script: nullScript, changeDocumentId: '001', transportRequestId: '001', filePath: '/path') jsr.step.transportRequestUploadFile(script: nullScript, changeDocumentId: '001', transportRequestId: '001', filePath: '/path')
} }
@Test @Test
@ -115,7 +115,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
thrown.expect(IllegalArgumentException) thrown.expect(IllegalArgumentException)
thrown.expectMessage("ERROR - NO VALUE AVAILABLE FOR filePath") thrown.expectMessage("ERROR - NO VALUE AVAILABLE FOR filePath")
jsr.step.call(script: nullScript, changeDocumentId: '001', transportRequestId: '001', applicationId: 'app') jsr.step.transportRequestUploadFile(script: nullScript, changeDocumentId: '001', transportRequestId: '001', applicationId: 'app')
} }
@Test @Test
@ -137,7 +137,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
thrown.expect(AbortException) thrown.expect(AbortException)
thrown.expectMessage("Exception message") thrown.expectMessage("Exception message")
jsr.step.call(script: nullScript, jsr.step.transportRequestUploadFile(script: nullScript,
changeDocumentId: '001', changeDocumentId: '001',
transportRequestId: '001', transportRequestId: '001',
applicationId: 'app', applicationId: 'app',
@ -172,7 +172,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
} }
} }
jsr.step.call(script: nullScript, jsr.step.transportRequestUploadFile(script: nullScript,
changeManagement: [type: 'CTS'], changeManagement: [type: 'CTS'],
transportRequestId: '002', transportRequestId: '002',
filePath: '/path', filePath: '/path',
@ -218,7 +218,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
} }
} }
jsr.step.call(script: nullScript, jsr.step.transportRequestUploadFile(script: nullScript,
changeDocumentId: '001', changeDocumentId: '001',
transportRequestId: '002', transportRequestId: '002',
applicationId: 'app', applicationId: 'app',
@ -289,7 +289,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
} }
} }
jsr.step.call(script: nullScript, jsr.step.transportRequestUploadFile(script: nullScript,
changeDocumentId: '001', changeDocumentId: '001',
transportRequestId: '002', transportRequestId: '002',
applicationId: 'app', applicationId: 'app',
@ -319,7 +319,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
} }
} }
jsr.step.call(script: nullScript, jsr.step.transportRequestUploadFile(script: nullScript,
changeDocumentId: '001', changeDocumentId: '001',
transportRequestId: '002', transportRequestId: '002',
applicationId: 'app', applicationId: 'app',
@ -347,7 +347,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
} }
} }
jsr.step.call(script: nullScript, jsr.step.transportRequestUploadFile(script: nullScript,
changeDocumentId: '001', changeDocumentId: '001',
transportRequestId: '001', transportRequestId: '001',
applicationId: 'app', applicationId: 'app',
@ -361,7 +361,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
thrown.expectMessage('Invalid backend type: \'DUMMY\'. Valid values: [SOLMAN, CTS, NONE]. ' + thrown.expectMessage('Invalid backend type: \'DUMMY\'. Valid values: [SOLMAN, CTS, NONE]. ' +
'Configuration: \'changeManagement/type\'.') 'Configuration: \'changeManagement/type\'.')
jsr.step.call(script: nullScript, jsr.step.transportRequestUploadFile(script: nullScript,
applicationId: 'app', applicationId: 'app',
filePath: '/path', filePath: '/path',
changeManagement: [type: 'DUMMY']) changeManagement: [type: 'DUMMY'])
@ -373,7 +373,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
jlr.expect('[INFO] Change management integration intentionally switched off.') jlr.expect('[INFO] Change management integration intentionally switched off.')
jsr.step.call(script: nullScript, jsr.step.transportRequestUploadFile(script: nullScript,
changeManagement: [type: 'NONE']) changeManagement: [type: 'NONE'])
} }