use of org.jenkins.plugins.audit2db.internal.model.BuildParameterImpl in project selenium_java by sergueik.
the class BuildParameterImplTests method differentAttributesShouldPreserveEquality.
@Test
public void differentAttributesShouldPreserveEquality() {
final BuildParameter actual = new BuildParameterImpl(expected.getId(), expected.getName() + "DIFFERENT", expected.getValue() + "DIFFERENT", otherDetails);
Assert.assertEquals("Broken equality", expected, actual);
}
use of org.jenkins.plugins.audit2db.internal.model.BuildParameterImpl in project selenium_java by sergueik.
the class BuildDetailsImplTests method getBuildDetails.
private BuildDetails getBuildDetails() {
final BuildDetails build = new BuildDetailsImpl();
build.setDuration(Long.valueOf(60));
build.setEndDate(new Date(build.getStartDate().getTime() + (build.getDuration() * 1000)));
build.setFullName("BUILD FULL NAME");
build.setId("BUILD ID");
build.setName("BUILD NAME");
build.setUserId("BUILD USER ID");
build.setUserName("BUILD USER NAME");
final List<BuildParameter> params = new ArrayList<BuildParameter>();
params.add(new BuildParameterImpl("PARAM_ID", "PARAM NAME", "PARAM VALUE", build));
build.setParameters(params);
return build;
}
use of org.jenkins.plugins.audit2db.internal.model.BuildParameterImpl in project selenium_java by sergueik.
the class BuildParameterImplTests method differentIdShouldBreakEquality.
@Test
public void differentIdShouldBreakEquality() {
final BuildParameter actual = new BuildParameterImpl(expected.getId() + "DIFFERENT", expected.getName(), expected.getValue(), expected.getBuildDetails());
Assert.assertFalse("Broken inequality logic", actual.equals(expected));
}
use of org.jenkins.plugins.audit2db.internal.model.BuildParameterImpl in project selenium_java by sergueik.
the class TestUtils method createRandomBuildDetails.
public static BuildDetails createRandomBuildDetails(final boolean withParams) {
final long salt = System.nanoTime();
final BuildDetails build = new BuildDetailsImpl();
build.setDuration(Long.valueOf(60 + (long) (Math.random() * 60)));
build.setEndDate(new Date(build.getStartDate().getTime() + (build.getDuration() * 1000)));
build.setFullName("BUILD FULL NAME " + salt);
build.setId("BUILD ID " + salt);
build.setName("BUILD NAME " + salt);
build.setUserId("BUILD USER ID " + salt);
build.setUserName("BUILD USER NAME " + salt);
if (withParams) {
final List<BuildParameter> params = new ArrayList<BuildParameter>();
params.add(new BuildParameterImpl("PARAM_ID 1 " + salt, "PARAM NAME 1 " + salt, "PARAM VALUE 1 " + salt, build));
params.add(new BuildParameterImpl("PARAM_ID 2 " + salt, "PARAM NAME 2 " + salt, "PARAM VALUE 2 " + salt, build));
build.setParameters(params);
}
final BuildNode node = new BuildNodeImpl("NODE ADDRESS", "NODE HOSTNAME", "NODE DISPLAYNAME", "NODE URL", "NODE NAME", "NODE DESCRIPTION", "NODE LABEL");
build.setNode(node);
return build;
}
use of org.jenkins.plugins.audit2db.internal.model.BuildParameterImpl in project selenium_java by sergueik.
the class BuildDetailsResolver method addParametersFromContext.
private static void addParametersFromContext(BuildDetailsImpl details, Run<?, ?> run) throws IOException, InterruptedException {
LOGGER.finest("resolving build parameters");
List<BuildParameter> buildParameters = new ArrayList<BuildParameter>();
for (Action action : run.getAllActions()) {
if (!ParametersAction.class.isInstance(action)) {
continue;
}
ParametersAction paramAction = (ParametersAction) action;
for (ParameterValue param : paramAction.getParameters()) {
LOGGER.finest("found parameter: " + param);
String paramId = run.getId() + "-" + param.getName();
buildParameters.add(new BuildParameterImpl(paramId, param.getName(), param.getValue().toString(), details));
}
}
details.setParameters(buildParameters);
}
Aggregations