public void testODMGQueryObjects() throws Exception
{
long timestamp = System.currentTimeMillis();
String articleName = "query_test_article_" + timestamp;
String categoryName = "query_test_category_" + timestamp;
CategoryVO cat1 = odmgCreatePersistentCategoryWithArticles(categoryName, articleName, 6);
CategoryVO cat2 = odmgCreatePersistentCategoryWithArticles(categoryName, articleName, 6);
CategoryVO cat3 = odmgCreatePersistentCategoryWithArticles(categoryName, articleName, 6);
Collection result = odmgArticleBean.getArticles(articleName);
assertNotNull(result);
assertEquals("Wrong number of articles", 18, result.size());
result = odmgArticleBean.getCategoryByName(categoryName);
assertNotNull(result);
assertEquals("Wrong number of returned category objects", 3, result.size());
CategoryVO cat = (CategoryVO) result.iterator().next();
assertNotNull(cat);
Collection articles = cat.getAssignedArticles();
assertNotNull(articles);
assertEquals("Wrong number of referenced articles", 6, articles.size());
}