mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
MT - enable simple MT tests
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10966 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
15
source/java/org/alfresco/repo/tenant/MultiTDemoSystemTest.java → source/java/org/alfresco/repo/tenant/MultiTDemoTest.java
Executable file → Normal file
15
source/java/org/alfresco/repo/tenant/MultiTDemoSystemTest.java → source/java/org/alfresco/repo/tenant/MultiTDemoTest.java
Executable file → Normal file
@@ -62,13 +62,16 @@ import org.alfresco.util.ApplicationContextHelper;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
|
|
||||||
public class MultiTDemoSystemTest extends TestCase
|
public class MultiTDemoTest extends TestCase
|
||||||
{
|
{
|
||||||
private static Log logger = LogFactory.getLog(MultiTDemoSystemTest.class);
|
private static Log logger = LogFactory.getLog(MultiTDemoTest.class);
|
||||||
|
|
||||||
private static ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();
|
|
||||||
|
|
||||||
|
private static ApplicationContext ctx =new ClassPathXmlApplicationContext(
|
||||||
|
new String[] {ApplicationContextHelper.CONFIG_LOCATIONS[0], "classpath:tenant/mt-*context.xml"}
|
||||||
|
);
|
||||||
|
|
||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
private AuthenticationService authenticationService;
|
private AuthenticationService authenticationService;
|
||||||
private PersonService personService;
|
private PersonService personService;
|
||||||
@@ -105,7 +108,7 @@ public class MultiTDemoSystemTest extends TestCase
|
|||||||
public static StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
|
public static StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
|
||||||
|
|
||||||
|
|
||||||
public MultiTDemoSystemTest()
|
public MultiTDemoTest()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,7 +562,7 @@ public class MultiTDemoSystemTest extends TestCase
|
|||||||
public static void main(String args[])
|
public static void main(String args[])
|
||||||
{
|
{
|
||||||
System.out.println(new Date());
|
System.out.println(new Date());
|
||||||
junit.textui.TestRunner.run(MultiTDemoSystemTest.class);
|
junit.textui.TestRunner.run(MultiTDemoTest.class);
|
||||||
System.out.println(new Date());
|
System.out.println(new Date());
|
||||||
}
|
}
|
||||||
|
|
46
source/test-resources/tenant/mt-admin-context.xml
Normal file
46
source/test-resources/tenant/mt-admin-context.xml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||||
|
|
||||||
|
<beans>
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
<!-- MT Admin Service Implementation -->
|
||||||
|
<!-- -->
|
||||||
|
|
||||||
|
<bean id="tenantAdminService" class="org.alfresco.repo.tenant.MultiTAdminServiceImpl">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<property name="nodeService" ref="NodeService"/>
|
||||||
|
-->
|
||||||
|
<property name="nodeService" ref="dbNodeServiceImpl"/> <!-- TODO - go direct, until we expose deleteStore via public NodeService API -->
|
||||||
|
<property name="dictionaryComponent" ref="dictionaryService"/>
|
||||||
|
<property name="authenticationComponent" ref="authenticationComponent"/>
|
||||||
|
<property name="repoAdminService" ref="RepoAdminService"/>
|
||||||
|
<property name="tenantService" ref="tenantService"/>
|
||||||
|
<property name="transactionService" ref="transactionComponent"/>
|
||||||
|
<property name="attributeService" ref="AttributeService"/>
|
||||||
|
<property name="passwordEncoder" ref="passwordEncoder"/>
|
||||||
|
<property name="tenantFileContentStore" ref="tenantFileContentStore"/>
|
||||||
|
<property name="workflowService" ref="WorkflowService"/>
|
||||||
|
<property name="repositoryExporterService" ref="repositoryExporterComponent"/>
|
||||||
|
<property name="workflowDeployer" ref="workflowBootstrap"/>
|
||||||
|
<property name="moduleService" ref="moduleService"/>
|
||||||
|
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="tenantInterpreter" class="org.alfresco.repo.tenant.TenantInterpreter">
|
||||||
|
<property name="transactionService" ref="transactionComponent"/>
|
||||||
|
<property name="tenantAdminService" ref="tenantAdminService"/>
|
||||||
|
<property name="tenantService" ref="tenantService"/>
|
||||||
|
<property name="authenticationService" ref="AuthenticationService"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="tenantInterpreterHelp" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
|
||||||
|
<property name="resourceBundles">
|
||||||
|
<list>
|
||||||
|
<value>alfresco.messages.tenant-interpreter-help</value>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
76
source/test-resources/tenant/mt-contentstore-context.xml
Normal file
76
source/test-resources/tenant/mt-contentstore-context.xml
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||||
|
|
||||||
|
<beans>
|
||||||
|
|
||||||
|
<!-- ======================================= -->
|
||||||
|
<!-- Tenant Routing File Content Store Cache -->
|
||||||
|
<!-- ======================================= -->
|
||||||
|
|
||||||
|
<bean name="tenantFileStoresCache" class="org.alfresco.repo.cache.EhCacheAdapter">
|
||||||
|
<property name="cache">
|
||||||
|
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >
|
||||||
|
<property name="cacheManager">
|
||||||
|
<ref bean="internalEHCacheManager" />
|
||||||
|
</property>
|
||||||
|
<property name="cacheName">
|
||||||
|
<value>org.alfresco.cache.tenantFileStoresCache</value>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
<!-- Tenant Routing File Content Store -->
|
||||||
|
<!-- -->
|
||||||
|
|
||||||
|
<bean id="tenantFileContentStore" class="org.alfresco.repo.content.TenantRoutingFileContentStore" init-method="init">
|
||||||
|
<property name="defaultRootDir">
|
||||||
|
<value>${dir.contentstore}</value>
|
||||||
|
</property>
|
||||||
|
<property name="tenantService">
|
||||||
|
<ref bean="tenantService" />
|
||||||
|
</property>
|
||||||
|
<property name="storesCache">
|
||||||
|
<ref bean="tenantFileStoresCache" />
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- override content store cleaner to use tenant routing file content store -->
|
||||||
|
<!-- Performs the content cleanup -->
|
||||||
|
<bean id="contentStoreCleaner" class="org.alfresco.repo.content.cleanup.ContentStoreCleaner" >
|
||||||
|
<property name="dictionaryService">
|
||||||
|
<ref bean="dictionaryService" />
|
||||||
|
</property>
|
||||||
|
<property name="nodeDaoService" >
|
||||||
|
<ref bean="nodeDaoService" />
|
||||||
|
</property>
|
||||||
|
<property name="avmNodeDAO">
|
||||||
|
<ref bean="avmNodeDAO"/>
|
||||||
|
</property>
|
||||||
|
<property name="transactionService" >
|
||||||
|
<ref bean="transactionService" />
|
||||||
|
</property>
|
||||||
|
<property name="protectDays" >
|
||||||
|
<value>14</value>
|
||||||
|
</property>
|
||||||
|
<property name="stores" >
|
||||||
|
<list>
|
||||||
|
<ref bean="tenantFileContentStore" />
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
<property name="listeners" >
|
||||||
|
<list>
|
||||||
|
<ref bean="deletedContentBackupListener" />
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- override content service to use tenant routing file content store -->
|
||||||
|
<bean id="contentService" parent="baseContentService">
|
||||||
|
<property name="store">
|
||||||
|
<ref bean="tenantFileContentStore" />
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
55
source/test-resources/tenant/mt-context.xml
Normal file
55
source/test-resources/tenant/mt-context.xml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||||
|
|
||||||
|
<beans>
|
||||||
|
|
||||||
|
<!-- ===================================== -->
|
||||||
|
<!-- Tenants Cache -->
|
||||||
|
<!-- ===================================== -->
|
||||||
|
|
||||||
|
<!-- The cross-transaction shared cache for in-memory Tenants -->
|
||||||
|
|
||||||
|
<bean name="tenantsSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter">
|
||||||
|
<property name="cache">
|
||||||
|
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >
|
||||||
|
<property name="cacheManager">
|
||||||
|
<ref bean="internalEHCacheManager" />
|
||||||
|
</property>
|
||||||
|
<property name="cacheName">
|
||||||
|
<value>org.alfresco.cache.tenantsCache</value>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- The transactional cache for in-memory Tenants -->
|
||||||
|
|
||||||
|
<bean name="tenantsCache" class="org.alfresco.repo.cache.TransactionalCache">
|
||||||
|
<property name="sharedCache">
|
||||||
|
<ref bean="tenantsSharedCache" />
|
||||||
|
</property>
|
||||||
|
<property name="cacheManager" >
|
||||||
|
<ref bean="transactionalEHCacheManager" />
|
||||||
|
</property>
|
||||||
|
<property name="name">
|
||||||
|
<value>org.alfresco.tenantsTransactionalCache</value>
|
||||||
|
</property>
|
||||||
|
<property name="maxCacheSize">
|
||||||
|
<value>10</value>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
<!-- MT Service Implementation -->
|
||||||
|
<!-- -->
|
||||||
|
|
||||||
|
<bean id="tenantService" class="org.alfresco.repo.tenant.MultiTServiceImpl">
|
||||||
|
|
||||||
|
<property name="tenantsCache">
|
||||||
|
<ref bean="tenantsCache"/>
|
||||||
|
</property>
|
||||||
|
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
Reference in New Issue
Block a user