Search in sources :

Example 26 with Descriptor

use of org.alfresco.service.descriptor.Descriptor in project alfresco-repository by Alfresco.

the class SystemUsageDataCollectorTest method setUp.

@Before
public void setUp() {
    mockDescriptorDAO = mock(DescriptorDAO.class);
    mockCollectorService = mock(HBDataCollectorService.class);
    mockScheduler = mock(HeartBeatJobScheduler.class);
    mockDataSource = mock(BasicDataSource.class);
    Descriptor mockDescriptor = mock(Descriptor.class);
    when(mockDescriptor.getId()).thenReturn("mock_id");
    when(mockDescriptorDAO.getDescriptor()).thenReturn(mockDescriptor);
    usageSystemCollector = new SystemUsageDataCollector("acs.repository.usage.system", "1.0", "0 0 0 ? * *", mockScheduler);
    usageSystemCollector.setHbDataCollectorService(mockCollectorService);
    usageSystemCollector.setDataSource(mockDataSource);
    usageSystemCollector.setCurrentRepoDescriptorDAO(mockDescriptorDAO);
    collectedData = usageSystemCollector.collectData();
}
Also used : 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) BasicDataSource(org.apache.commons.dbcp.BasicDataSource) Before(org.junit.Before)

Aggregations

Descriptor (org.alfresco.service.descriptor.Descriptor)26 DescriptorService (org.alfresco.service.descriptor.DescriptorService)7 HeartBeatJobScheduler (org.alfresco.heartbeat.jobs.HeartBeatJobScheduler)6 DescriptorDAO (org.alfresco.repo.descriptor.DescriptorDAO)6 HBDataCollectorService (org.alfresco.service.cmr.repository.HBDataCollectorService)6 Before (org.junit.Before)6 RetryingTransactionHelper (org.alfresco.repo.transaction.RetryingTransactionHelper)5 ServiceRegistry (org.alfresco.service.ServiceRegistry)5 NodeRef (org.alfresco.service.cmr.repository.NodeRef)4 LicenseDescriptor (org.alfresco.service.license.LicenseDescriptor)4 BaseSpringTest (org.alfresco.util.BaseSpringTest)4 Test (org.junit.Test)4 Date (java.util.Date)3 HashMap (java.util.HashMap)3 RetryingTransactionCallback (org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback)3 IOException (java.io.IOException)2 Serializable (java.io.Serializable)2 Connection (java.sql.Connection)2 SQLException (java.sql.SQLException)2 Properties (java.util.Properties)2