Search in sources :

Example 1 with DataList

use of main.database.DataList in project Info-Evaluation by TechnionYP5777.

the class DataListTest method test4.

@Test
public void test4() {
    final TableTuple tup = new TableTuple("Charlie Sheen", "02/12/2016", "arrest on domestic violence charges");
    final DataList dl = new DataList();
    dl.insert("Justin Bieber", "23/01/2015", "drunk driving");
    assertEquals(1, dl.getNumOfTuples());
    dl.insert(tup);
    assertEquals(2, dl.getNumOfTuples());
    final DataList dl2 = new DataList();
    dl2.insert("Lindsay Lohan", "26/05/2007", "driving under influence and possession of cocaine");
    final TableTuple tup2 = new TableTuple("Lindsay Lohan", "24/07/2007", "driving under influence and possession of cocaine");
    dl2.insert(tup2);
    dl2.merge(dl);
    assertEquals(4, dl2.getNumOfTuples());
    assert dl2.getList().contains(tup);
    assert dl2.getList().contains(tup2);
}
Also used : TableTuple(main.database.TableTuple) DataList(main.database.DataList) Test(org.junit.Test)

Example 2 with DataList

use of main.database.DataList in project Info-Evaluation by TechnionYP5777.

the class DataListTest method test1.

@Test
public void test1() {
    final TableTuple tup = new TableTuple("Charlie Sheen", "02/12/2016", "arrest on domestic violence charges");
    final DataList dl = new DataList();
    assertEquals(0, dl.getNumOfTuples());
    dl.insert(tup);
    assertEquals(1, dl.getNumOfTuples());
}
Also used : TableTuple(main.database.TableTuple) DataList(main.database.DataList) Test(org.junit.Test)

Example 3 with DataList

use of main.database.DataList in project Info-Evaluation by TechnionYP5777.

the class MySQLConnectorTest method initializeDatabase.

@Before
public void initializeDatabase() throws SQLException {
    clearDB();
    TableTuple t1 = new TableTuple("Justin Bieber", "01/23/2014", "suspicion of driving under the influence and driving with an expired license");
    t1.addKeyWord("driving");
    t1.addKeyWord("influence");
    t1.addKeyWord("expired license");
    TableTuple t2 = new TableTuple("Columbus Short", "02/14/2014", "physically attacking his wife");
    t2.addKeyWord("wife attacking");
    TableTuple t3 = new TableTuple("Soulja Boy", "01/22/2014", "possession of a loaded gun");
    t3.addKeyWord("gun possession");
    TableTuple t4 = new TableTuple("Chris Kattan", "02/10/2015", "suspicion of drunk driving");
    t4.addKeyWord("drunk driving");
    TableTuple t5 = new TableTuple("Suge Knight", "01/29/2015", "involved in a fatal hit run");
    t5.addKeyWord("hit and run");
    TableTuple t6 = new TableTuple("Emile Hirsch", "02/12/2015", "assault charges");
    t6.addKeyWord("assault");
    TableTuple t7 = new TableTuple("Austin Chumlee Russell", "03/09/2016", "sexual assault");
    t7.addKeyWord("assault");
    TableTuple t8 = new TableTuple("Track Palin", "01/18/2016", "charges of fourth-degree assault and interfering with the report of a domestic violence crime");
    t8.addKeyWord("assault");
    t8.addKeyWord("violence");
    TableTuple t9 = new TableTuple("Don McLean", "01/17/2015", "misdemeanor domestic violence charges");
    t9.addKeyWord("violence");
    DataList dl = new DataList();
    dl.insert(t1);
    dl.insert(t2);
    dl.insert(t3);
    dl.insert(t4);
    dl.insert(t5);
    dl.insert(t6);
    dl.insert(t7);
    dl.insert(t8);
    dl.insert(t9);
    addEvents(dl);
    addAllKeywords(dl);
}
Also used : TableTuple(main.database.TableTuple) DataList(main.database.DataList) Before(org.junit.Before)

Example 4 with DataList

use of main.database.DataList in project Info-Evaluation by TechnionYP5777.

the class DataListTest method test3.

@Test
public void test3() {
    final TableTuple tup = new TableTuple("Charlie Sheen", "02/12/2016", "arrest on domestic violence charges");
    final DataList dl = new DataList();
    dl.insert("Justin Bieber", "23/01/2015", "drunk driving");
    assertEquals(1, dl.getNumOfTuples());
    dl.insert(tup);
    assertEquals(2, dl.getNumOfTuples());
    final DataList dl2 = new DataList(dl);
    assertEquals(2, dl2.getNumOfTuples());
    assert dl2.getList().contains(tup);
}
Also used : TableTuple(main.database.TableTuple) DataList(main.database.DataList) Test(org.junit.Test)

Example 5 with DataList

use of main.database.DataList in project Info-Evaluation by TechnionYP5777.

the class DataListTest method test2.

@Test
public void test2() {
    final TableTuple tup = new TableTuple("Charlie Sheen", "02/12/2016", "arrest on domestic violence charges");
    final DataList dl = new DataList();
    dl.insert("Justin Bieber", "23/01/2015", "drunk driving");
    assertEquals(1, dl.getNumOfTuples());
    dl.insert(tup);
    assertEquals(2, dl.getNumOfTuples());
}
Also used : TableTuple(main.database.TableTuple) DataList(main.database.DataList) Test(org.junit.Test)

Aggregations

DataList (main.database.DataList)7 TableTuple (main.database.TableTuple)7 Test (org.junit.Test)5 Before (org.junit.Before)2 AnalyzePage (main.Analyze.AnalyzePage)1 InteractiveTableTuple (main.database.InteractiveTableTuple)1