<commit_before>package rundeck.services

import grails.test.hibernate.HibernateSpec
import org.quartz.Scheduler
import rundeck.CommandExec
import rundeck.ScheduledExecution
import rundeck.Workflow
import spock.lang.Unroll

/**
 * Created by ronaveva on 2/17/20.
 */
class LocalJobSchedulesManagerSpec extends HibernateSpec {

    List<Class> getDomainClasses() { [ScheduledExecution] }

    public static final String TEST_UUID2 = '490966E0-2E2F-4505-823F-E2665ADC66FB'

    private Map createJobParams(Map overrides = [:]) {
        [
                jobName       : 'blue',
                project       : 'AProject',
                groupPath     : 'some/where',
                description   : 'a job',
                argString     : '-a b -c d',
                workflow      : new Workflow(
                        keepgoing: true,
                        commands: [new CommandExec([adhocRemoteString: 'test buddy'])]
                ),
                serverNodeUUID: null,
                scheduled     : true
        ] + overrides
    }

    @Unroll
    def "nextExecutionTime"() {
        given:<commit_msg>LocalJobSchedulesManagerSpec needed domain<commit_after>package rundeck.services

import grails.test.hibernate.HibernateSpec
import org.quartz.Scheduler
import rundeck.CommandExec
import rundeck.ScheduledExecution
import rundeck.Workflow
import spock.lang.Unroll

/**
 * Created by ronaveva on 2/17/20.
 */
class LocalJobSchedulesManagerSpec extends HibernateSpec {

    List<Class> getDomainClasses() { [ScheduledExecution, CommandExec] }

    public static final String TEST_UUID2 = '490966E0-2E2F-4505-823F-E2665ADC66FB'

    private Map createJobParams(Map overrides = [:]) {
        [
                jobName       : 'blue',
                project       : 'AProject',
                groupPath     : 'some/where',
                description   : 'a job',
                argString     : '-a b -c d',
                workflow      : new Workflow(
                        keepgoing: true,
                        commands: [new CommandExec([adhocRemoteString: 'test buddy'])]
                ),
                serverNodeUUID: null,
                scheduled     : true
        ] + overrides
    }

    @Unroll
    def "nextExecutionTime"() {
        given:
{'fraction_non_alphanumeric': 0.08728070175438596, 'fraction_numerical': 0.02456140350877193, 'mean_word_length': 1.8873417721518988, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6964075', 'n_tokens_mistral': 696, 'n_tokens_neox': 624, 'n_words': 140}