CCM NG: Fixed failures in ContentSectionManagerTest
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@6003 8810af33-2d31-482b-a856-94f89814c4df
Former-commit-id: c0508682fe
pull/2/head
parent
bbdea3782c
commit
58b2632a14
|
|
@ -172,6 +172,7 @@ public class ContentSectionManagerTest {
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
||||||
.addClass(org.libreccm.modules.Module.class)
|
.addClass(org.libreccm.modules.Module.class)
|
||||||
.addClass(org.libreccm.modules.RequiredModule.class)
|
.addClass(org.libreccm.modules.RequiredModule.class)
|
||||||
|
.addClass(org.libreccm.imexport.Exportable.class)
|
||||||
.addPackage(org.librecms.dispatcher.ItemResolver.class.getPackage())
|
.addPackage(org.librecms.dispatcher.ItemResolver.class.getPackage())
|
||||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
||||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
||||||
|
|
@ -287,6 +288,7 @@ public class ContentSectionManagerTest {
|
||||||
value = "datasets/org/librecms/contentsection/"
|
value = "datasets/org/librecms/contentsection/"
|
||||||
+ "ContentSectionManagerTest/after-add-role.xml",
|
+ "ContentSectionManagerTest/after-add-role.xml",
|
||||||
excludeColumns = {"object_id",
|
excludeColumns = {"object_id",
|
||||||
|
"uuid",
|
||||||
"role_id",
|
"role_id",
|
||||||
"permission_id",
|
"permission_id",
|
||||||
"creation_date",
|
"creation_date",
|
||||||
|
|
@ -454,12 +456,12 @@ public class ContentSectionManagerTest {
|
||||||
"creation_date"})
|
"creation_date"})
|
||||||
@InSequence(400)
|
@InSequence(400)
|
||||||
public void addContentTypeToSection() {
|
public void addContentTypeToSection() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
||||||
.findById(-13002L)
|
.findById(13002L)
|
||||||
.get();
|
.get();
|
||||||
final Workflow workflowTemplate = workflowRepo
|
final Workflow workflowTemplate = workflowRepo
|
||||||
.findById(-14001L)
|
.findById(14001L)
|
||||||
.get();
|
.get();
|
||||||
|
|
||||||
manager.addContentTypeToSection(Event.class,
|
manager.addContentTypeToSection(Event.class,
|
||||||
|
|
@ -481,12 +483,12 @@ public class ContentSectionManagerTest {
|
||||||
+ "ContentSectionManagerTest/data.xml")
|
+ "ContentSectionManagerTest/data.xml")
|
||||||
@InSequence(500)
|
@InSequence(500)
|
||||||
public void addAlreadyAddedContentTypeToSection() {
|
public void addAlreadyAddedContentTypeToSection() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
||||||
.findById(-13002L)
|
.findById(13002L)
|
||||||
.get();
|
.get();
|
||||||
final Workflow workflowTemplate = workflowRepo
|
final Workflow workflowTemplate = workflowRepo
|
||||||
.findById(-14002L)
|
.findById(14002L)
|
||||||
.get();
|
.get();
|
||||||
|
|
||||||
manager.addContentTypeToSection(News.class,
|
manager.addContentTypeToSection(News.class,
|
||||||
|
|
@ -509,11 +511,11 @@ public class ContentSectionManagerTest {
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
@InSequence(600)
|
@InSequence(600)
|
||||||
public void addContentTypeToSectionTypeIsNull() {
|
public void addContentTypeToSectionTypeIsNull() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
||||||
.findById(-13002L).get();
|
.findById(13002L).get();
|
||||||
final Workflow workflowTemplate = workflowRepo
|
final Workflow workflowTemplate = workflowRepo
|
||||||
.findById(-14002L).get();
|
.findById(14002L).get();
|
||||||
|
|
||||||
manager.addContentTypeToSection(null,
|
manager.addContentTypeToSection(null,
|
||||||
section,
|
section,
|
||||||
|
|
@ -537,9 +539,9 @@ public class ContentSectionManagerTest {
|
||||||
@InSequence(700)
|
@InSequence(700)
|
||||||
public void addContentTypeToSectionSectionIsNull() {
|
public void addContentTypeToSectionSectionIsNull() {
|
||||||
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
||||||
.findById(-13002L).get();
|
.findById(13002L).get();
|
||||||
final Workflow workflowTemplate = workflowRepo
|
final Workflow workflowTemplate = workflowRepo
|
||||||
.findById(-14002L).get();
|
.findById(14002L).get();
|
||||||
|
|
||||||
manager.addContentTypeToSection(Event.class,
|
manager.addContentTypeToSection(Event.class,
|
||||||
null,
|
null,
|
||||||
|
|
@ -561,9 +563,9 @@ public class ContentSectionManagerTest {
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
@InSequence(800)
|
@InSequence(800)
|
||||||
public void addContentTypeToSectionLifecycleIsNull() {
|
public void addContentTypeToSectionLifecycleIsNull() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
final Workflow workflowTemplate = workflowRepo
|
final Workflow workflowTemplate = workflowRepo
|
||||||
.findById(-14001L).get();
|
.findById(14001L).get();
|
||||||
|
|
||||||
manager.addContentTypeToSection(Event.class,
|
manager.addContentTypeToSection(Event.class,
|
||||||
section,
|
section,
|
||||||
|
|
@ -585,9 +587,9 @@ public class ContentSectionManagerTest {
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
@InSequence(900)
|
@InSequence(900)
|
||||||
public void addContentTypeToSectionWorkflowIsNull() {
|
public void addContentTypeToSectionWorkflowIsNull() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
||||||
.findById(-13002L).get();
|
.findById(13002L).get();
|
||||||
|
|
||||||
manager.addContentTypeToSection(Event.class,
|
manager.addContentTypeToSection(Event.class,
|
||||||
section,
|
section,
|
||||||
|
|
@ -610,11 +612,11 @@ public class ContentSectionManagerTest {
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
@InSequence(1000)
|
@InSequence(1000)
|
||||||
public void addContentTypeToSectionLifecycleNotInSection() {
|
public void addContentTypeToSectionLifecycleNotInSection() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
||||||
.findById(-13003L).get();
|
.findById(13003L).get();
|
||||||
final Workflow workflowTemplate = workflowRepo
|
final Workflow workflowTemplate = workflowRepo
|
||||||
.findById(-14001L).get();
|
.findById(14001L).get();
|
||||||
|
|
||||||
manager.addContentTypeToSection(Event.class,
|
manager.addContentTypeToSection(Event.class,
|
||||||
section,
|
section,
|
||||||
|
|
@ -636,11 +638,11 @@ public class ContentSectionManagerTest {
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
@InSequence(1100)
|
@InSequence(1100)
|
||||||
public void addContentTypeToSectionWorkflowNoInSection() {
|
public void addContentTypeToSectionWorkflowNoInSection() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
final LifecycleDefinition lifecycleDef = lifecycleDefRepo
|
||||||
.findById(-13002L).get();
|
.findById(13002L).get();
|
||||||
final Workflow workflowTemplate = workflowRepo
|
final Workflow workflowTemplate = workflowRepo
|
||||||
.findById(-14003L).get();
|
.findById(14003L).get();
|
||||||
|
|
||||||
manager.addContentTypeToSection(Event.class,
|
manager.addContentTypeToSection(Event.class,
|
||||||
section,
|
section,
|
||||||
|
|
@ -657,7 +659,7 @@ public class ContentSectionManagerTest {
|
||||||
+ "ContentSectionManagerTest/data.xml")
|
+ "ContentSectionManagerTest/data.xml")
|
||||||
@InSequence(1200)
|
@InSequence(1200)
|
||||||
public void verifyHasContentType() {
|
public void verifyHasContentType() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
|
|
||||||
assertThat(manager.hasContentType(Article.class, section), is(true));
|
assertThat(manager.hasContentType(Article.class, section), is(true));
|
||||||
assertThat(manager.hasContentType(News.class, section), is(true));
|
assertThat(manager.hasContentType(News.class, section), is(true));
|
||||||
|
|
@ -675,7 +677,7 @@ public class ContentSectionManagerTest {
|
||||||
+ "ContentSectionManagerTest/after-remove-contenttype.xml")
|
+ "ContentSectionManagerTest/after-remove-contenttype.xml")
|
||||||
@InSequence(1300)
|
@InSequence(1300)
|
||||||
public void removeContentTypeFromSection() {
|
public void removeContentTypeFromSection() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
|
|
||||||
manager.removeContentTypeFromSection(News.class, section);
|
manager.removeContentTypeFromSection(News.class, section);
|
||||||
}
|
}
|
||||||
|
|
@ -694,7 +696,7 @@ public class ContentSectionManagerTest {
|
||||||
+ "ContentSectionManagerTest/data.xml")
|
+ "ContentSectionManagerTest/data.xml")
|
||||||
@InSequence(1301)
|
@InSequence(1301)
|
||||||
public void removeNotExistingContentTypeFromSection() {
|
public void removeNotExistingContentTypeFromSection() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
|
|
||||||
manager.removeContentTypeFromSection(Event.class, section);
|
manager.removeContentTypeFromSection(Event.class, section);
|
||||||
}
|
}
|
||||||
|
|
@ -714,7 +716,7 @@ public class ContentSectionManagerTest {
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
@InSequence(1400)
|
@InSequence(1400)
|
||||||
public void removeContentTypeFromSectionTypeInUse() {
|
public void removeContentTypeFromSectionTypeInUse() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
|
|
||||||
manager.removeContentTypeFromSection(Article.class, section);
|
manager.removeContentTypeFromSection(Article.class, section);
|
||||||
}
|
}
|
||||||
|
|
@ -734,7 +736,7 @@ public class ContentSectionManagerTest {
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
@InSequence(1400)
|
@InSequence(1400)
|
||||||
public void removeContentTypeFromSectionTypeIsNull() {
|
public void removeContentTypeFromSectionTypeIsNull() {
|
||||||
final ContentSection section = repository.findById(-1100L).get();
|
final ContentSection section = repository.findById(1100L).get();
|
||||||
|
|
||||||
manager.removeContentTypeFromSection(null, section);
|
manager.removeContentTypeFromSection(null, section);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue