CCM NG/ccm-cms: Resolved some compile errors caused by changes of method signatures in ContentItemManager
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4827 8810af33-2d31-482b-a856-94f89814c4df
Former-commit-id: b53e2b6fb4
pull/2/head
parent
914bc340e3
commit
cd042145c3
|
|
@ -211,7 +211,7 @@ public class ContentItemManagerTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to create a new content item using
|
* Tries to create a new content item using
|
||||||
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, java.lang.Class)}.
|
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, java.lang.Class, java.util.Locale)}.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@InSequence(1100)
|
@InSequence(1100)
|
||||||
|
|
@ -234,7 +234,7 @@ public class ContentItemManagerTest {
|
||||||
"workflow_id"
|
"workflow_id"
|
||||||
})
|
})
|
||||||
public void createContentItem() {
|
public void createContentItem() {
|
||||||
|
|
||||||
shiro.getSystemUser().execute(() -> {
|
shiro.getSystemUser().execute(() -> {
|
||||||
final ContentSection section = sectionRepo
|
final ContentSection section = sectionRepo
|
||||||
.findByLabel("info")
|
.findByLabel("info")
|
||||||
|
|
@ -244,7 +244,8 @@ public class ContentItemManagerTest {
|
||||||
final Article article = itemManager.createContentItem("new-article",
|
final Article article = itemManager.createContentItem("new-article",
|
||||||
section,
|
section,
|
||||||
folder,
|
folder,
|
||||||
Article.class);
|
Article.class,
|
||||||
|
Locale.ENGLISH);
|
||||||
|
|
||||||
assertThat("DisplayName has not the expected value.",
|
assertThat("DisplayName has not the expected value.",
|
||||||
article.getDisplayName(), is(equalTo("new-article")));
|
article.getDisplayName(), is(equalTo("new-article")));
|
||||||
|
|
@ -265,7 +266,7 @@ public class ContentItemManagerTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if an {@link IllegalArgumentException} is thrown if
|
* Checks if an {@link IllegalArgumentException} is thrown if
|
||||||
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, java.lang.Class)}
|
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, java.lang.Class, java.util.Locale) }
|
||||||
* is called for a content type which is not registered for the provided
|
* is called for a content type which is not registered for the provided
|
||||||
* content section.
|
* content section.
|
||||||
*/
|
*/
|
||||||
|
|
@ -282,12 +283,16 @@ public class ContentItemManagerTest {
|
||||||
.get();
|
.get();
|
||||||
final Folder folder = section.getRootDocumentsFolder();
|
final Folder folder = section.getRootDocumentsFolder();
|
||||||
|
|
||||||
itemManager.createContentItem("Test", section, folder, Event.class);
|
itemManager.createContentItem("Test",
|
||||||
|
section,
|
||||||
|
folder,
|
||||||
|
Event.class,
|
||||||
|
Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies that an {@link IllegalArgumentException} is thrown if
|
* Verifies that an {@link IllegalArgumentException} is thrown if
|
||||||
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, java.lang.Class)}
|
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, java.lang.Class, java.util.Locale)}
|
||||||
* is called with {@code null} for the name of the new item.
|
* is called with {@code null} for the name of the new item.
|
||||||
*/
|
*/
|
||||||
@Test(expected = IllegalArgumentException.class)
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
|
@ -304,13 +309,17 @@ public class ContentItemManagerTest {
|
||||||
.get();
|
.get();
|
||||||
final Folder folder = section.getRootDocumentsFolder();
|
final Folder folder = section.getRootDocumentsFolder();
|
||||||
|
|
||||||
itemManager.createContentItem(null, section, folder, Article.class);
|
itemManager.createContentItem(null,
|
||||||
|
section,
|
||||||
|
folder,
|
||||||
|
Article.class,
|
||||||
|
Locale.ENGLISH);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies that an {@link IllegalArgumentException} is thrown if
|
* Verifies that an {@link IllegalArgumentException} is thrown if
|
||||||
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, java.lang.Class)}
|
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, java.lang.Class, java.util.Locale)}
|
||||||
* is called with an empty string for the name of the new content item.
|
* is called with an empty string for the name of the new content item.
|
||||||
*/
|
*/
|
||||||
@Test(expected = IllegalArgumentException.class)
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
|
@ -327,13 +336,17 @@ public class ContentItemManagerTest {
|
||||||
.get();
|
.get();
|
||||||
final Folder folder = section.getRootDocumentsFolder();
|
final Folder folder = section.getRootDocumentsFolder();
|
||||||
|
|
||||||
itemManager.createContentItem(" ", section, folder, Article.class);
|
itemManager.createContentItem(" ",
|
||||||
|
section,
|
||||||
|
folder,
|
||||||
|
Article.class,
|
||||||
|
Locale.ENGLISH);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies that an {@link IllegalArgumentException} is thrown if
|
* Verifies that an {@link IllegalArgumentException} is thrown if
|
||||||
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, java.lang.Class)}
|
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, java.lang.Class, java.util.Locale)}
|
||||||
* is called with {@code null} for the folder in which the new item is
|
* is called with {@code null} for the folder in which the new item is
|
||||||
* created.
|
* created.
|
||||||
*/
|
*/
|
||||||
|
|
@ -350,13 +363,17 @@ public class ContentItemManagerTest {
|
||||||
.findByLabel("info")
|
.findByLabel("info")
|
||||||
.get();
|
.get();
|
||||||
|
|
||||||
itemManager.createContentItem("Test", section, null, Article.class);
|
itemManager.createContentItem("Test",
|
||||||
|
section,
|
||||||
|
null,
|
||||||
|
Article.class,
|
||||||
|
Locale.ENGLISH);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to create a new content item with an alternative workflow using
|
* Tries to create a new content item with an alternative workflow using
|
||||||
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, org.libreccm.workflow.WorkflowTemplate, java.lang.Class)}.
|
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, org.libreccm.workflow.WorkflowTemplate, java.lang.Class, java.util.Locale)}.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@InSequence(2100)
|
@InSequence(2100)
|
||||||
|
|
@ -394,7 +411,8 @@ public class ContentItemManagerTest {
|
||||||
section,
|
section,
|
||||||
folder,
|
folder,
|
||||||
workflowTemplate,
|
workflowTemplate,
|
||||||
Article.class);
|
Article.class,
|
||||||
|
Locale.ENGLISH);
|
||||||
|
|
||||||
assertThat("DisplayName has not the expected value.",
|
assertThat("DisplayName has not the expected value.",
|
||||||
article.getDisplayName(), is(equalTo("new-article")));
|
article.getDisplayName(), is(equalTo("new-article")));
|
||||||
|
|
@ -415,7 +433,7 @@ public class ContentItemManagerTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies that
|
* Verifies that
|
||||||
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, org.libreccm.workflow.WorkflowTemplate, java.lang.Class)}
|
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, org.libreccm.workflow.WorkflowTemplate, java.lang.Class, java.util.Locale)}
|
||||||
* throws an {@link IllegalArgumentException} if the provided type of the
|
* throws an {@link IllegalArgumentException} if the provided type of the
|
||||||
* item to create is not registered with the provided content section.
|
* item to create is not registered with the provided content section.
|
||||||
*/
|
*/
|
||||||
|
|
@ -440,13 +458,14 @@ public class ContentItemManagerTest {
|
||||||
section,
|
section,
|
||||||
folder,
|
folder,
|
||||||
workflowTemplate,
|
workflowTemplate,
|
||||||
Event.class);
|
Event.class,
|
||||||
|
Locale.ENGLISH);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies that
|
* Verifies that
|
||||||
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, org.libreccm.workflow.WorkflowTemplate, java.lang.Class)}
|
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, org.libreccm.workflow.WorkflowTemplate, java.lang.Class, java.util.Locale)}
|
||||||
* throws an {@link IllegalArgumentException} if called with {@code null}
|
* throws an {@link IllegalArgumentException} if called with {@code null}
|
||||||
* for the name of the new item.
|
* for the name of the new item.
|
||||||
*/
|
*/
|
||||||
|
|
@ -471,15 +490,16 @@ public class ContentItemManagerTest {
|
||||||
section,
|
section,
|
||||||
folder,
|
folder,
|
||||||
workflowTemplate,
|
workflowTemplate,
|
||||||
Article.class);
|
Article.class,
|
||||||
|
Locale.ENGLISH);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies that
|
* Verifies that
|
||||||
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, org.libreccm.workflow.WorkflowTemplate, java.lang.Class)}
|
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, org.libreccm.workflow.WorkflowTemplate, java.lang.Class, java.util.Locale)}
|
||||||
* throws an {@link IllegalArgumentException} if called with {@code null}
|
* throws an {@link IllegalArgumentException} if called with {@code null}
|
||||||
* for the name of the new item and for thw workflow of the new item.
|
* for the name of the new item and for the workflow of the new item.
|
||||||
*/
|
*/
|
||||||
@Test(expected = IllegalArgumentException.class)
|
@Test(expected = IllegalArgumentException.class)
|
||||||
@InSequence(2400)
|
@InSequence(2400)
|
||||||
|
|
@ -499,13 +519,14 @@ public class ContentItemManagerTest {
|
||||||
section,
|
section,
|
||||||
folder,
|
folder,
|
||||||
null,
|
null,
|
||||||
Article.class);
|
Article.class,
|
||||||
|
Locale.ENGLISH);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies that
|
* Verifies that
|
||||||
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, org.libreccm.workflow.WorkflowTemplate, java.lang.Class)}
|
* {@link ContentItemManager#createContentItem(java.lang.String, org.librecms.contentsection.ContentSection, org.librecms.contentsection.Folder, org.libreccm.workflow.WorkflowTemplate, java.lang.Class, java.util.Locale)}
|
||||||
* throws an {@link IllegalArgumentException} if called with {@code null}
|
* throws an {@link IllegalArgumentException} if called with {@code null}
|
||||||
* for the folder in which the new item is created.
|
* for the folder in which the new item is created.
|
||||||
*/
|
*/
|
||||||
|
|
@ -529,7 +550,8 @@ public class ContentItemManagerTest {
|
||||||
section,
|
section,
|
||||||
null,
|
null,
|
||||||
workflowTemplate,
|
workflowTemplate,
|
||||||
Article.class);
|
Article.class,
|
||||||
|
Locale.ENGLISH);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -554,7 +576,7 @@ public class ContentItemManagerTest {
|
||||||
"workflow_id"
|
"workflow_id"
|
||||||
})
|
})
|
||||||
public void moveItem() {
|
public void moveItem() {
|
||||||
|
|
||||||
final Optional<ContentItem> item = itemRepo.findById(-10100L);
|
final Optional<ContentItem> item = itemRepo.findById(-10100L);
|
||||||
assertThat(item.isPresent(), is(true));
|
assertThat(item.isPresent(), is(true));
|
||||||
|
|
||||||
|
|
@ -596,7 +618,7 @@ public class ContentItemManagerTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies that null null null null null null null null null null null null
|
* Verifies that null null null null null null null null null null null null
|
||||||
* null null null null null null null null null {@link ContentItemManager#move(org.librecms.contentsection.ContentItem, org.librecms.contentsection.Folder)
|
* null null null null null null null null null null {@link ContentItemManager#move(org.librecms.contentsection.ContentItem, org.librecms.contentsection.Folder)
|
||||||
* throws an {@link IllegalArgumentException} if the type of the item to
|
* throws an {@link IllegalArgumentException} if the type of the item to
|
||||||
* copy has not been registered in content section to which the target
|
* copy has not been registered in content section to which the target
|
||||||
* folder belongs.
|
* folder belongs.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue