cst.test
Class TestCaseFilters

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by cst.test.AbstractCSTTestCase
              extended by cst.test.TestCaseFilters
All Implemented Interfaces:
junit.framework.Test

public class TestCaseFilters
extends AbstractCSTTestCase


 Copyright 2010 Medical Research Council Unit for Lifelong Health and Ageing
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software 
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.  
 

Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Field Summary
 
Fields inherited from class cst.test.AbstractCSTTestCase
adminServiceAPI, adminUser, DATE_FORMAT, endUser, loggingServiceAPI, sampleTrialSubjectModel, sessionProperties, simpleDateFormat, testDataSet
 
Constructor Summary
TestCaseFilters(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testAllFilterN1()
           
 void testCompleteFilterN1()
          private void printResults(String header, ArrayList results) { System.out.println("============="+header+"========BEGIN"); for (String result : results) { System.out.println("RESULT:"+result); } System.out.println("============="+header+"========END"); }
 void testCoreAndCompletionFilterA1()
          apply both a core field filter and a completion filter.
 void testCoreAndCompletionFilterA2()
          apply both a core field filter and a completion filter.
 void testCoreAndCompletionFilterN1()
          apply both a core field filter and a completion filter and return >= 1 result
 void testCoreAndDateTypeFilterA1()
          apply both a core field filter and a date type filter.
 void testCoreAndDateTypeFilterA2()
          apply both a core field filter and a date type filter.
 void testCoreAndDateTypeFilterN1()
          apply both a core field filter and a date type filter which return >=1 results
 void testCoreAndDateTypeFilterN2()
          apply both a core field filter and a date type filter which return >=1 results
 void testDateTypeBetweenN1()
          apply a date filter begin date <= X <= end date where >=1 result returned.
 void testDateTypeBetweenN2()
          apply a date filter begin date <= X <= end date where no results returned.
 void testDateTypeValueEqualsA1()
          apply a date filter, X = date, no results returned.
 void testDateTypeValueEqualsN1()
          apply a date filter, X = date, >1 results returned.
 void testDateTypeValueEqualsN2()
          apply a date filter, X = date, 1 results returned.
 void testDateTypeValueGreaterThanA1()
          apply a date filter, X > date, no results returned.
 void testDateTypeValueGreaterThanEqualA1()
          apply a date filter, X >= date, no results returned.
 void testDateTypeValueGreaterThanEqualN1()
          apply a date filter, X >= date, >1 results returned.
 void testDateTypeValueGreaterThanN1()
          apply a date filter, X > date, >1 results returned.
 void testDateTypeValueLessThanA1()
          apply a date filter, X < date, no results returned.
 void testDateTypeValueLessThanEqualA1()
          apply a date filter, X < date, no results returned.
 void testDateTypeValueLessThanEqualN1()
          apply a date filter, X <= date, >1 results returned.
 void testDateTypeValueLessThanN1()
          apply a date filter, X < date, >1 results returned.
 void testDateTypeValuePresentN1()
          apply a date filter, X is not blank end, where results returned.
 void testDateTypeValuePresentN2()
          apply a date filter, X is blank end, where results returned.
 void testIncompleteFilterN1()
           
 void testOnlyCoreFilterN1()
          apply only a core filter and return >= 1 results
 
Methods inherited from class cst.test.AbstractCSTTestCase
populateDatabase, userTestDataSet
 
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, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestCaseFilters

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

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class AbstractCSTTestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class AbstractCSTTestCase
Throws:
java.lang.Exception

testCompleteFilterN1

public void testCompleteFilterN1()
private void printResults(String header, ArrayList results) { System.out.println("============="+header+"========BEGIN"); for (String result : results) { System.out.println("RESULT:"+result); } System.out.println("============="+header+"========END"); }


testIncompleteFilterN1

public void testIncompleteFilterN1()

testAllFilterN1

public void testAllFilterN1()

testOnlyCoreFilterN1

public void testOnlyCoreFilterN1()
apply only a core filter and return >= 1 results


testDateTypeBetweenN1

public void testDateTypeBetweenN1()
apply a date filter begin date <= X <= end date where >=1 result returned.


testDateTypeBetweenN2

public void testDateTypeBetweenN2()
apply a date filter begin date <= X <= end date where no results returned.


testDateTypeValuePresentN1

public void testDateTypeValuePresentN1()
apply a date filter, X is not blank end, where results returned.


testDateTypeValuePresentN2

public void testDateTypeValuePresentN2()
apply a date filter, X is blank end, where results returned.


testDateTypeValueEqualsN1

public void testDateTypeValueEqualsN1()
apply a date filter, X = date, >1 results returned.


testDateTypeValueEqualsN2

public void testDateTypeValueEqualsN2()
apply a date filter, X = date, 1 results returned.


testDateTypeValueEqualsA1

public void testDateTypeValueEqualsA1()
apply a date filter, X = date, no results returned.


testDateTypeValueGreaterThanN1

public void testDateTypeValueGreaterThanN1()
apply a date filter, X > date, >1 results returned.


testDateTypeValueGreaterThanA1

public void testDateTypeValueGreaterThanA1()
apply a date filter, X > date, no results returned.


testDateTypeValueGreaterThanEqualN1

public void testDateTypeValueGreaterThanEqualN1()
apply a date filter, X >= date, >1 results returned.


testDateTypeValueGreaterThanEqualA1

public void testDateTypeValueGreaterThanEqualA1()
apply a date filter, X >= date, no results returned.


testDateTypeValueLessThanN1

public void testDateTypeValueLessThanN1()
apply a date filter, X < date, >1 results returned.


testDateTypeValueLessThanA1

public void testDateTypeValueLessThanA1()
apply a date filter, X < date, no results returned.


testDateTypeValueLessThanEqualN1

public void testDateTypeValueLessThanEqualN1()
apply a date filter, X <= date, >1 results returned.


testDateTypeValueLessThanEqualA1

public void testDateTypeValueLessThanEqualA1()
apply a date filter, X < date, no results returned.


testCoreAndDateTypeFilterN1

public void testCoreAndDateTypeFilterN1()
apply both a core field filter and a date type filter which return >=1 results


testCoreAndDateTypeFilterN2

public void testCoreAndDateTypeFilterN2()
apply both a core field filter and a date type filter which return >=1 results


testCoreAndDateTypeFilterA1

public void testCoreAndDateTypeFilterA1()
apply both a core field filter and a date type filter. The core field filter has matches but the date type filter does not


testCoreAndDateTypeFilterA2

public void testCoreAndDateTypeFilterA2()
apply both a core field filter and a date type filter. The core field filter has no matches but the date type filter does have matches


testCoreAndCompletionFilterN1

public void testCoreAndCompletionFilterN1()
apply both a core field filter and a completion filter and return >= 1 result


testCoreAndCompletionFilterA1

public void testCoreAndCompletionFilterA1()
apply both a core field filter and a completion filter. The core field filter has results but the completion filter does not.


testCoreAndCompletionFilterA2

public void testCoreAndCompletionFilterA2()
apply both a core field filter and a completion filter. The core field filter has no results but the completion filter does have results.