jimm.datavision.test
Class AggregateTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by jimm.datavision.test.AggregateTest
All Implemented Interfaces:
junit.framework.Test

public class AggregateTest
extends junit.framework.TestCase

Tests the aggregate functions by reading a report from an XML file, running it, and verifying the output.

These tests are tightly coupled with the contents of the file aggregate_test.xml and the contents of the data generated by a MockAggregateDataSource.

Author:
Jim Menard, jimm@io.com

Field Summary
protected  java.util.Collection aggrFields
           
protected static java.io.File EXAMPLE_REPORT
           
protected static java.io.File OUT_FILE
           
protected  Report report
           
 
Constructor Summary
AggregateTest(java.lang.String name)
           
 
Method Summary
protected  void expect(int lineNum, java.lang.String value, java.io.BufferedReader in)
           
static void main(java.lang.String[] args)
           
 void runTest(java.lang.String funcName, java.lang.String[] expected)
           
protected  void setAggregateFieldFunction(java.lang.String function)
           
 void setUp()
           
static junit.framework.Test suite()
           
 void tearDown()
           
 void testAverage()
           
 void testCount()
           
 void testHasParameterFields()
           
 void testMax()
           
 void testMin()
           
 void testStddev()
           
 void testSum()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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
 

Field Detail

EXAMPLE_REPORT

protected static final java.io.File EXAMPLE_REPORT

OUT_FILE

protected static final java.io.File OUT_FILE

report

protected Report report

aggrFields

protected java.util.Collection aggrFields
Constructor Detail

AggregateTest

public AggregateTest(java.lang.String name)
Method Detail

suite

public static junit.framework.Test suite()

setUp

public void setUp()
           throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

public void tearDown()
Overrides:
tearDown in class junit.framework.TestCase

testSum

public void testSum()
             throws java.io.IOException,
                    java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

testMin

public void testMin()
             throws java.io.IOException,
                    java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

testMax

public void testMax()
             throws java.io.IOException,
                    java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

testCount

public void testCount()
               throws java.io.IOException,
                      java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

testAverage

public void testAverage()
                 throws java.io.IOException,
                        java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

testStddev

public void testStddev()
                throws java.io.IOException,
                       java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

runTest

public void runTest(java.lang.String funcName,
                    java.lang.String[] expected)
             throws java.io.IOException,
                    java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

setAggregateFieldFunction

protected void setAggregateFieldFunction(java.lang.String function)

expect

protected void expect(int lineNum,
                      java.lang.String value,
                      java.io.BufferedReader in)
               throws java.io.IOException
Throws:
java.io.IOException

testHasParameterFields

public void testHasParameterFields()

main

public static void main(java.lang.String[] args)