Example usage for com.liferay.portal.kernel.test AssertUtils assertEqualsIgnoreCase

List of usage examples for com.liferay.portal.kernel.test AssertUtils assertEqualsIgnoreCase

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.test AssertUtils assertEqualsIgnoreCase.

Prototype

public static void assertEqualsIgnoreCase(String expectedString, String actualString) 

Source Link

Usage

From source file:com.liferay.adaptive.media.journal.internal.exportimport.data.handler.test.AMJournalArticleStagedModelDataHandlerTest.java

License:Open Source License

private void _assertXMLEquals(String expectedXML, String actualXML) throws Exception {

    AssertUtils.assertEqualsIgnoreCase(SAXReaderUtil.read(expectedXML).formattedString(),
            SAXReaderUtil.read(actualXML).formattedString());
}

From source file:com.liferay.bookmarks.service.test.BookmarksFolderServiceTest.java

License:Open Source License

@Test
public void testSearchAndVerifyDocs() throws Exception {
    ServiceContext serviceContext = ServiceContextTestUtil.getServiceContext(_group.getGroupId());

    BookmarksFolder folder = BookmarksTestUtil.addFolder(_group.getGroupId(), RandomTestUtil.randomString());

    BookmarksEntry entry = BookmarksTestUtil.addEntry(folder.getFolderId(), true, serviceContext);

    SearchContext searchContext = BookmarksTestUtil.getSearchContext(entry.getCompanyId(), entry.getGroupId(),
            entry.getFolderId(), "test");

    Indexer<BookmarksEntry> indexer = IndexerRegistryUtil.getIndexer(BookmarksEntry.class);

    Hits hits = indexer.search(searchContext);

    Assert.assertEquals(1, hits.getLength());

    List<Document> results = hits.toList();

    for (Document doc : results) {
        Assert.assertEquals(entry.getCompanyId(), GetterUtil.getLong(doc.get(Field.COMPANY_ID)));
        Assert.assertEquals(BookmarksEntry.class.getName(), doc.get(Field.ENTRY_CLASS_NAME));
        Assert.assertEquals(entry.getEntryId(), GetterUtil.getLong(doc.get(Field.ENTRY_CLASS_PK)));
        AssertUtils.assertEqualsIgnoreCase(entry.getName(), doc.get(Field.TITLE));
        Assert.assertEquals(entry.getUrl(), doc.get(Field.URL));
    }/*w  w w .  ja v a  2s .c  o  m*/
}