CCM NG: Fixed several problems in tests due to several changes.
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4528 8810af33-2d31-482b-a856-94f89814c4df
parent
ff93de29f0
commit
0a24284c08
|
|
@ -62,7 +62,7 @@ public class LocalizedString implements Serializable {
|
||||||
*/
|
*/
|
||||||
@ElementCollection(fetch = FetchType.EAGER)
|
@ElementCollection(fetch = FetchType.EAGER)
|
||||||
@MapKeyColumn(name = "LOCALE")
|
@MapKeyColumn(name = "LOCALE")
|
||||||
@Column(name = "LOCALIZED_VALUES")
|
@Column(name = "LOCALIZED_VALUE")
|
||||||
@Basic
|
@Basic
|
||||||
@Lob
|
@Lob
|
||||||
@Type(type = "org.hibernate.type.TextType")
|
@Type(type = "org.hibernate.type.TextType")
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,7 @@ public class CategoryManagerTest {
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@ public class CategoryRepositoryTest {
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ public class ConfigurationManagerTest {
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
.addPackage(org.libreccm.l10n.LocalizedString.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ public class CcmObjectRepositoryTest {
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.experimental.categories.Category;
|
import org.junit.experimental.categories.Category;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
|
|
@ -35,7 +34,6 @@ import org.libreccm.testutils.DatasetsVerifier;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ public class DependencyTreeManagerCycleTest {
|
||||||
.addClass(org.libreccm.modules.IntegrationException.class)
|
.addClass(org.libreccm.modules.IntegrationException.class)
|
||||||
.addClass(TreeNode.class)
|
.addClass(TreeNode.class)
|
||||||
.addClass(org.libreccm.modules.CcmModule.class)
|
.addClass(org.libreccm.modules.CcmModule.class)
|
||||||
|
.addClass(org.libreccm.modules.ModuleEvent.class)
|
||||||
.addClass(org.libreccm.modules.ModuleInfo.class)
|
.addClass(org.libreccm.modules.ModuleInfo.class)
|
||||||
.addClass(org.libreccm.modules.ModuleStatus.class)
|
.addClass(org.libreccm.modules.ModuleStatus.class)
|
||||||
.addClass(org.libreccm.modules.Module.class)
|
.addClass(org.libreccm.modules.Module.class)
|
||||||
|
|
@ -110,6 +111,7 @@ public class DependencyTreeManagerCycleTest {
|
||||||
org.libreccm.modules.dependencytree.test.cycle.TestModuleB.class)
|
org.libreccm.modules.dependencytree.test.cycle.TestModuleB.class)
|
||||||
.addClass(
|
.addClass(
|
||||||
org.libreccm.modules.dependencytree.test.cycle.TestModuleC.class)
|
org.libreccm.modules.dependencytree.test.cycle.TestModuleC.class)
|
||||||
|
.addPackage(org.libreccm.pagemodel.PageModel.class.getPackage())
|
||||||
.addClass(org.libreccm.web.ApplicationType.class)
|
.addClass(org.libreccm.web.ApplicationType.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
|
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,6 @@ import org.jboss.arquillian.junit.Arquillian;
|
||||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||||
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
|
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
|
||||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
|
|
||||||
|
|
@ -44,7 +42,6 @@ import org.junit.experimental.categories.Category;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
import org.libreccm.tests.categories.IntegrationTest;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -110,6 +107,7 @@ public class DependencyTreeManagerTest {
|
||||||
.addClass(org.libreccm.modules.IntegrationException.class)
|
.addClass(org.libreccm.modules.IntegrationException.class)
|
||||||
.addClass(org.libreccm.modules.TreeNode.class)
|
.addClass(org.libreccm.modules.TreeNode.class)
|
||||||
.addClass(org.libreccm.modules.CcmModule.class)
|
.addClass(org.libreccm.modules.CcmModule.class)
|
||||||
|
.addClass(org.libreccm.modules.ModuleEvent.class)
|
||||||
.addClass(org.libreccm.modules.ModuleInfo.class)
|
.addClass(org.libreccm.modules.ModuleInfo.class)
|
||||||
.addClass(org.libreccm.modules.ModuleStatus.class)
|
.addClass(org.libreccm.modules.ModuleStatus.class)
|
||||||
.addClass(org.libreccm.modules.Module.class)
|
.addClass(org.libreccm.modules.Module.class)
|
||||||
|
|
@ -126,6 +124,8 @@ public class DependencyTreeManagerTest {
|
||||||
org.libreccm.modules.dependencytree.test.valid.TestModuleB.class)
|
org.libreccm.modules.dependencytree.test.valid.TestModuleB.class)
|
||||||
.addClass(
|
.addClass(
|
||||||
org.libreccm.modules.dependencytree.test.valid.TestModuleC.class)
|
org.libreccm.modules.dependencytree.test.valid.TestModuleC.class)
|
||||||
|
// .addClass(org.libreccm.portation.Portable.class)
|
||||||
|
.addPackage(org.libreccm.pagemodel.PageModel.class.getPackage())
|
||||||
.addClass(org.libreccm.web.ApplicationType.class)
|
.addClass(org.libreccm.web.ApplicationType.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
|
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ public class AuthorizationInterceptorTest {
|
||||||
.addPackage(com.arsdigita.xml.formatters.DateTimeFormatter.class
|
.addPackage(com.arsdigita.xml.formatters.DateTimeFormatter.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,7 @@ public class ChallengeManagerTest {
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ package org.libreccm.security;
|
||||||
|
|
||||||
import org.apache.shiro.subject.ExecutionException;
|
import org.apache.shiro.subject.ExecutionException;
|
||||||
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.jboss.arquillian.container.test.api.Deployment;
|
import org.jboss.arquillian.container.test.api.Deployment;
|
||||||
|
|
@ -93,39 +92,40 @@ public class GroupManagerTest {
|
||||||
@Deployment
|
@Deployment
|
||||||
public static WebArchive createDeployment() {
|
public static WebArchive createDeployment() {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.libreccm.security.GroupManagerTest.war")
|
"LibreCCM-org.libreccm.security.GroupManagerTest.war")
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
.addPackage(org.libreccm.categorization.Categorization.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(
|
.addPackage(
|
||||||
org.libreccm.configuration.ConfigurationManager.class
|
org.libreccm.configuration.ConfigurationManager.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.core.CcmObject.class.getPackage())
|
.addPackage(org.libreccm.core.CcmObject.class.getPackage())
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class.getPackage()).
|
.addPackage(org.libreccm.l10n.LocalizedString.class.getPackage()).
|
||||||
addPackage(org.libreccm.security.User.class.getPackage())
|
addPackage(org.libreccm.security.User.class.getPackage())
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.testutils.EqualsVerifier.class
|
.addPackage(org.libreccm.testutils.EqualsVerifier.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
||||||
.addPackage(com.arsdigita.kernel.security.SecurityConfig.class
|
.addPackage(com.arsdigita.kernel.security.SecurityConfig.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsLibraries(getModuleDependencies())
|
||||||
"META-INF/persistence.xml")
|
.addAsResource("test-persistence.xml",
|
||||||
.addAsWebInfResource("test-web.xml", "web.xml")
|
"META-INF/persistence.xml")
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsWebInfResource("test-web.xml", "web.xml")
|
||||||
.addAsWebInfResource("META-INF/beans.xml", "beans.xml");
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
|
.addAsWebInfResource("META-INF/beans.xml", "beans.xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -149,8 +149,8 @@ public class GroupManagerTest {
|
||||||
@Test
|
@Test
|
||||||
@UsingDataSet("datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
@UsingDataSet("datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
||||||
@ShouldMatchDataSet(
|
@ShouldMatchDataSet(
|
||||||
value = "datasets/org/libreccm/security/GroupManagerTest/after-add.yml",
|
value = "datasets/org/libreccm/security/GroupManagerTest/after-add.yml",
|
||||||
excludeColumns = {"membership_id"})
|
excludeColumns = {"membership_id"})
|
||||||
@InSequence(200)
|
@InSequence(200)
|
||||||
public void addUserToGroup() {
|
public void addUserToGroup() {
|
||||||
final Group admins = groupRepository.findByName("admins");
|
final Group admins = groupRepository.findByName("admins");
|
||||||
|
|
@ -174,7 +174,7 @@ public class GroupManagerTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
shiro.getSystemUser().execute(
|
shiro.getSystemUser().execute(
|
||||||
() -> groupManager.addMemberToGroup(null, admins));
|
() -> groupManager.addMemberToGroup(null, admins));
|
||||||
} catch (ExecutionException ex) {
|
} catch (ExecutionException ex) {
|
||||||
throw ex.getCause();
|
throw ex.getCause();
|
||||||
}
|
}
|
||||||
|
|
@ -189,7 +189,7 @@ public class GroupManagerTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
shiro.getSystemUser().execute(
|
shiro.getSystemUser().execute(
|
||||||
() -> groupManager.addMemberToGroup(jdoe, null));
|
() -> groupManager.addMemberToGroup(jdoe, null));
|
||||||
} catch (ExecutionException ex) {
|
} catch (ExecutionException ex) {
|
||||||
throw ex.getCause();
|
throw ex.getCause();
|
||||||
}
|
}
|
||||||
|
|
@ -198,20 +198,20 @@ public class GroupManagerTest {
|
||||||
@Test
|
@Test
|
||||||
@UsingDataSet("datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
@UsingDataSet("datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
||||||
@ShouldMatchDataSet(
|
@ShouldMatchDataSet(
|
||||||
value = "datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
value = "datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
||||||
@InSequence(230)
|
@InSequence(230)
|
||||||
public void addUserToGroupAgain() {
|
public void addUserToGroupAgain() {
|
||||||
final Group admins = groupRepository.findByName("admins");
|
final Group admins = groupRepository.findByName("admins");
|
||||||
final User jdoe = userRepository.findByName("jdoe");
|
final User jdoe = userRepository.findByName("jdoe");
|
||||||
|
|
||||||
shiro.getSystemUser().execute(
|
shiro.getSystemUser().execute(
|
||||||
() -> groupManager.addMemberToGroup(jdoe, admins));
|
() -> groupManager.addMemberToGroup(jdoe, admins));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@UsingDataSet("datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
@UsingDataSet("datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
||||||
@ShouldMatchDataSet("datasets/org/libreccm/security/GroupManagerTest/"
|
@ShouldMatchDataSet("datasets/org/libreccm/security/GroupManagerTest/"
|
||||||
+ "after-remove.yml")
|
+ "after-remove.yml")
|
||||||
@InSequence(300)
|
@InSequence(300)
|
||||||
public void removeUserFromGroup() {
|
public void removeUserFromGroup() {
|
||||||
final Group admins = groupRepository.findByName("admins");
|
final Group admins = groupRepository.findByName("admins");
|
||||||
|
|
@ -238,7 +238,7 @@ public class GroupManagerTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
shiro.getSystemUser().execute(
|
shiro.getSystemUser().execute(
|
||||||
() -> groupManager.removeMemberFromGroup(null, admins));
|
() -> groupManager.removeMemberFromGroup(null, admins));
|
||||||
} catch (ExecutionException ex) {
|
} catch (ExecutionException ex) {
|
||||||
throw ex.getCause();
|
throw ex.getCause();
|
||||||
}
|
}
|
||||||
|
|
@ -253,7 +253,7 @@ public class GroupManagerTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
shiro.getSystemUser().execute(
|
shiro.getSystemUser().execute(
|
||||||
() -> groupManager.removeMemberFromGroup(jdoe, null));
|
() -> groupManager.removeMemberFromGroup(jdoe, null));
|
||||||
} catch (ExecutionException ex) {
|
} catch (ExecutionException ex) {
|
||||||
throw ex.getCause();
|
throw ex.getCause();
|
||||||
}
|
}
|
||||||
|
|
@ -262,14 +262,14 @@ public class GroupManagerTest {
|
||||||
@Test
|
@Test
|
||||||
@UsingDataSet("datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
@UsingDataSet("datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
||||||
@ShouldMatchDataSet(
|
@ShouldMatchDataSet(
|
||||||
value = "datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
value = "datasets/org/libreccm/security/GroupManagerTest/data.yml")
|
||||||
@InSequence(330)
|
@InSequence(330)
|
||||||
public void removeUserGroupNotAMember() {
|
public void removeUserGroupNotAMember() {
|
||||||
final Group admins = groupRepository.findByName("admins");
|
final Group admins = groupRepository.findByName("admins");
|
||||||
final User mmuster = userRepository.findByName("mmuster");
|
final User mmuster = userRepository.findByName("mmuster");
|
||||||
|
|
||||||
shiro.getSystemUser().execute(
|
shiro.getSystemUser().execute(
|
||||||
() -> groupManager.removeMemberFromGroup(mmuster, admins));
|
() -> groupManager.removeMemberFromGroup(mmuster, admins));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ public class GroupRepositoryTest {
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ public class OneTimeAuthManagerTest {
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ public class PartyRepositoryTest {
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ public class PermissionCheckerTest {
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ public class PermissionManagerTest {
|
||||||
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,6 @@ import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
|
||||||
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
||||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
@ -42,12 +40,11 @@ import org.junit.experimental.categories.Category;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
import org.libreccm.tests.categories.IntegrationTest;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
import static org.libreccm.testutils.DependenciesHelpers.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -120,6 +117,7 @@ public class RoleManagerTest {
|
||||||
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@ public class RoleRepositoryTest {
|
||||||
getPackage())
|
getPackage())
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,7 @@ public class SecuredCollectionTest {
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ public class SecuredIteratorTest {
|
||||||
.addPackage(com.arsdigita.kernel.KernelConfig.class.getPackage())
|
.addPackage(com.arsdigita.kernel.KernelConfig.class.getPackage())
|
||||||
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ public class ShiroTest {
|
||||||
.addPackage(com.arsdigita.kernel.KernelConfig.class.getPackage())
|
.addPackage(com.arsdigita.kernel.KernelConfig.class.getPackage())
|
||||||
.addPackage(com.arsdigita.kernel.security.SecurityConfig.class
|
.addPackage(com.arsdigita.kernel.security.SecurityConfig.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addClass(org.libreccm.security.authorization.LabBean.class)
|
.addClass(org.libreccm.security.authorization.LabBean.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,6 @@ package org.libreccm.security;
|
||||||
|
|
||||||
import org.apache.shiro.subject.ExecutionException;
|
import org.apache.shiro.subject.ExecutionException;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.hibernate.exception.ConstraintViolationException;
|
import org.hibernate.exception.ConstraintViolationException;
|
||||||
|
|
@ -41,8 +39,6 @@ import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
|
||||||
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
||||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
@ -53,6 +49,7 @@ import org.junit.runner.RunWith;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
import org.libreccm.tests.categories.IntegrationTest;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
import static org.libreccm.testutils.DependenciesHelpers.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -123,6 +120,7 @@ public class UserManagerTest {
|
||||||
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
.addPackage(com.arsdigita.util.UncheckedWrapperException.class
|
||||||
.getPackage())
|
.getPackage())
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
|
||||||
|
|
@ -33,14 +33,12 @@ import org.jboss.arquillian.persistence.UsingDataSet;
|
||||||
import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
|
import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
|
||||||
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
||||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||||
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
|
|
||||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
import static org.libreccm.testutils.DependenciesHelpers.*;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
@ -50,7 +48,6 @@ import org.junit.runner.RunWith;
|
||||||
import org.libreccm.core.EmailAddress;
|
import org.libreccm.core.EmailAddress;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
import org.libreccm.tests.categories.IntegrationTest;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
@ -126,6 +123,7 @@ public class UserRepositoryTest {
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||||
|
.addClass(org.libreccm.portation.Portable.class)
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue