当前位置: 首页>>代码示例>>Java>>正文


Java ProgressListener类代码示例

本文整理汇总了Java中com.izforge.izpack.api.event.ProgressListener的典型用法代码示例。如果您正苦于以下问题:Java ProgressListener类的具体用法?Java ProgressListener怎么用?Java ProgressListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ProgressListener类属于com.izforge.izpack.api.event包,在下文中一共展示了ProgressListener类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterPacks

import com.izforge.izpack.api.event.ProgressListener; //导入依赖的package包/类
@Override
public void afterPacks(final List<Pack> packs, final ProgressListener progressListener) {
    try {
        progressListener.startAction("Konfigurace RoboZonky", 7);
        progressListener.nextStep("Příprava strategie.", 1, 1);
        final CommandLinePart strategyConfig = prepareStrategy();
        progressListener.nextStep("Příprava nastavení e-mailu.", 2, 1);
        final CommandLinePart emailConfig = prepareEmailConfiguration();
        progressListener.nextStep("Příprava nastavení JMX.", 3, 1);
        final CommandLinePart jmx = prepareJmx();
        progressListener.nextStep("Příprava nastavení Zonky.", 4, 1);
        final CommandLinePart credentials = prepareCore();
        progressListener.nextStep("Příprava nastavení logování.", 5, 1);
        final CommandLinePart logging = prepareLogging();
        progressListener.nextStep("Generování parametrů příkazové řádky.", 6, 1);
        final CommandLinePart result = prepareCommandLine(strategyConfig, emailConfig, jmx, credentials, logging);
        progressListener.nextStep("Generování spustitelného souboru.", 7, 1);
        prepareRunScript(result);
        progressListener.stopAction();
    } catch (final Exception ex) {
        LOGGER.log(Level.SEVERE, "Uncaught exception.", ex);
        throw new IllegalStateException("Uncaught exception.", ex);
    }
}
 
开发者ID:RoboZonky,项目名称:robozonky,代码行数:25,代码来源:RoboZonkyInstallerListener.java

示例2: progressUnix

import com.izforge.izpack.api.event.ProgressListener; //导入依赖的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

示例3: progressWindows

import com.izforge.izpack.api.event.ProgressListener; //导入依赖的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

示例4: afterDelete

import com.izforge.izpack.api.event.ProgressListener; //导入依赖的package包/类
public void afterDelete(final List<File> files,
		final ProgressListener listener) {
	for (File file : files) {
		getLogger().logInfo(this, "afterDelete", "+++ file=[%s] ",
				file.getName());
	}
}
 
开发者ID:isandlaTech,项目名称:cohorte-utilities,代码行数:8,代码来源:CListenerUninstaller.java

示例5: afterPacks

import com.izforge.izpack.api.event.ProgressListener; //导入依赖的package包/类
@Override
public void afterPacks(List<Pack> arg0, ProgressListener arg1) {
}
 
开发者ID:ElevenPaths,项目名称:latch-plugin-open-xchange,代码行数:4,代码来源:LatchInstallerListener.java

示例6: afterDelete

import com.izforge.izpack.api.event.ProgressListener; //导入依赖的package包/类
@Override
public void afterDelete(List<File> arg0, ProgressListener arg1) {
}
 
开发者ID:ElevenPaths,项目名称:latch-plugin-open-xchange,代码行数:4,代码来源:LatchUninstallerListener.java

示例7: afterPacks

import com.izforge.izpack.api.event.ProgressListener; //导入依赖的package包/类
public void afterPacks(final List<Pack> packs,
		final ProgressListener listener) {
	getLogger().logInfo(this, "afterPacks", "+++ packs.size=[%s]",
			packs.size());
}
 
开发者ID:isandlaTech,项目名称:cohorte-utilities,代码行数:6,代码来源:CListenerInstaller.java


注:本文中的com.izforge.izpack.api.event.ProgressListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。