@Test public void testCreateJob() throws Exception { // Create the namespace entity. namespaceDaoTestHelper.createNamespaceEntity(TEST_ACTIVITI_NAMESPACE_CD); // Create a job definition create request using hard coded test values. JobDefinitionCreateRequest jobDefinitionCreateRequest = jobDefinitionServiceTestHelper.createJobDefinitionCreateRequest(); // Create the job definition. jobDefinitionService.createJobDefinition(jobDefinitionCreateRequest, false); // Create a job create request using hard coded test values. JobCreateRequest jobCreateRequest = jobServiceTestHelper.createJobCreateRequest(TEST_ACTIVITI_NAMESPACE_CD, TEST_ACTIVITI_JOB_NAME); // Create the job. Job resultJob = jobService.createAndStartJob(jobCreateRequest); // Validate the results. assertNotNull(resultJob); assertNotNull(resultJob.getId()); assertTrue(!resultJob.getId().isEmpty()); assertEquals(TEST_ACTIVITI_NAMESPACE_CD, resultJob.getNamespace()); assertEquals(TEST_ACTIVITI_JOB_NAME, resultJob.getJobName()); assertEquals(jobDefinitionCreateRequest.getParameters().size() + jobCreateRequest.getParameters().size() + 1, resultJob.getParameters().size()); List<String> expectedParameters = new ArrayList<>(); expectedParameters.addAll(parametersToStringList(jobDefinitionCreateRequest.getParameters())); expectedParameters.addAll(parametersToStringList(jobCreateRequest.getParameters())); expectedParameters.addAll(parametersToStringList( Arrays.asList(new Parameter(HERD_WORKFLOW_ENVIRONMENT, configurationHelper.getProperty(ConfigurationValue.HERD_ENVIRONMENT))))); List<String> resultParameters = parametersToStringList(resultJob.getParameters()); assertTrue(expectedParameters.containsAll(resultParameters)); assertTrue(resultParameters.containsAll(expectedParameters)); }
assertEquals(TEST_ACTIVITI_NAMESPACE_CD, job.getNamespace()); assertEquals(TEST_ACTIVITI_JOB_NAME, job.getJobName());
@Test public void testCreateJobNoParams() throws Exception { // Create the namespace entity. namespaceDaoTestHelper.createNamespaceEntity(TEST_ACTIVITI_NAMESPACE_CD); // Create a job definition create request using hard coded test values. JobDefinitionCreateRequest jobDefinitionCreateRequest = jobDefinitionServiceTestHelper.createJobDefinitionCreateRequest(); jobDefinitionCreateRequest.setParameters(null); // Create the job definition. jobDefinitionService.createJobDefinition(jobDefinitionCreateRequest, false); // Create a job create request using hard coded test values. JobCreateRequest jobCreateRequest = jobServiceTestHelper.createJobCreateRequest(TEST_ACTIVITI_NAMESPACE_CD, TEST_ACTIVITI_JOB_NAME); jobCreateRequest.setParameters(null); // Create the job. Job resultJob = jobService.createAndStartJob(jobCreateRequest); //expected default parameter List<Parameter> expectedParameters = Arrays.asList(new Parameter(HERD_WORKFLOW_ENVIRONMENT, configurationHelper.getProperty(ConfigurationValue.HERD_ENVIRONMENT))); // Validate the results. assertNotNull(resultJob); assertNotNull(resultJob.getId()); assertTrue(!resultJob.getId().isEmpty()); assertEquals(TEST_ACTIVITI_NAMESPACE_CD, resultJob.getNamespace()); assertEquals(TEST_ACTIVITI_JOB_NAME, resultJob.getJobName()); assertTrue(resultJob.getParameters().size() == 1); assertTrue(expectedParameters.containsAll(resultJob.getParameters())); }
assertEquals(TEST_ACTIVITI_NAMESPACE_CD, job.getNamespace()); assertEquals(TEST_ACTIVITI_JOB_NAME, job.getJobName());
theNamespace = this.getNamespace(); strategy.appendField(locator, this, "namespace", buffer, theNamespace, (this.namespace!= null));
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;
theNamespace = this.getNamespace(); strategy.appendField(locator, this, "namespace", buffer, theNamespace, (this.namespace!= null));
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;
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;
theNamespace = this.getNamespace(); strategy.appendField(locator, this, "namespace", buffer, theNamespace, (this.namespace!= null));
theNamespace = this.getNamespace(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "namespace", theNamespace), currentHashCode, theNamespace, (this.namespace!= null));
theNamespace = this.getNamespace(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "namespace", theNamespace), currentHashCode, theNamespace, (this.namespace!= null));
theNamespace = this.getNamespace(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "namespace", theNamespace), currentHashCode, theNamespace, (this.namespace!= null));
/** * Asserts that the deleteJob call will move the job to completion, and add a record in the history instance with the specified delete reason. * * @throws Exception */ @Test public void testDeleteJob() throws Exception { // Start a job that will wait in a receive task jobDefinitionServiceTestHelper.createJobDefinition(ACTIVITI_XML_TEST_RECEIVE_TASK_WITH_CLASSPATH); Job job = jobService.createAndStartJob(jobServiceTestHelper.createJobCreateRequest(TEST_ACTIVITI_NAMESPACE_CD, TEST_ACTIVITI_JOB_NAME)); // Create a job delete request JobDeleteRequest jobDeleteRequest = new JobDeleteRequest(); jobDeleteRequest.setDeleteReason("test delete reason"); Job deleteJobResponse = jobService.deleteJob(job.getId(), jobDeleteRequest); // Assert delete job response assertEquals(job.getId(), deleteJobResponse.getId()); assertNull(deleteJobResponse.getNamespace()); assertNull(deleteJobResponse.getJobName()); assertEquals(JobStatusEnum.COMPLETED, deleteJobResponse.getStatus()); assertEquals(jobDeleteRequest.getDeleteReason(), deleteJobResponse.getDeleteReason()); // Assert historic process instance HistoricProcessInstance historicProcessInstance = activitiHistoryService.createHistoricProcessInstanceQuery().processInstanceId(job.getId()).singleResult(); assertNotNull(historicProcessInstance); assertEquals(jobDeleteRequest.getDeleteReason(), historicProcessInstance.getDeleteReason()); }
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);
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);
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);