Package de.idos.updates

Examples of de.idos.updates.Updater


        updateSystem = ConfiguredUpdateSystem.loadProperties().create();
    }

    @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


        assertThat(latestVersion, is(sameVersionAs(new NumericVersion(1, 0, 1))));
    }

    @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

    new Thread(new Runnable() {
      @Override
      public void run() {
        updateSystemBuilder.useStore(new SlowVersionStore(versionStore, slowThreadStartSignal));
        DefaultUpdateSystem slowUpdateSystem = updateSystemBuilder.create();
        Updater updater = slowUpdateSystem.checkForUpdates();
        updater.runCheck();
        ongoingInstallation = updater.updateToLatestVersion();
      }
    }).start();
  }
View Full Code Here

  public void canChangeDiscovery() throws Exception {
    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

  @Test
  public void canOverrideUnknownInstalledVersion() throws Exception {
    NumericVersion overriddenVersion = new NumericVersion(4, 2, 2);
    UpdateSystem updateSystem = ConfiguredUpdateSystem.loadProperties().andIfTheInstalledVersionIsUnknownUse(overriddenVersion).create();
    Updater updater = getUpdaterThatHasRun(updateSystem);
    Version installedVersion = updater.getInstalledVersion();
    assertThat(installedVersion, is(sameVersionAs(overriddenVersion)));
  }
View Full Code Here

    String userHome = System.getProperty("user.home");
    FileUtils.deleteQuietly(new File(userHome, ".updateunittest"));
  }

  private Updater getUpdaterThatHasRun(UpdateSystem updateSystem) {
    Updater updater = updateSystem.checkForUpdates();
    updater.runCheck();
    return updater;
  }
View Full Code Here

  }

  @Test(timeout = 1500)
  public void canInstallUpdatesEvenWhenTheActualVersionIsFixed() throws Exception {
    UpdateSystem updateSystem = ConfiguredUpdateSystem.loadProperties().create();
    Updater updater = getUpdaterThatHasRun(updateSystem);
    OngoingInstallation installation = updater.updateToLatestVersion();
    while(installation.isRunning()){
      //wait
    }
    Thread.sleep(500);
    assertThat(getUpdaterThatHasRun(updateSystem).hasUpdate(), is(UpdateAvailability.NotAvailable));
View Full Code Here

    String userHome = System.getProperty("user.home");
    return new File(userHome, ".updateunittest");
  }

  private Updater getUpdaterThatHasRun(UpdateSystem updateSystem) {
    Updater updater = updateSystem.checkForUpdates();
    updater.runCheck();
    return updater;
  }
View Full Code Here

  }

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

    String userHome = System.getProperty("user.home");
    FileUtils.deleteQuietly(new File(userHome, ".updateunittest"));
  }

  private Updater getUpdaterThatHasRun(UpdateSystem updateSystem) {
    Updater updater = updateSystem.checkForUpdates();
    updater.runCheck();
    return updater;
  }
View Full Code Here

TOP

Related Classes of de.idos.updates.Updater

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.