Package org.apache.sling.replication.transport.authentication

Examples of org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider


*/
public class RemoteReplicationPackageImporterTest {

    @Test
    public void testDummyImport() throws Exception {
        TransportAuthenticationProvider authenticationProvider = mock(TransportAuthenticationProvider.class);
        String[] endpoints = new String[0];
        for (TransportEndpointStrategyType strategy : TransportEndpointStrategyType.values()) {
            RemoteReplicationPackageImporter remoteReplicationPackageImporter = new RemoteReplicationPackageImporter(
                    authenticationProvider, endpoints, strategy.name());
            ResourceResolver resourceResolver = mock(ResourceResolver.class);
View Full Code Here


            Map<String, Object> builderProperties = extractMap(COMPONENT_PACKAGE_BUILDER, properties);
            ReplicationPackageBuilder packageBuilder = createBuilder(builderProperties);
            return new LocalReplicationPackageExporter(packageBuilder);
        } else if (PACKAGE_EXPORTER_REMOTE.equals(factory)) {
            Map<String, Object> authenticationProviderProperties = extractMap(COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER, properties);
            TransportAuthenticationProvider authenticationProvider = createTransportAuthenticationProvider(authenticationProviderProperties, componentProvider);

            Map<String, Object> builderProperties = extractMap(COMPONENT_PACKAGE_BUILDER, properties);
            ReplicationPackageBuilder packageBuilder = createBuilder(builderProperties);

View Full Code Here

            Map<String, Object> builderProperties = extractMap(COMPONENT_PACKAGE_BUILDER, properties);
            ReplicationPackageBuilder packageBuilder = createBuilder(builderProperties);
            return new LocalReplicationPackageImporter(packageBuilder, replicationEventFactory);
        } else if (PACKAGE_IMPORTER_REMOTE.equals(factory)) {
            Map<String, Object> authenticationProviderProperties = extractMap(COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER, properties);
            TransportAuthenticationProvider authenticationProvider = createTransportAuthenticationProvider(authenticationProviderProperties, componentProvider);

            String[] endpoints = PropertiesUtil.toStringArray(properties.get(PACKAGE_EXPORTER_REMOTE_PROPERTY_ENDPOINTS), new String[0]);
            String endpointStrategyName = PropertiesUtil.toString(properties.get(PACKAGE_EXPORTER_REMOTE_PROPERTY_ENDPOINTS_STRATEGY), "One");

            return new RemoteReplicationPackageImporter(authenticationProvider, endpoints, endpointStrategyName);
View Full Code Here

            return componentProvider.getComponent(ReplicationTrigger.class, name);

        } else if (TRIGGER_REMOTE_EVENT.equals(factory)) {
            Map<String, Object> authenticationProviderProperties = extractMap(COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER, properties);

            TransportAuthenticationProvider authenticationProvider = createTransportAuthenticationProvider(authenticationProviderProperties, componentProvider);
            String endpoint = PropertiesUtil.toString(properties.get(TRIGGER_REMOTE_EVENT_PROPERTY_ENDPOINT), null);

            return new RemoteEventReplicationTrigger(endpoint, authenticationProvider, scheduler);
        } else if (TRIGGER_RESOURCE_EVENT.equals(factory)) {
            String path = PropertiesUtil.toString(properties.get(TRIGGER_RESOURCE_EVENT_PROPERTY_PATH), null);
View Full Code Here

public class RemoteReplicationPackageExporterTest {

    @Test
    public void testDummyExport() throws Exception {
        ReplicationPackageBuilder packageBuilder = mock(ReplicationPackageBuilder.class);
        TransportAuthenticationProvider authProvider = mock(TransportAuthenticationProvider.class);
        String[] endpoints = new String[0];
        for (TransportEndpointStrategyType strategy : TransportEndpointStrategyType.values()) {
            RemoteReplicationPackageExporter remoteReplicationPackageExporter = new RemoteReplicationPackageExporter(
                    packageBuilder, authProvider, endpoints, strategy.name(), 1);
            ResourceResolver resourceResolver = mock(ResourceResolver.class);
View Full Code Here

        DefaultReplicationComponentFactory defaultReplicationComponentFactory = new DefaultReplicationComponentFactory();
        String name = "sample-auth";
        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);
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider

Copyright © 2018 www.massapicom. 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.