/** * Create an instance of {@link JobSummary } * */ public JobSummary createJobSummary() { return new JobSummary(); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof JobSummary) { final JobSummary copy = ((JobSummary) draftCopy); if (idShouldBeCopiedAndSet == Boolean.TRUE) { String sourceId; sourceId = this.getId(); String copyId = ((String) strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, (this.id!= null))); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) { if (namespaceShouldBeCopiedAndSet == Boolean.TRUE) { String sourceNamespace; sourceNamespace = this.getNamespace(); String copyNamespace = ((String) strategy.copy(LocatorUtils.property(locator, "namespace", sourceNamespace), sourceNamespace, (this.namespace!= null))); copy.setNamespace(copyNamespace); } else { if (namespaceShouldBeCopiedAndSet == Boolean.FALSE) { if (jobNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceJobName; sourceJobName = this.getJobName(); String copyJobName = ((String) strategy.copy(LocatorUtils.property(locator, "jobName", sourceJobName), sourceJobName, (this.jobName!= null))); copy.setJobName(copyJobName); } else { if (jobNameShouldBeCopiedAndSet == Boolean.FALSE) { if (startTimeShouldBeCopiedAndSet == Boolean.TRUE) {
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { theId = this.getId(); strategy.appendField(locator, this, "id", buffer, theId, (this.id!= null)); theNamespace = this.getNamespace(); strategy.appendField(locator, this, "namespace", buffer, theNamespace, (this.namespace!= null)); theJobName = this.getJobName(); strategy.appendField(locator, this, "jobName", buffer, theJobName, (this.jobName!= null)); theStartTime = this.getStartTime(); strategy.appendField(locator, this, "startTime", buffer, theStartTime, (this.startTime!= null)); theEndTime = this.getEndTime(); strategy.appendField(locator, this, "endTime", buffer, theEndTime, (this.endTime!= null)); theStatus = this.getStatus(); strategy.appendField(locator, this, "status", buffer, theStatus, (this.status!= null)); theTotalExceptions = this.getTotalExceptions(); strategy.appendField(locator, this, "totalExceptions", buffer, theTotalExceptions, true);
JobSummary jobSummary = new JobSummary(); jobSummary.setId(historicProcessInstance.getId()); jobSummary.setNamespace(jobDefinitionKey.getNamespace()); jobSummary.setJobName(jobDefinitionKey.getJobName()); jobSummary.setStartTime(HerdDateUtils.getXMLGregorianCalendarValue(historicProcessInstance.getStartTime())); jobSummary.setStatus(suspended ? JobStatusEnum.SUSPENDED : JobStatusEnum.RUNNING); jobSummary.setTotalExceptions(activitiService.getJobsWithExceptionCountByProcessInstanceId(historicProcessInstance.getId())); jobSummary.setEndTime(HerdDateUtils.getXMLGregorianCalendarValue(historicProcessInstance.getEndTime())); jobSummary.setStatus(JobStatusEnum.COMPLETED);
@Test public void testGetJobs() throws Exception { // Create a job summary. JobSummary jobSummary = new JobSummary(); jobSummary.setId(JOB_ID); jobSummary.setNamespace(JOB_NAMESPACE); jobSummary.setJobName(JOB_NAME); // Create a job summaries object. JobSummaries jobSummaries = new JobSummaries(Arrays.asList(jobSummary)); // Mock the external calls. when(jobService.getJobs(JOB_NAMESPACE, JOB_NAME, JobStatusEnum.RUNNING, START_TIME, END_TIME)).thenReturn(jobSummaries); // Call the method under test. JobSummaries result = jobRestController.getJobs(JOB_NAMESPACE, JOB_NAME, JobStatusEnum.RUNNING, START_TIME.toString(), END_TIME.toString()); // Verify the external calls. verify(jobService).getJobs(JOB_NAMESPACE, JOB_NAME, JobStatusEnum.RUNNING, START_TIME, END_TIME); verifyNoMoreInteractionsHelper(); // Validate the results. assertEquals(jobSummaries, result); }
/** * Validates the job summaries per specified map of expected job ids to their relative statuses. * * @param expectedJobStatuses the map of expected job ids to their relative statuses * @param actualJobSummaries the job summaries to be validated */ private void validateJobSummaries(Map<String, JobStatusEnum> expectedJobStatuses, JobSummaries actualJobSummaries) { // Build the mapping of the actual job ids to job statuses. Map<String, JobStatusEnum> actualJobStatuses = new HashMap<>(); for (JobSummary actualJobSummary : actualJobSummaries.getJobSummaries()) { actualJobStatuses.put(actualJobSummary.getId(), actualJobSummary.getStatus()); } // Compare the expected and actual mappings. assertEquals(expectedJobStatuses, actualJobStatuses); } }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof JobSummary) { final JobSummary copy = ((JobSummary) draftCopy); if (idShouldBeCopiedAndSet == Boolean.TRUE) { String sourceId; sourceId = this.getId(); String copyId = ((String) strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, (this.id!= null))); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) { if (namespaceShouldBeCopiedAndSet == Boolean.TRUE) { String sourceNamespace; sourceNamespace = this.getNamespace(); String copyNamespace = ((String) strategy.copy(LocatorUtils.property(locator, "namespace", sourceNamespace), sourceNamespace, (this.namespace!= null))); copy.setNamespace(copyNamespace); } else { if (namespaceShouldBeCopiedAndSet == Boolean.FALSE) { if (jobNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceJobName; sourceJobName = this.getJobName(); String copyJobName = ((String) strategy.copy(LocatorUtils.property(locator, "jobName", sourceJobName), sourceJobName, (this.jobName!= null))); copy.setJobName(copyJobName); } else { if (jobNameShouldBeCopiedAndSet == Boolean.FALSE) { if (startTimeShouldBeCopiedAndSet == Boolean.TRUE) {
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { theId = this.getId(); strategy.appendField(locator, this, "id", buffer, theId, (this.id!= null)); theNamespace = this.getNamespace(); strategy.appendField(locator, this, "namespace", buffer, theNamespace, (this.namespace!= null)); theJobName = this.getJobName(); strategy.appendField(locator, this, "jobName", buffer, theJobName, (this.jobName!= null)); theStartTime = this.getStartTime(); strategy.appendField(locator, this, "startTime", buffer, theStartTime, (this.startTime!= null)); theEndTime = this.getEndTime(); strategy.appendField(locator, this, "endTime", buffer, theEndTime, (this.endTime!= null)); theStatus = this.getStatus(); strategy.appendField(locator, this, "status", buffer, theStatus, (this.status!= null)); theTotalExceptions = this.getTotalExceptions(); strategy.appendField(locator, this, "totalExceptions", buffer, theTotalExceptions, true);
JobSummary jobSummary = new JobSummary(); jobSummary.setId(historicProcessInstance.getId()); jobSummary.setNamespace(jobDefinitionKey.getNamespace()); jobSummary.setJobName(jobDefinitionKey.getJobName()); jobSummary.setStartTime(HerdDateUtils.getXMLGregorianCalendarValue(historicProcessInstance.getStartTime())); jobSummary.setStatus(suspended ? JobStatusEnum.SUSPENDED : JobStatusEnum.RUNNING); jobSummary.setTotalExceptions(activitiService.getJobsWithExceptionCountByProcessInstanceId(historicProcessInstance.getId())); jobSummary.setEndTime(HerdDateUtils.getXMLGregorianCalendarValue(historicProcessInstance.getEndTime())); jobSummary.setStatus(JobStatusEnum.COMPLETED);
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof JobSummary) { final JobSummary copy = ((JobSummary) draftCopy); if (idShouldBeCopiedAndSet == Boolean.TRUE) { String sourceId; sourceId = this.getId(); String copyId = ((String) strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, (this.id!= null))); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) { if (namespaceShouldBeCopiedAndSet == Boolean.TRUE) { String sourceNamespace; sourceNamespace = this.getNamespace(); String copyNamespace = ((String) strategy.copy(LocatorUtils.property(locator, "namespace", sourceNamespace), sourceNamespace, (this.namespace!= null))); copy.setNamespace(copyNamespace); } else { if (namespaceShouldBeCopiedAndSet == Boolean.FALSE) { if (jobNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceJobName; sourceJobName = this.getJobName(); String copyJobName = ((String) strategy.copy(LocatorUtils.property(locator, "jobName", sourceJobName), sourceJobName, (this.jobName!= null))); copy.setJobName(copyJobName); } else { if (jobNameShouldBeCopiedAndSet == Boolean.FALSE) { if (startTimeShouldBeCopiedAndSet == Boolean.TRUE) {
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { theId = this.getId(); strategy.appendField(locator, this, "id", buffer, theId, (this.id!= null)); theNamespace = this.getNamespace(); strategy.appendField(locator, this, "namespace", buffer, theNamespace, (this.namespace!= null)); theJobName = this.getJobName(); strategy.appendField(locator, this, "jobName", buffer, theJobName, (this.jobName!= null)); theStartTime = this.getStartTime(); strategy.appendField(locator, this, "startTime", buffer, theStartTime, (this.startTime!= null)); theEndTime = this.getEndTime(); strategy.appendField(locator, this, "endTime", buffer, theEndTime, (this.endTime!= null)); theStatus = this.getStatus(); strategy.appendField(locator, this, "status", buffer, theStatus, (this.status!= null)); theTotalExceptions = this.getTotalExceptions(); strategy.appendField(locator, this, "totalExceptions", buffer, theTotalExceptions, true);
/** * Create an instance of {@link JobSummary } * */ public JobSummary createJobSummary() { return new JobSummary(); }
theId = this.getId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId, (this.id!= null)); theNamespace = this.getNamespace(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "namespace", theNamespace), currentHashCode, theNamespace, (this.namespace!= null)); theJobName = this.getJobName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "jobName", theJobName), currentHashCode, theJobName, (this.jobName!= null)); theStartTime = this.getStartTime(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "startTime", theStartTime), currentHashCode, theStartTime, (this.startTime!= null)); theEndTime = this.getEndTime(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "endTime", theEndTime), currentHashCode, theEndTime, (this.endTime!= null)); theStatus = this.getStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus, (this.status!= null)); theTotalExceptions = this.getTotalExceptions(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "totalExceptions", theTotalExceptions), currentHashCode, theTotalExceptions, true);
/** * Create an instance of {@link JobSummary } * */ public JobSummary createJobSummary() { return new JobSummary(); }
theId = this.getId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId, (this.id!= null)); theNamespace = this.getNamespace(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "namespace", theNamespace), currentHashCode, theNamespace, (this.namespace!= null)); theJobName = this.getJobName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "jobName", theJobName), currentHashCode, theJobName, (this.jobName!= null)); theStartTime = this.getStartTime(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "startTime", theStartTime), currentHashCode, theStartTime, (this.startTime!= null)); theEndTime = this.getEndTime(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "endTime", theEndTime), currentHashCode, theEndTime, (this.endTime!= null)); theStatus = this.getStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus, (this.status!= null)); theTotalExceptions = this.getTotalExceptions(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "totalExceptions", theTotalExceptions), currentHashCode, theTotalExceptions, true);
public Object createNewInstance() { return new JobSummary(); }
lhsId = this.getId(); String rhsId; rhsId = that.getId(); if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId, (this.id!= null), (that.id!= null))) { return false; lhsNamespace = this.getNamespace(); String rhsNamespace; rhsNamespace = that.getNamespace(); if (!strategy.equals(LocatorUtils.property(thisLocator, "namespace", lhsNamespace), LocatorUtils.property(thatLocator, "namespace", rhsNamespace), lhsNamespace, rhsNamespace, (this.namespace!= null), (that.namespace!= null))) { return false; lhsJobName = this.getJobName(); String rhsJobName; rhsJobName = that.getJobName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "jobName", lhsJobName), LocatorUtils.property(thatLocator, "jobName", rhsJobName), lhsJobName, rhsJobName, (this.jobName!= null), (that.jobName!= null))) { return false; lhsStartTime = this.getStartTime(); XMLGregorianCalendar rhsStartTime; rhsStartTime = that.getStartTime(); if (!strategy.equals(LocatorUtils.property(thisLocator, "startTime", lhsStartTime), LocatorUtils.property(thatLocator, "startTime", rhsStartTime), lhsStartTime, rhsStartTime, (this.startTime!= null), (that.startTime!= null))) { return false; lhsEndTime = this.getEndTime(); XMLGregorianCalendar rhsEndTime; rhsEndTime = that.getEndTime(); if (!strategy.equals(LocatorUtils.property(thisLocator, "endTime", lhsEndTime), LocatorUtils.property(thatLocator, "endTime", rhsEndTime), lhsEndTime, rhsEndTime, (this.endTime!= null), (that.endTime!= null))) { return false;
public Object createNewInstance() { return new JobSummary(); }
lhsId = this.getId(); String rhsId; rhsId = that.getId(); if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId, (this.id!= null), (that.id!= null))) { return false; lhsNamespace = this.getNamespace(); String rhsNamespace; rhsNamespace = that.getNamespace(); if (!strategy.equals(LocatorUtils.property(thisLocator, "namespace", lhsNamespace), LocatorUtils.property(thatLocator, "namespace", rhsNamespace), lhsNamespace, rhsNamespace, (this.namespace!= null), (that.namespace!= null))) { return false; lhsJobName = this.getJobName(); String rhsJobName; rhsJobName = that.getJobName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "jobName", lhsJobName), LocatorUtils.property(thatLocator, "jobName", rhsJobName), lhsJobName, rhsJobName, (this.jobName!= null), (that.jobName!= null))) { return false; lhsStartTime = this.getStartTime(); XMLGregorianCalendar rhsStartTime; rhsStartTime = that.getStartTime(); if (!strategy.equals(LocatorUtils.property(thisLocator, "startTime", lhsStartTime), LocatorUtils.property(thatLocator, "startTime", rhsStartTime), lhsStartTime, rhsStartTime, (this.startTime!= null), (that.startTime!= null))) { return false; lhsEndTime = this.getEndTime(); XMLGregorianCalendar rhsEndTime; rhsEndTime = that.getEndTime(); if (!strategy.equals(LocatorUtils.property(thisLocator, "endTime", lhsEndTime), LocatorUtils.property(thatLocator, "endTime", rhsEndTime), lhsEndTime, rhsEndTime, (this.endTime!= null), (that.endTime!= null))) { return false;
public Object createNewInstance() { return new JobSummary(); }