RM-2075 Integration test for classification reasons.

Currently just checks the bootstrapped config file has been loaded and
is exposed over the API.

+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101228 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tom Page
2015-04-07 09:35:10 +00:00
parent 37a950d211
commit 8403b07d42
4 changed files with 108 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
*/
package org.alfresco.module.org_alfresco_module_rm.test.integration;
import org.alfresco.module.org_alfresco_module_rm.test.integration.classification.ClassificationTestSuite;
import org.alfresco.module.org_alfresco_module_rm.test.integration.disposition.DispositionTestSuite;
import org.alfresco.module.org_alfresco_module_rm.test.integration.dod.DoD5015TestSuite;
import org.alfresco.module.org_alfresco_module_rm.test.integration.event.EventTestSuite;
@@ -55,7 +56,8 @@ import org.junit.runners.Suite.SuiteClasses;
HoldTestSuite.class,
VersionTestSuite.class,
RelationshipTestSuite.class,
TransferTestSuite.class
TransferTestSuite.class,
ClassificationTestSuite.class
})
public class IntegrationTestSuite
{

View File

@@ -0,0 +1,64 @@
/*
* Copyright (C) 2005-2015 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.module.org_alfresco_module_rm.test.integration.classification;
import java.util.List;
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationReason;
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
/**
* Tests of classification reason handling.
*
* @author tpage
* @since 3.0
*/
public class ClassificationReasonsTest extends BaseRMTestCase
{
/**
* Given the default classification reasons config file is on the classpath
* When the system has finished starting up
* Then the classification service exposes the classification reasons.
*/
public void testLoadBootstrappedClassificationReasons() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
public void given() throws Exception
{
// NOOP: The default classification reasons config file is on the classpath.
}
public void when() throws Exception
{
// NOOP: The system has finished starting up.
}
public void then() throws Exception
{
// Check the classification service exposes the classification reasons.
List<ClassificationReason> reasons = classificationService.getClassificationReasons();
assertNotNull(reasons);
assertEquals("The default classification reasons in rm-classification-levels.json contains three reasons.",
3, reasons.size());
}
});
}
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.module.org_alfresco_module_rm.test.integration.classification;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
/**
* Record integration test suite
*
* @author tpage
* @since 3.0
*/
@RunWith(Suite.class)
@SuiteClasses(
{
ClassificationReasonsTest.class
})
public class ClassificationTestSuite
{
}

View File

@@ -29,6 +29,7 @@ import org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminSe
import org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService;
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService;
import org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
@@ -160,6 +161,7 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
protected HoldService holdService;
protected InplaceRecordService inplaceRecordService;
protected RelationshipService relationshipService;
protected ClassificationService classificationService;
/** test data */
protected String siteId;
@@ -399,6 +401,7 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
holdService = (HoldService) applicationContext.getBean("HoldService");
inplaceRecordService = (InplaceRecordService) applicationContext.getBean("InplaceRecordService");
relationshipService = (RelationshipService) applicationContext.getBean("RelationshipService");
classificationService = (ClassificationService) applicationContext.getBean("ClassificationService");
}
/**