Пример #1
0
        public virtual void testBuiltinFunctionMapperRegistration()
        {
            // given a process engine configuration with a custom function mapper
            ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl)ProcessEngineConfiguration.CreateStandaloneInMemProcessEngineConfiguration().SetJdbcUrl("jdbc:h2:mem:camunda" + this.GetType().Name);

            CustomExpressionManager customExpressionManager = new CustomExpressionManager();

            Assert.True(customExpressionManager.FunctionMappers.Count == 0);
            config.ExpressionManager = customExpressionManager;

            // when the engine is initialized
            engine = config.BuildProcessEngine();

            // then two default function mappers should be registered
            Assert.AreSame(customExpressionManager, config.ExpressionManager);
            Assert.AreEqual(2, customExpressionManager.FunctionMappers.Count);

            bool commandContextMapperFound = false;
            bool dateTimeMapperFound       = false;

            foreach (FunctionMapper functionMapper in customExpressionManager.FunctionMappers)
            {
                if (functionMapper is CommandContextFunctionMapper)
                {
                    commandContextMapperFound = true;
                }

                if (functionMapper is DateTimeFunctionMapper)
                {
                    dateTimeMapperFound = true;
                }
            }

            Assert.True(commandContextMapperFound && dateTimeMapperFound);
        }
Пример #2
0
        public virtual void TestJobExecutorHintConfiguration()
        {
            var engineConfig1 = ProcessEngineConfiguration.CreateStandaloneInMemProcessEngineConfiguration();

            Assert.True(engineConfig1.HintJobExecutor, "default setting is true");

            var engineConfig2 =
                ProcessEngineConfiguration.CreateStandaloneInMemProcessEngineConfiguration().SetHintJobExecutor(false);

            Assert.IsFalse(engineConfig2.HintJobExecutor);

            var engineConfig3 =
                ProcessEngineConfiguration.CreateStandaloneInMemProcessEngineConfiguration().SetHintJobExecutor(true);

            Assert.True(engineConfig3.HintJobExecutor);
        }
 protected internal virtual ProcessEngineConfigurationImpl createProcessEngineConfiguration()
 {
     return((ProcessEngineConfigurationImpl)ProcessEngineConfiguration.CreateStandaloneInMemProcessEngineConfiguration().SetJdbcUrl("jdbc:h2:mem:camunda" + this.GetType().Name));
 }