diff --git a/ccm-bundle-devel-wildfly-swarm/pom.xml b/ccm-bundle-devel-wildfly-swarm/pom.xml index 175c10b22..585f0273c 100644 --- a/ccm-bundle-devel-wildfly-swarm/pom.xml +++ b/ccm-bundle-devel-wildfly-swarm/pom.xml @@ -15,6 +15,10 @@ org.libreccm ccm-bundle-devel-wildfly-swarm war + + + false + diff --git a/ccm-cms/src/test/java/org/librecms/contentsection/AttachmentListManagerTest.java b/ccm-cms/src/test/java/org/librecms/contentsection/AttachmentListManagerTest.java index a0bc69118..5ea74a877 100644 --- a/ccm-cms/src/test/java/org/librecms/contentsection/AttachmentListManagerTest.java +++ b/ccm-cms/src/test/java/org/librecms/contentsection/AttachmentListManagerTest.java @@ -370,10 +370,13 @@ public class AttachmentListManagerTest { "list_id", "uuid"}) public void createAttachmentList() { - final Optional item = itemRepo.findById(-520); - assertThat(item.isPresent(), is(true)); - listManager.createAttachmentList(item.get(), "newList"); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-520); + assertThat(item.isPresent(), is(true)); + + listManager.createAttachmentList(item.get(), "newList"); + }); } /** @@ -392,9 +395,12 @@ public class AttachmentListManagerTest { + "data.xml") @ShouldThrowException(IllegalArgumentException.class) public void createAttachmentListForItemNull() { - final ContentItem item = null; - listManager.createAttachmentList(item, "newList"); + shiro.getSystemUser().execute(() -> { + final ContentItem item = null; + + listManager.createAttachmentList(item, "newList"); + }); } /** @@ -412,10 +418,13 @@ public class AttachmentListManagerTest { "datasets/org/librecms/contentsection/AttachmentListManagerTest/" + "data.xml") public void createAttachmentListNameIsNull() { - final Optional item = itemRepo.findById(-520); - assertThat(item.isPresent(), is(true)); - listManager.createAttachmentList(item.get(), null); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-520); + assertThat(item.isPresent(), is(true)); + + listManager.createAttachmentList(item.get(), null); + }); } /** @@ -433,10 +442,13 @@ public class AttachmentListManagerTest { "datasets/org/librecms/contentsection/AttachmentListManagerTest/" + "data.xml") public void createAttachmentListNameIsEmpty() { - final Optional item = itemRepo.findById(-520); - assertThat(item.isPresent(), is(true)); - listManager.createAttachmentList(item.get(), " "); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-520); + assertThat(item.isPresent(), is(true)); + + listManager.createAttachmentList(item.get(), " "); + }); } /** @@ -457,10 +469,13 @@ public class AttachmentListManagerTest { "list_id", "uuid"}) public void createAttachmentListWithPosition() { - final Optional item = itemRepo.findById(-510); - assertThat(item.isPresent(), is(true)); - listManager.createAttachmentList(item.get(), "newList", 1); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-510); + assertThat(item.isPresent(), is(true)); + + listManager.createAttachmentList(item.get(), "newList", 1); + }); } /** @@ -484,10 +499,13 @@ public class AttachmentListManagerTest { "list_id", "uuid"}) public void createAttachmentListWithNegativePosition() { - final Optional item = itemRepo.findById(-510); - assertThat(item.isPresent(), is(true)); - listManager.createAttachmentList(item.get(), "newList", -3); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-510); + assertThat(item.isPresent(), is(true)); + + listManager.createAttachmentList(item.get(), "newList", -3); + }); } /** @@ -512,10 +530,13 @@ public class AttachmentListManagerTest { "list_id", "uuid"}) public void createAttachmentListWithPositionAfterLast() { - final Optional item = itemRepo.findById(-510); - assertThat(item.isPresent(), is(true)); - listManager.createAttachmentList(item.get(), "newList", 10); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-510); + assertThat(item.isPresent(), is(true)); + + listManager.createAttachmentList(item.get(), "newList", 10); + }); } /** @@ -534,9 +555,12 @@ public class AttachmentListManagerTest { + "data.xml") @ShouldThrowException(IllegalArgumentException.class) public void createAttachmentListWithPositionForItemNull() { - final ContentItem item = null; - listManager.createAttachmentList(item, "newList", 10); + shiro.getSystemUser().execute(() -> { + final ContentItem item = null; + + listManager.createAttachmentList(item, "newList", 10); + }); } /** @@ -555,10 +579,13 @@ public class AttachmentListManagerTest { + "data.xml") @ShouldThrowException(IllegalArgumentException.class) public void createAttachmentListWithPositionNameIsNull() { - final Optional item = itemRepo.findById(-510); - assertThat(item.isPresent(), is(true)); - listManager.createAttachmentList(item.get(), null, 10); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-510); + assertThat(item.isPresent(), is(true)); + + listManager.createAttachmentList(item.get(), null, 10); + }); } /** @@ -577,10 +604,13 @@ public class AttachmentListManagerTest { + "data.xml") @ShouldThrowException(IllegalArgumentException.class) public void createAttachmentListWithPositionNameIsEmpty() { - final Optional item = itemRepo.findById(-510); - assertThat(item.isPresent(), is(true)); - listManager.createAttachmentList(item.get(), " ", 10); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-510); + assertThat(item.isPresent(), is(true)); + + listManager.createAttachmentList(item.get(), " ", 10); + }); } /** @@ -599,11 +629,14 @@ public class AttachmentListManagerTest { + "AttachmentListManagerTest/after-remove.xml", excludeColumns = {"timestamp"}) public void removeAttachmentList() { - final Optional item = itemRepo.findById(-510); - assertThat(item.isPresent(), is(true)); - final AttachmentList list = item.get().getAttachments().get(0); - listManager.removeAttachmentList(list); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-510); + assertThat(item.isPresent(), is(true)); + final AttachmentList list = item.get().getAttachments().get(0); + + listManager.removeAttachmentList(list); + }); } /** @@ -641,11 +674,14 @@ public class AttachmentListManagerTest { + "AttachmentListManagerTest/after-move-up.xml", excludeColumns = {"timestamp"}) public void moveUp() { - final Optional item = itemRepo.findById(-510); - assertThat(item.isPresent(), is(true)); - final AttachmentList list = item.get().getAttachments().get(0); - listManager.moveUp(list); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-510); + assertThat(item.isPresent(), is(true)); + final AttachmentList list = item.get().getAttachments().get(0); + + listManager.moveUp(list); + }); } /** @@ -661,11 +697,14 @@ public class AttachmentListManagerTest { "datasets/org/librecms/contentsection/AttachmentListManagerTest/" + "data.xml") public void moveUpLast() { - final Optional item = itemRepo.findById(-510); - assertThat(item.isPresent(), is(true)); - final AttachmentList list = item.get().getAttachments().get(2); - listManager.moveUp(list); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-510); + assertThat(item.isPresent(), is(true)); + final AttachmentList list = item.get().getAttachments().get(2); + + listManager.moveUp(list); + }); } /** @@ -683,9 +722,12 @@ public class AttachmentListManagerTest { + "data.xml") @ShouldThrowException(IllegalArgumentException.class) public void moveUpListNull() { - final AttachmentList list = null; - listManager.moveUp(list); + shiro.getSystemUser().execute(() -> { + final AttachmentList list = null; + + listManager.moveUp(list); + }); } /** @@ -702,11 +744,14 @@ public class AttachmentListManagerTest { + "AttachmentListManagerTest/after-move-down.xml", excludeColumns = {"timestamp"}) public void moveDown() { - final Optional item = itemRepo.findById(-510); - assertThat(item.isPresent(), is(true)); - final AttachmentList list = item.get().getAttachments().get(2); - listManager.moveDown(list); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-510); + assertThat(item.isPresent(), is(true)); + final AttachmentList list = item.get().getAttachments().get(2); + + listManager.moveDown(list); + }); } /** @@ -722,11 +767,14 @@ public class AttachmentListManagerTest { "datasets/org/librecms/contentsection/AttachmentListManagerTest/" + "data.xml") public void moveDownFirst() { - final Optional item = itemRepo.findById(-510); - assertThat(item.isPresent(), is(true)); - final AttachmentList list = item.get().getAttachments().get(0); - listManager.moveDown(list); + shiro.getSystemUser().execute(() -> { + final Optional item = itemRepo.findById(-510); + assertThat(item.isPresent(), is(true)); + final AttachmentList list = item.get().getAttachments().get(0); + + listManager.moveDown(list); + }); } /** @@ -744,9 +792,12 @@ public class AttachmentListManagerTest { + "data.xml") @ShouldThrowException(IllegalArgumentException.class) public void moveDownListNull() { - final AttachmentList list = null; - listManager.moveDown(list); + shiro.getSystemUser().execute(() -> { + final AttachmentList list = null; + + listManager.moveDown(list); + }); } } diff --git a/ccm-core/pom.xml b/ccm-core/pom.xml index ac8328d28..c6971a6c2 100644 --- a/ccm-core/pom.xml +++ b/ccm-core/pom.xml @@ -454,7 +454,7 @@ org.apache.maven.plugins maven-surefire-report-plugin - 2.19.1 + 2.20 false @@ -462,12 +462,12 @@ org.jacoco jacoco-maven-plugin - 0.7.8 + 0.7.9 org.codehaus.mojo findbugs-maven-plugin - 3.0.3 + 3.0.4 findbugs-exclude.xml @@ -475,7 +475,7 @@ org.apache.maven.plugins maven-pmd-plugin - 3.7 + 3.8 true utf-8 diff --git a/ccm-core/src/test/java/org/libreccm/security/UserManagerTest.java b/ccm-core/src/test/java/org/libreccm/security/UserManagerTest.java index 5c0cae997..9d64908a6 100644 --- a/ccm-core/src/test/java/org/libreccm/security/UserManagerTest.java +++ b/ccm-core/src/test/java/org/libreccm/security/UserManagerTest.java @@ -176,24 +176,24 @@ public class UserManagerTest { assertThat(userManager.verifyPassword(jane2, "foo456"), is(true)); } - @Test(expected = ArquillianProxyException.class) - @UsingDataSet("datasets/org/libreccm/security/UserManagerTest/data.yml") - @ShouldThrowException(ConstraintViolationException.class) - @InSequence(400) - public void createUserWithInValidName() throws Throwable { - try { - shiro.getSystemUser().execute( - () -> userManager.createUser("Jane", - "Doe", - "j#ne", - "jane.doe@example.org", - "foo456")); - } catch (ExecutionException ex) { - throw ex.getCause(); - } - fail(); - } - +// Temporaily disabled until we decide if we want to limit the valid characters in a user name +// @Test(expected = ArquillianProxyException.class) +// @UsingDataSet("datasets/org/libreccm/security/UserManagerTest/data.yml") +// @ShouldThrowException(ConstraintViolationException.class) +// @InSequence(400) +// public void createUserWithInValidName() throws Throwable { +// try { +// shiro.getSystemUser().execute( +// () -> userManager.createUser("Jane", +// "Doe", +// "j#ne", +// "jane.doe@example.org", +// "foo456")); +// } catch (ExecutionException ex) { +// throw ex.getCause(); +// } +// fail(); +// } @Test @UsingDataSet("datasets/org/libreccm/security/UserManagerTest/data.yml") @InSequence(500) diff --git a/pom.xml b/pom.xml index 0ce3be2a3..5d715365f 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ ccm-bundle-devel ccm-bundle-devel-wildfly-web ccm-bundle-devel-wildfly - ccm-bundle-devel-wildfly-swarm + ccm-xafilesystemadapter @@ -103,10 +103,15 @@ ${project.build.sourceEncoding} + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + org.apache.maven.plugins maven-surefire-plugin - 2.19.1 + 2.20 org.apache.maven.plugins @@ -121,7 +126,7 @@ org.apache.maven.plugins maven-war-plugin - 3.0.0 + 3.1.0 org.apache.maven.plugins @@ -136,7 +141,7 @@ org.apache.maven.plugins maven-pmd-plugin - 3.7 + 3.8 true utf-8 @@ -172,7 +177,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.12 + 3.0.0 org.codehaus.mojo @@ -199,7 +204,7 @@ org.jacoco jacoco-maven-plugin - 0.7.8 + 0.7.9 org.wildfly.plugins @@ -214,12 +219,12 @@ org.wildfly.swarm wildfly-swarm-plugin - 2017.1.1 + 2017.6.1 com.vaadin vaadin-maven-plugin - 8.0.5 + 8.0.6