Beispiel #1
0
        public virtual void assertJobRemoved(string activityId, string handlerType)
        {
            JobDefinition jobDefinitionBefore = snapshotBeforeMigration.getJobDefinitionForActivityIdAndType(activityId, handlerType);

            assertNotNull("Expected that a job definition for activity '" + activityId + "' exists before migration", jobDefinitionBefore);

            Job jobBefore = snapshotBeforeMigration.getJobForDefinitionId(jobDefinitionBefore.Id);

            assertNotNull("Expected that a job for activity '" + activityId + "' exists before migration", jobBefore);
            assertTimerJob(jobBefore);

            foreach (Job job in snapshotAfterMigration.Jobs)
            {
                if (jobBefore.Id.Equals(job.Id))
                {
                    fail("Expected job '" + jobBefore.Id + "' to be removed after migration");
                }
            }
        }
Beispiel #2
0
        public virtual void assertJobCreated(string activityId, string handlerType)
        {
            JobDefinition jobDefinitionAfter = snapshotAfterMigration.getJobDefinitionForActivityIdAndType(activityId, handlerType);

            assertNotNull("Expected that a job definition for activity '" + activityId + "' exists after migration", jobDefinitionAfter);

            Job jobAfter = snapshotAfterMigration.getJobForDefinitionId(jobDefinitionAfter.Id);

            assertNotNull("Expected that a job for activity '" + activityId + "' exists after migration", jobAfter);
            assertTimerJob(jobAfter);
            assertEquals(jobDefinitionAfter.ProcessDefinitionId, jobAfter.ProcessDefinitionId);
            assertEquals(jobDefinitionAfter.ProcessDefinitionKey, jobAfter.ProcessDefinitionKey);

            foreach (Job job in snapshotBeforeMigration.Jobs)
            {
                if (jobAfter.Id.Equals(job.Id))
                {
                    fail("Expected job '" + jobAfter.Id + "' to be created first after migration");
                }
            }
        }