本文整理汇总了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);
}
示例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);
}
示例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));
}*/
}