Package de.idos.updates

Examples of de.idos.updates.Version


    }

    public Version lookUpLatestVersion() {
        report.lookingUpLatestAvailableVersion();
        try {
            Version latestVersion = strategy.findLatestUpdate().getVersion();
            report.latestAvailableVersionIs(latestVersion);
            return latestVersion;
        } catch (Exception e) {
            report.versionLookupFailed(e);
            return VersionFinder.BASE_VERSION;
View Full Code Here


  public HttpLookup(URL baseUrl) {
    this.baseUrl = baseUrl;
  }

  public Update findLatestUpdate() throws IOException {
    Version latestVersion = findLatestVersion();
    return new UpdateDescription(latestVersion);
  }
View Full Code Here

    @Then("^the system uses the file on the classpath to configure itself$")
    public void the_system_uses_the_file_on_the_classpath_to_configure_itself() throws Throwable {
      Updater updater = updateSystem.checkForUpdates();
      updater.runCheck();
      Version latestVersion = updater.getLatestVersion();
        assertThat(latestVersion, is(sameVersionAs(new NumericVersion(1, 0, 1))));
    }
View Full Code Here

    @Then("^the system uses the file in the working directory to configure itself$")
    public void the_system_uses_the_file_in_the_working_directory_to_configure_itself() throws Throwable {
      Updater updater = updateSystem.checkForUpdates();
      updater.runCheck();
      Version latestVersion = updater.getLatestVersion();
        assertThat(latestVersion, is(sameVersionAs(new NumericVersion(1, 0, 2))));
    }
View Full Code Here

  public void stopServer() throws Exception {
    fileServer.stop();
  }

  private void assertLatestReportedVersionIsLatestExpectedVersion() {
    Version latestReportedVersion = updater.getLatestVersion();
    assertThat(latestReportedVersion, is(sameVersionAs(latestVersion)));
  }
View Full Code Here

  HttpRepository repository = new HttpRepository("http://localhost:8081/");
  VersionStore store = mock(VersionStore.class);

  @Test
  public void returnsBaseVersionIfServerIsInaccessible() throws Exception {
    Version latestVersion = repository.getLatestVersion();
    assertThat(latestVersion, CoreMatchers.is(VersionFinder.BASE_VERSION));
  }
View Full Code Here

    fileServer.stop();
  }

  @Test
  public void retrievesLatestVersionFromServer() throws Exception {
    Version latestVersion = repository.getLatestVersion();
    assertThat(latestVersion, is(sameVersionAs(new NumericVersion(5, 0, 4))));
  }
View Full Code Here

  @Test
  public void createsHttpInstaller() throws Exception {
    Installation installation = mock(Installation.class);
    InstallationStrategy<String> strategy = repository.createInstallationStrategy(installation);
    Version mock = mock(Version.class);
    strategy.installElement("X", mock);
    verify(installation).addContent(isA(UrlDataInVersion.class));
  }
View Full Code Here

  }

  @Test
  public void usesConfiguredFileRepository() throws Exception {
    UpdateSystem updateSystem = ConfiguredUpdateSystem.loadProperties().create();
    Version latestVersion = getUpdaterThatHasRun(updateSystem).getLatestVersion();
    assertThat(latestVersion, is(sameVersionAs(new NumericVersion(4, 2, 1))));
  }
View Full Code Here

    VersionDiscovery discovery = mock(VersionDiscovery.class);
    NumericVersion overriddenVersion = new NumericVersion(4, 2, 2);
    when(discovery.getLatestVersion()).thenReturn(overriddenVersion);
    UpdateSystem updateSystem = ConfiguredUpdateSystem.loadProperties().butDiscoverAvailableVersionThrough(discovery).create();
    Updater updater = getUpdaterThatHasRun(updateSystem);
    Version latestVersion = updater.getLatestVersion();
    assertThat(latestVersion, is(sameVersionAs(overriddenVersion)));
  }
View Full Code Here

TOP

Related Classes of de.idos.updates.Version

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.