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


Java InstallRequest.perform方法代码示例

本文整理汇总了Java中org.jboss.forge.furnace.manager.request.InstallRequest.perform方法的典型用法代码示例。如果您正苦于以下问题:Java InstallRequest.perform方法的具体用法?Java InstallRequest.perform怎么用?Java InstallRequest.perform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.forge.furnace.manager.request.InstallRequest的用法示例。


在下文中一共展示了InstallRequest.perform方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testFurnaceLoadsInstalledAddonFromSeparateInstance

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
@Test(timeout = 20000)
public void testFurnaceLoadsInstalledAddonFromSeparateInstance() throws IOException, TimeoutException
{
   Assert.assertEquals(1, furnace.getRepositories().size());
   Assert.assertEquals(0, furnace.getAddonRegistry().getAddons().size());
   Assert.assertEquals(0, furnace.getRepositories().get(0).listEnabled().size());

   Furnace furnace2 = ServiceLoader.load(Furnace.class).iterator().next();
   AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
   furnace2.addRepository(AddonRepositoryMode.MUTABLE, repository);
   AddonManager addonManager = new AddonManagerImpl(furnace2, resolver);

   AddonId addon = AddonId.from("test:no_dep", "1.1.2-SNAPSHOT");
   InstallRequest install = addonManager.install(addon);
   List<? extends AddonActionRequest> actions = install.getActions();
   Assert.assertEquals(1, actions.size());
   Assert.assertThat(actions.get(0), instanceOf(DeployRequest.class));
   install.perform();

   Addons.waitUntilStarted(furnace.getAddonRegistry().getAddon(addon));

   Assert.assertEquals(1, furnace2.getRepositories().get(0).listEnabled().size());
   Assert.assertEquals(1, furnace.getRepositories().get(0).listEnabled().size());
   Assert.assertEquals(1, furnace.getAddonRegistry().getAddons().size());
}
 
开发者ID:forge,项目名称:furnace,代码行数:26,代码来源:AddonManagerHotswapTest.java

示例2: execute

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
@Override
public void execute() throws MojoExecutionException, MojoFailureException
{
   Furnace forge = new FurnaceImpl();
   if (!addonRepository.exists())
   {
      addonRepository.mkdirs();
   }
   AddonRepository repository = forge.addRepository(AddonRepositoryMode.MUTABLE, addonRepository);
   MavenAddonDependencyResolver addonResolver = new MavenAddonDependencyResolver(this.classifier);
   addonResolver.setSettings(settings);
   AddonManager addonManager = new AddonManagerImpl(forge, addonResolver);

   for (String addonId : addonIds)
   {
      AddonId id = AddonId.fromCoordinates(addonId);
      InstallRequest install = addonManager.install(id, repository);
      if (!install.getActions().isEmpty())
      {
         getLog().info("" + install);
         install.perform();
      }
   }
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:25,代码来源:AddonInstallMojo.java

示例3: testInstallAddonAddon

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
@Test
public void testInstallAddonAddon()
{
   // Addons depends directly on Projects, UI, Maven, parser-java, javaee
   // Addons depends indirectly on Environment, Dependencies, resources, facets, ui-spi, convert
   AddonId addon = AddonId.from("org.jboss.forge.addon:addons", "2.0.0.Alpha6");
   InstallRequest install = addonManager.install(addon);
   List<?> actions = install.getActions();
   Assert.assertEquals(12, actions.size());
   Assert.assertThat((List<DeployRequest>) actions, everyItem(isA(DeployRequest.class)));
   install.perform();
}
 
开发者ID:forge,项目名称:furnace,代码行数:13,代码来源:AddonManagerRealTest.java

示例4: testInstallUIAddon

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
@Test
public void testInstallUIAddon() throws IOException
{
   InstallRequest install;
   AddonId addonUI = AddonId.from("org.jboss.forge.addon:ui", "2.0.0.Alpha6");
   install = addonManager.install(addonUI);
   List<?> actions = install.getActions();
   Assert.assertEquals(5, install.getActions().size());
   Assert.assertThat((List<DeployRequest>) actions, everyItem(isA(DeployRequest.class)));
   install.perform();
   install = addonManager.install(addonUI);
   // No actions should be needed, since we have all the needed addons
   Assert.assertEquals(0, install.getActions().size());
}
 
开发者ID:forge,项目名称:furnace,代码行数:15,代码来源:AddonManagerRealTest.java

示例5: testFurnaceLoadsInstalledAddonFromSameInstance

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
@Test(timeout = 5000)
public void testFurnaceLoadsInstalledAddonFromSameInstance() throws IOException
{
   Assert.assertEquals(1, furnace.getRepositories().size());
   Assert.assertEquals(0, furnace.getAddonRegistry().getAddons().size());
   Assert.assertEquals(0, furnace.getRepositories().get(0).listEnabled().size());
   AddonId addon = AddonId.from("test:no_dep", "1.0.0.Final");
   InstallRequest install = addonManager.install(addon);
   List<? extends AddonActionRequest> actions = install.getActions();
   Assert.assertEquals(1, actions.size());
   Assert.assertThat(actions.get(0), instanceOf(DeployRequest.class));
   install.perform();
   Assert.assertEquals(1, furnace.getRepositories().get(0).listEnabled().size());
   Assert.assertEquals(1, furnace.getAddonRegistry().getAddons().size());
}
 
开发者ID:forge,项目名称:furnace,代码行数:16,代码来源:AddonManagerHotswapTest.java

示例6: testAddonInstallNoDependencyWithAddonAlreadyInstalled

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
@Test
public void testAddonInstallNoDependencyWithAddonAlreadyInstalled() throws IOException
{
   AddonId addon = AddonId.from("test:no_dep", "1.0.0.Final");
   InstallRequest install = addonManager.install(addon);
   install.perform();
   install = addonManager.install(addon);
   Assert.assertTrue(install.getActions().isEmpty());
}
 
开发者ID:forge,项目名称:furnace,代码行数:10,代码来源:AddonManagerInstallTest.java

示例7: testAddonInstallSnapshot

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
@Test
public void testAddonInstallSnapshot() throws IOException
{
   AddonId addon = AddonId.from("test:no_dep", "1.1.2-SNAPSHOT");
   InstallRequest install = addonManager.install(addon);
   Assert.assertEquals(1, install.getActions().size());
   install.perform();
   install = addonManager.install(addon);
   List<? extends AddonActionRequest> actions = install.getActions();
   Assert.assertEquals(1, actions.size());
   Assert.assertThat(actions.get(0), instanceOf(UpdateRequest.class));
}
 
开发者ID:forge,项目名称:furnace,代码行数:13,代码来源:AddonManagerInstallTest.java

示例8: testInstallAddonAddon

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testInstallAddonAddon()
{
   // Addons depends directly on Projects, UI, Maven, parser-java, javaee
   // Addons depends indirectly on Environment, Dependencies, resources, facets, ui-spi, convert
   AddonId addon = AddonId.from("org.jboss.forge.addon:addons", "2.0.0.Alpha6");
   InstallRequest install = addonManager.install(addon);
   List<?> actions = install.getActions();
   Assert.assertEquals(12, actions.size());
   Assert.assertThat((List<DeployRequest>) actions, everyItem(isA(DeployRequest.class)));
   install.perform();
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:14,代码来源:AddonManagerRealTest.java

示例9: testInstallUIAddon

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testInstallUIAddon() throws IOException
{
   InstallRequest install;
   AddonId addonUI = AddonId.from("org.jboss.forge.addon:ui", "2.0.0.Alpha6");
   install = addonManager.install(addonUI);
   List<?> actions = install.getActions();
   Assert.assertEquals(5, install.getActions().size());
   Assert.assertThat((List<DeployRequest>) actions, everyItem(isA(DeployRequest.class)));
   install.perform();
   install = addonManager.install(addonUI);
   // No actions should be needed, since we have all the needed addons
   Assert.assertEquals(0, install.getActions().size());
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:16,代码来源:AddonManagerRealTest.java

示例10: installOldAddonVersion

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
/**
 * Uninstalls the current addon and installs the other one. This fails because we would need to replace all the
 * dependencies as well, effectively, the whole Windup.
 */
private void installOldAddonVersion(String currentUiVersion)
{
    RemoveRequest remove = manager.remove(AddonId.from(WINDUP_UI_ADDON_NAME, currentUiVersion));
    remove.perform();
    final AddonId olderAddonId = AddonId.from(WINDUP_UI_ADDON_NAME, WINDUP_OLD_VERSION);
    log.info("Downgrading to " + olderAddonId + ". This may take a while to download.");
    InstallRequest install = manager.install(olderAddonId);
    install.perform();
}
 
开发者ID:windup,项目名称:windup,代码行数:14,代码来源:WindupUpdateDistributionCommandTest.java

示例11: execute

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入方法依赖的package包/类
@Override
public void execute() throws MojoExecutionException, MojoFailureException
{
   if (skip)
   {
      getLog().info("Execution skipped.");
      return;
   }
   Furnace forge = new FurnaceImpl();
   if (!addonRepository.exists())
   {
      addonRepository.mkdirs();
   }
   else if (overwrite)
   {
      try
      {
         deleteDirectory(addonRepository);
         addonRepository.mkdirs();
      }
      catch (IOException e)
      {
         forge.close();
         throw new MojoExecutionException("Could not delete " + addonRepository, e);
      }
   }
   AddonRepository repository = forge.addRepository(AddonRepositoryMode.MUTABLE, addonRepository);
   MavenAddonDependencyResolver addonResolver = new MavenAddonDependencyResolver(this.classifier);
   addonResolver.setSettings(settings);
   addonResolver.setResolveAddonAPIVersions(!skipAddonAPIVersionResolution);
   AddonManager addonManager = new AddonManagerImpl(forge, addonResolver);

   for (String addonId : addonIds)
   {
      AddonId id = AddonId.fromCoordinates(addonId);
      InstallRequest install = addonManager.install(id, repository);
      if (!install.getActions().isEmpty())
      {
         getLog().info("" + install);
         install.perform();
      }
   }
}
 
开发者ID:forge,项目名称:furnace,代码行数:44,代码来源:AddonInstallMojo.java


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