mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
59891: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3) 59686: Merged PATCHES/V4.2.1 (4.2.1) to V4.2-BUG-FIX (4.2.2) 59685 : Merged DEV to PATCHES/V4.2.1 (4.2.1) 59669 : MNT-10257 : Error during synchronization: java.lang.Integer cannot be cast to java.lang.Long - New fix for this issue was implemented. - Unit test was added. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62210 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2101,7 +2101,7 @@ public class ChainingUserRegistrySynchronizer extends AbstractLifecycleBean
|
||||
ChainingUserRegistrySynchronizer.ROOT_ATTRIBUTE_PATH,
|
||||
ChainingUserRegistrySynchronizer.START_TIME_ATTRIBUTE);
|
||||
ChainingUserRegistrySynchronizer.this.attributeService.setAttribute(
|
||||
-1,
|
||||
-1L,
|
||||
ChainingUserRegistrySynchronizer.ROOT_ATTRIBUTE_PATH,
|
||||
ChainingUserRegistrySynchronizer.END_TIME_ATTRIBUTE);
|
||||
ChainingUserRegistrySynchronizer.this.attributeService.setAttribute(
|
||||
|
@@ -41,6 +41,8 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.alfresco.util.PropertyMap;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.context.support.StaticApplicationContext;
|
||||
|
||||
@@ -901,6 +903,30 @@ public class ChainingUserRegistrySynchronizerTest extends TestCase
|
||||
: AuthorityType.USER, shortName);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Test {@link ApplicationListener} that checks SyncEndTime before the SynchronizeEndEvent and SynchronizeDirectoryEndEvent events.
|
||||
*/
|
||||
public static class TestSynchronizeEventListener implements ApplicationListener<ApplicationEvent>
|
||||
{
|
||||
private ChainingUserRegistrySynchronizer synchronizer;
|
||||
|
||||
public void setSynchronizer(ChainingUserRegistrySynchronizer synchronizer)
|
||||
{
|
||||
this.synchronizer = synchronizer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationEvent event)
|
||||
{
|
||||
if (SynchronizeEndEvent.class.isAssignableFrom(event.getClass())
|
||||
|| SynchronizeDirectoryEndEvent.class.isAssignableFrom(event.getClass()))
|
||||
{
|
||||
assertEquals(null, this.synchronizer.getSyncEndTime());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A Mock {@link UserRegistry} that returns a fixed set of users and groups.
|
||||
*/
|
||||
|
@@ -73,4 +73,8 @@
|
||||
<!-- A fake applicaton context manager into which we can inject test-specific beans -->
|
||||
<bean id="testApplicationContextManager" class="org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizerTest$MockApplicationContextManager" />
|
||||
|
||||
<bean id="testSynchronizeEventListener" class="org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizerTest$TestSynchronizeEventListener">
|
||||
<property name="synchronizer" ref="testUserRegistrySynchronizer" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
Reference in New Issue
Block a user