Package sagan.tools

Examples of sagan.tools.DownloadLink


    private void extractPlatformDownloadLink(Download download) {
        ToolSuitePlatform platform = createOrFindPlatform(download.getOs(), download.getVersion());
        EclipseVersion eclipseVersion = createOrFindEclipseVersion(download.getEclipseVersion(), platform);
        Architecture architecture = createOrFindArchitecture(download.getDescription(), eclipseVersion, platform);

        DownloadLink link = downloadLinkExtractor.createDownloadLink(download);
        architecture.getDownloadLinks().add(link);
    }
View Full Code Here


            fileType = "tar.gz";
        } else {
            fileType = download.getFile().substring(download.getFile().lastIndexOf(".") + 1);
        }
        String architecture = download.getDescription().indexOf("64bit") != -1 ? "64" : "32";
        return new DownloadLink(url, fileType, download.getSize(), download.getOs(), architecture);
    }
View Full Code Here

    }

    @Test
    public void stsIndexHasDownloadLinks() throws Exception {
        Map<String, ToolSuitePlatform> platforms = new HashMap<>();
        List<DownloadLink> downloadLinks = Collections.singletonList(new DownloadLink(
                "http://example.com/download.dmg", "dmg", "323MB", "mac", "64"));
        List<Architecture> architectures = Collections.singletonList(new Architecture(
                "Mac OS X (Cocoa, 64bit)", downloadLinks));
        List<EclipseVersion> eclipseVersions = Collections
                .singletonList(new EclipseVersion("1.2", architectures));
View Full Code Here

    }

    @Test
    public void ggtsIndexHasDownloadLinks() throws Exception {
        Map<String, ToolSuitePlatform> platforms = new HashMap<>();
        List<DownloadLink> downloadLinks = Collections.singletonList(new DownloadLink(
                "http://example.com/download.dmg", "dmg", "323MB", "mac", "64"));
        List<Architecture> architectures = Collections.singletonList(new Architecture(
                "Mac OS X (Cocoa, 64bit)", downloadLinks));
        List<EclipseVersion> eclipseVersions = Collections
                .singletonList(new EclipseVersion("1.2", architectures));
View Full Code Here

    @Test
    public void testPreferredDownloadLinks() throws Exception {
        ToolSuiteDownloads toolSuite = buildToolSuite();

        Set<DownloadLink> links = new HashSet<>();
        links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-win32.zip",
                "zip", "323MB", "windows", "32"));
        links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-win32-x86_64.zip",
                "zip", "323MB", "windows", "64"));
        links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-macosx-cocoa.tar.gz",
                "tar.gz", "323MB", "mac", "32"));
        links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-macosx-cocoa-x86_64.tar.gz",
                "tar.gz", "323MB", "mac", "64"));
        links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-linux-gtk.tar.gz",
                "tar.gz", "323MB", "linux", "32"));
        links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-linux-gtk-x86_64.tar.gz",
                "tar.gz", "323MB", "linux", "64"));

        assertThat(toolSuite.getPreferredDownloadLinks(), equalTo(links));
    }
View Full Code Here

        List<Architecture> v36MacArchitectures = new ArrayList<>();
        List<DownloadLink> v36Mac64Links = new ArrayList<>();
        String os = "mac";
        String architecture = "64";
        v36Mac64Links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-macosx-cocoa-x86_64.tar.gz",
                "tar.gz", "323MB", os, architecture));
        v36MacArchitectures.add(new Architecture("Mac OS X (Cocoa, 64bit)", v36Mac64Links));

        List<DownloadLink> v36Mac32Links = new ArrayList<>();
        architecture = "32";
        v36Mac32Links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-macosx-cocoa.tar.gz",
                "tar.gz", "323MB", os, architecture));
        v36MacArchitectures.add(new Architecture("Mac OS X (Cocoa)", v36Mac32Links));
        macEclipseVersions.add(new EclipseVersion("4.4", v36MacArchitectures));

        List<Architecture> v35MacArchitectures = new ArrayList<>();
        List<DownloadLink> v35Mac64Links = new ArrayList<>();
        architecture = "64";
        v35Mac64Links.add(new DownloadLink("http://example.com/spring-tool-suite-3.5.1.RELEASE-e4.3.2-macosx-cocoa-x86_64.tar.gz",
                "tar.gz", "323MB", os, architecture));
        v35Mac64Links.add(new DownloadLink("http://example.com/spring-tool-suite-3.5.1.RELEASE-e4.3.2-macosx-cocoa-x86_64-installer.dmg",
                "dmg", "323MB", os, architecture));
        v35MacArchitectures.add(new Architecture("Mac OS X (Cocoa, 64bit)", v35Mac64Links));

        List<DownloadLink> v35Mac32Links = new ArrayList<>();
        architecture = "32";
        v35Mac32Links.add(new DownloadLink("http://example.com/spring-tool-suite-3.5.1.RELEASE-e4.3.2-macosx-cocoa.tar.gz",
                "tar.gz", "323MB", os, architecture));
        v35Mac32Links.add(new DownloadLink("http://example.com/spring-tool-suite-3.5.1.RELEASE-e4.3.2-macosx-cocoa-installer.dmg",
                "dmg", "323MB", os, architecture));
        v35MacArchitectures.add(new Architecture("Mac OS X (Cocoa)", v35Mac32Links));
        macEclipseVersions.add(new EclipseVersion("4.3.2", v35MacArchitectures));

        platforms.put("mac", new ToolSuitePlatform("Mac", macEclipseVersions));

        os = "windows";
        List<Architecture> winArchitectures = new ArrayList<>();
        List<DownloadLink> win32Links = new ArrayList<>();
        architecture = "32";
        win32Links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-win32.zip",
                "zip", "323MB", os, architecture));
        winArchitectures.add(new Architecture("Windows", win32Links));

        List<DownloadLink> win64Links = new ArrayList<>();
        architecture = "64";
        win64Links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-win32-x86_64.zip",
                "zip", "323MB", os, architecture));
        winArchitectures.add(new Architecture("Windows (64bit)", win64Links));
        platforms.put("windows", new ToolSuitePlatform("Windows", Collections.singletonList(new EclipseVersion("4.4",
                winArchitectures))));

        os = "linux";
        List<Architecture> linuxArchitectures = new ArrayList<>();
        List<DownloadLink> linux32Links = new ArrayList<>();
        architecture = "32";
        linux32Links.add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-linux-gtk.tar.gz",
                "tar.gz", "323MB", os, architecture));
        linux32Links.add(new DownloadLink("http://example.com/linux.sh", "sh", "323MB", os, architecture));
        linuxArchitectures.add(new Architecture("Linux (GTK)", linux32Links));

        List<DownloadLink> linux64Links = new ArrayList<>();
        architecture = "64";
        linux64Links
                .add(new DownloadLink("http://example.com/spring-tool-suite-3.6.0.RELEASE-e4.4-linux-gtk-x86_64.tar.gz",
                        "tar.gz", "323MB", os, architecture));
        linuxArchitectures.add(new Architecture("Linux (GTK, 64bit)", linux64Links));
        platforms.put("linux", new ToolSuitePlatform("Linux", Collections.singletonList(new EclipseVersion("4.3",
                linuxArchitectures))));
View Full Code Here

        List<EclipseVersion> eclipseVersions = windows.getEclipseVersions();
        assertThat(eclipseVersions.size(), equalTo(1));
        assertThat(eclipseVersions.get(0).getName(), equalTo("4.4"));

        assertThat(windows.getEclipseVersions().get(0).getArchitectures().get(0).getDownloadLinks().size(), equalTo(1));
        DownloadLink downloadLink =
                windows.getEclipseVersions().get(0).getArchitectures().get(0).getDownloadLinks().get(0);
        assertThat(
                downloadLink.getUrl(),
                equalTo("http://download.springsource.com/release/STS/3.6.0/dist/e4.4/spring-tool-suite-3.6.0.RELEASE-e4.4-win32.zip"));

        assertThat(toolSuite.getArchives().size(), equalTo(5));
        assertThat(toolSuite.getArchives().get(0).getVersion(), equalTo("4.4"));
        assertThat(toolSuite.getArchives().get(1).getVersion(), equalTo("4.3.2"));
View Full Code Here

        List<EclipseVersion> eclipseVersions = mac.getEclipseVersions();
        assertThat(eclipseVersions.size(), equalTo(1));
        assertThat(eclipseVersions.get(0).getName(), equalTo("4.4"));

        assertThat(windows.getEclipseVersions().get(0).getArchitectures().get(0).getDownloadLinks().size(), equalTo(1));
        DownloadLink downloadLink =
                windows.getEclipseVersions().get(0).getArchitectures().get(0).getDownloadLinks().get(0);
        assertThat(
                downloadLink.getUrl(),
                equalTo("http://download.springsource.com/release/STS/3.6.0/dist/e4.4/groovy-grails-tool-suite-3.6.0.RELEASE-e4.4-win32.zip"));

        assertThat(toolSuite.getArchives().size(), equalTo(5));
        assertThat(toolSuite.getArchives().get(0).getVersion(), equalTo("4.4"));
        assertThat(toolSuite.getArchives().get(1).getVersion(), equalTo("4.3.2"));
View Full Code Here

TOP

Related Classes of sagan.tools.DownloadLink

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.