Examples of ConfigurationHandler


Examples of org.apache.ace.agent.ConfigurationHandler

        assertEquals(identificationHandler.getAgentId(), "yyy");
    }

    @Test
    public void testNoIdentification() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);
        reset(configurationHandler);
        expect(configurationHandler.get(eq(AgentConstants.CONFIG_IDENTIFICATION_AGENTID), anyObject(String.class)))
            .andReturn(null).once();
        replay(configurationHandler);
        IdentificationHandler identificationHandler = m_agentContext.getHandler(IdentificationHandler.class);
        assertNull(identificationHandler.getAgentId());
    }
View Full Code Here

Examples of org.apache.ace.agent.ConfigurationHandler

        assertNull(identificationHandler.getAgentId());
    }

    @Test
    public void testEmptyIdentification() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);
        reset(configurationHandler);
        expect(configurationHandler.get(eq(AgentConstants.CONFIG_IDENTIFICATION_AGENTID), anyObject(String.class)))
            .andReturn(null).once();
        replay(configurationHandler);
        IdentificationHandler identificationHandler = m_agentContext.getHandler(IdentificationHandler.class);
        assertNull(identificationHandler.getAgentId());
    }
View Full Code Here

Examples of org.apache.ace.agent.ConfigurationHandler

    @Test
    public void testBasicAuthFORBIDDEN() throws Exception {
        Map<String, String> props = new HashMap<String, String>();
        props.put(AgentConstants.CONFIG_CONNECTION_AUTHTYPE, Types.NONE.name());

        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);
        configurationHandler.putAll(props);

        ConnectionHandler connectionHandler = m_agentContext.getHandler(ConnectionHandler.class);
        HttpURLConnection connection = (HttpURLConnection) connectionHandler.getConnection(m_basicAuthURL);

        assertEquals(connection.getResponseCode(), HttpServletResponse.SC_FORBIDDEN);
View Full Code Here

Examples of org.apache.ace.agent.ConfigurationHandler

        Map<String, String> props = new HashMap<String, String>();
        props.put(AgentConstants.CONFIG_CONNECTION_AUTHTYPE, Types.BASIC.name());
        props.put(AgentConstants.CONFIG_CONNECTION_USERNAME, USERNAME);
        props.put(AgentConstants.CONFIG_CONNECTION_PASSWORD, PASSWORD);

        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);
        configurationHandler.putAll(props);

        ConnectionHandler connectionHandler = m_agentContext.getHandler(ConnectionHandler.class);

        HttpURLConnection connection = (HttpURLConnection) connectionHandler.getConnection(m_basicAuthURL);
        assertEquals(connection.getResponseCode(), HttpServletResponse.SC_OK);
View Full Code Here

Examples of org.apache.ace.agent.ConfigurationHandler

        clearTestMocks();
    }

    @Test
    public void testAvailableURL() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);

        configureAgent(configurationHandler, AgentConstants.CONFIG_DISCOVERY_SERVERURLS, m_availableURL.toExternalForm(), AgentConstants.CONFIG_DISCOVERY_CHECKING, "true");

        DiscoveryHandler discoveryHandler = m_agentContext.getHandler(DiscoveryHandler.class);
        assertEquals(discoveryHandler.getServerUrl(), m_availableURL);
View Full Code Here

Examples of org.apache.ace.agent.ConfigurationHandler

        assertEquals(discoveryHandler.getServerUrl(), m_availableURL);
    }

    @Test
    public void testUnavailableURL_unavailable() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);

        configureAgent(configurationHandler, AgentConstants.CONFIG_DISCOVERY_SERVERURLS, m_unavailableURL.toExternalForm(), AgentConstants.CONFIG_DISCOVERY_CHECKING, "true");

        DiscoveryHandler discoveryHandler = m_agentContext.getHandler(DiscoveryHandler.class);
        assertNull(discoveryHandler.getServerUrl());
View Full Code Here

Examples of org.apache.ace.agent.ConfigurationHandler

        assertNull(discoveryHandler.getServerUrl());
    }

    @Test
    public void testUnavailableAfterConfigUpdate() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);

        configureAgent(configurationHandler, AgentConstants.CONFIG_DISCOVERY_SERVERURLS, m_availableURL.toExternalForm(), AgentConstants.CONFIG_DISCOVERY_CHECKING, "true");

        DiscoveryHandler discoveryHandler = m_agentContext.getHandler(DiscoveryHandler.class);
        assertEquals(discoveryHandler.getServerUrl(), m_availableURL);
View Full Code Here

Examples of org.apache.ace.agent.ConfigurationHandler

        assertNull(discoveryHandler.getServerUrl());
    }

    @Test
    public void testAvailableAfterConfigUpdate() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);

        configureAgent(configurationHandler, AgentConstants.CONFIG_DISCOVERY_SERVERURLS, m_unavailableURL.toExternalForm(), AgentConstants.CONFIG_DISCOVERY_CHECKING, "true");

        DiscoveryHandler discoveryHandler = m_agentContext.getHandler(DiscoveryHandler.class);
        assertNull(discoveryHandler.getServerUrl());
View Full Code Here

Examples of org.apache.ace.agent.ConfigurationHandler

        assertEquals(discoveryHandler.getServerUrl(), m_availableURL);
    }

    @Test
    public void testAvailableAfterUnavailableURL() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);

        configureAgent(configurationHandler, AgentConstants.CONFIG_DISCOVERY_SERVERURLS, m_unavailableURL.toExternalForm() + "," + m_availableURL.toExternalForm(), AgentConstants.CONFIG_DISCOVERY_CHECKING, "true");

        DiscoveryHandler discoveryHandler = m_agentContext.getHandler(DiscoveryHandler.class);
        assertEquals(discoveryHandler.getServerUrl(), m_availableURL);
View Full Code Here

Examples of org.apache.ace.agent.ConfigurationHandler

        assertEquals(discoveryHandler.getServerUrl(), m_availableURL);
    }

    @Test
    public void testEmptyURLConfig() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);

        configureAgent(configurationHandler, AgentConstants.CONFIG_DISCOVERY_SERVERURLS, "", AgentConstants.CONFIG_DISCOVERY_CHECKING, "true");

        DiscoveryHandler discoveryHandler = m_agentContext.getHandler(DiscoveryHandler.class);
        assertNull(discoveryHandler.getServerUrl());
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.