org.carrot2.core.test
Class ClusteringProcessTestBase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.carrot2.core.test.ClusteringProcessTestBase
All Implemented Interfaces:
junit.framework.Test

public abstract class ClusteringProcessTestBase
extends junit.framework.TestCase

A base class for testing clustering algorithms. This class contains utility code for setting up a LocalController and passing through XML data sets.

Author:
Dawid Weiss

Field Summary
 org.apache.log4j.Logger log
          Logger instance attached to this test.
 
Constructor Summary
ClusteringProcessTestBase(String testName)
          JUnit-specific constructor.
 
Method Summary
protected  void addCustomComponents(LocalControllerBase controller)
          Set up your own filters and add them to the controller (if needed).
protected  void assertResultsInRange(InputStream inputStream, String query, int requestedDocuments, Range docsRange, Range clustersRange, Map requestParameters)
          Assert the processing of an input XML stream in Carrot2 format causes no error and the results are within the given ranges (documents and clusters).
protected  void assertResultsInRange(String query, int requestedDocuments, Range documents, Range clusters, Map requestParameters)
          Processes a sample XML file.
protected abstract  String[] getFiltersChain(LocalControllerBase controller)
          Implement this method and return the filters chain used for clustering.
protected  void setUp()
           
protected  void tearDown()
           
 
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

log

public final org.apache.log4j.Logger log
Logger instance attached to this test.

Constructor Detail

ClusteringProcessTestBase

public ClusteringProcessTestBase(String testName)
JUnit-specific constructor.

Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

addCustomComponents

protected void addCustomComponents(LocalControllerBase controller)
Set up your own filters and add them to the controller (if needed).


getFiltersChain

protected abstract String[] getFiltersChain(LocalControllerBase controller)
Implement this method and return the filters chain used for clustering.


assertResultsInRange

protected final void assertResultsInRange(String query,
                                          int requestedDocuments,
                                          Range documents,
                                          Range clusters,
                                          Map requestParameters)
                                   throws Exception
Processes a sample XML file.

Throws:
Exception
See Also:
assertResultsInRange(InputStream, String, int, Range, Range, Map)

assertResultsInRange

protected final void assertResultsInRange(InputStream inputStream,
                                          String query,
                                          int requestedDocuments,
                                          Range docsRange,
                                          Range clustersRange,
                                          Map requestParameters)
                                   throws Exception
Assert the processing of an input XML stream in Carrot2 format causes no error and the results are within the given ranges (documents and clusters).

Throws:
Exception


Copyright (c) Dawid Weiss, Stanislaw Osinski