Examples of NumericVersion


Examples of de.idos.updates.NumericVersion

  @Given("^the repository contains several new versions$")
  public void the_repository_contains_several_new_versions() throws Throwable {
    File versionsFolder = new File(repositoryFolder, AVAILABLE_VERSIONS);
    new File(versionsFolder, "4.2.1").mkdir();
    new File(versionsFolder, "4.2.2").mkdir();
    this.latestVersion = new NumericVersion(4, 2, 2);
  }
View Full Code Here

Examples of de.idos.updates.NumericVersion

    File latestVersionFolder = new File(versionsFolder, "4.2.1");
    latestVersionFolder.mkdir();
    File staging = folder.newFolder("staging");
    File content = ZipFileMother.createContentFileForZip(staging, "contentFromZip");
    ZipFileMother.createZipFileInTemporaryFolder(latestVersionFolder, "v4.2.1.zip", content);
    this.latestVersion = new NumericVersion(4, 2, 1);
  }
View Full Code Here

Examples of de.idos.updates.NumericVersion

  }

  @Test
  public void extendsBaseUrlWhenListingContent() throws Exception {
    HttpInstaller installer = createInstaller(new NullInstallation());
    List<String> elementsToInstall = installer.findAllElementsToInstall(new NumericVersion(5, 0, 4));
    assertThat(elementsToInstall.size(), is(2));
  }
View Full Code Here

Examples of de.idos.updates.NumericVersion

  @Test
  public void extendsBaseUrlWhenDownloadingElements() throws Exception {
    Installation installation = FilesystemInstallation.create(folder.getRoot(), new NullReport());
    HttpInstaller installer = createInstaller(installation);
    installer.installElement("fileToUpdate", new NumericVersion(5, 0, 4));
    assertThat(new File(folder.getRoot(), "fileToUpdate").exists(), is(true));
  }
View Full Code Here

Examples of de.idos.updates.NumericVersion

  }

  @Test(timeout = 5000)
  public void deletesVersionIfErrorsOccurDuringTransfer() throws Exception {
    final CountDownLatch countDownLatch = new CountDownLatch(1);
    NumericVersion version = new NumericVersion(5, 0, 4);
    Installation installation = mock(Installation.class);
    doThrow(new RuntimeException()).when(installation).addContent(isA(DataInVersion.class));
    doAnswer(new Answer() {
      @Override
      public Object answer(InvocationOnMock invocation) throws Throwable {
View Full Code Here

Examples of de.idos.updates.NumericVersion

  }

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

Examples of de.idos.updates.NumericVersion

  @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

Examples of de.idos.updates.NumericVersion

    verify(installation).addContent(isA(UrlDataInVersion.class));
  }

  @Test
  public void worksIfNoReporterIsRegistered() throws Exception {
    repository.transferVersionTo(new NumericVersion(5, 0, 4), new FilesystemVersionStore(folder.getRoot(), new FilesystemInstallationStarter()));
    assertThat(new File(folder.getRoot(), "5.0.4").exists(), is(true));
  }
View Full Code Here

Examples of de.idos.updates.NumericVersion

  }

  @Test
  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

Examples of de.idos.updates.NumericVersion

    assertThat(latestVersion, is(sameVersionAs(overriddenVersion)));
  }

  @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
TOP
Copyright © 2018 www.massapi.com. 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.