From de78077920637fae4ef9f4d5582f661491642df4 Mon Sep 17 00:00:00 2001 From: Kai Zimmermann Date: Fri, 11 Mar 2016 09:27:48 +0100 Subject: [PATCH 1/2] Added check for rollout repo content after test. Signed-off-by: Kai Zimmermann --- .../hawkbit/AbstractIntegrationTest.java | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java index 9d5fa2483..18f9bca06 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java @@ -11,7 +11,6 @@ package org.eclipse.hawkbit; import static org.fest.assertions.api.Assertions.assertThat; import java.util.List; -import java.util.Properties; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; @@ -31,6 +30,7 @@ import org.eclipse.hawkbit.repository.LocalArtifactRepository; import org.eclipse.hawkbit.repository.RolloutGroupManagement; import org.eclipse.hawkbit.repository.RolloutGroupRepository; import org.eclipse.hawkbit.repository.RolloutManagement; +import org.eclipse.hawkbit.repository.RolloutRepository; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.SoftwareModuleMetadataRepository; import org.eclipse.hawkbit.repository.SoftwareModuleRepository; @@ -190,6 +190,9 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware { @Autowired protected RolloutGroupRepository rolloutGroupRepository; + @Autowired + protected RolloutRepository rolloutRepository; + protected MockMvc mvc; @Autowired @@ -208,23 +211,6 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware { private static CIMySqlTestDatabase tesdatabase; - static { - final Properties props = System.getProperties(); - - // if( props.getProperty( SuiteEmbeddedConfiguration.IM_HOME ) == null ) - // { - // props.setProperty( SuiteEmbeddedConfiguration.IM_HOME, - // "./src/test/resources/im" ); - // } - - } - - /* - * (non-Javadoc) - * - * @see org.springframework.context.EnvironmentAware#setEnvironment(org. - * springframework.core.env. Environment) - */ @Override public void setEnvironment(final Environment environment) { this.environment = environment; @@ -287,6 +273,8 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware { assertThat(softwareModuleTypeRepository.findAll()).isEmpty(); assertThat(distributionSetTypeRepository.findAll()).isEmpty(); assertThat(tenantMetaDataRepository.findAll()).isEmpty(); + assertThat(rolloutGroupRepository.findAll()).isEmpty(); + assertThat(rolloutRepository.findAll()).isEmpty(); } @Transactional From 3da4e73edeb32fc0434578ca1b62835358df7c03 Mon Sep 17 00:00:00 2001 From: Kai Zimmermann Date: Fri, 11 Mar 2016 09:37:49 +0100 Subject: [PATCH 2/2] Raised timeout for the async test. Signed-off-by: Kai Zimmermann --- .../eclipse/hawkbit/rest/resource/RolloutResourceTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/RolloutResourceTest.java b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/RolloutResourceTest.java index 29cb4ede0..f27eb5186 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/RolloutResourceTest.java +++ b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/RolloutResourceTest.java @@ -453,8 +453,8 @@ public class RolloutResourceTest extends AbstractIntegrationTest { .andExpect(status().isOk()); // check if running - assertThat(doWithTimeout(() -> getRollout(rollout.getId()), result -> success(result), 5000, 100)).isNotNull(); - + assertThat(doWithTimeout(() -> getRollout(rollout.getId()), result -> success(result), 60_000, 100)) + .isNotNull(); } @Test