Package sagan.tools

Examples of sagan.tools.Architecture


    }

    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


    private Architecture createOrFindArchitecture(String architectureName, EclipseVersion eclipseVersion,
                                                  ToolSuitePlatform platform) {
        String key = platform.getName() + eclipseVersion.getName() + architectureName;

        Architecture architecture = architectureMap.get(key);
        if (architecture == null) {
            architecture = new Architecture(architectureName, new ArrayList<>());
            eclipseVersion.getArchitectures().add(architecture);
            architectureMap.put(key, architecture);
        }
        return architecture;
    }
View Full Code Here

                            EclipseXmlProduct eclipseXmlProduct) {
        String os = eclipseXmlDownload.getOs();
        EclipsePlatform platform = getEclipsePlatform(os);
        EclipseRelease release = getEclipseRelease(eclipseXmlProduct, platform);
        EclipsePackage eclipsePackage = getEclipsePackage(eclipseXmlPackage, os, release);
        Architecture architecture = getArchitecture(eclipseXmlDownload, os, release, eclipsePackage);
        architecture.getDownloadLinks().add(downloadLinkExtractor.createDownloadLink(eclipseXmlDownload));
        platforms.put(os, platform);
    }
View Full Code Here

    }

    private Architecture getArchitecture(EclipseXmlDownload eclipseXmlDownload, String os, EclipseRelease release,
                                         EclipsePackage eclipsePackage) {
        String key = os + release.getName() + eclipsePackage.getName() + eclipseXmlDownload.getDescription();
        Architecture architecture = architectureMap.get(key);
        if (architecture == null) {
            String name = eclipseXmlDownload.getDescription();
            architecture = new Architecture(name, new ArrayList<>());

            architectureMap.put(key, architecture);
            eclipsePackage.getArchitectures().add(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));

        ToolSuitePlatform windows = new ToolSuitePlatform("windows", eclipseVersions);
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));

        ToolSuitePlatform windows = new ToolSuitePlatform("windows", eclipseVersions);
View Full Code Here

    @Test
    public void addsADownloadLinkTheArchitecture() throws Exception {
        ToolSuitePlatform platform = toolSuite.getPlatformList().get(1);
        EclipseVersion eclipseVersion = platform.getEclipseVersions().get(0);
        Architecture architecture = eclipseVersion.getArchitectures().get(0);

        assertThat(architecture.getDownloadLinks().size(), equalTo(2));
        assertThat(
                architecture.getDownloadLinks().get(0).getUrl(),
                equalTo("http://dist.springsource.com/release/STS/3.3.0/dist/e4.3/spring-tool-suite-3.3.0.RELEASE-e4.3-macosx-cocoa-installer.dmg"));
        assertThat(
                architecture.getDownloadLinks().get(1).getUrl(),
                equalTo("http://dist.springsource.com/release/STS/3.3.0/dist/e4.3/spring-tool-suite-3.3.0.RELEASE-e4.3-macosx-cocoa-installer.tar.gz"));
    }
View Full Code Here

        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))));

        List<UpdateSiteArchive> archives = Collections.emptyList();
        return new ToolSuiteDownloads("ShortName", "3.6.0.RELEASE",
View Full Code Here

        toolSuite = toolXmlConverter.convert(toolSuiteXml, "Spring Tool Suite", "STS");
    }

    @Test
    public void addsADownloadLinkForStsOnly() throws Exception {
        Architecture macArchitecture =
                toolSuite.getPlatformList().get(1).getEclipseVersions().get(0).getArchitectures().get(0);
        assertThat(macArchitecture.getDownloadLinks().size(), equalTo(1));
        assertThat(
                macArchitecture.getDownloadLinks().get(0).getUrl(),
                equalTo("http://dist.springsource.com/release/STS/3.3.0/dist/e4.3/spring-tool-suite-3.3.0.RELEASE-e4.3-macosx-cocoa-installer.dmg"));
    }
View Full Code Here

    @Test
    public void addsADownloadLinkTheArchitecture() throws Exception {
        ToolSuitePlatform platform = toolSuite.getPlatformList().get(1);
        EclipseVersion eclipseVersion = platform.getEclipseVersions().get(0);
        Architecture architecture = eclipseVersion.getArchitectures().get(0);

        assertThat(architecture.getDownloadLinks().size(), equalTo(1));
        assertThat(
                architecture.getDownloadLinks().get(0).getUrl(),
                equalTo("http://dist.springsource.com/release/STS/3.3.0/dist/e4.3/spring-tool-suite-3.3.0.RELEASE-e4.3-macosx-cocoa-installer.dmg"));
        assertThat(architecture.getDownloadLinks().get(0).getOs(), equalTo("mac"));
        assertThat(architecture.getDownloadLinks().get(0).getArchitecture(), equalTo("32"));
    }
View Full Code Here

TOP

Related Classes of sagan.tools.Architecture

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.