Package de.idos.updates.store

Examples of de.idos.updates.store.OngoingInstallation


  @Test
  public void handsOutInstallationFromConnectionWhenNewerIsAvailable() throws Exception {
    InstallableUpdate update = mock(InstallableUpdate.class);
    when(update.isUpdateFrom(currentVersion)).thenReturn(UpdateAvailability.Available);
    when(connection.getLatestAvailableUpdate()).thenReturn(update);
    OngoingInstallation installation = mock(OngoingInstallation.class);
    when(update.install()).thenReturn(installation);
    UpdateCheck check = createExecutedUpdateCheck();
    OngoingInstallation actualInstallation = check.updateToLatestVersion();
    assertThat(actualInstallation, is(installation));
  }
View Full Code Here


  @Test
  public void returnsNullVersionOtherwise() throws Exception {
    when(connection.getLatestAvailableUpdate()).thenReturn(update);
    UpdateCheck check = createExecutedUpdateCheck();
    OngoingInstallation actualInstallation = check.updateToLatestVersion();
    assertThat(actualInstallation, is(instanceOf(NullInstallation.class)));
  }
View Full Code Here

  VersionReceptacle receptacle = mock(VersionReceptacle.class);
  DefaultVersionInstaller installer = new DefaultVersionInstaller(transfer, receptacle);

  @Test
  public void handsOutInstallationFromTransfer() throws Exception {
    OngoingInstallation installation = mock(Installation.class);
    Version version = mock(Version.class);
    when(transfer.transferVersionTo(version, receptacle)).thenReturn(installation);
    OngoingInstallation install = installer.install(version);
    assertThat(install, is(installation));
  }
View Full Code Here

  public void handsOutInstallationControllerFromStore() throws Exception {
    NumericVersion version = new NumericVersion(4, 2, 1);
    Installation installation = mock(Installation.class);
    when(store.beginInstallation(version)).thenReturn(installation);
    FilesystemRepository repository = new FilesystemRepository(folder.getRoot());
    OngoingInstallation actualInstallation = repository.transferVersionTo(version, store);
    assertThat(actualInstallation, is((OngoingInstallation) installation));
  }
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

TOP

Related Classes of de.idos.updates.store.OngoingInstallation

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.