edu.umd.cfar.lamp.viper.util
Class UtilTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byedu.umd.cfar.lamp.viper.util.UtilTest
All Implemented Interfaces:
junit.framework.Test

public class UtilTest
extends junit.framework.TestCase

Testsuite for the geometry package.

See Also:
Test Infected

Constructor Summary
UtilTest(java.lang.String name)
          Constructs a new UnitTest of the given name.
 
Method Summary
protected  void setUp()
          This code is invoked before running any tests.
static junit.framework.Test suite()
          Constructs the Test object that points to the test.
 void testAssignment()
          Tests the hungarian assignment algorithm.
static boolean testAssignment(long[][] data, long sum)
          Helps test hungarian assigment.
 void testMatrixIterators()
          Test the implementors of the MatrixIteratorinterface.
 void testRLE()
          Test run-length-encoded lists.
 void testSparseMatrix()
          Test the SparseMatrixclass.
static boolean testTranspose(long[][] data)
          Makes sure the transpose function works.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UtilTest

public UtilTest(java.lang.String name)
Constructs a new UnitTest of the given name.

Parameters:
name - The name of the test.
Method Detail

setUp

protected void setUp()
This code is invoked before running any tests.


suite

public static junit.framework.Test suite()
Constructs the Test object that points to the test.

Returns:
All the tests to run on this package.

testSparseMatrix

public void testSparseMatrix()
Test the SparseMatrixclass.


testMatrixIterators

public void testMatrixIterators()
Test the implementors of the MatrixIteratorinterface.


testAssignment

public void testAssignment()
Tests the hungarian assignment algorithm.


testAssignment

public static boolean testAssignment(long[][] data,
                                     long sum)
Helps test hungarian assigment.

Parameters:
data - the bipartite graph weights
sum - the optimal sum
Returns:
if found a matching that equals the optimal sum

testTranspose

public static boolean testTranspose(long[][] data)
Makes sure the transpose function works.

Parameters:
data - the data to transpose
Returns:
true if the transpose worked.

testRLE

public void testRLE()
Test run-length-encoded lists.