Package org.rhq.enterprise.server.plugins.jboss.software

Examples of org.rhq.enterprise.server.plugins.jboss.software.JBossSoftwareContentSourceAdapter


    // Test Cases  --------------------------------------------

    @Test(enabled = TESTS_ENABLED)
    public void liveConnection() throws Exception {
        // Setup
        JBossSoftwareContentSourceAdapter adapter = new JBossSoftwareContentSourceAdapter();
        adapter.initialize(CONFIGURATION);

        // Test
        PackageSyncReport report = new PackageSyncReport();

        adapter.synchronizePackages(null, report, null);

        // Verify
        assert report.getNewPackages().size() > 0 : "No packages were parsed from the live feed";

        log.info("Number of new packages found in liveConnection: " + report.getNewPackages().size());
View Full Code Here


    }

    @Test(enabled = TESTS_ENABLED)
    public void testConnection() throws Exception {
        // Setup
        JBossSoftwareContentSourceAdapter adapter = new JBossSoftwareContentSourceAdapter();
        adapter.initialize(CONFIGURATION);

        // Test

        // This will throw an exception if the connection cannot be made
        adapter.testConnection();
    }
View Full Code Here

    }

    @Test(enabled = TESTS_ENABLED)
    public void bitsGrab() throws Exception {
        // Setup
        JBossSoftwareContentSourceAdapter adapter = new JBossSoftwareContentSourceAdapter();
        adapter.initialize(CONFIGURATION);

        // Test
        InputStream inputStream = adapter
            .getInputStream("https://network.jboss.com/jbossnetwork/secureDownload.html?softwareId=a0430000007iuElAAI");

        // Verify
        assert inputStream != null : "No input stream read from URL";
    }
View Full Code Here

    }

    @Test(enabled = TESTS_ENABLED)
    public void proxyConnection() throws Exception {
        // Setup
        JBossSoftwareContentSourceAdapter adapter = new JBossSoftwareContentSourceAdapter();
        adapter.initialize(PROXY_CONFIGURATION);

        // Test
        PackageSyncReport report = new PackageSyncReport();

        adapter.synchronizePackages(null, report, null);

        // Verify
        assert report.getNewPackages().size() > 0 : "No packages were parsed from the live feed";

        log.info("Number of new packages found in proxyConnection: " + report.getNewPackages().size());
View Full Code Here

    }

    @Test(enabled = TESTS_ENABLED)
    public void authenticatingProxyConnection() throws Exception {
        // Setup
        JBossSoftwareContentSourceAdapter adapter = new JBossSoftwareContentSourceAdapter();
        adapter.initialize(AUTHENTICATING_PROXY_CONFIGURATION);

        // Test
        PackageSyncReport report = new PackageSyncReport();

        adapter.synchronizePackages(null, report, null);

        // Verify
        assert report.getNewPackages().size() > 0 : "No packages were parsed from the live feed";

        log.info("Number of new packages found in proxyConnection: " + report.getNewPackages().size());
View Full Code Here

    public void invalidLogin() throws Exception {
        // Setup
        Configuration invalidLoginConfiguration = CONFIGURATION.clone();
        invalidLoginConfiguration.put(new PropertySimple("username", "foo"));

        JBossSoftwareContentSourceAdapter adapter = new JBossSoftwareContentSourceAdapter();
        adapter.initialize(invalidLoginConfiguration);

        // Test
        PackageSyncReport report = new PackageSyncReport();

        try {
            adapter.synchronizePackages(null, report, null);
        }
        catch (Exception e) {
            assert e.getMessage().toLowerCase().contains("invalid login") :
                "Error message does not properly indicate a failed login. Message: " + e.getMessage();
        }
View Full Code Here

    public void invalidUrl() throws Exception {
        // Setup
        Configuration invalidUrlConfiguration = CONFIGURATION.clone();
        invalidUrlConfiguration.put(new PropertySimple("url", "http://redhat.com/foo.html"));

        JBossSoftwareContentSourceAdapter adapter = new JBossSoftwareContentSourceAdapter();
        adapter.initialize(invalidUrlConfiguration);

        // Test
        PackageSyncReport report = new PackageSyncReport();

        try {
            adapter.synchronizePackages(null, report, null);
        }
        catch (Exception e) {
            assert e.getMessage().toLowerCase().contains("not find the feed") :
                "Error message does not properly indicate an incorrect URL. Message: " + e.getMessage();
        }
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.plugins.jboss.software.JBossSoftwareContentSourceAdapter

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.