return;
}
clearTestData();
Transaction tx = _kit.getTransaction(_conn);
tx.begin();
ProductGroup pg = new ProductGroup();
pg.setId(new Integer(77777));
pg.setName("1");
_conn.makePersistent(pg);
Article article = Article.createInstance();
article.setArticleId(new Integer(77777));
article.setStock(333);
pg.add(article);
article.setProductGroup(pg);
_conn.makePersistent(article);
Identity pgOid = _conn.getIdentity(pg);
tx.commit();
tx = _kit.getTransaction(_conn);
tx.begin();
pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
pg.getAllArticlesInGroup().clear();
tx.commit();
tx = _kit.getTransaction(_conn);
tx.begin();
pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
assertEquals("should be equal", 0, pg.getAllArticlesInGroup().size());
tx.commit();
tx = _kit.getTransaction(_conn);
tx.begin();
pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
pg.getAllArticlesInGroup().add(article);
tx.commit();
tx = _kit.getTransaction(_conn);
tx.begin();
pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
assertEquals("should be equal", 1, pg.getAllArticlesInGroup().size());
tx.commit();
clearTestData();
}