Package com.day.cq.replication

Examples of com.day.cq.replication.Agent


        verifyNoMoreInteractions(replicator);
    }

    @Test
    public void testGetFlushAgents() throws Exception {
        final Agent agent1 = mock(Agent.class);
        final Agent agent2 = mock(Agent.class);

        final AgentConfig agentConfig1 = mock(AgentConfig.class);
        final AgentConfig agentConfig2 = mock(AgentConfig.class);

        @SuppressWarnings("unchecked")
        final Map<String, Agent> agents = mock(Map.class);
        final Collection<Agent> agentValues = Arrays.asList(new Agent[]{ agent1, agent2 });

        when(agentManager.getAgents()).thenReturn(agents);

        when(agents.values()).thenReturn(agentValues);

        when(agent1.getId()).thenReturn("Agent 1");
        when(agent1.isEnabled()).thenReturn(true);
        when(agent1.getConfiguration()).thenReturn(agentConfig1);

        when(agent2.getId()).thenReturn("Agent 2");
        when(agent2.isEnabled()).thenReturn(true);
        when(agent2.getConfiguration()).thenReturn(agentConfig2);

        when(agentConfig1.getSerializationType()).thenReturn("flush");
        when(agentConfig2.getSerializationType()).thenReturn("notflush");

        when(agentConfig1.getTransportURI()).thenReturn("http://localhost/dispatcher/invalidate.cache");
View Full Code Here


            if (paths.length > 0) {
                final Map<Agent, ReplicationResult> results = dispatcherFlusher.flush(resourceResolver,
                        replicationActionType, true, paths);

                for (final Map.Entry<Agent, ReplicationResult> entry : results.entrySet()) {
                    final Agent agent = entry.getKey();
                    final ReplicationResult result = entry.getValue();

                    overallResults.add(new FlushResult(agent, result));
                }
            }
View Full Code Here

TOP

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

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.