@ContextConfiguration(locations="/spring/xlrelease-context-test.xml") public abstract class XLReleaseIntegrationTest extends XLReleaseTest
Autowired XL Release services in fields and use them to setup a test
environment and assert conditions.
A typical test would look like this:
public class MyIntegrationTest extends XLReleaseIntegrationTest {
@Autowired
private RepositoryService repositoryService;
@Test
public void should_create_release_in_repository() {
Release release = ReleaseBuilder.newRelease().withId(TestIds.RELEASE1).build();
repositoryService.create(release);
assertThat(repositoryService.read(TestIds.RELEASE1)).isNotNull();
}
}
Note: A test instance of XL Release is setup in a temporary folder and has some services mocked up for speed and easier testing. So you cannot test initializers or upgraders, for example.
| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
JcrTestInDirectoryRule |
directory |
com.xebialabs.deployit.jcr.JcrTemplate |
jcrTemplate |
com.xebialabs.deployit.repository.RepositoryService |
repositoryService |
| Constructor and Description |
|---|
XLReleaseIntegrationTest() |
XLReleaseIntegrationTest(boolean useCache) |
| Modifier and Type | Method and Description |
|---|---|
void |
before() |
protected void |
deleteOnTearDown(com.xebialabs.deployit.plugin.api.udm.ConfigurationItem... items) |
protected void |
deleteOnTearDown(java.lang.String... ids) |
void |
tearDown() |
boot@Autowired public com.xebialabs.deployit.repository.RepositoryService repositoryService
@Autowired public com.xebialabs.deployit.jcr.JcrTemplate jcrTemplate
public JcrTestInDirectoryRule directory
@Autowired protected org.springframework.context.ApplicationContext applicationContext
public XLReleaseIntegrationTest()
public XLReleaseIntegrationTest(boolean useCache)
public void before()
public void tearDown()
throws java.lang.Exception
java.lang.Exceptionprotected void deleteOnTearDown(com.xebialabs.deployit.plugin.api.udm.ConfigurationItem... items)
protected void deleteOnTearDown(java.lang.String... ids)