本文整理汇总了Java中com.izforge.izpack.api.event.InstallerListener类的典型用法代码示例。如果您正苦于以下问题:Java InstallerListener类的具体用法?Java InstallerListener怎么用?Java InstallerListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InstallerListener类属于com.izforge.izpack.api.event包,在下文中一共展示了InstallerListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: progressUnix
import com.izforge.izpack.api.event.InstallerListener; //导入依赖的package包/类
@Test
public void progressUnix() {
final ProgressListener progress = Mockito.mock(ProgressListener.class);
// execute SUT
RoboZonkyInstallerListener.setInstallData(data);
final InstallerListener listener = new RoboZonkyInstallerListener(RoboZonkyInstallerListener.OS.LINUX);
listener.afterPacks(Collections.emptyList(), progress);
// test
SoftAssertions.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();
});
Mockito.verify(progress, times(1)).startAction(ArgumentMatchers.anyString(), ArgumentMatchers.anyInt());
Mockito.verify(progress, times(7))
.nextStep(ArgumentMatchers.anyString(), ArgumentMatchers.anyInt(), ArgumentMatchers.eq(1));
Mockito.verify(progress, times(1)).stopAction();
}
示例2: progressWindows
import com.izforge.izpack.api.event.InstallerListener; //导入依赖的package包/类
@Test
public void progressWindows() {
final ProgressListener progress = Mockito.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
SoftAssertions.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();
});
Mockito.verify(progress, times(1)).startAction(ArgumentMatchers.anyString(), ArgumentMatchers.anyInt());
Mockito.verify(progress, times(7))
.nextStep(ArgumentMatchers.anyString(), ArgumentMatchers.anyInt(), ArgumentMatchers.eq(1));
Mockito.verify(progress, times(1)).stopAction();
}
示例3: CListenerInstaller
import com.izforge.izpack.api.event.InstallerListener; //导入依赖的package包/类
/**
* Constructor. Register this Installer listener as a service. The Services
* Broker is already created at this point of time. It's the static bloc
* above who creates and initializes the service broker.
*
*/
public CListenerInstaller() {
super();
// register this Installer Listener as a service in PICOSOC broker
registerMeAsService(InstallerListener.class);
// log info
getLogger().logInfo(this, "<init>", "Instanciated");
}