Examples of NumericVersion


Examples of de.idos.updates.NumericVersion

  @Test
  public void reportsLatestVersionFromFile() throws Exception {
    addVersion("4.2.1");
    Version version = getLatestVersionFromRepository();
    assertThat(version, is(sameVersionAs(new NumericVersion(4, 2, 1))));
  }
View Full Code Here

Examples of de.idos.updates.NumericVersion

  @Test
  public void reportsLatestVersionFromAllRegistered() throws Exception {
    addVersion("4.2.1");
    addVersion("4.2.2");
    Version version = getLatestVersionFromRepository();
    assertThat(version, is(sameVersionAs(new NumericVersion(4, 2, 2))));
  }
View Full Code Here

Examples of de.idos.updates.NumericVersion

  @Test
  public void transfersVersionToStore() throws Exception {
    addVersion("4.2.1");
    File content = addContentToVersion("4.2.1", "content");
    NumericVersion version = new NumericVersion(4, 2, 1);
    Installation installation = mock(Installation.class);
    when(store.beginInstallation(version)).thenReturn(installation);
    new FilesystemRepository(folder.getRoot()).transferVersionTo(version, store);
    Thread.sleep(10);
    verify(installation).addContent(new FileDataInVersion(content));
View Full Code Here

Examples of de.idos.updates.NumericVersion

  @Test
  public void runsInstallationInASeparateThread() throws Exception {
    addVersion("4.2.1");
    addContentToVersion("4.2.1", "content");
    NumericVersion version = new NumericVersion(4, 2, 1);
    CountDownLatch latch = new CountDownLatch(1);
    Installation installation = new SlowInstallation(new NullInstallation(), latch);
    when(store.beginInstallation(version)).thenReturn(installation);
    FilesystemRepository repository = new FilesystemRepository(folder.getRoot());
    ProgressReport report = mock(ProgressReport.class);
View Full Code Here

Examples of de.idos.updates.NumericVersion

    verify(report, never()).finishedInstallation();
  }

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

Examples of de.idos.updates.NumericVersion

  Version fallback = new NumericVersion(1, 0, 0);
  FallbackVersionDiscovery discovery = new FallbackVersionDiscovery(wrapped, fallback);

  @Test
  public void returnsOriginalVersionIfItIsNotTheNullVersion() throws Exception {
    Version original = new NumericVersion(0, 8, 9);
    when(wrapped.getLatestVersion()).thenReturn(original);
    assertThat(discovery.getLatestVersion(), is(original));
  }
View Full Code Here

Examples of de.idos.updates.NumericVersion

    assertThat(getUpdaterThatHasRun(updateSystem).hasUpdate(), is(UpdateAvailability.NotAvailable));
  }

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

Examples of de.idos.updates.NumericVersion

  @Test
  public void returnsFixedVersionNumberEvenIfALaterVersionIsInstalled() throws Exception {
    File versionsFolder = new File(getVersionParent(), "versions");
    new File(versionsFolder, "4.0.0").mkdirs();
    NumericVersion overriddenVersion = new NumericVersion(3, 3, 1);
    UpdateSystem updateSystem = ConfiguredUpdateSystem.loadProperties().andIfTheInstalledVersionIsUnknownUse(overriddenVersion).create();
    Version installedVersion = getUpdaterThatHasRun(updateSystem).getInstalledVersion();
    assertThat(installedVersion, is(sameVersionAs(overriddenVersion)));
  }
View Full Code Here

Examples of de.idos.updates.NumericVersion

  @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

Examples of de.idos.updates.NumericVersion

    @Test
    public void createsFoldersInUserHome() throws Exception {
        System.setProperty("user.home", folder.getRoot().getAbsolutePath());
        VersionStore store = VersionStoreBuilder.inUserHomeForApplication("Demo").create();
        store.beginInstallation(new NumericVersion(1, 1, 1));
        File file = new File(folder.getRoot(), ".Demo/versions/1.1.1");
        System.out.println(file);
        assertThat(file.exists(), is(true));
    }
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.