public void testQuerySystem() throws Exception
{
System.out.println("testing Query System");
StatisticsQueryCriteria sqc = new StatisticsQueryCriteriaImpl();
sqc.setQueryType(PortalStatistics.QUERY_TYPE_USER);
int desired = 5;
sqc.setListsize(""+desired);
sqc.setSorttype("count");
sqc.setSortorder("desc");
AggregateStatistics as = statistics.queryStatistics(sqc);
assertNotNull(as);
System.out.println("user = " + as);
int size = as.getStatlist().size();
assertTrue( (size <=desired));
sqc.setQueryType(PortalStatistics.QUERY_TYPE_PORTLET);
sqc.setListsize(""+desired);
sqc.setSorttype("count");
sqc.setSortorder("desc");
as = statistics.queryStatistics(sqc);
assertNotNull(as);
System.out.println("portlet = " + as);
size = as.getStatlist().size();
assertTrue( (size <=desired));
sqc.setQueryType(PortalStatistics.QUERY_TYPE_PAGE);
sqc.setListsize(""+desired);
sqc.setSorttype("count");
sqc.setSortorder("desc");
as = statistics.queryStatistics(sqc);
assertNotNull(as);
System.out.println("page = " + as);
size = as.getStatlist().size();
assertTrue( (size <=desired));