Skip to content

Instantly share code, notes, and snippets.

@kpiwko
Created November 19, 2014 11:59
Show Gist options
  • Save kpiwko/2d7752f6fb69dfe062a8 to your computer and use it in GitHub Desktop.
Save kpiwko/2d7752f6fb69dfe062a8 to your computer and use it in GitHub Desktop.
Gradle profile test
@Test
public void profilesInstallationsTestsArrays() {
Project project = ProjectBuilder.builder().build()
project.apply plugin: 'spacelift'
// enable foobar profile
project.ext.set("foobar", "true")
project.spacelift {
tools { rhc { command "rhc" } }
profiles {
foobar {
enabledInstallations ([
"eap",
"ews"
])
tests (["fooTest", "barTest"])
}
}
installations {
eap {}
ews {}
}
tests {
fooTest {}
barTest {}
}
}
// initialize current project tools - this is effectively init-tools task
GradleSpacelift.currentProject(project)
project.getTasks()['init'].execute()
assertThat project.selectedProfile, is(notNullValue())
assertThat project.selectedProfile.name, is('foobar')
assertThat project.selectedInstallations.size(), is(2)
//assertThat project.selectedTests.size(), is(2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment