當前位置: 首頁>>代碼示例>>Java>>正文


Java InstallerListener類代碼示例

本文整理匯總了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();
}
 
開發者ID:RoboZonky,項目名稱:robozonky,代碼行數:26,代碼來源:RoboZonkyInstallerListenerTest.java

示例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();
}
 
開發者ID:RoboZonky,項目名稱:robozonky,代碼行數:29,代碼來源:RoboZonkyInstallerListenerTest.java

示例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");
}
 
開發者ID:isandlaTech,項目名稱:cohorte-utilities,代碼行數:14,代碼來源:CListenerInstaller.java


注:本文中的com.izforge.izpack.api.event.InstallerListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。