mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4327: changed InvalidParameterException with IntegrityException
This commit is contained in:
@@ -29,11 +29,11 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.repo.node.integrity.IntegrityException;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -69,7 +69,7 @@ public class FilePlanTypeUnitTest extends BaseUnitTest
|
||||
* When adding a child of type TYPE_FILE_PLAN
|
||||
* Then an error should be thrown
|
||||
*/
|
||||
@Test (expected = InvalidParameterException.class)
|
||||
@Test (expected = IntegrityException.class)
|
||||
public void testAddFileplanToFileplan()
|
||||
{
|
||||
ChildAssociationRef childAssoc = createFileplanContainerChild(TYPE_FILE_PLAN);
|
||||
@@ -112,7 +112,7 @@ public class FilePlanTypeUnitTest extends BaseUnitTest
|
||||
* When adding another child of type TYPE_HOLD_CONTAINER
|
||||
* Then an error should be thrown
|
||||
*/
|
||||
@Test (expected = InvalidParameterException.class)
|
||||
@Test (expected = IntegrityException.class)
|
||||
public void testCreateMultipleHoldContainers()
|
||||
{
|
||||
ChildAssociationRef existingHoldAssoc = createFileplanContainerChild(TYPE_HOLD_CONTAINER);
|
||||
@@ -141,7 +141,7 @@ public class FilePlanTypeUnitTest extends BaseUnitTest
|
||||
* When adding another child of type TYPE_TRANSFER_CONTAINER
|
||||
* Then an error should be thrown
|
||||
*/
|
||||
@Test (expected = InvalidParameterException.class)
|
||||
@Test (expected = IntegrityException.class)
|
||||
public void testCreateMultipleTransferContainers()
|
||||
{
|
||||
ChildAssociationRef existingHoldAssoc = createFileplanContainerChild(TYPE_TRANSFER_CONTAINER);
|
||||
@@ -170,7 +170,7 @@ public class FilePlanTypeUnitTest extends BaseUnitTest
|
||||
* When adding another child of type TYPE_UNFILED_RECORD_CONTAINER
|
||||
* Then an error should be thrown
|
||||
*/
|
||||
@Test (expected = InvalidParameterException.class)
|
||||
@Test (expected = IntegrityException.class)
|
||||
public void testCreateMultipleUnfiledRecordsContainers()
|
||||
{
|
||||
ChildAssociationRef existingHoldAssoc = createFileplanContainerChild(TYPE_UNFILED_RECORD_CONTAINER);
|
||||
|
@@ -29,10 +29,9 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.repo.node.integrity.IntegrityException;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -52,9 +51,9 @@ public class HoldContainerTypeUnitTest extends BaseUnitTest
|
||||
|
||||
/**
|
||||
* Given that we try to add a non "rma:hold" type to hold container,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test (expected = InvalidParameterException.class)
|
||||
@Test (expected = IntegrityException.class)
|
||||
public void testAddNonHoldTypeToHoldContainer()
|
||||
{
|
||||
QName type = AlfMock.generateQName();
|
||||
|
@@ -30,7 +30,6 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
|
||||
@@ -38,6 +37,7 @@ import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.MockAuthenticationUtilHelper;
|
||||
import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil;
|
||||
import org.alfresco.repo.node.integrity.IntegrityException;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
@@ -77,9 +77,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model
|
||||
|
||||
/**
|
||||
* Given that we try to add non allowed type to rm site,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
@Test(expected = IntegrityException.class)
|
||||
public void testAddNonAcceptedTypeToRmSite()
|
||||
{
|
||||
NodeRef rmSiteNodeRef = generateNodeRef(TYPE_RM_SITE, true);
|
||||
@@ -149,9 +149,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model
|
||||
|
||||
/**
|
||||
* Given that we try to add more than two cm:folder to rm site,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
@Test(expected = IntegrityException.class)
|
||||
public void testAddMoreThanTwhoFolderTypeToRmSite()
|
||||
{
|
||||
NodeRef rmSiteNodeRef = generateNodeRef(TYPE_RM_SITE, true);
|
||||
@@ -208,9 +208,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model
|
||||
|
||||
/**
|
||||
* Given that we try to add one dod:filePlan to standard rm site,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
@Test(expected = IntegrityException.class)
|
||||
public void testAddDODFilePlanTypeToStandardRmSite()
|
||||
{
|
||||
NodeRef rmSiteNodeRef = generateNodeRef(TYPE_RM_SITE, true);
|
||||
@@ -225,9 +225,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model
|
||||
|
||||
/**
|
||||
* Given that we try to add more than one rma:filePlan to rm site,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
@Test(expected = IntegrityException.class)
|
||||
public void testAddMoreThanOneFilePlanTypeToRmSite()
|
||||
{
|
||||
NodeRef rmSiteNodeRef = generateNodeRef(TYPE_RM_SITE, true);
|
||||
@@ -281,9 +281,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model
|
||||
|
||||
/**
|
||||
* Given that we try to add more than one dod:filePlan to rm site,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
@Test(expected = IntegrityException.class)
|
||||
public void testAddMoreThanOneDODFilePlanTypeToRmSite()
|
||||
{
|
||||
NodeRef rmSiteNodeRef = generateNodeRef(TYPE_DOD_5015_SITE, true);
|
||||
@@ -315,9 +315,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model
|
||||
|
||||
/**
|
||||
* Given that we try to add one rma:filePlan to DOD rm site,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
@Test(expected = IntegrityException.class)
|
||||
public void testAddStandardFilePlanTypeToDODRmSite()
|
||||
{
|
||||
NodeRef rmSiteNodeRef = generateNodeRef(TYPE_DOD_5015_SITE, true);
|
||||
|
@@ -29,10 +29,9 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.repo.node.integrity.IntegrityException;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -52,9 +51,9 @@ public class TransferContainerTypeUnitTest extends BaseUnitTest
|
||||
|
||||
/**
|
||||
* Given that we try to add to transfer container,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
@Test(expected = IntegrityException.class)
|
||||
public void testAddToTransferContainerTest()
|
||||
{
|
||||
NodeRef transferContainer = generateNodeRef(TYPE_TRANSFER_CONTAINER, true);
|
||||
|
@@ -30,10 +30,9 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.repo.node.integrity.IntegrityException;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -53,9 +52,9 @@ public class TransferTypeUnitTest extends BaseUnitTest
|
||||
|
||||
/**
|
||||
* Given that we try to add to transfer type folder,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
@Test(expected = IntegrityException.class)
|
||||
public void testAddToTransferFolderTest()
|
||||
{
|
||||
NodeRef transferFolder = generateNodeRef(TYPE_TRANSFER, true);
|
||||
|
@@ -30,11 +30,10 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.repo.node.integrity.IntegrityException;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -54,9 +53,9 @@ public class UnfiledRecordContainerTypeUnitTest extends BaseUnitTest
|
||||
|
||||
/**
|
||||
* Given that we try to add a type that is not one of "rma:unfiledRecordFolder", "cm:content" or "rma:nonElectronicDocument" types to unfiled record container,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
@Test(expected = IntegrityException.class)
|
||||
public void testAddNonAcceptedTypeToUnfiledRecordContainer()
|
||||
{
|
||||
QName type = AlfMock.generateQName();
|
||||
|
@@ -30,11 +30,10 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.repo.node.integrity.IntegrityException;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -54,9 +53,9 @@ public class UnfiledRecordFolderTypeUnitTest extends BaseUnitTest
|
||||
|
||||
/**
|
||||
* Given that we try to add a type that is not one of "rma:unfiledRecordFolder", "cm:content" or "rma:nonElectronicDocument" types to unfiled record folder,
|
||||
* Then InvalidParameterException is thrown.
|
||||
* Then IntegrityException is thrown.
|
||||
*/
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
@Test(expected = IntegrityException.class)
|
||||
public void testAddNonAcceptedTypeToUnfiledRecordFolder()
|
||||
{
|
||||
QName type = AlfMock.generateQName();
|
||||
|
Reference in New Issue
Block a user