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


Java InstallRequest类代码示例

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


InstallRequest类属于org.jboss.forge.furnace.manager.request包,在下文中一共展示了InstallRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: install

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入依赖的package包/类
@Override
public InstallRequest install(final AddonId addonId, final AddonRepository repository)
{
   MutableAddonRepository mutableRepo = assertMutableRepository(repository);
   AddonInfo addonInfo = info(addonId);
   List<AddonInfo> allAddons = collectRequiredAddons(addonInfo);
   Map<AddonId, AddonRepository> installedAddonIds = getInstalledAddons();
   List<AddonActionRequest> actions = new ArrayList<>();
   for (AddonInfo newAddonInfo : allAddons)
   {
      AddonActionRequest request = createRequest(addonInfo, newAddonInfo, mutableRepo, installedAddonIds);
      if (request != null)
      {
         actions.add(request);
      }
   }
   return createInstallRequest(addonInfo, actions);
}
 
开发者ID:forge,项目名称:furnace,代码行数:19,代码来源:AddonManagerImpl.java

示例3: install

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入依赖的package包/类
@Override
public InstallRequest install(final AddonId addonId, final AddonRepository repository)
{
   MutableAddonRepository mutableRepo = assertMutableRepository(repository);
   AddonInfo addonInfo = info(addonId);
   List<AddonInfo> allAddons = new LinkedList<AddonInfo>();
   collectRequiredAddons(addonInfo, allAddons);
   Map<AddonId, AddonRepository> installedAddonIds = getInstalledAddons();
   List<AddonActionRequest> actions = new ArrayList<AddonActionRequest>();
   for (AddonInfo newAddonInfo : allAddons)
   {
      AddonActionRequest request = createRequest(addonInfo, newAddonInfo, mutableRepo, installedAddonIds);
      if (request != null)
      {
         actions.add(request);
      }
   }
   return createInstallRequest(addonInfo, actions);
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:20,代码来源:AddonManagerImpl.java

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: testAddonInstallNoDependencyWithEmptyRepository

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入依赖的package包/类
@Test
public void testAddonInstallNoDependencyWithEmptyRepository() throws IOException
{
   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));
}
 
开发者ID:forge,项目名称:furnace,代码行数:10,代码来源:AddonManagerInstallTest.java

示例9: 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

示例10: 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

示例11: testAddonUpdate

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

示例12: testInstallTwoDeps

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testInstallTwoDeps() throws IOException
{
   AddonId addon = AddonId.from("test:one_dep", "1.0.0.Final");
   InstallRequest install = addonManager.install(addon);
   List<?> actions = install.getActions();
   Assert.assertEquals(2, actions.size());
   Assert.assertThat((List<DeployRequest>) actions, everyItem(isA(DeployRequest.class)));
}
 
开发者ID:forge,项目名称:furnace,代码行数:11,代码来源:AddonManagerInstallTest.java

示例13: testParentExclusion

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testParentExclusion() throws IOException
{
   AddonId addon = AddonId.from("test:no_dep_one_lib_excluding_indirect_lib", "1.0.0.Final");
   InstallRequest install = addonManager.install(addon);
   List<? extends AddonActionRequest> actions = install.getActions();
   Assert.assertEquals(1, actions.size());
   Assert.assertThat((List<DeployRequest>) actions, everyItem(isA(DeployRequest.class)));
   DeployRequest deployRequest = (DeployRequest) actions.get(0);
   AddonInfo addonInfo = deployRequest.getRequestedAddonInfo();
   Set<File> resources = addonInfo.getResources();
   Assert.assertEquals("It should have three resources", 3, resources.size());
}
 
开发者ID:forge,项目名称:furnace,代码行数:15,代码来源:AddonManagerInstallTest.java

示例14: testAddonInstallAPIVersionNoDependencyWithEmptyRepository

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入依赖的package包/类
@Test
public void testAddonInstallAPIVersionNoDependencyWithEmptyRepository() throws IOException
{
   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));
   Assert.assertEquals(SingleVersion.valueOf("2.4.1.Final"), actions.get(0).getRequestedAddonInfo().getAddon()
            .getApiVersion());
}
 
开发者ID:forge,项目名称:furnace,代码行数:12,代码来源:AddonManagerInstallTest.java

示例15: testUpdateOnImmutableRepository

import org.jboss.forge.furnace.manager.request.InstallRequest; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testUpdateOnImmutableRepository() throws Exception
{
   AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
   AddonId no_dep_newer = AddonId.from("test:no_dep", "1.0.1.Final");

   // Adding an addon in a immutable repo
   deployAddonInImmutableRepository(no_dep, immutable);
   InstallRequest newer = addonManager.install(no_dep_newer);
   List<? extends AddonActionRequest> actions = newer.getActions();
   Assert.assertEquals(1, actions.size());
   Assert.assertThat((List<DeployRequest>) actions, everyItem(isA(DeployRequest.class)));
}
 
开发者ID:forge,项目名称:furnace,代码行数:15,代码来源:AddonManagerRepositoryTest.java


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