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'] sourceSets.main.java.srcDirs = [sourceJavaDir, 'source/compatibility']
dependencies { dependencies {
compile fileTree(dir: 'libs', include: '*.jar') compile fileTree(dir: 'libs', include: '*.jar')
compile 'javax.servlet:servlet-api:2.5' compile 'javax.servlet:servlet-api:2.5'
testCompile 'org.springframework:spring-test:2.5' testCompile 'org.springframework:spring-test:2.5'
testRuntime files(explodedConfigDir) testRuntime files(explodedConfigDir)
testRuntime files(configDir) testRuntime files(configDir)
testRuntime files(testResourceDir) testRuntime files(testResourceDir)
alfrescoDeps group: alfrescoGroupId, name: 'alfresco', version: alfrescoBaseVersion, type: 'war' alfrescoDeps group: alfrescoGroupId, name: 'alfresco', version: alfrescoBaseVersion, type: 'war'
alfrescoDeps group: alfrescoGroupId, name: 'alfresco-solr', version: alfrescoBaseVersion, type: 'zip' alfrescoDeps group: alfrescoGroupId, name: 'alfresco-solr', version: alfrescoBaseVersion, type: 'zip'
} }
@@ -30,11 +30,11 @@ eclipse {
classpath { classpath {
file { file {
withXml { withXml {
Map<String, String> map = new HashMap<String, String>() Map<String, String> map = new HashMap<String, String>()
map.put('kind', 'src') map.put('kind', 'src')
map.put('path', configDir) map.put('path', configDir)
def node = it.asNode() def node = it.asNode()
node.appendNode('classpathentry', map) node.appendNode('classpathentry', map)
} }
@@ -74,16 +74,16 @@ test {
include '**/CapabilitiesTest.class' include '**/CapabilitiesTest.class'
include '**/CompositeCapabilityTest.class' include '**/CompositeCapabilityTest.class'
include '**/DeclarativeCapabilityTest.class' include '**/DeclarativeCapabilityTest.class'
include '**/JSONConversionComponentTest.class' include '**/JSONConversionComponentTest.class'
include '**/RecordsManagementServiceImplTest.class' include '**/RecordsManagementServiceImplTest.class'
include '**/CustomEMailMappingServiceServiceImplTest.class' include '**/CustomEMailMappingServiceImplTest.class'
include '**/DispositionServiceImplTest.class' include '**/DispositionServiceImplTest.class'
include '**/RecordsManagementActionServiceImplTest.class' include '**/RecordsManagementActionServiceImplTest.class'
include '**/RecordsManagementAdminServiceImplTest.class' include '**/RecordsManagementAdminServiceImplTest.class'
include '**/RecordsManagementSearchServiceImplTest.class' include '**/RecordsManagementSearchServiceImplTest.class'
testLogging.showStandardStreams = true testLogging.showStandardStreams = true
jvmArgs '-Xms256M', '-Xmx1024M', '-XX:MaxPermSize=256M' 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") ant.property(name: "dir.root", value: System.getProperty("user.dir") + "/build/test_alf_data")
systemProperties = ant.getProperties() systemProperties = ant.getProperties()
} }
beforeTest { descriptor -> beforeTest { descriptor ->
logger.lifecycle("Running test: " + 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 * Custom EMail Mapping Service
* *
* @author Roy Wetherall * @author Roy Wetherall
* @since 2.0 * @since 2.0
*/ */
public class CustomEMailMappingServiceServiceImplTest extends BaseRMTestCase public class CustomEMailMappingServiceImplTest extends BaseRMTestCase
{ {
private CustomEmailMappingService eMailMappingService; private CustomEmailMappingService eMailMappingService;
@Override @Override
protected void initServices() protected void initServices()
{ {
super.initServices(); super.initServices();
eMailMappingService = (CustomEmailMappingService)applicationContext.getBean("customEmailMappingService"); eMailMappingService = (CustomEmailMappingService)applicationContext.getBean("customEmailMappingService");
} }
@Override @Override
protected boolean isUserTest() protected boolean isUserTest()
{ {
return true; return true;
} }
public void testCRUD() throws Exception public void testCRUD() throws Exception
{ {
doTestInTransaction(new Test<Void>() doTestInTransaction(new Test<Void>()
@@ -55,30 +55,30 @@ public class CustomEMailMappingServiceServiceImplTest extends BaseRMTestCase
public Void run() public Void run()
{ {
checkCustomMappingSize(20); checkCustomMappingSize(20);
eMailMappingService.addCustomMapping("monkey", "cm:monkeyFace"); eMailMappingService.addCustomMapping("monkey", "cm:monkeyFace");
CustomMapping monkeyMapping = getCustomMapping("monkey", "cm:monkeyFace", checkCustomMappingSize(21), true); CustomMapping monkeyMapping = getCustomMapping("monkey", "cm:monkeyFace", checkCustomMappingSize(21), true);
assertNotNull(monkeyMapping); assertNotNull(monkeyMapping);
assertEquals("monkey", monkeyMapping.getFrom()); assertEquals("monkey", monkeyMapping.getFrom());
assertEquals("cm:monkeyFace", monkeyMapping.getTo()); assertEquals("cm:monkeyFace", monkeyMapping.getTo());
eMailMappingService.deleteCustomMapping("monkey", "cm:monkeyFace"); eMailMappingService.deleteCustomMapping("monkey", "cm:monkeyFace");
getCustomMapping("monkey", "cm:monkeyFace", checkCustomMappingSize(20), false); getCustomMapping("monkey", "cm:monkeyFace", checkCustomMappingSize(20), false);
return null; return null;
} }
}, rmAdminName); }, rmAdminName);
} }
private CustomMapping getCustomMapping(String from, String to, Set<CustomMapping> maps, boolean contains) private CustomMapping getCustomMapping(String from, String to, Set<CustomMapping> maps, boolean contains)
{ {
CustomMapping result = null; CustomMapping result = null;
CustomMapping key = new CustomMapping(from, to); CustomMapping key = new CustomMapping(from, to);
assertEquals(contains, maps.contains(key)); assertEquals(contains, maps.contains(key));
if (contains == true) if (contains == true)
{ {
for (CustomMapping map : maps) for (CustomMapping map : maps)
{ {
if (map.equals(key) == true) if (map.equals(key) == true)
@@ -86,18 +86,18 @@ public class CustomEMailMappingServiceServiceImplTest extends BaseRMTestCase
result = key; result = key;
break; break;
} }
} }
} }
return result; return result;
} }
private Set<CustomMapping> checkCustomMappingSize(int expected) private Set<CustomMapping> checkCustomMappingSize(int expected)
{ {
Set<CustomMapping> maps = eMailMappingService.getCustomMappings(); Set<CustomMapping> maps = eMailMappingService.getCustomMappings();
assertEquals(expected, maps.size()); assertEquals(expected, maps.size());
return maps; return maps;
} }
@SuppressWarnings("unused") @SuppressWarnings("unused")
private void print(Set<CustomMapping> maps) private void print(Set<CustomMapping> maps)
{ {