예제 #1
0
  public void testUpdate() {
    // create items
    final List<Integer> items = TestCaseDaoHelper.fixCreateItems(mItemDAO, 1);
    final Item item = mItemDAO.findItem(items.get(0));
    LOG.debug("Old item title - " + item.getTitle());
    item.setTitle(DOCUMENT_NEW_TITLE);

    // update item object
    mItemDAO.updateItem(item);
    assertNotNull("Object has been changed.", item);
    assertEquals("Newly assigned Object tite doesn't match.", item.getTitle(), DOCUMENT_NEW_TITLE);
  }
예제 #2
0
  /** Test unicoded text */
  public void testUnicodedText() {
    final String unicodedText = "সাহায্য করুন কেউ";
    final Item newItem =
        new Item.Builder()
            .title(unicodedText)
            .document("<fields><field name='abc'>" + unicodedText + "</field></fields>")
            .build();
    final Integer itemId = mItemDAO.createItem(newItem);
    assertNotNull(itemId);

    // retrieve the newly created item
    final Item item = mItemDAO.findItem(itemId);
    assertNotNull(item);
    assertEquals(item.getTitle(), unicodedText);
    System.out.println("Item - " + item);

    // find newly created item by the unicode text
    final List<Item> items =
        mItemDAO.findItems(new Item.Builder().title(unicodedText).build(), 0, 1);
    mDontCleanup = true;
  }