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.'); } } }
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,802 Super User 2024 Season 2
Martin Dráb 229,129 Most Valuable Professional
nmaenpaa 101,154