use of com.izforge.izpack.api.event.ProgressListener in project robozonky by RoboZonky.
the class RoboZonkyInstallerListenerTest method progressWindows.
@Test
void progressWindows() {
final ProgressListener progress = mock(ProgressListener.class);
final InstallData localData = RoboZonkyInstallerListenerTest.mockData();
// execute SUT
RoboZonkyInstallerListener.setInstallData(localData);
final InstallerListener listener = new RoboZonkyInstallerListener(RoboZonkyInstallerListener.OS.WINDOWS);
listener.afterPacks(Collections.emptyList(), progress);
// test
assertSoftly(softly -> {
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "logback.xml")).exists();
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky.properties")).exists();
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky.cli")).exists();
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky-exec.sh")).doesNotExist();
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky-exec.bat")).exists().has(new Condition<>(File::canExecute, "Is executable"));
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky-systemd.service")).doesNotExist();
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky-upstart.conf")).doesNotExist();
softly.assertThat(RoboZonkyInstallerListener.CLI_CONFIG_FILE).exists();
});
verify(progress, times(1)).startAction(anyString(), anyInt());
verify(progress, times(7)).nextStep(anyString(), anyInt(), eq(1));
verify(progress, times(1)).stopAction();
}
use of com.izforge.izpack.api.event.ProgressListener in project robozonky by RoboZonky.
the class RoboZonkyInstallerListenerTest method progressUnix.
@Test
void progressUnix() {
final ProgressListener progress = mock(ProgressListener.class);
// execute SUT
RoboZonkyInstallerListener.setInstallData(data);
final InstallerListener listener = new RoboZonkyInstallerListener(RoboZonkyInstallerListener.OS.LINUX);
listener.afterPacks(Collections.emptyList(), progress);
// test
assertSoftly(softly -> {
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "logback.xml")).exists();
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky.properties")).exists();
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky.cli")).exists();
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky-exec.bat")).doesNotExist();
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky-exec.sh")).exists().has(new Condition<>(File::canExecute, "Is executable"));
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky-systemd.service")).exists();
softly.assertThat(new File(RoboZonkyInstallerListener.INSTALL_PATH, "robozonky-upstart.conf")).exists();
softly.assertThat(RoboZonkyInstallerListener.CLI_CONFIG_FILE).exists();
});
verify(progress, times(1)).startAction(anyString(), anyInt());
verify(progress, times(7)).nextStep(anyString(), anyInt(), eq(1));
verify(progress, times(1)).stopAction();
}
Aggregations