Package org.apache.sling.replication.component.impl

Examples of org.apache.sling.replication.component.impl.DefaultReplicationComponentFactory.createComponent()


        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put("name", name);
        ReplicationComponentProvider provider = mock(ReplicationComponentProvider.class);
        ReplicationAgent agent = mock(ReplicationAgent.class);
        when(provider.getComponent(ReplicationAgent.class, name)).thenReturn(agent);
        ReplicationAgent component = defaultReplicationComponentFactory.createComponent(ReplicationAgent.class, properties, provider);
        assertNull(component); // agents cannot be referenced by service name using the factory
    }

    @Test
    public void testDefaultCreateComponentForTriggerByService() throws Exception {
View Full Code Here


        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put("name", name);
        ReplicationComponentProvider provider = mock(ReplicationComponentProvider.class);
        ReplicationTrigger trigger = mock(ReplicationTrigger.class);
        when(provider.getComponent(ReplicationTrigger.class, name)).thenReturn(trigger);
        ReplicationTrigger component = defaultReplicationComponentFactory.createComponent(ReplicationTrigger.class, properties, provider);
        assertNotNull(component);
    }

    @Test
    public void testDefaultCreateComponentForTransportAuthenticationProviderByService() throws Exception {
View Full Code Here

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put("name", name);
        ReplicationComponentProvider provider = mock(ReplicationComponentProvider.class);
        TransportAuthenticationProvider authenticationProvider = mock(TransportAuthenticationProvider.class);
        when(provider.getComponent(TransportAuthenticationProvider.class, name)).thenReturn(authenticationProvider);
        TransportAuthenticationProvider component = defaultReplicationComponentFactory.createComponent(TransportAuthenticationProvider.class, properties, provider);
        assertNotNull(component);
    }

    @Test
    public void testDefaultCreateComponentForImporterByService() throws Exception {
View Full Code Here

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put("name", name);
        ReplicationComponentProvider provider = mock(ReplicationComponentProvider.class);
        ReplicationPackageImporter importer = mock(ReplicationPackageImporter.class);
        when(provider.getComponent(ReplicationPackageImporter.class, name)).thenReturn(importer);
        ReplicationPackageImporter component = defaultReplicationComponentFactory.createComponent(ReplicationPackageImporter.class, properties, provider);
        assertNotNull(component);
    }

    @Test
    public void testDefaultCreateComponentForExporterByService() throws Exception {
View Full Code Here

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put("name", name);
        ReplicationComponentProvider provider = mock(ReplicationComponentProvider.class);
        ReplicationPackageExporter exporter = mock(ReplicationPackageExporter.class);
        when(provider.getComponent(ReplicationPackageExporter.class, name)).thenReturn(exporter);
        ReplicationPackageExporter component = defaultReplicationComponentFactory.createComponent(ReplicationPackageExporter.class, properties, provider);
        assertNotNull(component);
    }

    @Test
    public void testCreateAgent() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.