use of org.jenkins.plugins.audit2db.model.BuildDetails in project selenium_java by sergueik.
the class BuildDetailsHibernateRepositoryTests method retrievalByNonMatchingIdShouldReturnNullEntity.
@Test
public void retrievalByNonMatchingIdShouldReturnNullEntity() {
final BuildDetails build = TestUtils.createRandomBuildDetails();
final Object buildId = repository.saveBuildDetails(build);
Assert.assertNotNull("Unexpected null build id", buildId);
final BuildDetails retrievedBuild = repository.getBuildDetailsById(build.getId() + "NOMATCH");
Assert.assertNull("Unexpected null build", retrievedBuild);
}
use of org.jenkins.plugins.audit2db.model.BuildDetails in project selenium_java by sergueik.
the class BuildDetailsHibernateRepositoryTests method retrievalByMatchingDurationRangeShouldReturnNonEmptyList.
@Test
public void retrievalByMatchingDurationRangeShouldReturnNonEmptyList() {
final BuildDetails build = TestUtils.createRandomBuildDetails();
final Object buildId = repository.saveBuildDetails(build);
Assert.assertNotNull("Unexpected null build id", buildId);
final long min = build.getDuration() - 10;
final long max = min + 100;
final List<BuildDetails> builds = repository.getBuildDetailsByDurationRange(min, max);
Assert.assertNotNull("Unexpected null list of builds", builds);
Assert.assertFalse("Unexpected empty list of builds", builds.isEmpty());
Assert.assertEquals("Unexpected number of builds", 1, builds.size());
Assert.assertEquals("Mismatching build details found", build, builds.get(0));
}
use of org.jenkins.plugins.audit2db.model.BuildDetails in project selenium_java by sergueik.
the class BuildDetailsHibernateRepositoryTests method retrievalByNonMatchingUserIdShouldReturnEmptyList.
@Test
public void retrievalByNonMatchingUserIdShouldReturnEmptyList() {
final BuildDetails build = TestUtils.createRandomBuildDetails();
final Object buildId = repository.saveBuildDetails(build);
Assert.assertNotNull("Unexpected null build id", buildId);
final List<BuildDetails> builds = repository.getBuildDetailsByUserId(build.getUserId() + "NOMATCH");
Assert.assertNotNull("Unexpected null list of builds", builds);
Assert.assertTrue("Unexpected non-empty list of builds", builds.isEmpty());
}
use of org.jenkins.plugins.audit2db.model.BuildDetails in project selenium_java by sergueik.
the class BuildDetailsHibernateRepositoryTests method retrievalByMatchingIdShouldReturnSameEntity.
@Test
public void retrievalByMatchingIdShouldReturnSameEntity() {
final BuildDetails build = TestUtils.createRandomBuildDetails();
final Object buildId = repository.saveBuildDetails(build);
Assert.assertNotNull("Unexpected null build id", buildId);
final BuildDetails retrievedBuild = repository.getBuildDetailsById(build.getId());
Assert.assertNotNull("Unexpected null build", build);
Assert.assertEquals("Mismatching build details found", build, retrievedBuild);
}
use of org.jenkins.plugins.audit2db.model.BuildDetails in project selenium_java by sergueik.
the class BuildDetailsHibernateRepositoryTests method createShouldReturnMatchingId.
@Test
public void createShouldReturnMatchingId() {
final BuildDetails build = TestUtils.createRandomBuildDetails();
final Object buildId = repository.saveBuildDetails(build);
Assert.assertNotNull("Unexpected null build id", buildId);
Assert.assertEquals("Unexpected build id", buildId, build.getId());
}
Aggregations