[
https://issues.jboss.org/browse/FORGE-1790?page=com.atlassian.jira.plugin...
]
Ondrej Zizka edited comment on FORGE-1790 at 1/26/15 2:11 PM:
--------------------------------------------------------------
How about this:
{code:java}
private static <T> AddonDependencyEntry[] copyAddonDeps(final Class<T>
cls)
{
AddonDependency[] annDeps = cls.getAnnotation(Dependencies.class).value();
AddonDependencyEntry[] entries = new AddonDependencyEntry[annDeps.length];
for( int i = 0; i < annDeps.length; i++ )
{
AddonDependency annDep = annDeps[i];
entries[i] = AddonDependencyEntry.create(annDep.name());
}
return entries;
}
{code}
{code:java}
@Deployment
@Dependencies({
@AddonDependency(name = "org.jboss.windup.config:windup-config"),
@AddonDependency(name = "org.jboss.windup.exec:windup-exec"),
@AddonDependency(name = "org.jboss.windup.utils:utils"),
@AddonDependency(name = "org.jboss.windup.rules.apps:rules-java"),
//@AddonDependency(name =
"org.jboss.windup.reporting:windup-reporting"),
@AddonDependency(name =
"org.jboss.windup.quickstarts:windup-skiparchives"),
@AddonDependency(name = "org.jboss.forge.furnace.container:cdi"),
})
public static ForgeArchive getDeployment()
{
final ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
.addBeansXML()
.addPackages(true, SkipArchRulesetTest.class.getPackage())
.addAsAddonDependencies(copyAddonDeps(SkipArchRulesetTest.class));
return archive;
}
{code}
was (Author: ozizka):
How about this:
{code:java}
private static <T> AddonDependencyEntry[] classToAddonDepEntries(final
Class<T> cls)
{
AddonDependency[] annDeps = cls.getAnnotation(Dependencies.class).value();
AddonDependencyEntry[] entries = new AddonDependencyEntry[annDeps.length];
for( int i = 0; i < annDeps.length; i++ )
{
AddonDependency annDep = annDeps[i];
entries[i] = AddonDependencyEntry.create(annDep.name());
}
return entries;
}
{code}
{code:java}
@Deployment
@Dependencies({
@AddonDependency(name = "org.jboss.windup.config:windup-config"),
@AddonDependency(name = "org.jboss.windup.exec:windup-exec"),
@AddonDependency(name = "org.jboss.windup.utils:utils"),
@AddonDependency(name = "org.jboss.windup.rules.apps:rules-java"),
//@AddonDependency(name =
"org.jboss.windup.reporting:windup-reporting"),
@AddonDependency(name =
"org.jboss.windup.quickstarts:windup-skiparchives"),
@AddonDependency(name = "org.jboss.forge.furnace.container:cdi"),
})
public static ForgeArchive getDeployment()
{
AddonDependencyEntry[] entries = copyAddonDeps(SkipArchRulesetTest.class);
final ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
.addBeansXML()
.addPackages(true, SkipArchRulesetTest.class.getPackage())
.addAsAddonDependencies(copyAddonDeps(SkipArchRulesetTest.class));
return archive;
}
{code}
Make adding addon deps easier in getDeployment().
-------------------------------------------------
Key: FORGE-1790
URL:
https://issues.jboss.org/browse/FORGE-1790
Project: Forge
Issue Type: Feature Request
Components: Test Harness
Affects Versions: 2.13.1.Final
Reporter: Ondrej Zizka
Assignee: George Gastaldi
Currently, the deps need to be stated twice - once in annotations, and then in
getDeployment(). If getDeployment() wasn't static, one could get that using
reflection. But Arquillian needs getDeployment static.
This also limits usage of subclassing, because subclass can't add dependencies to
it's parent.
Would be nice to come up with some solution to this.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)