当前位置: 首页>>代码示例>>C#>>正文


C# ExecutionContext.PutLong方法代码示例

本文整理汇总了C#中ExecutionContext.PutLong方法的典型用法代码示例。如果您正苦于以下问题:C# ExecutionContext.PutLong方法的具体用法?C# ExecutionContext.PutLong怎么用?C# ExecutionContext.PutLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ExecutionContext的用法示例。


在下文中一共展示了ExecutionContext.PutLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestSaveExecutionContextJob2

        public void TestSaveExecutionContextJob2()
        {
            var execution = new JobExecution(1);
            var originalContext = new ExecutionContext();
            execution.ExecutionContext = originalContext;
            originalContext.PutString("test1", "test1");
            originalContext.PutLong("test2", 2L);

            _executionContextDao.SaveExecutionContext(execution);
            var context = _executionContextDao.GetExecutionContext(execution);

            Assert.AreEqual(originalContext, context);
        }
开发者ID:pkubryk,项目名称:SummerBatch,代码行数:13,代码来源:MapExecutionContextDaoTest.cs

示例2: TestSaveExecutionContextStep2

        public void TestSaveExecutionContextStep2()
        {
            Insert(@"TestData\DbDao\ExecutionContextTestData.xml");
            var jobExecution = new JobExecution(1);
            var execution = new StepExecution("TestStep", jobExecution, 1);
            var originalContext = new ExecutionContext();
            execution.ExecutionContext = originalContext;
            originalContext.PutString("test1", "test1");
            originalContext.PutLong("test2", 2L);

            _executionContextDao.SaveExecutionContext(execution);
            var context = _executionContextDao.GetExecutionContext(execution);

            Assert.AreEqual(originalContext, context);
        }
开发者ID:pkubryk,项目名称:SummerBatch,代码行数:15,代码来源:DbExecutionContextDaoTest.cs

示例3: EbcdicFileTestRestart

        public void EbcdicFileTestRestart() {
            // local resources
            System.IO.File.Copy("Ebcdic/Resources/outputs/simple.txt", "C:/temp/outputs/SimpleWritten.txt", true);
            IResource fileResource = new FileSystemResource(new FileInfo("C:/temp/outputs/SimpleWritten.txt"));
            var executionContext = new ExecutionContext();
            executionContext.PutLong("EbcdicFileWriter.current.count",21L);
            executionContext.PutLong("EbcdicFileWriter.written", 1L);
            FileInfo fileInfo = new FileInfo("Ebcdic/Resources/copybooks/simple.fileformat");
            
            IResource copybookResource = new FileSystemResource(fileInfo);

            //1. WRITE
            EbcdicWriterMapper writerMapper = new EbcdicWriterMapper();
            writerMapper.AfterPropertiesSet();

            var writer = new EbcdicFileWriter<Simple>
            {
                AppendAllowed = false,
                WriteRdw = false,
                Resource = fileResource,
                EbcdicWriterMapper = writerMapper,
                DefaultValue = EbcdicEncoder.DefaultValue.LowValue,
                DeleteIfExist = true
            };


            var mySimple = new Simple() { LongValue = 12, FloatValue = 12.5f, Date = DateTime.Now, BooleanValue = true };
            List<Simple> simpleList = new List<Simple> { mySimple };

            writer.Copybooks = new List<IResource> { new FileSystemResource(fileInfo) };

            writer.AfterPropertiesSet();
            writer.Open(executionContext);
            writer.Write(simpleList);
            writer.Close();

            //2.READ WHAT WAS WRITTEN
            var reader = new EbcdicFileReader<Simple>
            {
                EbcdicReaderMapper = new SimpleEbcdicMapper(),
                Rdw = false,
                Resource = fileResource,
                Name = "PersonReader",
                SaveState = false,
                Copybook = copybookResource
            };
            reader.AfterPropertiesSet();

            var simples = new List<Simple>();
            reader.Open(executionContext);
            Simple simple;
            while ((simple = reader.Read()) != null)
            {
                simples.Add(simple);
            }
            reader.Close();

            /*foreach (Ebcdic.Test.Person p in simple)
            {
                Assert.AreEqual(p.Id, p.Value);
                Assert.IsTrue(p.Name.StartsWith("Name_" + p.Id));
            }*/
        }
开发者ID:pkubryk,项目名称:SummerBatch,代码行数:63,代码来源:EbcdicFileTest.cs


注:本文中的ExecutionContext.PutLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。