Package com.day.cq.replication

Examples of com.day.cq.replication.ReplicationAction


    @Test
    public void testPreprocess_notAccepts_ReplicationOptionsIsNull() throws Exception {
        when(hierarchicalFlushRules.size()).thenReturn(9);

        dispatcherFlushRules.preprocess(new ReplicationAction(ReplicationActionType.ACTIVATE, "/content/foo"), null);

        verifyZeroInteractions(dispatcherFlusher);
    }
View Full Code Here


    @Test
    public void testPreprocess_notAccepts_ReplicationActionNoFlushRules() throws Exception {
        when(this.hierarchicalFlushRules.size()).thenReturn(0);
        when(this.resourceOnlyFlushRules.size()).thenReturn(0);

        final ReplicationAction replicationAction = mock(ReplicationAction.class);
        when(replicationAction.getPath()).thenReturn("/content/acs-aem-commons");

        dispatcherFlushRules.preprocess(replicationAction, new ReplicationOptions());

        verifyZeroInteractions(dispatcherFlusher);
    }
View Full Code Here

    @Test
    public void testPreprocess_notAccepts_ReplicationActionPathEmpty() throws Exception {
        when(this.hierarchicalFlushRules.size()).thenReturn(9);
        when(this.resourceOnlyFlushRules.size()).thenReturn(9);

        final ReplicationAction replicationAction = mock(ReplicationAction.class);
        when(replicationAction.getPath()).thenReturn("");

        dispatcherFlushRules.preprocess(replicationAction, new ReplicationOptions());

        verifyZeroInteractions(dispatcherFlusher);
    }
View Full Code Here

    @Test
    public void testPreprocess_notAccepts_ReplicationActionPathNull() throws Exception {
        when(this.hierarchicalFlushRules.size()).thenReturn(9);
        when(this.resourceOnlyFlushRules.size()).thenReturn(9);

        final ReplicationAction replicationAction = mock(ReplicationAction.class);
        when(replicationAction.getPath()).thenReturn(null);

        dispatcherFlushRules.preprocess(replicationAction, new ReplicationOptions());

        verifyZeroInteractions(dispatcherFlusher);
    }
View Full Code Here

    @Test
    public void testPreprocess_notAccepts_ReplicationActionTypeInternalPoll() throws Exception {
        when(this.hierarchicalFlushRules.size()).thenReturn(9);
        when(this.resourceOnlyFlushRules.size()).thenReturn(9);

        final ReplicationAction replicationAction = mock(ReplicationAction.class);
        when(replicationAction.getPath()).thenReturn("/content/acs-aem-commons");
        when(replicationAction.getType()).thenReturn(ReplicationActionType.INTERNAL_POLL);

        dispatcherFlushRules.preprocess(replicationAction, new ReplicationOptions());

        verifyZeroInteractions(dispatcherFlusher);
    }
View Full Code Here

    @Test
    public void testPreprocess_notAccepts_ReplicationActionTypeTest() throws Exception {
        when(this.hierarchicalFlushRules.size()).thenReturn(9);
        when(this.resourceOnlyFlushRules.size()).thenReturn(9);

        final ReplicationAction replicationAction = mock(ReplicationAction.class);
        when(replicationAction.getPath()).thenReturn("/content/acs-aem-commons");
        when(replicationAction.getType()).thenReturn(ReplicationActionType.TEST);

        dispatcherFlushRules.preprocess(replicationAction, new ReplicationOptions());

        verifyZeroInteractions(dispatcherFlusher);
    }
View Full Code Here

    @Test
    public void testPreprocess_notAccepts_NonMatchingPath() throws Exception {
        this.hierarchicalFlushRules.put(Pattern.compile("/content/foo.*"), new String[] { "/content/target" });

        final ReplicationAction replicationAction = mock(ReplicationAction.class);
        when(replicationAction.getPath()).thenReturn("/content/acs-aem-commons");
        when(replicationAction.getType()).thenReturn(ReplicationActionType.ACTIVATE);

        final ReplicationOptions replicationOptions = new ReplicationOptions();
        replicationOptions.setSynchronous(false);

        dispatcherFlushRules.preprocess(replicationAction, replicationOptions);
View Full Code Here

    @Test
    public void testPreprocess_success_hierarchical() throws Exception {
        hierarchicalFlushRules.put(Pattern.compile("/content/acs-aem-commons/.*"), new String[] { "/content/target", "/content/target2" });

        final ReplicationAction replicationAction = mock(ReplicationAction.class);
        when(replicationAction.getPath()).thenReturn("/content/acs-aem-commons/page");
        when(replicationAction.getType()).thenReturn(ReplicationActionType.ACTIVATE);

        final ReplicationOptions replicationOptions = new ReplicationOptions();
        replicationOptions.setSynchronous(false);

        final ArgumentCaptor<DispatcherFlushFilter> agentFilterCaptor = ArgumentCaptor.forClass(DispatcherFlushFilter
View Full Code Here

    @Test
    public void testPreprocess_success_resourceOnly() throws Exception {
        resourceOnlyFlushRules.put(Pattern.compile("/content/acs-aem-commons/.*"), new String[] { "/content/target" });

        final ReplicationAction replicationAction = mock(ReplicationAction.class);
        when(replicationAction.getPath()).thenReturn("/content/acs-aem-commons/page");
        when(replicationAction.getType()).thenReturn(ReplicationActionType.ACTIVATE);

        final ReplicationOptions replicationOptions = new ReplicationOptions();
        replicationOptions.setSynchronous(false);

        final ArgumentCaptor<DispatcherFlushFilter> agentFilterCaptor = ArgumentCaptor.forClass(DispatcherFlushFilter
View Full Code Here

    @Test
    public void testPreprocess_success_hierarchicalAndResourceOnly() throws Exception {
        hierarchicalFlushRules.put(Pattern.compile("/content/.*"), new String[] { "/content/hierarchical" });
        resourceOnlyFlushRules.put(Pattern.compile("/content/.*"), new String[] { "/content/resource-only" });

        final ReplicationAction replicationAction = mock(ReplicationAction.class);
        when(replicationAction.getPath()).thenReturn("/content/acs-aem-commons/page");
        when(replicationAction.getType()).thenReturn(ReplicationActionType.ACTIVATE);

        final ReplicationOptions replicationOptions = new ReplicationOptions();
        replicationOptions.setSynchronous(false);
        replicationOptions.setFilter(new DispatcherFlushFilter());

View Full Code Here

TOP

Related Classes of com.day.cq.replication.ReplicationAction

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.