CCM NG: One test in CategoryManagerTest failed when executed after other tests because the hibernate_sequence sequence in the database was not reset between tests.
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3778 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
6a2ce5a0dc
commit
aaf0b053d3
|
|
@ -237,46 +237,44 @@ public class CategoryManagerTest {
|
||||||
categoryManager.removeSubCategoryFromCategory(bar, foo);
|
categoryManager.removeSubCategoryFromCategory(bar, foo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fails for unknown reasons when executed after the other tests in this
|
@Test
|
||||||
// Test suite, but works when executed stand alone. To be investigated.
|
@UsingDataSet(
|
||||||
// @Test
|
"datasets/org/libreccm/categorization/CategoryManagerTest/data.yml")
|
||||||
// @UsingDataSet(
|
@ShouldMatchDataSet(
|
||||||
// "datasets/org/libreccm/categorization/CategoryManagerTest/data.yml")
|
value = "datasets/org/libreccm/categorization/CategoryManagerTest/"
|
||||||
// @ShouldMatchDataSet(
|
+ "after-create-multiple-categories.yml")
|
||||||
// value = "datasets/org/libreccm/categorization/CategoryManagerTest/"
|
@InSequence(3100)
|
||||||
// + "after-create-multiple-categories.yml")
|
public void createMultipleCategories() {
|
||||||
// @InSequence(3100)
|
final Domain domain = domainRepo.findByDomainKey("test");
|
||||||
// public void createMultipleCategories() {
|
final Category root = domain.getRoot();
|
||||||
// final Domain domain = domainRepo.findByDomainKey("test");
|
|
||||||
// final Category root = domain.getRoot();
|
final Category com = new Category();
|
||||||
//
|
com.setName("com");
|
||||||
// final Category com = new Category();
|
com.setDisplayName("com");
|
||||||
// com.setName("com");
|
com.setUniqueId("com");
|
||||||
// com.setDisplayName("com");
|
categoryRepo.save(com);
|
||||||
// com.setUniqueId("com");
|
categoryManager.addSubCategoryToCategory(com, root);
|
||||||
// categoryRepo.save(com);
|
|
||||||
// categoryManager.addSubCategoryToCategory(com, root);
|
final Category example = new Category();
|
||||||
//
|
example.setName("example");
|
||||||
// final Category example = new Category();
|
example.setDisplayName("example");
|
||||||
// example.setName("example");
|
example.setUniqueId("example");
|
||||||
// example.setDisplayName("example");
|
categoryRepo.save(example);
|
||||||
// example.setUniqueId("example");
|
categoryManager.addSubCategoryToCategory(example, com);
|
||||||
// categoryRepo.save(example);
|
|
||||||
// categoryManager.addSubCategoryToCategory(example, com);
|
final Category categories = new Category();
|
||||||
//
|
categories.setName("categories");
|
||||||
// final Category categories = new Category();
|
categories.setDisplayName("categories");
|
||||||
// categories.setName("categories");
|
categories.setUniqueId("categories");
|
||||||
// categories.setDisplayName("categories");
|
categoryRepo.save(categories);
|
||||||
// categories.setUniqueId("categories");
|
categoryManager.addSubCategoryToCategory(categories, example);
|
||||||
// categoryRepo.save(categories);
|
|
||||||
// categoryManager.addSubCategoryToCategory(categories, example);
|
final Category test = new Category();
|
||||||
//
|
test.setName("test");
|
||||||
// final Category test = new Category();
|
test.setDisplayName("test");
|
||||||
// test.setName("test");
|
test.setUniqueId("test");
|
||||||
// test.setDisplayName("test");
|
categoryRepo.save(test);
|
||||||
// test.setUniqueId("test");
|
categoryManager.addSubCategoryToCategory(test, categories);
|
||||||
// categoryRepo.save(test);
|
}
|
||||||
// categoryManager.addSubCategoryToCategory(test, categories);
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,4 +40,6 @@ DELETE FROM ccm_core.user_email_addresses;
|
||||||
|
|
||||||
DELETE FROM ccm_core.parties;
|
DELETE FROM ccm_core.parties;
|
||||||
|
|
||||||
DELETE FROM ccm_core.ccm_roles;
|
DELETE FROM ccm_core.ccm_roles;
|
||||||
|
|
||||||
|
ALTER SEQUENCE hibernate_sequence RESTART WITH 1;
|
||||||
|
|
@ -40,4 +40,6 @@ DELETE FROM ccm_core.user_email_addresses;
|
||||||
|
|
||||||
DELETE FROM ccm_core.parties;
|
DELETE FROM ccm_core.parties;
|
||||||
|
|
||||||
DELETE FROM ccm_core.ccm_roles;
|
DELETE FROM ccm_core.ccm_roles;
|
||||||
|
|
||||||
|
ALTER SEQUENCE hibernate_sequence RESTART;
|
||||||
Loading…
Reference in New Issue