Search in sources :

Example 1 with RepoServerMgmtMBean

use of org.alfresco.repo.admin.RepoServerMgmtMBean in project alfresco-repository by Alfresco.

the class SessionsUsageDataCollectorTest method setUp.

@Before
public void setUp() {
    mockDescriptorDAO = mock(DescriptorDAO.class);
    mockCollectorService = mock(HBDataCollectorService.class);
    mockScheduler = mock(HeartBeatJobScheduler.class);
    repoServerMgmtMBean = mock(RepoServerMgmtMBean.class);
    when(repoServerMgmtMBean.getTicketCountNonExpired()).thenReturn(TICKET_NON_EXPIRED);
    Descriptor mockDescriptor = mock(Descriptor.class);
    when(mockDescriptor.getId()).thenReturn("mock_id");
    when(mockDescriptorDAO.getDescriptor()).thenReturn(mockDescriptor);
    sessionsUsageDataCollector = new SessionsUsageDataCollector("acs.repository.usage.sessions", "1.0", "0 0 0/1 ? * *", mockScheduler);
    sessionsUsageDataCollector.setHbDataCollectorService(mockCollectorService);
    sessionsUsageDataCollector.setCurrentRepoDescriptorDAO(mockDescriptorDAO);
    sessionsUsageDataCollector.setRepoServerMgmt(repoServerMgmtMBean);
    collectedData = sessionsUsageDataCollector.collectData();
}
Also used : RepoServerMgmtMBean(org.alfresco.repo.admin.RepoServerMgmtMBean) HeartBeatJobScheduler(org.alfresco.heartbeat.jobs.HeartBeatJobScheduler) HBDataCollectorService(org.alfresco.service.cmr.repository.HBDataCollectorService) Descriptor(org.alfresco.service.descriptor.Descriptor) DescriptorDAO(org.alfresco.repo.descriptor.DescriptorDAO) Before(org.junit.Before)

Aggregations

HeartBeatJobScheduler (org.alfresco.heartbeat.jobs.HeartBeatJobScheduler)1 RepoServerMgmtMBean (org.alfresco.repo.admin.RepoServerMgmtMBean)1 DescriptorDAO (org.alfresco.repo.descriptor.DescriptorDAO)1 HBDataCollectorService (org.alfresco.service.cmr.repository.HBDataCollectorService)1 Descriptor (org.alfresco.service.descriptor.Descriptor)1 Before (org.junit.Before)1