
Description:
i don't understand what is interactive session, i cannot find any documents about it.
and i have a test class, and there is a test case in it. the test case will open a form though formAdaptor , and i need to judgment whether it running on interactive session.
i know that we can use isRunningBatch() and hasGUI() to check it. but i don't understand why it is running on batch or why it is running on interactive session? how are these judged?
the following code you can have a reference, i am a little confused what is the basis of judgmet?
if you know, please give me some suggestions, thanks!
For example:
using System;
using System.Globalization;
class TestClass extends SysTestCase
{
[SysTestMethod]
public void tsetMethod1()
{
boolean beforeBatch = isRunningOnBatch();
boolean beforeinterative = hasGUI();
container beforeResult = [beforeBatch, beforeinterative];
// Arrange
using (var formAdaptor = BatchJobHistoryFormAdaptor::open())
{
// simulate running in interactive session
boolean isBatch = isRunningOnBatch();
boolean isinterative = hasGUI();
container result = [isBatch, isinterative];
// Assert
this.assertEquals([false /*isbatch*/, true /*isInteractive*/], result, ' did not match the expected.');
}
}
[SysTestMethod]
public void testMethod2()
{
boolean beforeBatch = isRunningOnBatch();
boolean beforeinterative = hasGUI();
container beforeResult = [beforeBatch, beforeinterative];
using (var batchHandler = new SysTestBatchExecutionWrapper())
{
boolean isBatch = isRunningOnBatch();
boolean isinterative = hasGUI();
container result = [isBatch, isinterative];
// Assert
this.assertEquals([true /*isbatch*/, false /*isInteractive*/], result, ' did not match the expected.');
}
}
}