org.jboss.forge.furnace.repositories.AddonDependencyEntry Java Examples

The following examples show how to use org.jboss.forge.furnace.repositories.AddonDependencyEntry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NewNodeXmlTest.java    From fabric8-forge with Apache License 2.0 6 votes vote down vote up
@Deployment
@AddonDependencies({
        @AddonDependency(name = "org.jboss.forge.addon:maven"),
        @AddonDependency(name = "org.jboss.forge.addon:projects"),
        @AddonDependency(name = "org.jboss.forge.addon:ui"),
        @AddonDependency(name = "org.jboss.forge.addon:ui-test-harness"),
        @AddonDependency(name = "org.jboss.forge.addon:shell-test-harness"),
        @AddonDependency(name = "io.fabric8.forge:camel")
})
public static AddonArchive getDeployment() {
    AddonArchive archive = ShrinkWrap
            .create(AddonArchive.class)
            .addBeansXML()
            .addAsAddonDependencies(
                    AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi"),
                    AddonDependencyEntry.create("org.jboss.forge.addon:ui"),
                    AddonDependencyEntry.create("org.jboss.forge.addon:ui-test-harness"),
                    AddonDependencyEntry.create("org.jboss.forge.addon:shell-test-harness"),
                    AddonDependencyEntry.create("org.jboss.forge.addon:projects"),
                    AddonDependencyEntry.create("org.jboss.forge.addon:maven"),
                    AddonDependencyEntry.create("io.fabric8.forge:camel")
            );
    return archive;
}
 
Example #2
Source File: TagServiceHolderTest.java    From windup with Eclipse Public License 1.0 6 votes vote down vote up
@Deployment
@AddonDependencies({
    @AddonDependency(name = "org.jboss.windup.config:windup-config"),
    @AddonDependency(name = "org.jboss.forge.furnace.container:cdi")
})
public static AddonArchive getDeployment()
{
    final AddonArchive archive = ShrinkWrap
        .create(AddonArchive.class)
        .addClasses(TestIterationPayloadTestRuleProvider.class, TestChildModel.class, TestParentModel.class)
        .addBeansXML()
        .addAsResource(new File("src/test/java/org/jboss/windup/config/tags/test2.tags.xml"))
        .addAsAddonDependencies(
            AddonDependencyEntry.create("org.jboss.windup.config:windup-config"),
            AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi")
        );
    return archive;
}
 
Example #3
Source File: TagsRulesTest.java    From windup with Eclipse Public License 1.0 6 votes vote down vote up
@Deployment
@AddonDependencies({
    @AddonDependency(name = "org.jboss.windup.config:windup-config"),
    @AddonDependency(name = "org.jboss.forge.furnace.container:cdi")
})
public static AddonArchive getDeployment()
{
    final AddonArchive archive = ShrinkWrap
        .create(AddonArchive.class)
        .addClasses(TestIterationPayloadTestRuleProvider.class, TestChildModel.class, TestParentModel.class)
        .addBeansXML()
        .addAsResource(new File("src/test/java/org/jboss/windup/config/tags/test.tags.xml"), "/")
        .addAsAddonDependencies(
            AddonDependencyEntry.create("org.jboss.windup.config:windup-config"),
            AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi")
        );
    return archive;
}
 
Example #4
Source File: JavaClassTestFile2.java    From windup with Eclipse Public License 1.0 6 votes vote down vote up
@Deployment
@Dependencies({
            @AddonDependency(name = "org.jboss.windup.config:windup-config"),
            @AddonDependency(name = "org.jboss.windup.exec:windup-exec"),
            @AddonDependency(name = "org.jboss.windup.rules.apps:windup-rules-java"),
            @AddonDependency(name = "org.jboss.windup.reporting:windup-reporting"),
            @AddonDependency(name = "org.jboss.forge.furnace.container:cdi")
})
public static ForgeArchive getDeployment()
{
    final ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
                .addBeansXML()
                .addClass(TestHintsClassificationsTestRuleProvider.class)
                .addAsAddonDependencies(
                            AddonDependencyEntry.create("org.jboss.windup.config:windup-config"),
                            AddonDependencyEntry.create("org.jboss.windup.exec:windup-exec"),
                            AddonDependencyEntry.create("org.jboss.windup.rules.apps:windup-rules-java"),
                            AddonDependencyEntry.create("org.jboss.windup.reporting:windup-reporting"),
                            AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi")
                );

    return archive;
}
 
Example #5
Source File: JavaClassTestFile1.java    From windup with Eclipse Public License 1.0 6 votes vote down vote up
@Deployment
@Dependencies({
            @AddonDependency(name = "org.jboss.windup.config:windup-config"),
            @AddonDependency(name = "org.jboss.windup.exec:windup-exec"),
            @AddonDependency(name = "org.jboss.windup.rules.apps:windup-rules-java"),
            @AddonDependency(name = "org.jboss.windup.reporting:windup-reporting"),
            @AddonDependency(name = "org.jboss.forge.furnace.container:cdi")
})
public static ForgeArchive getDeployment()
{
    final ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
                .addBeansXML()
                .addClass(TestJavaClassTestRuleProvider.class)
                .addClass(JavaClassTest.class)
                .addAsAddonDependencies(
                            AddonDependencyEntry.create("org.jboss.windup.config:windup-config"),
                            AddonDependencyEntry.create("org.jboss.windup.exec:windup-exec"),
                            AddonDependencyEntry.create("org.jboss.windup.rules.apps:windup-rules-java"),
                            AddonDependencyEntry.create("org.jboss.windup.reporting:windup-reporting"),
                            AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi")
                );

    return archive;
}
 
Example #6
Source File: AddonModuleLoader.java    From furnace with Eclipse Public License 1.0 6 votes vote down vote up
private void addAddonDependency(Set<AddonView> views, AddonId found, Builder builder,
         AddonDependencyEntry dependency)
{
   AddonId addonId = stateManager.resolveAddonId(views, dependency.getName());
   ModuleIdentifier moduleId = null;
   if (addonId != null)
   {
      Addon addon = lifecycleManager.getAddon(views, addonId);
      moduleId = findCompatibleInstalledModule(addonId);
      if (moduleId != null)
      {
         builder.addDependency(DependencySpec.createModuleDependencySpec(
                  PathFilters.not(PathFilters.getMetaInfFilter()),
                  dependency.isExported() ? PathFilters.acceptAll() : PathFilters.rejectAll(),
                  this,
                  moduleCache.getModuleId(addon),
                  dependency.isOptional()));
      }
   }

   if (!dependency.isOptional() && (addonId == null || moduleId == null))
      throw new ContainerException("Dependency [" + dependency + "] could not be loaded for addon [" + found
               + "]");
}
 
Example #7
Source File: AddonRepositoryLoadingTest.java    From furnace with Eclipse Public License 1.0 6 votes vote down vote up
@Deployment(order = 0)
@DeployToRepository("1")
public static AddonArchive getDeployment()
{
   AddonArchive archive = ShrinkWrap
            .create(AddonArchive.class)
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("dep1", "1"),
                     AddonDependencyEntry.create("dep2", "2"),
                     AddonDependencyEntry.create("dep3", "3"),
                     AddonDependencyEntry.create("dep4", "4"),
                     AddonDependencyEntry.create("dep5", "5")
            );

   archive.addAsLocalServices(AddonRepositoryLoadingTest.class);

   return archive;
}
 
Example #8
Source File: FurnaceDeployableContainer.java    From furnace with Eclipse Public License 1.0 6 votes vote down vote up
private void deployToRepository(Archive<?> archive, MutableAddonRepository repository, final AddonId addonToDeploy)
{
   File destDir = repository.getAddonBaseDir(addonToDeploy);
   destDir.mkdirs();
   ShrinkWrapUtil.toFile(new File(destDir.getAbsolutePath(), archive.getName()), archive);
   ShrinkWrapUtil.unzip(destDir, archive);
   System.out.println("Furnace test harness is deploying [" + addonToDeploy + "] to repository [" + repository
            + "] ...");

   if (archive instanceof AddonDependencyAware)
   {
      repository.deploy(addonToDeploy,
               ((AddonDependencyAware<?>) archive).getAddonDependencies(),
               Collections.<File> emptyList());
   }
   else
   {
      repository.deploy(addonToDeploy,
               Collections.<AddonDependencyEntry> emptyList(),
               Collections.<File> emptyList());
   }

   repository.enable(addonToDeploy);
}
 
Example #9
Source File: FurnaceDeploymentScenarioGenerator.java    From furnace with Eclipse Public License 1.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void addAutomaticDependencies(DeploymentDescription primaryDeployment, Class<?> classUnderTest,
         Method deploymentMethod, Collection<DeploymentDescription> deployments)
{
   for (AddonDependencyEntry dependency : getAddonSet(classUnderTest))
   {
      createAnnotatedDeployment(primaryDeployment,
               classUnderTest,
               deploymentMethod,
               deployments,
               dependency.getName(),
               dependency.getVersionRange().toString(),
               AddonDependency.class.getSimpleName(),
               true,
               dependency.isExported(),
               dependency.isOptional(),
               new Class[0],
               10000,
               TimeUnit.MILLISECONDS,
               NullException.class);
   }
}
 
Example #10
Source File: DeployRequestImpl.java    From furnace with Eclipse Public License 1.0 6 votes vote down vote up
protected void deploy(MutableAddonRepository repository)
{
   AddonId addon = addonInfo.getAddon();
   Set<File> resourceJars = addonInfo.getResources();

   if (resourceJars.isEmpty())
   {
      log.fine("No resource JARs found for " + addon);
   }

   Set<AddonDependencyEntry> addonDependencies = addonInfo.getDependencyEntries();
   if (addonDependencies.isEmpty())
   {
      log.fine("No dependencies found for addon " + addon);
   }
   log.info("Deploying addon " + addon);
   repository.deploy(addon, addonDependencies, resourceJars);
}
 
Example #11
Source File: NewComponentInstanceTest.java    From fabric8-forge with Apache License 2.0 6 votes vote down vote up
@Deployment
@AddonDependencies({
        @AddonDependency(name = "org.jboss.forge.addon:maven"),
        @AddonDependency(name = "org.jboss.forge.addon:projects"),
        @AddonDependency(name = "org.jboss.forge.addon:ui"),
        @AddonDependency(name = "org.jboss.forge.addon:ui-test-harness"),
        @AddonDependency(name = "org.jboss.forge.addon:shell-test-harness"),
        @AddonDependency(name = "io.fabric8.forge:camel")
})
public static AddonArchive getDeployment() {
    AddonArchive archive = ShrinkWrap
            .create(AddonArchive.class)
            .addBeansXML()
            .addAsAddonDependencies(
                    AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi"),
                    AddonDependencyEntry.create("org.jboss.forge.addon:ui"),
                    AddonDependencyEntry.create("org.jboss.forge.addon:ui-test-harness"),
                    AddonDependencyEntry.create("org.jboss.forge.addon:shell-test-harness"),
                    AddonDependencyEntry.create("org.jboss.forge.addon:projects"),
                    AddonDependencyEntry.create("org.jboss.forge.addon:maven"),
                    AddonDependencyEntry.create("io.fabric8.forge:camel")
            );
    return archive;
}
 
Example #12
Source File: MultipleRepositoryLoadingTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(order = 0)
@DeployToRepository("1")
public static AddonArchive getDeployment()
{
   AddonArchive archive = ShrinkWrap
            .create(AddonArchive.class)
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("dep1", "1"),
                     AddonDependencyEntry.create("dep2", "2")
            );

   archive.addAsLocalServices(MultipleRepositoryLoadingTest.class);

   return archive;
}
 
Example #13
Source File: ProxyMethodHandlerDispatchTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(order = 1)
public static AddonArchive getDeployment()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addAsLocalServices(ProxyMethodHandlerDispatchTest.class)
            .addAsAddonDependencies(AddonDependencyEntry.create("dep"));

   return archive;
}
 
Example #14
Source File: ThreadProxyInterruptTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(order = 1)
public static AddonArchive getDeployment()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addAsLocalServices(ThreadProxyInterruptTest.class)
            .addAsAddonDependencies(AddonDependencyEntry.create("dep"));

   return archive;
}
 
Example #15
Source File: ClassLoaderAdapterPassthroughTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(order = 3)
public static AddonArchive getDeployment()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addBeansXML()
            .addClass(MockResult.class)
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("dep", "1")
            )
            .addAsLocalServices(ClassLoaderAdapterPassthroughTest.class);

   return archive;
}
 
Example #16
Source File: AddonRepositoryStorageStrategyImpl.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Set<AddonDependencyEntry> getAddonDependencies(final AddonId addon)
{
   return lock.performLocked(LockMode.READ, new Callable<Set<AddonDependencyEntry>>()
   {
      @Override
      public Set<AddonDependencyEntry> call() throws Exception
      {
         Set<AddonDependencyEntry> result = new LinkedHashSet<AddonDependencyEntry>();
         File descriptor = getAddonDescriptor(addon);

         try
         {
            Node installed = getXmlRoot(descriptor);

            List<Node> children = installed.get("dependencies/dependency");
            for (final Node child : children)
            {
               if (child != null)
               {
                  result.add(AddonDependencyEntry.create(
                           child.getAttribute(ATTR_NAME),
                           Versions.parseMultipleVersionRange(child.getAttribute(ATTR_VERSION)),
                           Boolean.valueOf(child.getAttribute(ATTR_EXPORT)),
                           Boolean.valueOf(child.getAttribute(ATTR_OPTIONAL))));
               }
            }
         }
         catch (FileNotFoundException e)
         {
            // already removed
         }

         return result;
      }
   });
}
 
Example #17
Source File: AddonLoader.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
private Set<AddonDependency> fromAddonDependencyEntries(Addon addon,
         Set<AddonDependencyEntry> entries)
{
   Set<AddonDependency> result = new LinkedHashSet<AddonDependency>();
   for (AddonDependencyEntry entry : entries)
   {
      Set<AddonView> views = stateManager.getViewsOf(addon);
      AddonId dependencyId = stateManager.resolveAddonId(views, entry.getName());

      Addon dependency = null;
      if (dependencyId != null)
         dependency = lifecycleManager.getAddon(views.iterator().next(), dependencyId);

      if (dependency == null || dependency.getStatus().isMissing())
      {
         if (!entry.isOptional())
         {
            result.add(new MissingAddonDependencyImpl(entry));
         }
      }
      else
      {
         result.add(new AddonDependencyImpl(lock,
                  dependency,
                  entry.isExported(),
                  entry.isOptional()));
      }
   }
   return result;
}
 
Example #18
Source File: CLACProxiedCollectionsReturnTypeUnwrappingTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(name = "dep1,1", testable = false, order = 2)
public static AddonArchive getDeploymentDep1()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addClasses()
            .addAsAddonDependencies(AddonDependencyEntry.create("dep2", "2"))
            .addBeansXML();

   return archive;
}
 
Example #19
Source File: AddonModuleLoader.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
private void addAddonDependencies(Set<AddonView> views, AddonRepository repository, AddonId found, Builder builder)
         throws ContainerException
{
   Set<AddonDependencyEntry> addons = repository.getAddonDependencies(found);
   for (AddonDependencyEntry dependency : addons)
   {
      if (!dependency.getName().startsWith(CONTAINER_PREFIX))
         addAddonDependency(views, found, builder, dependency);
   }
}
 
Example #20
Source File: AddonModuleLoader.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
private void addContainerDependencies(Set<AddonView> views, AddonRepository repository, AddonId found,
         Builder builder)
                  throws ContainerException
{
   Set<AddonDependencyEntry> addons = repository.getAddonDependencies(found);
   for (AddonDependencyEntry dependency : addons)
   {
      /*
       * Containers should always take precedence at runtime.
       */
      if (dependency.getName().startsWith(CONTAINER_PREFIX))
         addAddonDependency(views, found, builder, dependency);
   }
}
 
Example #21
Source File: ImportedLookupTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(name = "dep1,1", testable = false, order = 2)
public static AddonArchive getDeploymentDep1()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addClasses(MockServiceConsumer.class, MockService.class)
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("dep3")
            );

   return archive;
}
 
Example #22
Source File: ClassLoaderAdapterWhitelistLoaderLookupTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(name = "dep1,1", testable = false, order = 2)
public static AddonArchive getDeploymentDep1()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addClasses(MockContextConsumer.class, MockContext.class)
            .addAsLocalServices(MockContextConsumer.class)
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("dep3")
            );

   return archive;
}
 
Example #23
Source File: SidewaysProxyAnonymousCollisionTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(name = "B,1", testable = false, order = 2)
public static AddonArchive getDeploymentB()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addClasses(Action1.class)
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("D", "1")
            );

   return archive;
}
 
Example #24
Source File: PreShutdownEventTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(order = 2)
public static AddonArchive getDeployment()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("dep1")
            );

   archive.addAsLocalServices(PreShutdownEventTest.class);

   return archive;
}
 
Example #25
Source File: PostStartupEventTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(order = 1)
public static AddonArchive getDeployment()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("dep1")
            );

   archive.addAsLocalServices(PostStartupEventTest.class);

   return archive;
}
 
Example #26
Source File: ClassLoaderAdapterWhitelistLoaderPassthroughTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(name = "dep1,1", testable = false, order = 2)
public static AddonArchive getDeploymentDep1()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addClasses(MockContextConsumer.class, MockContext.class)
            .addBeansXML()
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("dep3")
            );

   return archive;
}
 
Example #27
Source File: FurnaceDeploymentScenarioGenerator.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
private Set<AddonDependencyEntry> getAddonSet(Class<?> classUnderTest)
{
   if (addonSet == null)
      buildDependencyMaps(classUnderTest);

   return addonSet;
}
 
Example #28
Source File: ClassLoaderAdapterWhitelistLoaderPassthroughTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(name = "dep2,1", testable = false, order = 1)
public static AddonArchive getDeploymentDep2()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addClasses(MockContextPayloadImpl.class)
            .addBeansXML()
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("dep3")
            );

   return archive;
}
 
Example #29
Source File: SidewaysProxyAnonymousCollisionTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(name = "C,1", testable = false, order = 1)
public static AddonArchive getDeploymentC()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addClasses(Payload.class, Payload1.class)
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("E", "1")
            );

   return archive;
}
 
Example #30
Source File: ClassLoaderParameterUnwrappedTest.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Deployment(order = 3)
public static AddonArchive getDeployment()
{
   AddonArchive archive = ShrinkWrap.create(AddonArchive.class)
            .addBeansXML()
            .addClasses(IterableFactory.class, ClassWithClassAsParameter.class)
            .addAsAddonDependencies(
                     AddonDependencyEntry.create("dep2", "2")
            )
            .addAsLocalServices(ClassLoaderParameterUnwrappedTest.class);

   return archive;
}