Search in sources :

Example 16 with DistributionPackageImporter

use of org.apache.sling.distribution.packaging.DistributionPackageImporter in project sling by apache.

the class ImportingDistributionPackageProcessorTest method testGetPackagesCount.

@Test
public void testGetPackagesCount() throws Exception {
    DistributionPackageImporter importer = mock(DistributionPackageImporter.class);
    SlingRepository repository = mock(SlingRepository.class);
    String agentService = "agentService";
    ResourceResolverFactory resourceResolverFactory = mock(ResourceResolverFactory.class);
    String subServiceName = "ssn";
    SimpleDistributionAgentAuthenticationInfo authInfo = new SimpleDistributionAgentAuthenticationInfo(repository, agentService, resourceResolverFactory, subServiceName);
    String callingUser = "foo";
    String requestId = "123";
    DefaultDistributionLog log = mock(DefaultDistributionLog.class);
    ImportingDistributionPackageProcessor processor = new ImportingDistributionPackageProcessor(importer, authInfo, callingUser, requestId, log);
    assertEquals(0, processor.getPackagesCount());
}
Also used : SlingRepository(org.apache.sling.jcr.api.SlingRepository) ResourceResolverFactory(org.apache.sling.api.resource.ResourceResolverFactory) DistributionPackageImporter(org.apache.sling.distribution.packaging.DistributionPackageImporter) DefaultDistributionLog(org.apache.sling.distribution.log.impl.DefaultDistributionLog) Test(org.junit.Test)

Example 17 with DistributionPackageImporter

use of org.apache.sling.distribution.packaging.DistributionPackageImporter in project sling by apache.

the class ImportingDistributionPackageProcessorTest method testGetPackagesSize.

@Test
public void testGetPackagesSize() throws Exception {
    DistributionPackageImporter importer = mock(DistributionPackageImporter.class);
    SlingRepository repository = mock(SlingRepository.class);
    String agentService = "agentService";
    ResourceResolverFactory resourceResolverFactory = mock(ResourceResolverFactory.class);
    String subServiceName = "ssn";
    SimpleDistributionAgentAuthenticationInfo authInfo = new SimpleDistributionAgentAuthenticationInfo(repository, agentService, resourceResolverFactory, subServiceName);
    String callingUser = "foo";
    String requestId = "123";
    DefaultDistributionLog log = mock(DefaultDistributionLog.class);
    ImportingDistributionPackageProcessor processor = new ImportingDistributionPackageProcessor(importer, authInfo, callingUser, requestId, log);
    assertEquals(0, processor.getPackagesSize());
}
Also used : SlingRepository(org.apache.sling.jcr.api.SlingRepository) ResourceResolverFactory(org.apache.sling.api.resource.ResourceResolverFactory) DistributionPackageImporter(org.apache.sling.distribution.packaging.DistributionPackageImporter) DefaultDistributionLog(org.apache.sling.distribution.log.impl.DefaultDistributionLog) Test(org.junit.Test)

Aggregations

DistributionPackageImporter (org.apache.sling.distribution.packaging.DistributionPackageImporter)17 DefaultDistributionLog (org.apache.sling.distribution.log.impl.DefaultDistributionLog)13 Test (org.junit.Test)13 ResourceResolverFactory (org.apache.sling.api.resource.ResourceResolverFactory)12 DistributionPackageExporter (org.apache.sling.distribution.packaging.DistributionPackageExporter)12 DistributionQueueProvider (org.apache.sling.distribution.queue.DistributionQueueProvider)12 SlingRepository (org.apache.sling.jcr.api.SlingRepository)12 DistributionQueueDispatchingStrategy (org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy)11 DistributionEventFactory (org.apache.sling.distribution.event.impl.DistributionEventFactory)9 DistributionPackage (org.apache.sling.distribution.packaging.DistributionPackage)7 DistributionPackageInfo (org.apache.sling.distribution.packaging.DistributionPackageInfo)7 DistributionQueueItemStatus (org.apache.sling.distribution.queue.DistributionQueueItemStatus)7 SimpleDistributionQueue (org.apache.sling.distribution.queue.impl.simple.SimpleDistributionQueue)7 ResourceResolver (org.apache.sling.api.resource.ResourceResolver)6 DistributionRequest (org.apache.sling.distribution.DistributionRequest)5 SimpleDistributionRequest (org.apache.sling.distribution.SimpleDistributionRequest)5 DistributionPackageProcessor (org.apache.sling.distribution.packaging.DistributionPackageProcessor)5 InvocationOnMock (org.mockito.invocation.InvocationOnMock)5 DistributionResponse (org.apache.sling.distribution.DistributionResponse)4 HashMap (java.util.HashMap)3