Liferay 7.0-ce-b4

com.liferay.portlet.asset.search.test
Class BaseAssetSearchTestCase

java.lang.Object
  extended by com.liferay.portlet.asset.search.test.BaseAssetSearchTestCase

public abstract class BaseAssetSearchTestCase
extends Object


Field Summary
static AggregateTestRule aggregateTestRule
           
 
Constructor Summary
BaseAssetSearchTestCase()
           
 
Method Summary
protected abstract  BaseModel<?> addBaseModel(BaseModel<?> parentBaseModel, Map<Locale,String> titleMap, ServiceContext serviceContext)
           
protected  BaseModel<?> addBaseModel(BaseModel<?> parentBaseModel, String keywords, Date expirationDate, ServiceContext serviceContext)
           
protected abstract  BaseModel<?> addBaseModel(BaseModel<?> parentBaseModel, String keywords, ServiceContext serviceContext)
           
protected  List<BaseModel<?>> addBaseModels(Group[] groups, String keywords, ServiceContext serviceContext)
           
protected  BaseModel<?> addBaseModelWithClassType(BaseModel<?> parentBaseModel, String keywords, ServiceContext serviceContext)
           
protected  BaseModel<?> addBaseModelWithWorkflow(BaseModel<?> parentBaseModel, String keywords, boolean approved, ServiceContext serviceContext)
           
protected  void assertCount(int expectedCount, AssetEntryQuery assetEntryQuery, SearchContext searchContext)
           
protected  void assertCount(int expectedCount, AssetEntryQuery assetEntryQuery, SearchContext searchContext, int start, int end)
           
protected  String[] format(Date[] dates, DateFormat dateFormat)
           
protected  Date[] generateRandomDates(Date startDate, int size)
           
protected abstract  Class<?> getBaseModelClass()
           
protected  String getBaseModelClassName()
           
protected  long[] getClassTypeIds()
           
protected  Date[] getExpirationDates(List<AssetEntry> assetEntries, String orderByType)
           
protected  String[] getOrderedTitles(List<Map<Locale,String>> orderedTitleMaps, Locale locale)
           
protected  BaseModel<?> getParentBaseModel(Group group, ServiceContext serviceContext)
           
protected abstract  String getSearchKeywords()
           
protected  String[] getTitles(List<AssetEntry> assetEntries, Locale locale)
           
protected  boolean isLocalizableTitle()
           
protected  List<AssetEntry> search(AssetEntryQuery assetEntryQuery, SearchContext searchContext)
           
protected  int searchCount(AssetEntryQuery assetEntryQuery, SearchContext searchContext, int start, int end)
           
 void setUp()
           
 void testAllAssetCategories1()
           
 void testAllAssetCategories2()
           
 void testAllAssetCategories3()
           
 void testAllAssetCategories4()
           
 void testAllAssetTags1()
           
 void testAllAssetTags2()
           
 void testAllAssetTags3()
           
 void testAllAssetTags4()
           
 void testAllAssetTagsMultipleGroups1()
           
 void testAllAssetTagsMultipleGroups2()
           
 void testAllAssetTagsMultipleGroups3()
           
 void testAllAssetTagsMultipleGroups4()
           
 void testAnyAssetCategories1()
           
 void testAnyAssetCategories2()
           
 void testAnyAssetCategories3()
           
 void testAnyAssetCategories4()
           
 void testAnyAssetTags1()
           
 void testAnyAssetTags2()
           
 void testAnyAssetTags3()
           
 void testAnyAssetTags4()
           
protected  void testAssetCategorization(AssetEntryQuery assetEntryQuery, int expectedResults)
           
protected  void testAssetCategorization(Group[] groups, AssetEntryQuery assetEntryQuery, int expectedResults)
           
 void testAssetCategoryAllAndAny()
           
 void testAssetCategoryNotAllAndAll()
           
 void testAssetCategoryNotAllAndAny()
           
 void testAssetCategoryNotAllAndNotAny()
           
 void testAssetCategoryNotAnyAndAll()
           
 void testAssetCategoryNotAnyAndAny()
           
 void testAssetTagsAllAndAny()
           
 void testAssetTagsNotAllAndAll()
           
 void testAssetTagsNotAllAndAny()
           
 void testAssetTagsNotAllAndNotAny()
           
 void testAssetTagsNotAnyAndAll()
           
 void testAssetTagsNotAnyAndAny()
           
 void testClassName1()
           
 void testClassName2()
           
protected  void testClassNames(AssetEntryQuery assetEntryQuery, int expectedResult)
           
protected  void testClassTypeIds(AssetEntryQuery assetEntryQuery, boolean classType)
           
 void testClassTypeIds1()
           
 void testClassTypeIds2()
           
 void testGroups()
           
 void testNotAllAssetCategories1()
           
 void testNotAllAssetCategories2()
           
 void testNotAllAssetCategories3()
           
 void testNotAllAssetCategories4()
           
 void testNotAllAssetTags1()
           
 void testNotAllAssetTags2()
           
 void testNotAllAssetTags3()
           
 void testNotAllAssetTags4()
           
 void testNotAllAssetTagsMultipleGroups1()
           
 void testNotAllAssetTagsMultipleGroups2()
           
 void testNotAllAssetTagsMultipleGroups3()
           
 void testNotAllAssetTagsMultipleGroups4()
           
 void testNotAnyAssetCategories1()
           
 void testNotAnyAssetCategories2()
           
 void testNotAnyAssetCategories3()
           
 void testNotAnyAssetCategories4()
           
 void testNotAnyAssetTags1()
           
 void testNotAnyAssetTags2()
           
 void testNotAnyAssetTags3()
           
 void testNotAnyAssetTags4()
           
protected  void testOrderByCreateDate(AssetEntryQuery assetEntryQuery, String orderByType, String[] titles, String[] orderedTitles)
           
 void testOrderByCreateDateAsc()
           
 void testOrderByCreateDateDesc()
           
protected  void testOrderByExpirationDate(AssetEntryQuery assetEntryQuery, String orderByType, Date[] expirationDates)
           
 void testOrderByExpirationDateAsc()
           
 void testOrderByExpirationDateDesc()
           
protected  void testOrderByTitle(AssetEntryQuery assetEntryQuery, String orderByType, List<Map<Locale,String>> titleMaps, List<Map<Locale,String>> orderedTitleMaps, Locale[] locales)
           
 void testOrderByTitleAsc()
           
 void testOrderByTitleDesc()
           
protected  void testPaginationType(AssetEntryQuery assetEntryQuery, int size)
           
 void testPaginationTypeNone()
           
 void testPaginationTypeRegular()
           
 void testPaginationTypeSimple()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aggregateTestRule

public static final AggregateTestRule aggregateTestRule
Constructor Detail

BaseAssetSearchTestCase

public BaseAssetSearchTestCase()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

testAllAssetCategories1

public void testAllAssetCategories1()
                             throws Exception
Throws:
Exception

testAllAssetCategories2

public void testAllAssetCategories2()
                             throws Exception
Throws:
Exception

testAllAssetCategories3

public void testAllAssetCategories3()
                             throws Exception
Throws:
Exception

testAllAssetCategories4

public void testAllAssetCategories4()
                             throws Exception
Throws:
Exception

testAllAssetTags1

public void testAllAssetTags1()
                       throws Exception
Throws:
Exception

testAllAssetTags2

public void testAllAssetTags2()
                       throws Exception
Throws:
Exception

testAllAssetTags3

public void testAllAssetTags3()
                       throws Exception
Throws:
Exception

testAllAssetTags4

public void testAllAssetTags4()
                       throws Exception
Throws:
Exception

testAllAssetTagsMultipleGroups1

public void testAllAssetTagsMultipleGroups1()
                                     throws Exception
Throws:
Exception

testAllAssetTagsMultipleGroups2

public void testAllAssetTagsMultipleGroups2()
                                     throws Exception
Throws:
Exception

testAllAssetTagsMultipleGroups3

public void testAllAssetTagsMultipleGroups3()
                                     throws Exception
Throws:
Exception

testAllAssetTagsMultipleGroups4

public void testAllAssetTagsMultipleGroups4()
                                     throws Exception
Throws:
Exception

testAnyAssetCategories1

public void testAnyAssetCategories1()
                             throws Exception
Throws:
Exception

testAnyAssetCategories2

public void testAnyAssetCategories2()
                             throws Exception
Throws:
Exception

testAnyAssetCategories3

public void testAnyAssetCategories3()
                             throws Exception
Throws:
Exception

testAnyAssetCategories4

public void testAnyAssetCategories4()
                             throws Exception
Throws:
Exception

testAnyAssetTags1

public void testAnyAssetTags1()
                       throws Exception
Throws:
Exception

testAnyAssetTags2

public void testAnyAssetTags2()
                       throws Exception
Throws:
Exception

testAnyAssetTags3

public void testAnyAssetTags3()
                       throws Exception
Throws:
Exception

testAnyAssetTags4

public void testAnyAssetTags4()
                       throws Exception
Throws:
Exception

testAssetCategoryAllAndAny

public void testAssetCategoryAllAndAny()
                                throws Exception
Throws:
Exception

testAssetCategoryNotAllAndAll

public void testAssetCategoryNotAllAndAll()
                                   throws Exception
Throws:
Exception

testAssetCategoryNotAllAndAny

public void testAssetCategoryNotAllAndAny()
                                   throws Exception
Throws:
Exception

testAssetCategoryNotAllAndNotAny

public void testAssetCategoryNotAllAndNotAny()
                                      throws Exception
Throws:
Exception

testAssetCategoryNotAnyAndAll

public void testAssetCategoryNotAnyAndAll()
                                   throws Exception
Throws:
Exception

testAssetCategoryNotAnyAndAny

public void testAssetCategoryNotAnyAndAny()
                                   throws Exception
Throws:
Exception

testAssetTagsAllAndAny

public void testAssetTagsAllAndAny()
                            throws Exception
Throws:
Exception

testAssetTagsNotAllAndAll

public void testAssetTagsNotAllAndAll()
                               throws Exception
Throws:
Exception

testAssetTagsNotAllAndAny

public void testAssetTagsNotAllAndAny()
                               throws Exception
Throws:
Exception

testAssetTagsNotAllAndNotAny

public void testAssetTagsNotAllAndNotAny()
                                  throws Exception
Throws:
Exception

testAssetTagsNotAnyAndAll

public void testAssetTagsNotAnyAndAll()
                               throws Exception
Throws:
Exception

testAssetTagsNotAnyAndAny

public void testAssetTagsNotAnyAndAny()
                               throws Exception
Throws:
Exception

testClassName1

public void testClassName1()
                    throws Exception
Throws:
Exception

testClassName2

public void testClassName2()
                    throws Exception
Throws:
Exception

testClassTypeIds1

public void testClassTypeIds1()
                       throws Exception
Throws:
Exception

testClassTypeIds2

public void testClassTypeIds2()
                       throws Exception
Throws:
Exception

testGroups

public void testGroups()
                throws Exception
Throws:
Exception

testNotAllAssetCategories1

public void testNotAllAssetCategories1()
                                throws Exception
Throws:
Exception

testNotAllAssetCategories2

public void testNotAllAssetCategories2()
                                throws Exception
Throws:
Exception

testNotAllAssetCategories3

public void testNotAllAssetCategories3()
                                throws Exception
Throws:
Exception

testNotAllAssetCategories4

public void testNotAllAssetCategories4()
                                throws Exception
Throws:
Exception

testNotAllAssetTags1

public void testNotAllAssetTags1()
                          throws Exception
Throws:
Exception

testNotAllAssetTags2

public void testNotAllAssetTags2()
                          throws Exception
Throws:
Exception

testNotAllAssetTags3

public void testNotAllAssetTags3()
                          throws Exception
Throws:
Exception

testNotAllAssetTags4

public void testNotAllAssetTags4()
                          throws Exception
Throws:
Exception

testNotAllAssetTagsMultipleGroups1

public void testNotAllAssetTagsMultipleGroups1()
                                        throws Exception
Throws:
Exception

testNotAllAssetTagsMultipleGroups2

public void testNotAllAssetTagsMultipleGroups2()
                                        throws Exception
Throws:
Exception

testNotAllAssetTagsMultipleGroups3

public void testNotAllAssetTagsMultipleGroups3()
                                        throws Exception
Throws:
Exception

testNotAllAssetTagsMultipleGroups4

public void testNotAllAssetTagsMultipleGroups4()
                                        throws Exception
Throws:
Exception

testNotAnyAssetCategories1

public void testNotAnyAssetCategories1()
                                throws Exception
Throws:
Exception

testNotAnyAssetCategories2

public void testNotAnyAssetCategories2()
                                throws Exception
Throws:
Exception

testNotAnyAssetCategories3

public void testNotAnyAssetCategories3()
                                throws Exception
Throws:
Exception

testNotAnyAssetCategories4

public void testNotAnyAssetCategories4()
                                throws Exception
Throws:
Exception

testNotAnyAssetTags1

public void testNotAnyAssetTags1()
                          throws Exception
Throws:
Exception

testNotAnyAssetTags2

public void testNotAnyAssetTags2()
                          throws Exception
Throws:
Exception

testNotAnyAssetTags3

public void testNotAnyAssetTags3()
                          throws Exception
Throws:
Exception

testNotAnyAssetTags4

public void testNotAnyAssetTags4()
                          throws Exception
Throws:
Exception

testOrderByCreateDateAsc

public void testOrderByCreateDateAsc()
                              throws Exception
Throws:
Exception

testOrderByCreateDateDesc

public void testOrderByCreateDateDesc()
                               throws Exception
Throws:
Exception

testOrderByExpirationDateAsc

public void testOrderByExpirationDateAsc()
                                  throws Exception
Throws:
Exception

testOrderByExpirationDateDesc

public void testOrderByExpirationDateDesc()
                                   throws Exception
Throws:
Exception

testOrderByTitleAsc

public void testOrderByTitleAsc()
                         throws Exception
Throws:
Exception

testOrderByTitleDesc

public void testOrderByTitleDesc()
                          throws Exception
Throws:
Exception

testPaginationTypeNone

public void testPaginationTypeNone()
                            throws Exception
Throws:
Exception

testPaginationTypeRegular

public void testPaginationTypeRegular()
                               throws Exception
Throws:
Exception

testPaginationTypeSimple

public void testPaginationTypeSimple()
                              throws Exception
Throws:
Exception

addBaseModel

protected abstract BaseModel<?> addBaseModel(BaseModel<?> parentBaseModel,
                                             Map<Locale,String> titleMap,
                                             ServiceContext serviceContext)
                                      throws Exception
Throws:
Exception

addBaseModel

protected BaseModel<?> addBaseModel(BaseModel<?> parentBaseModel,
                                    String keywords,
                                    Date expirationDate,
                                    ServiceContext serviceContext)
                             throws Exception
Throws:
Exception

addBaseModel

protected abstract BaseModel<?> addBaseModel(BaseModel<?> parentBaseModel,
                                             String keywords,
                                             ServiceContext serviceContext)
                                      throws Exception
Throws:
Exception

addBaseModels

protected List<BaseModel<?>> addBaseModels(Group[] groups,
                                           String keywords,
                                           ServiceContext serviceContext)
                                    throws Exception
Throws:
Exception

addBaseModelWithClassType

protected BaseModel<?> addBaseModelWithClassType(BaseModel<?> parentBaseModel,
                                                 String keywords,
                                                 ServiceContext serviceContext)
                                          throws Exception
Throws:
Exception

addBaseModelWithWorkflow

protected BaseModel<?> addBaseModelWithWorkflow(BaseModel<?> parentBaseModel,
                                                String keywords,
                                                boolean approved,
                                                ServiceContext serviceContext)
                                         throws Exception
Throws:
Exception

assertCount

protected void assertCount(int expectedCount,
                           AssetEntryQuery assetEntryQuery,
                           SearchContext searchContext)
                    throws Exception
Throws:
Exception

assertCount

protected void assertCount(int expectedCount,
                           AssetEntryQuery assetEntryQuery,
                           SearchContext searchContext,
                           int start,
                           int end)
                    throws Exception
Throws:
Exception

format

protected String[] format(Date[] dates,
                          DateFormat dateFormat)

generateRandomDates

protected Date[] generateRandomDates(Date startDate,
                                     int size)

getBaseModelClass

protected abstract Class<?> getBaseModelClass()

getBaseModelClassName

protected String getBaseModelClassName()

getClassTypeIds

protected long[] getClassTypeIds()

getExpirationDates

protected Date[] getExpirationDates(List<AssetEntry> assetEntries,
                                    String orderByType)
                             throws Exception
Throws:
Exception

getOrderedTitles

protected String[] getOrderedTitles(List<Map<Locale,String>> orderedTitleMaps,
                                    Locale locale)
                             throws Exception
Throws:
Exception

getParentBaseModel

protected BaseModel<?> getParentBaseModel(Group group,
                                          ServiceContext serviceContext)
                                   throws Exception
Throws:
Exception

getSearchKeywords

protected abstract String getSearchKeywords()

getTitles

protected String[] getTitles(List<AssetEntry> assetEntries,
                             Locale locale)
                      throws Exception
Throws:
Exception

isLocalizableTitle

protected boolean isLocalizableTitle()

search

protected List<AssetEntry> search(AssetEntryQuery assetEntryQuery,
                                  SearchContext searchContext)
                           throws Exception
Throws:
Exception

searchCount

protected int searchCount(AssetEntryQuery assetEntryQuery,
                          SearchContext searchContext,
                          int start,
                          int end)
                   throws Exception
Throws:
Exception

testAssetCategorization

protected void testAssetCategorization(AssetEntryQuery assetEntryQuery,
                                       int expectedResults)
                                throws Exception
Throws:
Exception

testAssetCategorization

protected void testAssetCategorization(Group[] groups,
                                       AssetEntryQuery assetEntryQuery,
                                       int expectedResults)
                                throws Exception
Throws:
Exception

testClassNames

protected void testClassNames(AssetEntryQuery assetEntryQuery,
                              int expectedResult)
                       throws Exception
Throws:
Exception

testClassTypeIds

protected void testClassTypeIds(AssetEntryQuery assetEntryQuery,
                                boolean classType)
                         throws Exception
Throws:
Exception

testOrderByCreateDate

protected void testOrderByCreateDate(AssetEntryQuery assetEntryQuery,
                                     String orderByType,
                                     String[] titles,
                                     String[] orderedTitles)
                              throws Exception
Throws:
Exception

testOrderByExpirationDate

protected void testOrderByExpirationDate(AssetEntryQuery assetEntryQuery,
                                         String orderByType,
                                         Date[] expirationDates)
                                  throws Exception
Throws:
Exception

testOrderByTitle

protected void testOrderByTitle(AssetEntryQuery assetEntryQuery,
                                String orderByType,
                                List<Map<Locale,String>> titleMaps,
                                List<Map<Locale,String>> orderedTitleMaps,
                                Locale[] locales)
                         throws Exception
Throws:
Exception

testPaginationType

protected void testPaginationType(AssetEntryQuery assetEntryQuery,
                                  int size)
                           throws Exception
Throws:
Exception

Liferay 7.0-ce-b4