Author: pete.muir(a)jboss.org
Date: 2009-03-18 15:31:44 -0400 (Wed, 18 Mar 2009)
New Revision: 2094
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactGenerator.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/Classes.java
Log:
Add ability to specify additional packages to include
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactGenerator.java
===================================================================
---
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactGenerator.java 2009-03-18
17:42:59 UTC (rev 2093)
+++
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactGenerator.java 2009-03-18
19:31:44 UTC (rev 2094)
@@ -40,6 +40,7 @@
private final Collection<Class<?>> classes;
private final Class<? extends Throwable> expectedDeploymentException;
private final Set<ResourceDescriptor> extraLibraries;
+ private final String[] packages;
private final Class<?> declaringClass;
@@ -100,10 +101,12 @@
if (declaringClass.isAnnotationPresent(Classes.class))
{
this.classes =
Arrays.asList(declaringClass.getAnnotation(Classes.class).value());
+ this.packages = declaringClass.getAnnotation(Classes.class).packages();
}
else
{
this.classes = Collections.emptyList();
+ this.packages = new String[0];
}
if (declaringClass.isAnnotationPresent(ExpectedDeploymentException.class))
{
@@ -157,6 +160,10 @@
artifact.getResources().removeAll(resources);
artifact.getResources().addAll(resources);
artifact.getLibraries().addAll(extraLibraries);
+ for (String packageName : packages)
+ {
+ artifact.addPackage(packageName, false);
+ }
return artifact;
}
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/Classes.java
===================================================================
---
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/Classes.java 2009-03-18
17:42:59 UTC (rev 2093)
+++
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/Classes.java 2009-03-18
19:31:44 UTC (rev 2094)
@@ -22,6 +22,8 @@
public @interface Classes
{
- Class<?>[] value();
+ Class<?>[] value() default {};
+ String[] packages() default {};
+
}
Show replies by date