Search in sources :

Example 1 with AnalyzePage

use of main.Analyze.AnalyzePage in project Info-Evaluation by TechnionYP5777.

the class AnalyzePageTest method testInteractiveParagraph.

@Test
public void testInteractiveParagraph() {
    List<InteractiveTableTuple> detailsTable = new AnalyzePage(text).getInteractiveDetails();
    assertEquals(detailsTable.size(), 4);
    assert "Soulja Boy".equals(detailsTable.get(2).getName());
    boolean realReason = false;
    for (ReasonPair ¢ : detailsTable.get(1).getReasons()) if ("driving under influence".equals(¢.getReason()))
        realReason = true;
    assert realReason;
    assert "12/29/2013".equals(detailsTable.get(3).getDate());
}
Also used : AnalyzePage(main.Analyze.AnalyzePage) ReasonPair(main.database.ReasonPair) InteractiveTableTuple(main.database.InteractiveTableTuple) Test(org.junit.Test)

Example 2 with AnalyzePage

use of main.Analyze.AnalyzePage in project Info-Evaluation by TechnionYP5777.

the class AnalyzePageTest method testBigParagraph.

@Test
public void testBigParagraph() {
    DataList detailsTable = new AnalyzePage(text).getDetails();
    assertEquals(detailsTable.getNumOfTuples(), 4);
    ArrayList<TableTuple> details = detailsTable.getList();
    assert "Tito Ortiz".equals(details.get(0).getName());
    assert "driving under influence".equals(details.get(0).getReason());
    assert "01/06/2016".equals(details.get(0).getDate());
    assert "David Cassidy".equals(details.get(1).getName());
    assert "driving under influence".equals(details.get(1).getReason());
    assert "01/10/2016".equals(details.get(1).getDate());
    assert "Soulja Boy".equals(details.get(2).getName());
    assert "possession of gun".equals(details.get(2).getReason());
    assert "01/22/2016".equals(details.get(2).getDate());
    assert "12/29/2013".equals(details.get(3).getDate());
    detailsTable = new AnalyzePage(text, "2014").getDetails();
    details = detailsTable.getList();
    assert "01/06/2014".equals(details.get(0).getDate());
    assert "01/10/2014".equals(details.get(1).getDate());
    assert "01/22/2014".equals(details.get(2).getDate());
    assert "12/29/2013".equals(details.get(3).getDate());
}
Also used : DataList(main.database.DataList) TableTuple(main.database.TableTuple) InteractiveTableTuple(main.database.InteractiveTableTuple) AnalyzePage(main.Analyze.AnalyzePage) Test(org.junit.Test)

Aggregations

AnalyzePage (main.Analyze.AnalyzePage)2 InteractiveTableTuple (main.database.InteractiveTableTuple)2 Test (org.junit.Test)2 DataList (main.database.DataList)1 ReasonPair (main.database.ReasonPair)1 TableTuple (main.database.TableTuple)1