de.cau.cs.kieler.core.kivi.test
Class KiViCoreTest

java.lang.Object
  extended by de.cau.cs.kieler.core.kivi.test.KiViCoreTest

public class KiViCoreTest
extends Object

Test of the core of KiVi. Will instanciate the KiVi instance, setup some Combinations and trigger some triggers. First test cases check whether the AbstractCombination correctly retrieves the necessary information from the combinations's execute methods and correctly throws exceptions if the combination is malformed.

Later tests run KiVi for some time. Some of the test cases can detect error states themselves (e.g. increase of effects queue) but some cannot. So these should be run manually and the console output needs to be interpreted correctly.

Most test cases are meant to play around with KiVi automatically.

Rating red

Constructor Summary
KiViCoreTest()
           
 
Method Summary
 void setupKiVi()
           
 void TestA()
          Simplest trigger-combination-effect interaction.
 void TestDisjointCombinations()
          Two combinations with totally different triggers.
 void TestEffect()
          A combination that schedules effects and two others listening for these effects.
 void TestGetTriggerStates()
          Test whether the trigger states that a combination listens to are correctly extracted via reflection from the execute methods.
 void TestNoExecute()
          Combination has no execute method -> exception should be thrown.
 void TestOverlappingParameters()
          Combination has multiple execute methods with overlapping parameters -> exception should be thrown.
 void TestSpammer()
          Spamming of triggers should not overflow the effects queue.
 void TestSpammerSynchronized()
          Spamming of triggers should not overflow the effects queue.
 void TestTwoEffects()
          Combination has multiple execute methods with effect parameters which is currently not supported; all effect triggers need to be in one execute method.
 void TestUndo()
          Test whether effects re correctly undone, respectively not undone.
 void TestWrongParameterType()
          Combination has execute method with not supported parameter type -> exception should be thrown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KiViCoreTest

public KiViCoreTest()
Method Detail

setupKiVi

public void setupKiVi()

TestNoExecute

public void TestNoExecute()
Combination has no execute method -> exception should be thrown.


TestOverlappingParameters

public void TestOverlappingParameters()
Combination has multiple execute methods with overlapping parameters -> exception should be thrown.


TestWrongParameterType

public void TestWrongParameterType()
Combination has execute method with not supported parameter type -> exception should be thrown.


TestTwoEffects

public void TestTwoEffects()
Combination has multiple execute methods with effect parameters which is currently not supported; all effect triggers need to be in one execute method. -> exception should be thrown.


TestGetTriggerStates

public void TestGetTriggerStates()
Test whether the trigger states that a combination listens to are correctly extracted via reflection from the execute methods.


TestA

public void TestA()
           throws InterruptedException
Simplest trigger-combination-effect interaction.

Throws:
InterruptedException

TestDisjointCombinations

public void TestDisjointCombinations()
                              throws InterruptedException
Two combinations with totally different triggers.

Throws:
InterruptedException

TestEffect

public void TestEffect()
                throws InterruptedException
A combination that schedules effects and two others listening for these effects.

Throws:
InterruptedException

TestUndo

public void TestUndo()
              throws InterruptedException
Test whether effects re correctly undone, respectively not undone.

Throws:
InterruptedException

TestSpammerSynchronized

public void TestSpammerSynchronized()
                             throws InterruptedException
Spamming of triggers should not overflow the effects queue.

Throws:
InterruptedException

TestSpammer

public void TestSpammer()
                 throws InterruptedException
Spamming of triggers should not overflow the effects queue.

Throws:
InterruptedException