ilCaseNodeTest is part of the petri net based workflow engine.
More...
ilCaseNodeTest is part of the petri net based workflow engine.
This class holds all tests for the class nodes/class.ilCaseNode
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
/
Definition at line 15 of file ilCaseNodeTest.php.
◆ setUp()
ilCaseNodeTest::setUp |
( |
| ) |
|
Definition at line 20 of file ilCaseNodeTest.php.
22 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
26 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
◆ tearDown()
ilCaseNodeTest::tearDown |
( |
| ) |
|
Definition at line 30 of file ilCaseNodeTest.php.
References $ilSetting.
33 if ($ilSetting != NULL)
35 $ilSetting->delete(
'IL_PHPUNIT_TEST_TIME');
36 $ilSetting->delete(
'IL_PHPUNIT_TEST_MICROTIME');
◆ testAddDetectorFirst()
ilCaseNodeTest::testAddDetectorFirst |
( |
| ) |
|
Definition at line 326 of file ilCaseNodeTest.php.
330 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
334 $node->addDetector($detector);
335 $detectors = $node->getDetectors();
338 $this->assertEquals($detector, $detectors[0]);
◆ testAddGetActivity()
ilCaseNodeTest::testAddGetActivity |
( |
| ) |
|
Definition at line 341 of file ilCaseNodeTest.php.
345 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
349 $node->addActivity( $activity );
350 $activities = $node->getActivities();
353 $this->assertEquals( $activity, $activities[0] );
◆ testAttemptTransitionPreconditionsValidOnExclusiveJoin()
ilCaseNodeTest::testAttemptTransitionPreconditionsValidOnExclusiveJoin |
( |
| ) |
|
Definition at line 183 of file ilCaseNodeTest.php.
References $success.
187 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
189 $node->addDetector($detector1);
191 $node->addDetector($detector2);
192 $node->setIsExclusiveJoin(
true);
193 $detector1->trigger(null);
194 $detector2->trigger(null);
197 $success = $node->attemptTransition();
◆ testCheckTransitionPreconditionsInvalid()
ilCaseNodeTest::testCheckTransitionPreconditionsInvalid |
( |
| ) |
|
Definition at line 163 of file ilCaseNodeTest.php.
167 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
169 $node->addDetector($detector1);
171 $node->addDetector($detector2);
173 $detector1->trigger(null);
177 $preconditions = $node->checkTransitionPreconditions();
180 $this->assertFalse($preconditions);
◆ testCheckTransitionPreconditionsValid()
ilCaseNodeTest::testCheckTransitionPreconditionsValid |
( |
| ) |
|
Definition at line 104 of file ilCaseNodeTest.php.
108 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
110 $node->addDetector($detector1);
112 $node->addDetector($detector2);
114 $detector1->trigger(null);
115 $detector2->trigger(null);
118 $preconditions = $node->checkTransitionPreconditions();
121 $this->assertTrue($preconditions);
◆ testCheckTransitionPreconditionsValidOnExclusiveJoin()
ilCaseNodeTest::testCheckTransitionPreconditionsValidOnExclusiveJoin |
( |
| ) |
|
Definition at line 124 of file ilCaseNodeTest.php.
128 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
130 $node->addDetector($detector1);
132 $node->addDetector($detector2);
133 $node->setIsExclusiveJoin(
true);
134 $detector1->trigger(null);
135 $detector2->trigger(null);
138 $preconditions = $node->checkTransitionPreconditions();
141 $this->assertTrue($preconditions);
◆ testConstructorValidContext()
ilCaseNodeTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 40 of file ilCaseNodeTest.php.
49 'Construction failed with valid context passed to constructor.'
◆ testDeactivate()
ilCaseNodeTest::testDeactivate |
( |
| ) |
|
Definition at line 86 of file ilCaseNodeTest.php.
90 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
92 $node->addDetector($detector);
96 $was_activated = $node->isActive();
98 $was_deactivated = !$node->isActive();
101 $this->assertEquals($was_activated, $was_deactivated);
◆ testExecuteActivitiesViaExecuteTransition()
ilCaseNodeTest::testExecuteActivitiesViaExecuteTransition |
( |
| ) |
|
Definition at line 238 of file ilCaseNodeTest.php.
242 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
244 $node->addDetector($detector);
246 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
248 $activity->setLogFile(
'ilTransitionLog.txt');
249 $activity->setLogLevel(
'MESSAGE');
250 $activity->setLogMessage(
'TEST');
251 $node->addActivity($activity);
255 $node->executeTransition();
258 $expected =
' :: MESSAGE :: TEST';
259 $fp = fopen(
'ilTransitionLog.txt', r);
261 $actual = substr($line, 25, strlen($line)-27);
262 @unlink(
'ilTransitionLog.txt');
◆ testExecuteEmitterViaExecuteTransition()
ilCaseNodeTest::testExecuteEmitterViaExecuteTransition |
( |
| ) |
|
Definition at line 269 of file ilCaseNodeTest.php.
273 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
275 $node->addDetector($detector);
277 require_once
'./Services/WorkflowEngine/classes/emitters/class.ilActivationEmitter.php';
280 $t_node->addDetector($t_detector);
282 $t_node->addDetector($foo_detector);
286 $emitter->setTargetDetector($t_detector);
287 $node->addEmitter($emitter);
291 $node->executeTransition();
294 $this->assertTrue($t_node->isActive());
◆ testExecuteEmitterViaExecuteTransitionExclusiveFork()
ilCaseNodeTest::testExecuteEmitterViaExecuteTransitionExclusiveFork |
( |
| ) |
|
Definition at line 297 of file ilCaseNodeTest.php.
301 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
303 $node->addDetector($detector);
305 require_once
'./Services/WorkflowEngine/classes/emitters/class.ilActivationEmitter.php';
308 $t_node->addDetector($t_detector);
310 $t_node->addDetector($foo_detector);
314 $emitter->setTargetDetector($t_detector);
315 $node->addEmitter($emitter);
316 $node->setIsExclusiveFork(
true);
320 $node->executeTransition();
323 $this->assertTrue($t_node->isActive());
◆ testExecuteTransition()
ilCaseNodeTest::testExecuteTransition |
( |
| ) |
|
Definition at line 203 of file ilCaseNodeTest.php.
207 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
209 $node->addDetector($detector);
213 $node->executeTransition();
214 $state = $node->isActive();
217 $this->assertFalse($state);
◆ testExecuteTransitionExclusiveFork()
ilCaseNodeTest::testExecuteTransitionExclusiveFork |
( |
| ) |
|
Definition at line 220 of file ilCaseNodeTest.php.
224 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
226 $node->addDetector($detector);
228 $node->setIsExclusiveFork(
true);
231 $node->executeTransition();
232 $state = $node->isActive();
235 $this->assertFalse($state);
◆ testGetContext()
ilCaseNodeTest::testGetContext |
( |
| ) |
|
Definition at line 53 of file ilCaseNodeTest.php.
59 $actual = $node->getContext();
62 if ($actual === $this->workflow)
64 $this->assertEquals($actual, $this->workflow);
66 $this->assertTrue(
false,
'Context not identical.');
◆ testIsActiveAndActivate()
ilCaseNodeTest::testIsActiveAndActivate |
( |
| ) |
|
Definition at line 70 of file ilCaseNodeTest.php.
74 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
76 $node->addDetector($detector);
82 $actual = $node->isActive();
83 $this->assertTrue($actual);
◆ testNotifyDetectorSatisfactionAndTransit()
ilCaseNodeTest::testNotifyDetectorSatisfactionAndTransit |
( |
| ) |
|
Definition at line 144 of file ilCaseNodeTest.php.
148 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
150 $node->addDetector($detector1);
152 $node->addDetector($detector2);
156 $this->assertTrue($node->isActive());
157 $detector1->trigger(null);
158 $detector2->trigger(null);
160 $this->assertFalse($node->isActive());
◆ $workflow
ilCaseNodeTest::$workflow |
The documentation for this class was generated from the following file: