uk.ac.cam.juliet.twitter.testing
Class BayesClassifierTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by uk.ac.cam.juliet.twitter.testing.BayesClassifierTest
All Implemented Interfaces:
junit.framework.Test

public class BayesClassifierTest
extends junit.framework.TestCase


Field Summary
(package private)  BayesClassifier classifier
           
 
Constructor Summary
BayesClassifierTest()
           
 
Method Summary
 void testExtractFeatures()
          tests BayesClassifier.
 void testGetConditionalProbability()
          tests BayesClassifier.
 void testGetSentimentScore1()
          tests BayesClassifier.
 void testGetSentimentScore2()
          tests BayesClassifier.
 void testIsExempted()
          tests BayesClassifier.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

classifier

BayesClassifier classifier
Constructor Detail

BayesClassifierTest

public BayesClassifierTest()
                    throws java.sql.SQLException,
                           java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException
Method Detail

testIsExempted

public void testIsExempted()
tests BayesClassifier. isExempted(Status)


testGetConditionalProbability

public void testGetConditionalProbability()
tests BayesClassifier. getConditionalProbability(String, Classification)


testExtractFeatures

public void testExtractFeatures()
tests BayesClassifier. extractFeatures(String)


testGetSentimentScore1

public void testGetSentimentScore1()
tests BayesClassifier. getSentimentScore(String) on 2 sample tweets and asserts that they are correctly classified


testGetSentimentScore2

public void testGetSentimentScore2()
tests BayesClassifier. getSentimentScore(String) on 2000 tweets sample, asserts that >85% of tweets scoring above 0.75 are positive tweets