use of main.database.InteractiveTableTuple in project Info-Evaluation by TechnionYP5777.
the class InteractiveTableTupleTest method test3.
@Test
public void test3() {
ReasonPair rp = new ReasonPair();
rp.setProbability(0.4);
rp.setReason("stubbing");
LinkedList<ReasonPair> lst = new LinkedList<>();
lst.add(rp);
InteractiveTableTuple t = new InteractiveTableTuple("Justin Bieber", "12/02/2016", lst);
assertEquals(t.getDate(), "12/02/2016");
assertEquals(t.getName(), "Justin Bieber");
assertEquals((t.getRegularDate() + ""), "Fri Dec 02 00:00:00 IST 2016");
assert t.getKeyWords().isEmpty();
assertEquals(t.getReasons().get(0).getProbability(), 0.4, 0);
assertEquals(t.getReasons().get(0).getReason(), "stubbing");
t.addKeyWord("stubbing");
assertEquals(t.getKeyWords().get(0), "stubbing");
t.addKeyWord("arrested");
assertEquals(t.getKeyWords().get(1), "arrested");
}
use of main.database.InteractiveTableTuple in project Info-Evaluation by TechnionYP5777.
the class InteractiveTableTupleTest method test0.
@Test
public void test0() {
InteractiveTableTuple t = new InteractiveTableTuple();
assertNull(t.getDate());
assertNull(t.getName());
assertNull(t.getRegularDate());
assert t.getKeyWords().isEmpty();
assert t.getReasons().isEmpty();
}
use of main.database.InteractiveTableTuple 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());
}
use of main.database.InteractiveTableTuple in project Info-Evaluation by TechnionYP5777.
the class InteractiveTableTupleTest method test1.
@Test
public void test1() {
InteractiveTableTuple t = new InteractiveTableTuple("Justin Bieber", "12/02/2016", null);
assertEquals(t.getDate(), "12/02/2016");
assertEquals(t.getName(), "Justin Bieber");
assertEquals((t.getRegularDate() + ""), "Fri Dec 02 00:00:00 IST 2016");
assert t.getKeyWords().isEmpty();
}
use of main.database.InteractiveTableTuple in project Info-Evaluation by TechnionYP5777.
the class InteractiveTableTupleTest method test2.
@Test
public void test2() {
InteractiveTableTuple t = new InteractiveTableTuple();
t.setName("Justin Bieber");
t.setDate("12/02/2016");
assertEquals(t.getDate(), "12/02/2016");
assertEquals(t.getName(), "Justin Bieber");
assertEquals((t.getRegularDate() + ""), "Fri Dec 02 00:00:00 IST 2016");
assert t.getKeyWords().isEmpty();
ReasonPair rp = new ReasonPair();
rp.setProbability(0.4);
rp.setReason("stubbing");
LinkedList<ReasonPair> lst = new LinkedList<>();
lst.add(rp);
t.setReasons(lst);
assertEquals(t.getReasons().get(0).getProbability(), 0.4, 0);
assertEquals(t.getReasons().get(0).getReason(), "stubbing");
}
Aggregations