Change the name of the test class for custom email mapping service

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@44173 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2012-11-29 17:14:14 +00:00
parent 260c2aec4b
commit b65d0e0d31
2 changed files with 30 additions and 30 deletions

View File

@@ -2,16 +2,16 @@
sourceSets.main.java.srcDirs = [sourceJavaDir, 'source/compatibility']
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'javax.servlet:servlet-api:2.5'
testCompile 'org.springframework:spring-test:2.5'
compile 'javax.servlet:servlet-api:2.5'
testCompile 'org.springframework:spring-test:2.5'
testRuntime files(explodedConfigDir)
testRuntime files(configDir)
testRuntime files(testResourceDir)
alfrescoDeps group: alfrescoGroupId, name: 'alfresco', version: alfrescoBaseVersion, type: 'war'
alfrescoDeps group: alfrescoGroupId, name: 'alfresco-solr', version: alfrescoBaseVersion, type: 'zip'
}
@@ -30,11 +30,11 @@ eclipse {
classpath {
file {
withXml {
Map<String, String> map = new HashMap<String, String>()
map.put('kind', 'src')
map.put('path', configDir)
def node = it.asNode()
node.appendNode('classpathentry', map)
}
@@ -74,16 +74,16 @@ test {
include '**/CapabilitiesTest.class'
include '**/CompositeCapabilityTest.class'
include '**/DeclarativeCapabilityTest.class'
include '**/JSONConversionComponentTest.class'
include '**/RecordsManagementServiceImplTest.class'
include '**/CustomEMailMappingServiceServiceImplTest.class'
include '**/CustomEMailMappingServiceImplTest.class'
include '**/DispositionServiceImplTest.class'
include '**/RecordsManagementActionServiceImplTest.class'
include '**/RecordsManagementAdminServiceImplTest.class'
include '**/RecordsManagementSearchServiceImplTest.class'
testLogging.showStandardStreams = true
jvmArgs '-Xms256M', '-Xmx1024M', '-XX:MaxPermSize=256M'
@@ -93,7 +93,7 @@ test {
ant.property(name: "dir.root", value: System.getProperty("user.dir") + "/build/test_alf_data")
systemProperties = ant.getProperties()
}
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}

View File

@@ -26,28 +26,28 @@ import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
/**
* Custom EMail Mapping Service
*
*
* @author Roy Wetherall
* @since 2.0
*/
public class CustomEMailMappingServiceServiceImplTest extends BaseRMTestCase
public class CustomEMailMappingServiceImplTest extends BaseRMTestCase
{
private CustomEmailMappingService eMailMappingService;
@Override
protected void initServices()
{
super.initServices();
eMailMappingService = (CustomEmailMappingService)applicationContext.getBean("customEmailMappingService");
}
@Override
protected boolean isUserTest()
{
return true;
}
public void testCRUD() throws Exception
{
doTestInTransaction(new Test<Void>()
@@ -55,30 +55,30 @@ public class CustomEMailMappingServiceServiceImplTest extends BaseRMTestCase
public Void run()
{
checkCustomMappingSize(20);
eMailMappingService.addCustomMapping("monkey", "cm:monkeyFace");
CustomMapping monkeyMapping = getCustomMapping("monkey", "cm:monkeyFace", checkCustomMappingSize(21), true);
assertNotNull(monkeyMapping);
assertEquals("monkey", monkeyMapping.getFrom());
assertEquals("cm:monkeyFace", monkeyMapping.getTo());
eMailMappingService.deleteCustomMapping("monkey", "cm:monkeyFace");
getCustomMapping("monkey", "cm:monkeyFace", checkCustomMappingSize(20), false);
getCustomMapping("monkey", "cm:monkeyFace", checkCustomMappingSize(20), false);
return null;
}
}, rmAdminName);
}
private CustomMapping getCustomMapping(String from, String to, Set<CustomMapping> maps, boolean contains)
{
CustomMapping result = null;
CustomMapping key = new CustomMapping(from, to);
assertEquals(contains, maps.contains(key));
if (contains == true)
{
{
for (CustomMapping map : maps)
{
if (map.equals(key) == true)
@@ -86,18 +86,18 @@ public class CustomEMailMappingServiceServiceImplTest extends BaseRMTestCase
result = key;
break;
}
}
}
}
return result;
}
private Set<CustomMapping> checkCustomMappingSize(int expected)
{
Set<CustomMapping> maps = eMailMappingService.getCustomMappings();
assertEquals(expected, maps.size());
return maps;
}
@SuppressWarnings("unused")
private void print(Set<CustomMapping> maps)
{