Author: pete.muir(a)jboss.org
Date: 2009-03-10 09:53:33 -0400 (Tue, 10 Mar 2009)
New Revision: 1905
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/AbstractTest.java
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/ear/EarArtifactDescriptor.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/JSR299ArtifactDescriptor.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/TCKArtifactDescriptor.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/war/WarArtifactDescriptor.java
test-harness/trunk/impl/src/test/java/org/jboss/testharness/test/impl/packaging/declarative/standalone/DeclarativeStandaloneTest.java
Log:
slight refactor
Modified: test-harness/trunk/impl/src/main/java/org/jboss/testharness/AbstractTest.java
===================================================================
---
test-harness/trunk/impl/src/main/java/org/jboss/testharness/AbstractTest.java 2009-03-10
13:38:04 UTC (rev 1904)
+++
test-harness/trunk/impl/src/main/java/org/jboss/testharness/AbstractTest.java 2009-03-10
13:53:33 UTC (rev 1905)
@@ -12,6 +12,7 @@
import org.jboss.testharness.api.TestResult.Status;
import org.jboss.testharness.impl.ConfigurationImpl;
import org.jboss.testharness.impl.packaging.ArtifactGenerator;
+import org.jboss.testharness.impl.packaging.jsr299.JSR299ArtifactDescriptor;
import org.jboss.testharness.impl.packaging.jsr299.TCKArtifactDescriptor;
import org.testng.IHookCallBack;
import org.testng.IHookable;
@@ -98,7 +99,14 @@
else if (artifact != null && artifact.isUnit())
{
Set<Class<?>> classes = artifact.getClasses();
- getCurrentConfiguration().getStandaloneContainers().deploy(classes,
Arrays.asList(artifact.getBeansXml().getSource()));
+ if (artifact instanceof JSR299ArtifactDescriptor)
+ {
+ getCurrentConfiguration().getStandaloneContainers().deploy(classes,
Arrays.asList(((JSR299ArtifactDescriptor) artifact).getBeansXml().getSource()));
+ }
+ else
+ {
+ getCurrentConfiguration().getStandaloneContainers().deploy(classes);
+ }
}
}
catch (IOException e)
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-10
13:38:04 UTC (rev 1904)
+++
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactGenerator.java 2009-03-10
13:53:33 UTC (rev 1905)
@@ -19,6 +19,7 @@
import org.jboss.testharness.api.Configuration;
import org.jboss.testharness.impl.packaging.ear.EarArtifactDescriptor;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.jboss.testharness.impl.packaging.jsr299.JSR299ArtifactDescriptor;
import org.jboss.testharness.impl.packaging.jsr299.TCKArtifactDescriptor;
import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
@@ -194,7 +195,7 @@
}
else
{
- artifact = new TCKArtifactDescriptor(declaringClass, beansXml);
+ artifact = new JSR299ArtifactDescriptor(declaringClass, beansXml);
}
if (addDeclaringPackage)
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ear/EarArtifactDescriptor.java
===================================================================
---
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ear/EarArtifactDescriptor.java 2009-03-10
13:38:04 UTC (rev 1904)
+++
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ear/EarArtifactDescriptor.java 2009-03-10
13:53:33 UTC (rev 1905)
@@ -10,10 +10,10 @@
import org.apache.log4j.Logger;
import org.jboss.testharness.impl.packaging.ResourceDescriptor;
-import org.jboss.testharness.impl.packaging.jsr299.TCKArtifactDescriptor;
+import org.jboss.testharness.impl.packaging.jsr299.JSR299ArtifactDescriptor;
import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
-public class EarArtifactDescriptor extends TCKArtifactDescriptor
+public class EarArtifactDescriptor extends JSR299ArtifactDescriptor
{
private static final Logger log = Logger.getLogger(EarArtifactDescriptor.class);
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/JSR299ArtifactDescriptor.java
===================================================================
---
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/JSR299ArtifactDescriptor.java 2009-03-10
13:38:04 UTC (rev 1904)
+++
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/JSR299ArtifactDescriptor.java 2009-03-10
13:53:33 UTC (rev 1905)
@@ -2,10 +2,9 @@
import static org.jboss.testharness.impl.util.Strings.isEmpty;
-import org.jboss.testharness.impl.packaging.ArtifactDescriptor;
import org.jboss.testharness.impl.packaging.ResourceDescriptor;
-public class JSR299ArtifactDescriptor extends ArtifactDescriptor
+public class JSR299ArtifactDescriptor extends TCKArtifactDescriptor
{
public static final String BEANS_XML_DESTINATION = "META-INF/beans.xml";
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/TCKArtifactDescriptor.java
===================================================================
---
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/TCKArtifactDescriptor.java 2009-03-10
13:38:04 UTC (rev 1904)
+++
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/TCKArtifactDescriptor.java 2009-03-10
13:53:33 UTC (rev 1905)
@@ -13,7 +13,7 @@
import org.jboss.testharness.impl.packaging.ResourceDescriptor;
import org.jboss.testharness.impl.util.DeploymentProperties;
-public class TCKArtifactDescriptor extends JSR299ArtifactDescriptor
+public class TCKArtifactDescriptor extends ArtifactDescriptor
{
private static ResourceDescriptor getTckSupportJar()
@@ -42,9 +42,9 @@
private boolean runLocally;
private Class<? extends Throwable> expectedDeploymentException;
- public TCKArtifactDescriptor(Class<?> declaringClass, String
beansXmlSourceFileName)
+ public TCKArtifactDescriptor(Class<?> declaringClass)
{
- super(declaringClass, beansXmlSourceFileName);
+ super(declaringClass);
if (isLibrariesSupported())
{
getLibraries().add(new ResourceDescriptor("testng.jar",
"/lib/testng-jdk15.jar"));
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/war/WarArtifactDescriptor.java
===================================================================
---
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/war/WarArtifactDescriptor.java 2009-03-10
13:38:04 UTC (rev 1904)
+++
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/war/WarArtifactDescriptor.java 2009-03-10
13:53:33 UTC (rev 1905)
@@ -4,9 +4,9 @@
import java.net.URL;
import org.jboss.testharness.impl.packaging.ResourceDescriptor;
-import org.jboss.testharness.impl.packaging.jsr299.TCKArtifactDescriptor;
+import org.jboss.testharness.impl.packaging.jsr299.JSR299ArtifactDescriptor;
-public class WarArtifactDescriptor extends TCKArtifactDescriptor
+public class WarArtifactDescriptor extends JSR299ArtifactDescriptor
{
public static final String WEB_XML_DESTINATION = "WEB-INF/web.xml";
Modified:
test-harness/trunk/impl/src/test/java/org/jboss/testharness/test/impl/packaging/declarative/standalone/DeclarativeStandaloneTest.java
===================================================================
---
test-harness/trunk/impl/src/test/java/org/jboss/testharness/test/impl/packaging/declarative/standalone/DeclarativeStandaloneTest.java 2009-03-10
13:38:04 UTC (rev 1904)
+++
test-harness/trunk/impl/src/test/java/org/jboss/testharness/test/impl/packaging/declarative/standalone/DeclarativeStandaloneTest.java 2009-03-10
13:53:33 UTC (rev 1905)
@@ -6,6 +6,7 @@
import org.jboss.testharness.api.Configuration;
import org.jboss.testharness.impl.packaging.ArtifactGenerator;
import org.jboss.testharness.impl.packaging.ear.EarArtifactDescriptor;
+import org.jboss.testharness.impl.packaging.jsr299.JSR299ArtifactDescriptor;
import org.jboss.testharness.impl.packaging.jsr299.TCKArtifactDescriptor;
import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
import org.jboss.testharness.test.impl.mock.MockConfiguration;
@@ -32,7 +33,7 @@
public void testDefaultDeclartiveArtifact() throws Exception
{
TCKArtifactDescriptor artifact = new
ArtifactGenerator(standaloneConfiguration).createArtifact(DummyTest.class);
- assert artifact.getClass().equals(TCKArtifactDescriptor.class);
+ assert artifact.getClass().equals(JSR299ArtifactDescriptor.class);
assert artifact.isUnit();
File root = artifact.getExplodedJar();
File currentPackage = getCurrentPackageAsFile(root);
@@ -149,7 +150,7 @@
public void testStandaloneEjbTestDeclartiveArtifact() throws Exception
{
TCKArtifactDescriptor artifact = new
ArtifactGenerator(standaloneConfiguration).createArtifact(DummyEjbTest.class);
- assert artifact.getClass().equals(TCKArtifactDescriptor.class);
+ assert artifact.getClass().equals(JSR299ArtifactDescriptor.class);
}
@Test
Show replies by date