Search in sources :

Example 1 with Label

use of com.newsrob.Label in project newsrob by marianokamp.

the class TestUtil method populateDatabaseWithDataSet1.

public static void populateDatabaseWithDataSet1(EntryManager entryManager) {
    Label l1 = new Label();
    l1.setName("l1");
    Label l2 = new Label();
    l2.setName("l2");
    // 1st article
    Entry e = new Entry();
    e.setAtomId("atomid1");
    e.setFeedTitle("feed_title");
    e.setFeedAtomId("feed_atom_id1");
    e.setTitle("title");
    e.setUpdated(new Date(2010, 10, 15).getTime() * 1000);
    e.addLabel(l1);
    entryManager.insert(e);
    // 2nd article --- READ
    e = new Entry();
    e.setAtomId("atomid2");
    e.setFeedTitle("feed_title2");
    e.setFeedAtomId("feed_atom_id2");
    e.setTitle("title2");
    e.setUpdated(new Date(2010, 10, 14).getTime() * 1000);
    e.addLabel(l1);
    e.addLabel(l2);
    e.setReadState(ReadState.READ);
    entryManager.insert(e);
    // 3rd article
    e = new Entry();
    e.setAtomId("atomid3");
    e.setFeedTitle("feed_title1");
    e.setFeedAtomId("feed_atom_id1");
    e.setTitle("title3");
    e.setUpdated(new Date(2010, 10, 16).getTime() * 1000);
    e.addLabel(l2);
    entryManager.insert(e);
    // 4th article
    e = new Entry();
    e.setAtomId("atomid4");
    e.setFeedTitle("feed_title1");
    e.setFeedAtomId("feed_atom_id1");
    e.setTitle("title4");
    e.setUpdated(new Date(2010, 10, 17).getTime() * 1000);
    e.addLabel(l2);
    entryManager.insert(e);
    // 5th article
    e = new Entry();
    e.setAtomId("atomid5");
    e.setFeedTitle("feed_title1");
    e.setFeedAtomId("feed_atom_id1");
    e.setTitle("title5");
    e.setUpdated(new Date(2010, 10, 18).getTime() * 1000);
    e.addLabel(l2);
    entryManager.insert(e);
}
Also used : Entry(com.newsrob.Entry) Label(com.newsrob.Label) Date(java.util.Date)

Example 2 with Label

use of com.newsrob.Label in project newsrob by marianokamp.

the class DashboardListActivityTests method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    setActivityInitialTouchMode(false);
    activity = getActivity();
    listView = (ListView) activity.findViewById(android.R.id.list);
    entryManager = EntryManager.getInstance(activity);
    Label l1 = new Label();
    l1.setName("l1");
    Label l2 = new Label();
    l2.setName("l2");
    // 1st article
    Entry e = new Entry();
    e.setAtomId("atomid");
    e.setFeedTitle("feed_title");
    e.setFeedAtomId("feed_atom_id");
    e.setTitle("title");
    e.setUpdated(new Date().getTime() * 1000);
    entryManager.insert(e);
    // 2nd article
    e.setAtomId("atomid_2");
    e.setTitle("title2");
    e.addLabel(l1);
    entryManager.insert(e);
    // 3rd article
    e.setAtomId("atomid_3");
    e.setTitle("title3");
    e.setFeedTitle("feed_title2");
    e.setFeedAtomId("feed_atom_id2");
    e.addLabel(l2);
    entryManager.insert(e);
    entryManager.fireModelUpdated();
    System.out.println("Loaded db.");
}
Also used : Entry(com.newsrob.Entry) Label(com.newsrob.Label) Date(java.util.Date)

Example 3 with Label

use of com.newsrob.Label in project newsrob by marianokamp.

the class DifferentialUpdateTests method createTestDataSet1.

private void createTestDataSet1() {
    Label l1 = new Label();
    l1.setName("l1");
    Label l2 = new Label();
    l2.setName("l2");
    // 1st article
    Entry e = new Entry();
    e.setAtomId(getAtomIdForArticle(1));
    e.setReadState(ReadState.READ);
    e.setReadStatePending(false);
    e.setFeedTitle("feed_title");
    e.setFeedAtomId("feed_atom_id");
    e.setTitle("title");
    e.setUpdated(new Date().getTime() * 1000);
    entryManager.insert(e);
    // 2nd article
    e = new Entry();
    e.setAtomId(getAtomIdForArticle(2));
    e.setFeedTitle("feed_title");
    e.setFeedAtomId("feed_atom_id");
    e.setReadState(ReadState.UNREAD);
    e.setReadStatePending(false);
    e.setTitle("title");
    e.setUpdated(new Date().getTime() * 1000);
    entryManager.insert(e);
    // 3rd article
    e = new Entry();
    e.setAtomId(getAtomIdForArticle(3));
    e.setFeedTitle("feed_title");
    e.setFeedAtomId("feed_atom_id");
    e.setReadState(ReadState.PINNED);
    e.setReadStatePending(false);
    e.setTitle("title");
    e.setUpdated(new Date().getTime() * 1000);
    entryManager.insert(e);
}
Also used : Entry(com.newsrob.Entry) Label(com.newsrob.Label) Date(java.util.Date)

Example 4 with Label

use of com.newsrob.Label in project newsrob by marianokamp.

the class LikeStateTests method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    entryManager = EntryManager.getInstance(getInstrumentation().getTargetContext());
    Label l1 = new Label();
    l1.setName("l1");
    Label l2 = new Label();
    l2.setName("l2");
    // 1st article
    Entry e = new Entry();
    e.setAtomId("atomid");
    e.setFeedTitle("feed_title");
    e.setFeedAtomId("feed_atom_id");
    e.setTitle("title");
    e.setUpdated(new Date().getTime() * 1000);
    entryManager.insert(e);
    // 2nd article
    e = new Entry();
    e.setAtomId("atomid2");
    e.setFeedTitle("feed_title");
    e.setFeedAtomId("feed_atom_id");
    e.setTitle("title");
    e.setUpdated(new Date().getTime() * 1000);
    entryManager.insert(e);
    System.out.println("Loaded db.");
}
Also used : Entry(com.newsrob.Entry) Label(com.newsrob.Label) Date(java.util.Date)

Aggregations

Entry (com.newsrob.Entry)4 Label (com.newsrob.Label)4 Date (java.util.Date)4