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


Java AddonManager类代码示例

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


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

示例1: testFurnaceLoadsInstalledAddonFromSeparateInstance

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的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.AddonManager; //导入依赖的package包/类
@Override
public void execute() throws MojoExecutionException, MojoFailureException
{
   if (skip)
   {
      getLog().info("Execution skipped.");
      return;
   }
   if (!addonRepository.exists())
   {
      throw new MojoExecutionException("Addon Repository " + addonRepository.getAbsolutePath() + " does not exist.");
   }
   Furnace forge = new FurnaceImpl();
   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);
      RemoveRequest request = addonManager.remove(id, repository);
      getLog().info("" + request);
      request.perform();
   }
}
 
开发者ID:forge,项目名称:furnace,代码行数:26,代码来源:AddonRemoveMojo.java

示例3: execute

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的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

示例4: testAddonsLoadAPIClassesFromBootpathJAR

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的package包/类
@Test
public void testAddonsLoadAPIClassesFromBootpathJAR() throws IOException, Exception
{
   Furnace furnace = FurnaceFactory.getInstance();

   furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir1);

   AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
   AddonManager manager = new AddonManagerImpl(furnace, resolver);

   AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
   AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");

   manager.install(no_dep).perform();
   manager.install(one_dep).perform();

   ConfigurationScanListener listener = new ConfigurationScanListener();
   ListenerRegistration<ContainerLifecycleListener> registration = furnace.addContainerLifecycleListener(listener);

   furnace.startAsync();

   while (!listener.isConfigurationScanned())
      Thread.sleep(100);

   registration.removeListener();

   Addon projectsAddon = furnace.getAddonRegistry().getAddon(no_dep);
   Addons.waitUntilStarted(projectsAddon, 10, TimeUnit.SECONDS);

   ClassLoader addonClassLoader = projectsAddon.getClassLoader().loadClass(Addon.class.getName()).getClassLoader();
   ClassLoader appClassLoader = Addon.class.getClassLoader();
   Assert.assertNotEquals(appClassLoader, addonClassLoader);

   Assert.assertTrue(projectsAddon.getStatus().isStarted());
   furnace.stop();
}
 
开发者ID:forge,项目名称:furnace,代码行数:37,代码来源:FurnaceSETest.java

示例5: execute

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的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

示例6: testAddonsDuplicatedIfSubgraphDiffers

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的package包/类
@Test
public void testAddonsDuplicatedIfSubgraphDiffers() throws IOException, InterruptedException, TimeoutException
{
   Furnace furnace = FurnaceFactory.getInstance();
   AddonRepository left = furnace.addRepository(AddonRepositoryMode.MUTABLE, leftRepo);
   AddonRepository right = furnace.addRepository(AddonRepositoryMode.MUTABLE, rightRepo);
   AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
   AddonManager manager = new AddonManagerImpl(furnace, resolver);

   AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
   AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");
   AddonId one_dep_a = AddonId.from("test:one_dep_a", "1.0.0.Final");
   AddonId one_dep_lib = AddonId.from("test:one_dep_lib", "1.0.0.Final");

   AddonId one_dep_2 = AddonId.from("test:one_dep", "2.0.0.Final");

   Assert.assertFalse(left.isDeployed(one_dep_lib));
   Assert.assertFalse(left.isDeployed(one_dep_a));
   Assert.assertFalse(left.isDeployed(no_dep));
   Assert.assertFalse(left.isDeployed(one_dep));
   Assert.assertFalse(left.isDeployed(one_dep_2));
   Assert.assertFalse(right.isDeployed(one_dep_lib));
   Assert.assertFalse(right.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertFalse(right.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(one_dep_2));

   manager.install(no_dep, left).perform();
   manager.deploy(one_dep, left).perform();
   manager.deploy(one_dep_a, left).perform();
   manager.deploy(one_dep_lib, left).perform();

   manager.deploy(one_dep_2, right).perform();

   Assert.assertTrue(left.isDeployed(no_dep));
   Assert.assertTrue(left.isDeployed(one_dep));
   Assert.assertTrue(left.isDeployed(one_dep_a));
   Assert.assertTrue(left.isDeployed(one_dep_lib));
   Assert.assertFalse(left.isDeployed(one_dep_2));

   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertFalse(right.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(one_dep_lib));
   Assert.assertTrue(right.isDeployed(one_dep_2));

   ConfigurationScanListener listener = new ConfigurationScanListener();
   ListenerRegistration<ContainerLifecycleListener> registration = furnace.addContainerLifecycleListener(listener);

   furnace.startAsync();

   while (!listener.isConfigurationScanned())
      Thread.sleep(100);

   AddonRegistry registry = furnace.getAddonRegistry();
   Addons.waitUntilStarted(registry.getAddon(one_dep_a), 10, TimeUnit.SECONDS);
   AddonRegistry leftRegistry = furnace.getAddonRegistry(left);

   Addon addon = leftRegistry.getAddon(one_dep);
   Assert.assertNotNull(addon);

   registration.removeListener();

   furnace.stop();
}
 
开发者ID:forge,项目名称:furnace,代码行数:66,代码来源:MultipleRepositoryViewTest.java

示例7: testAddonsCanReferenceDependenciesInOtherRepositories

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的package包/类
@Test
public void testAddonsCanReferenceDependenciesInOtherRepositories() throws IOException, InterruptedException,
         TimeoutException
{
   Furnace furnace = FurnaceFactory.getInstance();
   AddonRepository left = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir1);
   AddonRepository right = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir2);

   AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
   AddonManager manager = new AddonManagerImpl(furnace, resolver);

   AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
   AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");
   AddonId one_dep_a = AddonId.from("test:one_dep_a", "1.0.0.Final");

   Assert.assertFalse(left.isDeployed(one_dep_a));
   Assert.assertFalse(left.isDeployed(no_dep));
   Assert.assertFalse(left.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertFalse(right.isDeployed(one_dep));

   manager.install(no_dep, left).perform();
   manager.deploy(one_dep, left).perform();
   manager.deploy(one_dep_a, right).perform();

   Assert.assertFalse(left.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertTrue(left.isDeployed(one_dep));
   Assert.assertTrue(left.isDeployed(one_dep));
   Assert.assertTrue(right.isDeployed(one_dep_a));

   ConfigurationScanListener listener = new ConfigurationScanListener();
   ListenerRegistration<ContainerLifecycleListener> registration = furnace.addContainerLifecycleListener(listener);

   furnace.startAsync();

   while (!listener.isConfigurationScanned())
      Thread.sleep(100);

   Addons.waitUntilStarted(furnace.getAddonRegistry().getAddon(one_dep_a), 10, TimeUnit.SECONDS);

   registration.removeListener();

   furnace.stop();
}
 
开发者ID:forge,项目名称:furnace,代码行数:48,代码来源:MultipleRepositoryTest.java

示例8: testAddonsDontFailIfDuplicatedInOtherRepositories

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的package包/类
@Test
   public void testAddonsDontFailIfDuplicatedInOtherRepositories() throws IOException, Exception
   {
      Furnace furnace = FurnaceFactory.getInstance();
      AddonRepository left = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir1);
      AddonRepository right = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir2);

      AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
      AddonManager manager = new AddonManagerImpl(furnace, resolver);

      AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
      AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");
      AddonId one_dep_a = AddonId.from("test:one_dep_a", "1.0.0.Final");

      Assert.assertFalse(left.isDeployed(one_dep_a));
      Assert.assertFalse(left.isDeployed(no_dep));
      Assert.assertFalse(left.isDeployed(one_dep));
      Assert.assertFalse(right.isDeployed(one_dep_a));
      Assert.assertFalse(right.isDeployed(no_dep));
      Assert.assertFalse(right.isDeployed(one_dep));

      manager.install(no_dep, left).perform();
      manager.deploy(one_dep, left).perform();
      manager.deploy(one_dep_a, left).perform();
      manager.deploy(one_dep_a, right).perform();

      Assert.assertFalse(right.isDeployed(no_dep));
      Assert.assertFalse(right.isDeployed(one_dep));
      Assert.assertTrue(left.isDeployed(one_dep_a));
      Assert.assertTrue(left.isDeployed(one_dep));
      Assert.assertTrue(left.isDeployed(one_dep_a));
      Assert.assertTrue(right.isDeployed(one_dep_a));

      ConfigurationScanListener listener = new ConfigurationScanListener();
      ListenerRegistration<ContainerLifecycleListener> registration = furnace.addContainerLifecycleListener(listener);

      furnace.startAsync();

      while (!listener.isConfigurationScanned())
         Thread.sleep(100);

      registration.removeListener();

      Addons.waitUntilStarted(furnace.getAddonRegistry().getAddon(one_dep_a), 10, TimeUnit.SECONDS);
      Addons.waitUntilStarted(furnace.getAddonRegistry().getAddon(no_dep), 10, TimeUnit.SECONDS);
      Addons.waitUntilStarted(furnace.getAddonRegistry().getAddon(one_dep), 10, TimeUnit.SECONDS);

      System.out.println("Getting instances.");
      //FIXME Mocked addons should contain these classes. Use reflection to avoid compile-time dependency ?
//      ExportedInstance<ConverterFactory> instance = furnace.getAddonRegistry()
//               .getExportedInstance(ConverterFactory.class);
//      ConverterFactory factory = instance.get();
//
//      factory.getConverter(File.class,
//               furnace.getAddonRegistry().getAddon(one_dep_a).getClassLoader()
//                        .loadClass("org.jboss.forge.addon.resource.DirectoryResource"));

      furnace.stop();
   }
 
开发者ID:forge,项目名称:furnace,代码行数:60,代码来源:MultipleRepositoryTest.java

示例9: testAddonsSharedIfSubgraphEquivalent

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的package包/类
@Test
public void testAddonsSharedIfSubgraphEquivalent() throws IOException, InterruptedException, TimeoutException
{
   Furnace furnace = FurnaceFactory.getInstance(Furnace.class.getClassLoader());
   AddonRepository left = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir1);
   AddonRepository right = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir2);

   AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
   AddonManager manager = new AddonManagerImpl(furnace, resolver);

   AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
   AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");
   AddonId one_dep_a = AddonId.from("test:one_dep_a", "1.0.0.Final");

   AddonId no_dep2 = AddonId.from("test:no_dep", "2.0.0.Final");

   Assert.assertFalse(left.isDeployed(one_dep_a));
   Assert.assertFalse(left.isDeployed(no_dep));
   Assert.assertFalse(left.isDeployed(no_dep2));
   Assert.assertFalse(left.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertFalse(right.isDeployed(no_dep2));
   Assert.assertFalse(right.isDeployed(one_dep));

   manager.install(no_dep, left).perform();
   manager.deploy(one_dep, left).perform();

   manager.deploy(one_dep_a, right).perform();
   manager.deploy(no_dep2, right).perform();

   Assert.assertFalse(left.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertFalse(left.isDeployed(no_dep2));
   Assert.assertTrue(left.isDeployed(no_dep));
   Assert.assertTrue(left.isDeployed(one_dep));
   Assert.assertTrue(right.isDeployed(one_dep_a));
   Assert.assertTrue(right.isDeployed(no_dep2));

   ConfigurationScanListener listener = new ConfigurationScanListener();
   ListenerRegistration<ContainerLifecycleListener> registration = furnace.addContainerLifecycleListener(listener);

   furnace.startAsync();

   while (!listener.isConfigurationScanned())
      Thread.sleep(100);

   AddonRegistry registry = furnace.getAddonRegistry();
   Addons.waitUntilStarted(registry.getAddon(one_dep_a), 10, TimeUnit.SECONDS);
   AddonRegistry leftRegistry = furnace.getAddonRegistry(left);

   Assert.assertNotNull(leftRegistry.getAddon(no_dep));
   Assert.assertTrue(registry.getAddon(no_dep).getStatus().isMissing());

   Assert.assertNotNull(registry.getAddon(no_dep2));
   Assert.assertTrue(leftRegistry.getAddon(no_dep2).getStatus().isMissing());

   registration.removeListener();

   furnace.stop();
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:63,代码来源:MultipleRepositoryViewTest.java

示例10: testAddonsDuplicatedIfSubgraphDiffers

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的package包/类
@Test
public void testAddonsDuplicatedIfSubgraphDiffers() throws IOException, InterruptedException, TimeoutException
{
   Furnace furnace = FurnaceFactory.getInstance(Furnace.class.getClassLoader());
   AddonRepository left = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir1);
   AddonRepository right = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir2);
   AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
   AddonManager manager = new AddonManagerImpl(furnace, resolver);

   AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
   AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");
   AddonId one_dep_a = AddonId.from("test:one_dep_a", "1.0.0.Final");
   AddonId one_dep_lib = AddonId.from("test:one_dep_lib", "1.0.0.Final");

   AddonId one_dep_2 = AddonId.from("test:one_dep", "2.0.0.Final");

   Assert.assertFalse(left.isDeployed(one_dep_lib));
   Assert.assertFalse(left.isDeployed(one_dep_a));
   Assert.assertFalse(left.isDeployed(no_dep));
   Assert.assertFalse(left.isDeployed(one_dep));
   Assert.assertFalse(left.isDeployed(one_dep_2));
   Assert.assertFalse(right.isDeployed(one_dep_lib));
   Assert.assertFalse(right.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertFalse(right.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(one_dep_2));

   manager.install(no_dep, left).perform();
   manager.deploy(one_dep, left).perform();
   manager.deploy(one_dep_a, left).perform();
   manager.deploy(one_dep_lib, left).perform();

   manager.deploy(one_dep_2, right).perform();

   Assert.assertTrue(left.isDeployed(no_dep));
   Assert.assertTrue(left.isDeployed(one_dep));
   Assert.assertTrue(left.isDeployed(one_dep_a));
   Assert.assertTrue(left.isDeployed(one_dep_lib));
   Assert.assertFalse(left.isDeployed(one_dep_2));

   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertFalse(right.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(one_dep_lib));
   Assert.assertTrue(right.isDeployed(one_dep_2));

   ConfigurationScanListener listener = new ConfigurationScanListener();
   ListenerRegistration<ContainerLifecycleListener> registration = furnace.addContainerLifecycleListener(listener);

   furnace.startAsync();

   while (!listener.isConfigurationScanned())
      Thread.sleep(100);

   AddonRegistry registry = furnace.getAddonRegistry();
   Addons.waitUntilStarted(registry.getAddon(one_dep_a), 10, TimeUnit.SECONDS);
   AddonRegistry leftRegistry = furnace.getAddonRegistry(left);

   Addon addon = leftRegistry.getAddon(one_dep);
   Assert.assertNotNull(addon);

   registration.removeListener();

   furnace.stop();
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:66,代码来源:MultipleRepositoryViewTest.java

示例11: testAddonsCanReferenceDependenciesInOtherRepositories

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的package包/类
@Test
public void testAddonsCanReferenceDependenciesInOtherRepositories() throws IOException, InterruptedException,
         TimeoutException
{
   Furnace furnace = FurnaceFactory.getInstance(Furnace.class.getClassLoader());
   AddonRepository left = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir1);
   AddonRepository right = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir2);

   AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
   AddonManager manager = new AddonManagerImpl(furnace, resolver);

   AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
   AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");
   AddonId one_dep_a = AddonId.from("test:one_dep_a", "1.0.0.Final");

   Assert.assertFalse(left.isDeployed(one_dep_a));
   Assert.assertFalse(left.isDeployed(no_dep));
   Assert.assertFalse(left.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertFalse(right.isDeployed(one_dep));

   manager.install(no_dep, left).perform();
   manager.deploy(one_dep, left).perform();
   manager.deploy(one_dep_a, right).perform();

   Assert.assertFalse(left.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertTrue(left.isDeployed(one_dep));
   Assert.assertTrue(left.isDeployed(one_dep));
   Assert.assertTrue(right.isDeployed(one_dep_a));

   ConfigurationScanListener listener = new ConfigurationScanListener();
   ListenerRegistration<ContainerLifecycleListener> registration = furnace.addContainerLifecycleListener(listener);

   furnace.startAsync();

   while (!listener.isConfigurationScanned())
      Thread.sleep(100);

   Addons.waitUntilStarted(furnace.getAddonRegistry().getAddon(one_dep_a), 10, TimeUnit.SECONDS);

   registration.removeListener();

   furnace.stop();
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:48,代码来源:MultipleRepositoryTest.java

示例12: testAddonsDontFailIfDuplicatedInOtherRepositories

import org.jboss.forge.furnace.manager.AddonManager; //导入依赖的package包/类
@Test
   public void testAddonsDontFailIfDuplicatedInOtherRepositories() throws IOException, Exception
   {
      Furnace furnace = FurnaceFactory.getInstance(Furnace.class.getClassLoader());
      AddonRepository left = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir1);
      AddonRepository right = furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir2);

      AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
      AddonManager manager = new AddonManagerImpl(furnace, resolver);

      AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
      AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");
      AddonId one_dep_a = AddonId.from("test:one_dep_a", "1.0.0.Final");

      Assert.assertFalse(left.isDeployed(one_dep_a));
      Assert.assertFalse(left.isDeployed(no_dep));
      Assert.assertFalse(left.isDeployed(one_dep));
      Assert.assertFalse(right.isDeployed(one_dep_a));
      Assert.assertFalse(right.isDeployed(no_dep));
      Assert.assertFalse(right.isDeployed(one_dep));

      manager.install(no_dep, left).perform();
      manager.deploy(one_dep, left).perform();
      manager.deploy(one_dep_a, left).perform();
      manager.deploy(one_dep_a, right).perform();

      Assert.assertFalse(right.isDeployed(no_dep));
      Assert.assertFalse(right.isDeployed(one_dep));
      Assert.assertTrue(left.isDeployed(one_dep_a));
      Assert.assertTrue(left.isDeployed(one_dep));
      Assert.assertTrue(left.isDeployed(one_dep_a));
      Assert.assertTrue(right.isDeployed(one_dep_a));

      ConfigurationScanListener listener = new ConfigurationScanListener();
      ListenerRegistration<ContainerLifecycleListener> registration = furnace.addContainerLifecycleListener(listener);

      furnace.startAsync();

      while (!listener.isConfigurationScanned())
         Thread.sleep(100);

      registration.removeListener();

      Addons.waitUntilStarted(furnace.getAddonRegistry().getAddon(one_dep_a), 10, TimeUnit.SECONDS);
      Addons.waitUntilStarted(furnace.getAddonRegistry().getAddon(no_dep), 10, TimeUnit.SECONDS);
      Addons.waitUntilStarted(furnace.getAddonRegistry().getAddon(one_dep), 10, TimeUnit.SECONDS);

      System.out.println("Getting instances.");
      //FIXME Mocked addons should contain these classes. Use reflection to avoid compile-time dependency ?
//      ExportedInstance<ConverterFactory> instance = furnace.getAddonRegistry()
//               .getExportedInstance(ConverterFactory.class);
//      ConverterFactory factory = instance.get();
//
//      factory.getConverter(File.class,
//               furnace.getAddonRegistry().getAddon(one_dep_a).getClassLoader()
//                        .loadClass("org.jboss.forge.addon.resource.DirectoryResource"));

      furnace.stop();
   }
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:60,代码来源:MultipleRepositoryTest.java


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