Author: bdaw
Date: 2008-01-02 13:25:20 -0500 (Wed, 02 Jan 2008)
New Revision: 9410
Added:
modules/test/trunk/tooling/ant/src/main/java/
modules/test/trunk/tooling/ant/src/main/java/org/
modules/test/trunk/tooling/ant/src/main/java/org/jboss/
modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/
modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/tooling/
modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/tooling/ant/
modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/tooling/ant/TestsType.java
modules/test/trunk/tooling/core/
modules/test/trunk/tooling/core/pom.xml
modules/test/trunk/tooling/core/src/
modules/test/trunk/tooling/core/src/main/
modules/test/trunk/tooling/core/src/main/java/
modules/test/trunk/tooling/core/src/main/java/org/
modules/test/trunk/tooling/core/src/main/java/org/jboss/
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/JavaBuilder.java
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/TaskExecutingThread.java
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/ToolingConstants.java
modules/test/trunk/tooling/maven2/src/main/java/
modules/test/trunk/tooling/maven2/src/main/java/org/
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/maven2/
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/maven2/TestSuiteExecutor.java
Removed:
modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/tooling/ant/TestsType.java
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/maven2/TestSuiteExecutor.java
modules/test/trunk/tooling/src/
Modified:
modules/test/trunk/build/pom.xml
modules/test/trunk/pom.xml
modules/test/trunk/test/opends/pom.xml
modules/test/trunk/tooling/ant/pom.xml
modules/test/trunk/tooling/maven2/pom.xml
modules/test/trunk/tooling/pom.xml
Log:
specify maven plugin versions and split tooling to 3 submodules
Modified: modules/test/trunk/build/pom.xml
===================================================================
--- modules/test/trunk/build/pom.xml 2008-01-02 15:56:01 UTC (rev 9409)
+++ modules/test/trunk/build/pom.xml 2008-01-02 18:25:20 UTC (rev 9410)
@@ -67,68 +67,76 @@
</properties>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <showDeprecation>true</showDeprecation>
- <showWarnings>true</showWarnings>
- <optimize>true</optimize>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jboss-deploy-plugin</artifactId>
- <version>1.3</version>
- <executions>
- <execution>
- <goals>
- <goal>jboss-deploy</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- <pluginManagement>
+ <build>
<plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-idea-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <optimize>true</optimize>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jboss-deploy-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jboss-deploy</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
</plugins>
- </pluginManagement>
- </build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-1</version>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-idea-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
- <repositories>
- <repository>
+ <repositories>
+ <repository>
<id>repository.maven.org</id>
<name>Maven Repository</name>
<layout>default</layout>
@@ -158,7 +166,7 @@
<enabled>false</enabled>
</releases>
</repository>
- </repositories>
+ </repositories>
<pluginRepositories>
<pluginRepository>
<id>repository.maven.org</id>
@@ -200,7 +208,7 @@
</pluginRepositories>
- <reporting>
+ <reporting>
<plugins>
<plugin>
<artifactId>maven-changes-plugin</artifactId>
@@ -256,6 +264,11 @@
<artifactId>jboss-unit-tooling</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
Modified: modules/test/trunk/pom.xml
===================================================================
--- modules/test/trunk/pom.xml 2008-01-02 15:56:01 UTC (rev 9409)
+++ modules/test/trunk/pom.xml 2008-01-02 18:25:20 UTC (rev 9410)
@@ -11,12 +11,12 @@
<dependencies/>
<distributionManagement>
- <!--<repository>-->
- <!--Copy the distribution jar file to a local checkout of the maven repository
- - This variable can be set in $MAVEN_HOME/conf/settings.xml-->
- <!--<id>repository.jboss.org</id>-->
- <!--<url>file://${jboss.repository.root}</url>-->
- <!--</repository>-->
+ <repository>
+ <!--Copy the distribution jar file to a local checkout of the maven
repository-->
+ <!--- This variable can be set in $MAVEN_HOME/conf/settings.xml-->
+ <id>repository.jboss.org</id>
+ <url>file://${jboss.repository.root}</url>
+ </repository>
<snapshotRepository>
<id>snapshots.jboss.org</id>
<name>JBoss Snapshot Repository</name>
@@ -28,8 +28,7 @@
<modules>
<module>build</module>
<module>unit</module>
- <module>tooling/ant</module>
- <module>tooling/maven2</module>
+ <module>tooling</module>
<module>mc</module>
<module>remote</module>
<module>test/core</module>
Modified: modules/test/trunk/test/opends/pom.xml
===================================================================
--- modules/test/trunk/test/opends/pom.xml 2008-01-02 15:56:01 UTC (rev 9409)
+++ modules/test/trunk/test/opends/pom.xml 2008-01-02 18:25:20 UTC (rev 9410)
@@ -40,17 +40,7 @@
</resource>
</resources>
- <!--<sourceDirectory>../src/main/java</sourceDirectory>-->
-
<plugins>
- <!--<plugin>-->
- <!--<artifactId>maven-compiler-plugin</artifactId>-->
- <!--<configuration>-->
- <!--<includes>-->
-
<!--<include>org/jboss/portal/test/framework/embedded/opends/**</include>-->
- <!--</includes>-->
- <!--</configuration>-->
- <!--</plugin>-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-packaging-maven-plugin</artifactId>
Modified: modules/test/trunk/tooling/ant/pom.xml
===================================================================
--- modules/test/trunk/tooling/ant/pom.xml 2008-01-02 15:56:01 UTC (rev 9409)
+++ modules/test/trunk/tooling/ant/pom.xml 2008-01-02 18:25:20 UTC (rev 9410)
@@ -4,7 +4,7 @@
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
- <relativePath>../../build/pom.xml</relativePath>
+ <relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jboss-unit-tooling-ant</artifactId>
@@ -24,19 +24,9 @@
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-core</artifactId>
+ </dependency>
</dependencies>
-
- <build>
- <sourceDirectory>../src/main/java</sourceDirectory>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>org/jboss/unit/tooling/maven2/**</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
Copied: modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/tooling/ant (from rev
9349, modules/test/trunk/tooling/src/main/java/org/jboss/unit/tooling/ant)
Deleted:
modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/tooling/ant/TestsType.java
===================================================================
---
modules/test/trunk/tooling/src/main/java/org/jboss/unit/tooling/ant/TestsType.java 2007-12-14
15:52:59 UTC (rev 9349)
+++
modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/tooling/ant/TestsType.java 2008-01-02
18:25:20 UTC (rev 9410)
@@ -1,348 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.unit.tooling.ant;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.Java;
-import org.apache.tools.ant.types.Environment;
-import org.apache.tools.ant.types.Path;
-import org.jboss.unit.tooling.JavaBuilder;
-import org.jboss.unit.tooling.TaskExecutingThread;
-import org.jboss.unit.tooling.ant.configuration.ExcludeType;
-import org.jboss.unit.tooling.ant.configuration.IncludeType;
-import org.jboss.unit.tooling.ant.configuration.ParameterType;
-import org.jboss.unit.tooling.ant.configuration.PropertyType;
-import org.jboss.unit.tooling.ant.configuration.ReportsType;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
- * @version $Revision: 0.1 $
- */
-public class TestsType
-{
- private String config;
-
- private boolean fork = true;
-
- private List<IncludeType> includes = new LinkedList<IncludeType>();
-
- private List<ExcludeType> excludes = new LinkedList<ExcludeType>();
-
- private ReportsType reports;
-
- private Project project;
-
- private Path path;
-
- private String suiteName;
-
- private boolean jpda;
-
- private List<PropertyType> properties = new ArrayList<PropertyType>();
-
- private Set<Environment.Variable> sysproperties = new
HashSet<Environment.Variable>();
-
- private Set<ParameterType> parameters = new HashSet<ParameterType>();
-
-
-
- public TestsType()
- {
- }
-
-
- public void execute() throws BuildException
- {
- //Evaluate all the include filters
-
- Java javaTask = createJava();
-
- try
- {
- System.out.println("Invoking java: " +
javaTask.getCommandLine().toString());
- TaskExecutingThread executor = new TaskExecutingThread(javaTask);
- executor.run();
-
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- }
-
- private Java createJava()
- {
- Java javaTask = null;
- try
- {
-
- JavaBuilder javaBuilder = new JavaBuilder(getProject());
-
- addArguments(javaBuilder);
-
- javaTask = javaBuilder.buildJava();
-
- // Apply task classpath
- if (getClasspath() != null)
- {
- Path javaPath = javaTask.createClasspath();
- javaPath.add(getClasspath());
- }
-
- // Set system properties
- for (Environment.Variable sysproperty : sysproperties)
- {
- javaTask.addSysproperty(sysproperty);
- }
-
-
- }
- catch (BuildException e)
- {
- throw new IllegalStateException("Failed to create <java> ant task:
", e);
- }
-
- return javaTask;
- }
-
-
-
- private void addArguments(JavaBuilder javaBuilder)
- {
- javaBuilder.setConfig(config);
-
- if (getSuiteName() != null)
- {
- javaBuilder.setSuiteName(getSuiteName());
- }
-
- if (getReports() != null && getReports().getXMLReports() != null)
- {
- javaBuilder.setXmlReportDir(getReports().getXMLReports().getToDir());
- }
-
- if (getReports() != null && getReports().getHTMLReports() != null)
- {
- javaBuilder.setHtmlReportDir(getReports().getHTMLReports().getToDir());
- }
-
- for (IncludeType include : includes)
- {
- //Check attributes consistency
-
- if (include.getId() != null && (include.getIds() != null ||
include.getKeywords() != null))
- {
- throw new IllegalStateException("The use of attribute 'id' in
<include> tag should be exclusive");
- }
-
-
- if (include.getIds() != null)
- {
- javaBuilder.addUnparsedIncludeIDs(include.getIds());
- }
- if (include.getKeywords() != null)
- {
- javaBuilder.addUnparsedIncludeKeywords(include.getKeywords());
- }
- if (include.getId() != null)
- {
- javaBuilder.addUnparsedIncludeIDs(include.getId());
- }
- }
-
- for (ExcludeType exclude : excludes)
- {
-
- if (exclude.getId() != null && (exclude.getIds() != null ||
exclude.getKeywords() != null))
- {
- throw new IllegalStateException("The use of attribute 'id' in
<exclude> tag should be exclusive");
- }
-
- if (exclude.getIds() != null)
- {
- javaBuilder.addUnparsedExcludeIDs(exclude.getIds());
- }
- if (exclude.getKeywords() != null)
- {
- javaBuilder.addUnparsedExcludeKeywords(exclude.getKeywords());
- }
- if (exclude.getId() != null)
- {
- javaBuilder.addUnparsedExcludeIDs(exclude.getId());
- }
- }
-
- // Properties
-
- if (properties.size() > 0)
- {
-
- for (PropertyType property : properties)
- {
- javaBuilder.addProperty(property.getName(),property.getValue());
- }
-
-
javaBuilder.updateFQNProperties((Hashtable<String,String>)getProject().getProperties());
- }
-
-
- //Parameters
-
- for (ParameterType parameter : parameters)
- {
- javaBuilder.addParameter(parameter.getName(), parameter.getValues());
- }
-
-
javaBuilder.updateFQNParameters((Hashtable<String,String>)getProject().getProperties());
-
- }
-
- public Set<Environment.Variable> getSysproperties()
- {
- return sysproperties;
- }
-
- public void setSysproperties(Set<Environment.Variable> sysproperties)
- {
- this.sysproperties = sysproperties;
- }
-
- public void addConfiguredInclude(IncludeType include)
- {
- this.includes.add(include);
- }
-
- public void addConfiguredExclude(ExcludeType exclude)
- {
- this.excludes.add(exclude);
- }
-
- public void addConfiguredReports(ReportsType reports)
- {
- this.reports = reports;
- }
-
- public void addConfiguredProperty(PropertyType property)
- {
- this.properties.add(property);
- }
-
- public void addConfiguredParameter(ParameterType param)
- {
- this.parameters.add(param);
- }
-
- public Set<ParameterType> getParameters()
- {
- return parameters;
- }
-
- public void setParameters(Set<ParameterType> parameters)
- {
- this.parameters = parameters;
- }
-
- public String getConfig()
- {
- return config;
- }
-
- public void setConfig(String config)
- {
- this.config = config;
- }
-
-
- public Path getClasspath()
- {
- return path;
- }
-
- public void addConfiguredClasspath(Path path)
- {
- this.path = path;
- }
-
-
- public boolean isFork()
- {
- return fork;
- }
-
- public void setFork(boolean fork)
- {
- this.fork = fork;
- }
-
-
- public Project getProject()
- {
- return project;
- }
-
- public void setProject(Project project)
- {
- this.project = project;
- }
-
-
- public ReportsType getReports()
- {
- return reports;
- }
-
- public void setReports(ReportsType reports)
- {
- this.reports = reports;
- }
-
- public String getSuiteName()
- {
- return suiteName;
- }
-
- public void setSuiteName(String suiteName)
- {
- this.suiteName = suiteName;
- }
-
- public boolean isJpda()
- {
- return jpda;
- }
-
- public void setJpda(boolean jpda)
- {
- this.jpda = jpda;
- }
-}
Copied:
modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/tooling/ant/TestsType.java
(from rev 9409,
modules/test/trunk/tooling/src/main/java/org/jboss/unit/tooling/ant/TestsType.java)
===================================================================
---
modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/tooling/ant/TestsType.java
(rev 0)
+++
modules/test/trunk/tooling/ant/src/main/java/org/jboss/unit/tooling/ant/TestsType.java 2008-01-02
18:25:20 UTC (rev 9410)
@@ -0,0 +1,353 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.unit.tooling.ant;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Java;
+import org.apache.tools.ant.types.Environment;
+import org.apache.tools.ant.types.Path;
+import org.jboss.unit.tooling.JavaBuilder;
+import org.jboss.unit.tooling.TaskExecutingThread;
+import org.jboss.unit.tooling.ant.configuration.ExcludeType;
+import org.jboss.unit.tooling.ant.configuration.IncludeType;
+import org.jboss.unit.tooling.ant.configuration.ParameterType;
+import org.jboss.unit.tooling.ant.configuration.PropertyType;
+import org.jboss.unit.tooling.ant.configuration.ReportsType;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public class TestsType
+{
+ private String config;
+
+ private boolean fork = true;
+
+ private List<IncludeType> includes = new LinkedList<IncludeType>();
+
+ private List<ExcludeType> excludes = new LinkedList<ExcludeType>();
+
+ private ReportsType reports;
+
+ private Project project;
+
+ private Path path;
+
+ private String suiteName;
+
+ private boolean jpda;
+
+ private List<PropertyType> properties = new ArrayList<PropertyType>();
+
+ private Set<Environment.Variable> sysproperties = new
HashSet<Environment.Variable>();
+
+ private Set<ParameterType> parameters = new HashSet<ParameterType>();
+
+
+
+ public TestsType()
+ {
+ }
+
+
+ public void execute() throws BuildException
+ {
+ //Evaluate all the include filters
+
+ Java javaTask = createJava();
+
+ try
+ {
+ System.out.println("Invoking java: " +
javaTask.getCommandLine().toString());
+ TaskExecutingThread executor = new TaskExecutingThread(javaTask);
+ executor.run();
+
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ }
+
+ private Java createJava()
+ {
+ Java javaTask = null;
+ try
+ {
+
+ JavaBuilder javaBuilder = new JavaBuilder(getProject());
+
+ addArguments(javaBuilder);
+
+ javaTask = javaBuilder.buildJava();
+
+ // Apply task classpath
+ if (getClasspath() != null)
+ {
+ Path javaPath = javaTask.createClasspath();
+ javaPath.add(getClasspath());
+ }
+
+ // Set system properties
+ for (Environment.Variable sysproperty : sysproperties)
+ {
+ javaTask.addSysproperty(sysproperty);
+ }
+
+
+ }
+ catch (BuildException e)
+ {
+ throw new IllegalStateException("Failed to create <java> ant task:
", e);
+ }
+
+ return javaTask;
+ }
+
+
+
+ private void addArguments(JavaBuilder javaBuilder)
+ {
+ javaBuilder.setConfig(config);
+
+ if (isJpda())
+ {
+ javaBuilder.setJPDA(true);
+ }
+
+ if (getSuiteName() != null)
+ {
+ javaBuilder.setSuiteName(getSuiteName());
+ }
+
+ if (getReports() != null && getReports().getXMLReports() != null)
+ {
+ javaBuilder.setXmlReportDir(getReports().getXMLReports().getToDir());
+ }
+
+ if (getReports() != null && getReports().getHTMLReports() != null)
+ {
+ javaBuilder.setHtmlReportDir(getReports().getHTMLReports().getToDir());
+ }
+
+ for (IncludeType include : includes)
+ {
+ //Check attributes consistency
+
+ if (include.getId() != null && (include.getIds() != null ||
include.getKeywords() != null))
+ {
+ throw new IllegalStateException("The use of attribute 'id' in
<include> tag should be exclusive");
+ }
+
+
+ if (include.getIds() != null)
+ {
+ javaBuilder.addUnparsedIncludeIDs(include.getIds());
+ }
+ if (include.getKeywords() != null)
+ {
+ javaBuilder.addUnparsedIncludeKeywords(include.getKeywords());
+ }
+ if (include.getId() != null)
+ {
+ javaBuilder.addUnparsedIncludeIDs(include.getId());
+ }
+ }
+
+ for (ExcludeType exclude : excludes)
+ {
+
+ if (exclude.getId() != null && (exclude.getIds() != null ||
exclude.getKeywords() != null))
+ {
+ throw new IllegalStateException("The use of attribute 'id' in
<exclude> tag should be exclusive");
+ }
+
+ if (exclude.getIds() != null)
+ {
+ javaBuilder.addUnparsedExcludeIDs(exclude.getIds());
+ }
+ if (exclude.getKeywords() != null)
+ {
+ javaBuilder.addUnparsedExcludeKeywords(exclude.getKeywords());
+ }
+ if (exclude.getId() != null)
+ {
+ javaBuilder.addUnparsedExcludeIDs(exclude.getId());
+ }
+ }
+
+ // Properties
+
+ if (properties.size() > 0)
+ {
+
+ for (PropertyType property : properties)
+ {
+ javaBuilder.addProperty(property.getName(),property.getValue());
+ }
+
+
javaBuilder.updateFQNProperties((Hashtable<String,String>)getProject().getProperties());
+ }
+
+
+ //Parameters
+
+ for (ParameterType parameter : parameters)
+ {
+ javaBuilder.addParameter(parameter.getName(), parameter.getValues());
+ }
+
+
javaBuilder.updateFQNParameters((Hashtable<String,String>)getProject().getProperties());
+
+ }
+
+ public Set<Environment.Variable> getSysproperties()
+ {
+ return sysproperties;
+ }
+
+ public void setSysproperties(Set<Environment.Variable> sysproperties)
+ {
+ this.sysproperties = sysproperties;
+ }
+
+ public void addConfiguredInclude(IncludeType include)
+ {
+ this.includes.add(include);
+ }
+
+ public void addConfiguredExclude(ExcludeType exclude)
+ {
+ this.excludes.add(exclude);
+ }
+
+ public void addConfiguredReports(ReportsType reports)
+ {
+ this.reports = reports;
+ }
+
+ public void addConfiguredProperty(PropertyType property)
+ {
+ this.properties.add(property);
+ }
+
+ public void addConfiguredParameter(ParameterType param)
+ {
+ this.parameters.add(param);
+ }
+
+ public Set<ParameterType> getParameters()
+ {
+ return parameters;
+ }
+
+ public void setParameters(Set<ParameterType> parameters)
+ {
+ this.parameters = parameters;
+ }
+
+ public String getConfig()
+ {
+ return config;
+ }
+
+ public void setConfig(String config)
+ {
+ this.config = config;
+ }
+
+
+ public Path getClasspath()
+ {
+ return path;
+ }
+
+ public void addConfiguredClasspath(Path path)
+ {
+ this.path = path;
+ }
+
+
+ public boolean isFork()
+ {
+ return fork;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+
+ public Project getProject()
+ {
+ return project;
+ }
+
+ public void setProject(Project project)
+ {
+ this.project = project;
+ }
+
+
+ public ReportsType getReports()
+ {
+ return reports;
+ }
+
+ public void setReports(ReportsType reports)
+ {
+ this.reports = reports;
+ }
+
+ public String getSuiteName()
+ {
+ return suiteName;
+ }
+
+ public void setSuiteName(String suiteName)
+ {
+ this.suiteName = suiteName;
+ }
+
+ public boolean isJpda()
+ {
+ return jpda;
+ }
+
+ public void setJpda(boolean jpda)
+ {
+ this.jpda = jpda;
+ }
+}
Added: modules/test/trunk/tooling/core/pom.xml
===================================================================
--- modules/test/trunk/tooling/core/pom.xml (rev 0)
+++ modules/test/trunk/tooling/core/pom.xml 2008-01-02 18:25:20 UTC (rev 9410)
@@ -0,0 +1,29 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-portal-modules-test</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-unit-tooling-core</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Unit Tooling Core</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
Copied:
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/JavaBuilder.java
(from rev 9349,
modules/test/trunk/tooling/src/main/java/org/jboss/unit/tooling/JavaBuilder.java)
===================================================================
--- modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/JavaBuilder.java
(rev 0)
+++
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/JavaBuilder.java 2008-01-02
18:25:20 UTC (rev 9410)
@@ -0,0 +1,762 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.unit.tooling;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.Environment;
+import org.apache.tools.ant.types.Assertions;
+import org.apache.tools.ant.taskdefs.Java;
+import static org.jboss.unit.tooling.ToolingConstants.JBOSS_UNIT_PROPERTIES;
+import static org.jboss.unit.tooling.ToolingConstants.JBOSS_UNIT_PROPERTY;
+import static org.jboss.unit.tooling.ToolingConstants.JBOSS_UNIT_PARAMETERS;
+import static org.jboss.unit.tooling.ToolingConstants.JBOSS_UNIT_PARAMETER;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.LinkedList;
+
+import static org.jboss.unit.tooling.ToolingConstants.*;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class JavaBuilder
+{
+
+ private Project antProject;
+
+ private String config;
+
+ private String suiteName;
+
+ private Set<String> includeIDs = new HashSet<String>();
+
+ private Set<String> includeKeywords = new HashSet<String>();
+
+ private Set<String> excludeIDs = new HashSet<String>();
+
+ private Set<String> excludeKeywords = new HashSet<String>();
+
+ private boolean jPDA = false;
+
+ private boolean fork = true;
+
+ private String xmlReportDir;
+
+ private String htmlReportDir;
+
+ private Map<String,String> properties = new HashMap<String,String>();
+
+ private Map<String,List<String>> parameters = new HashMap<String,
List<String>>();
+
+ public JavaBuilder()
+ {
+ init();
+ }
+
+ public JavaBuilder(Project antProject)
+ {
+ this.antProject = antProject;
+ init();
+ }
+
+ private void init()
+ {
+ if (antProject == null)
+ {
+ antProject = new Project();
+ antProject.init();
+ }
+ }
+
+ public Java buildJava()
+ {
+ Java java = (Java)antProject.createTask("java");
+
+ java.setClassname("org.jboss.unit.tooling.Main");
+
+ // Set jboss logging to use JUL
+ Environment.Variable pluginProperty = new Environment.Variable();
+ pluginProperty.setKey("org.jboss.logging.Logger.pluginClass");
+ pluginProperty.setValue("org.jboss.logging.jdk.JDK14LoggerPlugin");
+ java.addSysproperty(pluginProperty);
+
+ // Set JUL to configure using the logging.properties file found in the current dir
+ Environment.Variable julProperty = new Environment.Variable();
+ julProperty.setKey("java.util.logging.config.file");
+ julProperty.setValue("logging.properties");
+ java.addSysproperty(julProperty);
+
+ // We enable by default all assertions : todo make it configurable perhaps (see JDK
doc about assertions)
+ Assertions assertions = new Assertions();
+ assertions.setProject(antProject);
+ assertions.addEnable(new Assertions.EnabledAssertion());
+ java.addAssertions(assertions);
+
+ // Beginning of jpda option implementation, need to improve it
+ if (jPDA)
+ {
+ Environment.Variable javaDotCompilerProperty = new Environment.Variable();
+ javaDotCompilerProperty.setKey("java.compiler");
+ javaDotCompilerProperty.setValue("NONE");
+ java.addSysproperty(javaDotCompilerProperty);
+ java.setJvmargs("-Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9000");
+ }
+
+ // Set fork
+ if (isFork())
+ {
+ java.setFork(true);
+ }
+
+
+ java.createArg().setValue(OPT_CONFIG + "=" + config);
+
+ if (getSuiteName() != null)
+ {
+ java.createArg().setValue(OPT_SUITE_NAME + "=" + getSuiteName());
+ }
+
+ if (getXmlReportDir() != null)
+ {
+ java.createArg().setValue(OPT_XML_REPORT_DIR + "=" +
getXmlReportDir());
+ }
+
+ if (getHtmlReportDir() != null)
+ {
+ java.createArg().setValue(OPT_HTML_REPORT_DIR + "=" +
getHtmlReportDir());
+ }
+
+ if (includeIDs.size() != 0)
+ {
+ java.createArg().setValue(generateArgument(includeIDs, OPT_IDS));
+ }
+
+ if (includeKeywords.size() != 0)
+ {
+ java.createArg().setValue(generateArgument(includeKeywords, OPT_KEYWORDS));
+ }
+
+ if (excludeIDs.size() != 0)
+ {
+ java.createArg().setValue(generateArgument(excludeIDs, OPT_EX_IDS));
+ }
+
+ if (excludeKeywords.size() != 0)
+ {
+ java.createArg().setValue(generateArgument(excludeKeywords, OPT_EX_KEYWORDS));
+ }
+
+
+ if (properties.size() > 0)
+ {
+
+ StringBuilder props = new StringBuilder("[");
+
+ for (Iterator<String> iterator = properties.keySet().iterator();
iterator.hasNext();)
+ {
+ String propertyKey = iterator.next();
+
+ String propertyValue = properties.get(propertyKey);
+
+ props.append(propertyKey + "=" + propertyValue);
+
+ if (iterator.hasNext())
+ {
+ props.append(",");
+ }
+ else
+ {
+ props.append("]");
+ }
+ }
+
+ java.createArg().setValue(OPT_PROPERTIES + "=" + props);
+
+ }
+
+
+ if (!parameters.isEmpty())
+ {
+ StringBuilder params = new StringBuilder("[");
+
+ Set<String> paramNames = parameters.keySet();
+
+ for (Iterator<String> stringIterator = paramNames.iterator();
stringIterator.hasNext();)
+ {
+ String name = stringIterator.next();
+
+
+ List<String> paramValues = parameters.get(name);
+
+ for (Iterator<String> iterator = paramValues.iterator();
iterator.hasNext();)
+ {
+ String value = iterator.next();
+
+
+ params.append(name)
+ .append("=")
+ .append(value);
+
+ if (iterator.hasNext())
+ {
+ params.append(",");
+ }
+ }
+
+ if (stringIterator.hasNext())
+ {
+ params.append(",");
+ }
+ else
+ {
+ params.append("]");
+ }
+
+ }
+
+ java.createArg().setValue(OPT_PARAMETERS + "=" + params);
+
+ }
+
+
+
+ return java;
+ }
+
+
+
+ public String getConfig()
+ {
+ return config;
+ }
+
+ public void setConfig(String config)
+ {
+ if (config == null)
+ {
+ throw new IllegalArgumentException("config cannot be null");
+ }
+ this.config = config;
+ }
+
+ public String getSuiteName()
+ {
+ return suiteName;
+ }
+
+ public void setSuiteName(String suiteName)
+ {
+ if (suiteName == null)
+ {
+ throw new IllegalArgumentException("suiteName cannot be null");
+ }
+ this.suiteName = suiteName;
+ }
+
+ public void addIncludeID(String id)
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException("id cannot be null");
+ }
+
+ includeIDs.add(id);
+ }
+
+ public void addUnparsedIncludeIDs(String ids)
+ {
+ if (ids == null)
+ {
+ throw new IllegalArgumentException("ids cannot be null");
+ }
+
+ addUnparsedString(getIncludeIDs(), ids);
+ }
+
+ public Set<String> getIncludeIDs()
+ {
+ return includeIDs;
+ }
+
+ public void setIncludeIDs(Set<String> includeIDs)
+ {
+ if (includeIDs == null)
+ {
+ throw new IllegalArgumentException("includeIDs cannot be null");
+ }
+
+ this.includeIDs = includeIDs;
+ }
+
+ public void addIncludeKeyword(String keyword)
+ {
+ if (keyword == null)
+ {
+ throw new IllegalArgumentException("keyword cannot be null");
+ }
+
+ includeKeywords.add(keyword);
+ }
+
+
+ public void addUnparsedIncludeKeywords(String keywords)
+ {
+ if (keywords == null)
+ {
+ throw new IllegalArgumentException("keywords cannot be null");
+ }
+
+ addUnparsedString(getIncludeKeywords(), keywords);
+ }
+
+ public Set<String> getIncludeKeywords()
+ {
+ return includeKeywords;
+ }
+
+ public void setIncludeKeywords(Set<String> includeKeywords)
+ {
+ if ( includeKeywords == null)
+ {
+ throw new IllegalArgumentException("includeKeywords cannot be null");
+ }
+
+ this.includeKeywords = includeKeywords;
+ }
+
+ public void addExcludeID(String id)
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException("id cannot be null");
+ }
+
+ excludeIDs.add(id);
+ }
+
+ public void addUnparsedExcludeIDs(String ids)
+ {
+ if (ids == null)
+ {
+ throw new IllegalArgumentException("ids cannot be null");
+ }
+
+ addUnparsedString(getExcludeIDs(), ids);
+ }
+
+ public Set<String> getExcludeIDs()
+ {
+ return excludeIDs;
+ }
+
+ public void setExcludeIDs(Set<String> excludeIDs)
+ {
+ if (excludeIDs == null)
+ {
+ throw new IllegalArgumentException("excludeIDs cannot be null");
+ }
+
+ this.excludeIDs = excludeIDs;
+ }
+
+ public void addExcludeKeyword(String keyword)
+ {
+ if (keyword == null)
+ {
+ throw new IllegalArgumentException("keyword cannot be null");
+ }
+
+ excludeKeywords.add(keyword);
+ }
+
+ public void addUnparsedExcludeKeywords(String keywords)
+ {
+ if (keywords == null)
+ {
+ throw new IllegalArgumentException("keywords cannot be null");
+ }
+
+ addUnparsedString(getExcludeKeywords(), keywords);
+ }
+
+ public Set<String> getExcludeKeywords()
+ {
+ return excludeKeywords;
+ }
+
+ public void setExcludeKeywords(Set<String> excludeKeywords)
+ {
+ if (excludeKeywords == null)
+ {
+ throw new IllegalArgumentException("excludeKeywords cannot be null");
+ }
+
+ this.excludeKeywords = excludeKeywords;
+ }
+
+ public boolean isJPDA()
+ {
+ return jPDA;
+ }
+
+ public void setJPDA(boolean jPDA)
+ {
+ this.jPDA = jPDA;
+ }
+
+ public boolean isFork()
+ {
+ return fork;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ private void addUnparsedString(Set<String> set, String valueString)
+ {
+ if (valueString == null)
+ {
+ throw new IllegalArgumentException("valueString cannot be null");
+ }
+ String[] parsedValues = valueString.split(",");
+ for (String keyword : parsedValues)
+ {
+ set.add(keyword.trim());
+ }
+ }
+
+
+ public String getXmlReportDir()
+ {
+ return xmlReportDir;
+ }
+
+ public void setXmlReportDir(String xmlReportDir)
+ {
+ this.xmlReportDir = xmlReportDir;
+ }
+
+ public String getHtmlReportDir()
+ {
+ return htmlReportDir;
+ }
+
+ public void setHtmlReportDir(String htmlReportDir)
+ {
+ this.htmlReportDir = htmlReportDir;
+ }
+
+ public Project getAntProject()
+ {
+ return antProject;
+ }
+
+ public void setAntProject(Project antProject)
+ {
+ this.antProject = antProject;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return properties;
+ }
+
+ public void setProperties(Map<String, String> properties)
+ {
+ this.properties = properties;
+ }
+
+ public void addProperties(Map<String,String> toAdd)
+ {
+ if (toAdd == null)
+ {
+ throw new IllegalArgumentException("property map cannot be null");
+ }
+
+ properties.putAll(toAdd);
+ }
+
+
+ public void addProperty(String key, String value)
+ {
+ if (key == null || value == null)
+ {
+ throw new IllegalArgumentException("Key and value must not be null");
+ }
+
+ properties.put(key, value);
+ }
+
+ public void updateFQNProperties(Map toUpdate)
+ {
+
+ String sysProperties = (String)toUpdate.get(JBOSS_UNIT_PROPERTIES);
+
+ if (sysProperties != null && sysProperties.length() > 0)
+ {
+
+ Map<String,String> parsedProps =
JavaBuilder.parseProperties(sysProperties);
+
+ properties.putAll(parsedProps);
+ }
+
+ for (Object sysPropKey : toUpdate.keySet())
+ {
+
+ if (sysPropKey.toString().startsWith(JBOSS_UNIT_PROPERTY))
+ {
+ String propertyString = sysPropKey + "=" +
toUpdate.get(sysPropKey);
+
+ propertyString = propertyString.replaceFirst(JBOSS_UNIT_PROPERTY +
"\\.", "");
+
+ //
+ String[] patternValues = propertyString.split("=");
+
+ //
+ if (patternValues.length != 2)
+ {
+ throw new IllegalArgumentException("Property not accepted, it should
match a=b and it is " + propertyString);
+ }
+
+ properties.put(patternValues[0],patternValues[1]);
+
+ }
+
+
+ }
+
+ }
+
+ public static Map<String,String> parseProperties(String propertiesString)
+ {
+ if (!propertiesString.matches("\\[.+=.+(,.+=.+)*\\]"))
+ {
+ throw new IllegalArgumentException("Properties don't follow proper
format: [a=b,c=d,e=f]");
+ }
+
+ Map<String,String> parsedProps = new HashMap<String,String>();
+
+ propertiesString =
propertiesString.replaceAll("\\[","").replaceAll("\\]","");
+
+ String propertyGroups[] = propertiesString.split(",");
+
+ for (String propertyGroup : propertyGroups)
+ {
+
+ String property[] = propertyGroup.split("=");
+
+ //
+ if (property.length != 2)
+ {
+ throw new IllegalArgumentException("Property not accepted, it should
match a=b and it is " + property);
+ }
+
+ parsedProps.put(property[0],property[1]);
+ }
+ return parsedProps;
+ }
+
+ public Map<String, List<String>> getParameters()
+ {
+ return parameters;
+ }
+
+ public void setParameters(Map<String, List<String>> parameters)
+ {
+ this.parameters = parameters;
+ }
+
+
+ public void addParameters(Map<String, List<String>> toAdd)
+ {
+
+ if (toAdd == null)
+ {
+ throw new IllegalArgumentException("parameter map cannot be null");
+ }
+
+ parameters.putAll(toAdd);
+
+ }
+
+ public void addParameter(String key, List<String> addValues)
+ {
+
+ if (key == null || addValues == null)
+ {
+ throw new IllegalArgumentException("parameter key and values list cannot be
null");
+ }
+
+ List<String> values;
+
+ if (parameters.containsKey(key))
+ {
+ values = parameters.get(key);
+ }
+ else
+ {
+ values = new LinkedList<String>();
+ }
+
+ values.addAll(addValues);
+
+ parameters.put(key, values);
+
+ }
+
+ public void updateFQNParameters(Map toUpdate)
+ {
+
+ Object sysParameters = toUpdate.get(JBOSS_UNIT_PARAMETERS);
+
+ if (sysParameters != null && sysParameters.toString().length() > 0)
+ {
+
+ Map<String,List<String>> parsedParams =
parseParameters(sysParameters.toString());
+
+
+ parameters.putAll(parsedParams);
+ }
+
+ for (Object sysPropKey : toUpdate.keySet())
+ {
+ if (sysPropKey.toString().startsWith(JBOSS_UNIT_PARAMETER + "."))
+ {
+ String propertyString = sysPropKey + "=" +
toUpdate.get(sysPropKey);
+
+ propertyString = propertyString.replaceFirst(JBOSS_UNIT_PARAMETER +
"\\.", "");
+
+
+ //
+ String[] parameter = propertyString.split("=",2);
+
+ //
+ if (parameter.length != 2)
+ {
+ throw new IllegalArgumentException("Property not accepted, it should
match a=b and it is " + propertyString);
+ }
+
+
+ List parameterValues = new LinkedList<String>();
+
+ if (parameter[1].matches("\\[.+(,.+)*\\]"))
+ {
+
+
+
+ String valuesString = parameter[1];
+
+ valuesString =
valuesString.replaceAll("\\[","").replaceAll("\\]","");
+
+ String[] values = valuesString.split(",");
+
+ for (String value : values)
+ {
+ parameterValues.add(value);
+ }
+
+ }
+ else
+ {
+ parameterValues.add(parameter[1]);
+ }
+
+ if (parameters.containsKey(parameter[0]))
+ {
+ parameters.get(parameter[0]).addAll(parameterValues);
+ }
+ else
+ {
+ parameters.put(parameter[0], parameterValues);
+ }
+ }
+ }
+ }
+
+ private Map<String, List<String>> parseParameters(String
parametersString)
+ {
+
+ if (!parametersString.matches("\\[.+=.+(,.+=.+)*\\]"))
+ {
+ throw new IllegalArgumentException("Parameters don't follow proper
format: [a=b,c=d,e=f]");
+ }
+
+ Map<String,List<String>> parsedParams = new
HashMap<String,List<String>>();
+
+ parametersString =
parametersString.replaceAll("\\[","").replaceAll("\\]","");
+
+ String parameterGroups[] = parametersString.split(",");
+
+ for (String parameterGroup : parameterGroups)
+ {
+
+ String parameter[] = parameterGroup.split("=");
+
+ //
+ if (parameter.length != 2)
+ {
+ throw new IllegalArgumentException("Parameter not accepted, it should
match a=b and it is " + parameter);
+ }
+
+ List<String> values;
+
+ if (parsedParams.containsKey(parameter[0]))
+ {
+ values = parsedParams.get(parameter[0]);
+ }
+ else
+ {
+ values = new LinkedList<String>();
+ }
+
+ values.add(parameter[1]);
+
+ parsedParams.put(parameter[0], values);
+ }
+
+ return parsedParams;
+
+
+ }
+
+ private String generateArgument(Set<String> values, String argumentName)
+ {
+
+ StringBuffer argument = new StringBuffer(argumentName).append("=");
+ for (String s : values)
+ {
+ argument.append(s).append(",");
+ }
+ // Remove last ','
+ argument.deleteCharAt(argument.length() - 1);
+ return argument.toString();
+ }
+}
Copied:
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/TaskExecutingThread.java
(from rev 9349,
modules/test/trunk/tooling/src/main/java/org/jboss/unit/tooling/TaskExecutingThread.java)
===================================================================
---
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/TaskExecutingThread.java
(rev 0)
+++
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/TaskExecutingThread.java 2008-01-02
18:25:20 UTC (rev 9410)
@@ -0,0 +1,50 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.unit.tooling;
+
+import org.apache.tools.ant.taskdefs.Java;
+import org.apache.tools.ant.Task;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public class TaskExecutingThread extends Thread
+{
+
+ private Task task;
+
+ private TaskExecutingThread()
+ {
+ }
+
+ public TaskExecutingThread(Task task)
+ {
+ this.task = task;
+ }
+
+ public void run()
+ {
+ this.task.execute();
+ }
+}
Copied:
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/ToolingConstants.java
(from rev 9349,
modules/test/trunk/tooling/src/main/java/org/jboss/unit/tooling/ToolingConstants.java)
===================================================================
---
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/ToolingConstants.java
(rev 0)
+++
modules/test/trunk/tooling/core/src/main/java/org/jboss/unit/tooling/ToolingConstants.java 2008-01-02
18:25:20 UTC (rev 9410)
@@ -0,0 +1,71 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.unit.tooling;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public final class ToolingConstants
+{
+
+ public static final String JBOSS_UNIT_PROPERTIES = "jboss.unit.properties";
+
+ public static final String JBOSS_UNIT_PROPERTY = "jboss.unit.property";
+
+ public static final String JBOSS_UNIT_PARAMETER = "jboss.unit.parameter";
+
+ public static final String JBOSS_UNIT_PARAMETERS = "jboss.unit.parameters";
+
+ public static final String OPT_ID = "--id";
+
+ public static final String OPT_IDS = "--ids";
+
+ public static final String OPT_KEYWORDS = "--keywords";
+
+ public static final String OPT_EX_ID = "--ex_id";
+
+ public static final String OPT_EX_IDS = "--ex_ids";
+
+ public static final String OPT_EX_KEYWORDS = "--ex_keywords";
+
+ public static final String OPT_CONFIG = "--config";
+
+ public static final String OPT_SUITE_NAME = "--suite_name";
+
+ public static final String OPT_NO_CONSOLE = "--no_console";
+
+ public static final String OPT_XML_REPORT_DIR = "--xml_report_dir";
+
+ public static final String OPT_HTML_REPORT_DIR = "--html_report_dir";
+
+ public static final String OPT_PROPERTY = "--property";
+
+ public static final String OPT_PROPERTIES = "--properties";
+
+ public static final String OPT_PARAMETER = "--parameter";
+
+ public static final String OPT_PARAMETERS = "--parameters";
+
+
+}
Modified: modules/test/trunk/tooling/maven2/pom.xml
===================================================================
--- modules/test/trunk/tooling/maven2/pom.xml 2008-01-02 15:56:01 UTC (rev 9409)
+++ modules/test/trunk/tooling/maven2/pom.xml 2008-01-02 18:25:20 UTC (rev 9410)
@@ -4,7 +4,7 @@
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
- <relativePath>../../build/pom.xml</relativePath>
+ <relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jboss-unit-tooling-maven2</artifactId>
@@ -40,21 +40,10 @@
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-core</artifactId>
+ </dependency>
</dependencies>
-
- <build>
- <sourceDirectory>../src/main/java</sourceDirectory>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>org/jboss/unit/tooling/ant/**</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
Copied: modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/maven2
(from rev 9349, modules/test/trunk/tooling/src/main/java/org/jboss/unit/tooling/maven2)
Deleted:
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/maven2/TestSuiteExecutor.java
===================================================================
---
modules/test/trunk/tooling/src/main/java/org/jboss/unit/tooling/maven2/TestSuiteExecutor.java 2007-12-14
15:52:59 UTC (rev 9349)
+++
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/maven2/TestSuiteExecutor.java 2008-01-02
18:25:20 UTC (rev 9410)
@@ -1,311 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.unit.tooling.maven2;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.DependencyResolutionRequiredException;
-import org.apache.maven.model.Resource;
-import org.apache.maven.project.MavenProject;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Java;
-import org.apache.tools.ant.types.Path;
-import org.jboss.unit.tooling.JavaBuilder;
-import org.jboss.unit.tooling.TaskExecutingThread;
-import org.jboss.unit.tooling.maven2.configuration.CasesDescription;
-import org.jboss.unit.tooling.maven2.configuration.Parameter;
-import org.jboss.unit.tooling.maven2.configuration.Reports;
-import org.jboss.unit.tooling.maven2.configuration.Testsuite;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class TestSuiteExecutor
-{
- private final MavenProject project;
-
- private final Reports reports;
-
- private final Testsuite testsuite;
-
- private TestSuiteExecutor()
- {
- project = null;
- reports = null;
- testsuite = null;
- }
-
- public TestSuiteExecutor(MavenProject project, Reports reports, Testsuite testsuite)
- {
- this.project = project;
- this.reports = reports;
- this.testsuite = testsuite;
- }
-
- public void execute()
- {
- Java javaTask = createJavaTask();
-
- System.out.println("Executing very first....");
-
- try
- {
- System.out.println("Invoking java: " +
javaTask.getCommandLine().toString());
-
-
- // This is really stupid workaround to the fact that maven eats whole output of
invoked java task.
- // Should be investigated and fixed in more proper way ...
-
- javaTask.setFork(true);
-
- File log = File.createTempFile("jboss-unit-" +
System.currentTimeMillis(), "log");
-
- javaTask.setOutput(log);
- javaTask.setError(log);
-
- javaTask.setAppend(true);
- javaTask.setLogError(true);
-
-
- // Execution of jboss-unit
-
- TaskExecutingThread executor = new TaskExecutingThread(javaTask);
- executor.run();
-
- // Print the collected output
- BufferedReader br = new BufferedReader(new FileReader(log));
- String line = null;
- while (( line = br.readLine()) != null){
- System.out.println(line);
- }
-
- // Cleanup
- log.delete();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- private Java createJavaTask()
- {
- Java javaTask = null;
- try
- {
-
- JavaBuilder javaBuilder = new JavaBuilder();
-
- addArguments(javaBuilder);
-
- javaTask = javaBuilder.buildJava();
-
-
- Path path = javaTask.createClasspath();
-
- // Apply task classpath
-
-// System.out.println("Creating classpath: ");
-
- for (Artifact artifact :
(Collection<Artifact>)project.getCompileArtifacts())
- {
- System.out.println("Compile Artifact: " + artifact.getGroupId() +
":" + artifact.getArtifactId());
- path.createPathElement().setLocation(artifact.getFile());
- }
-
- for (Artifact artifact :
(Collection<Artifact>)project.getTestArtifacts())
- {
-// System.out.println("Test Artifact: " + artifact.getGroupId() +
":" + artifact.getArtifactId());
- path.createPathElement().setLocation(artifact.getFile());
- }
-
- for (Artifact artifact :
(Collection<Artifact>)project.getRuntimeArtifacts())
- {
-// System.out.println("Runtime Artifact: " + artifact.getGroupId() +
":" + artifact.getArtifactId());
- path.createPathElement().setLocation(artifact.getFile());
- }
-
- for (Artifact artifact :
(Collection<Artifact>)project.getSystemArtifacts())
- {
-// System.out.println("System Artifact: " + artifact.getGroupId() +
":" + artifact.getArtifactId());
- path.createPathElement().setLocation(artifact.getFile());
- }
-
- for (Artifact artifact :
(Collection<Artifact>)project.getDependencyArtifacts())
- {
-// System.out.println("Dependency Artifact: " +
artifact.getGroupId() + ":" + artifact.getArtifactId());
- path.createPathElement().setLocation(artifact.getFile());
- }
-
- // getSystemPath returns null...
-// for (Dependency dependency :
(List<Dependency>)project.getTestDependencies())
-// {
-// path.createPathElement().setLocation(new
File(dependency.getSystemPath()));
-// }
-
-
-
- for (Resource resource :
(Collection<Resource>)project.getTestResources())
- {
-// System.out.println("Test Resource: " + resource.getDirectory());
- path.createPathElement().setLocation(new File(resource.getDirectory()));
- }
-
- try
- {
- for (String element :
(Collection<String>)project.getTestClasspathElements())
- {
-// System.out.println("TestClasspathElement: " + element);
- path.createPathElement().setLocation(new File(element));
- }
- }
- catch (DependencyResolutionRequiredException e)
- {
- e.printStackTrace();
- }
-
- }
- catch (BuildException e)
- {
- throw new IllegalStateException("Failed to create <java> ant task:
", e);
- }
-
- return javaTask;
- }
-
- private void addArguments(JavaBuilder javaBuilder)
- {
- javaBuilder.setConfig(testsuite.getConfig());
-
-// if (getSuiteName() != null)
-// {
-// javaBuilder.setSuiteName(getSuiteName());
-// }
-
- if (reports != null && reports.getXml() != null)
- {
- javaBuilder.setXmlReportDir(reports.getXml());
- }
-
- if (reports != null && reports.getHtml() != null)
- {
- javaBuilder.setHtmlReportDir(reports.getHtml());
- }
-
- javaBuilder.setJPDA(testsuite.isJPDA());
-
- for (CasesDescription include : testsuite.getIncludes())
- {
- //Check attributes consistency
-
-// if (include.getId() != null && (include.getIds() != null ||
include.getKeywords() != null))
-// {
-// throw new IllegalStateException("The use of <id> in
<include> tag should be exclusive");
-// }
-
-
- if (include.getIds() != null)
- {
- for (String id : include.getIds())
- {
- javaBuilder.addIncludeID(id);
- }
-
- }
- if (include.getKeywords() != null)
- {
- for (String keyword : include.getKeywords())
- {
- javaBuilder.addIncludeKeyword(keyword);
- }
- }
-// if (include.getId() != null)
-// {
-// javaBuilder.addIncludeID(include.getId());
-// }
- }
-
- for (CasesDescription exclude : testsuite.getExcludes())
- {
-
-// if (exclude.getId() != null && (exclude.getIds() != null ||
exclude.getKeywords() != null))
-// {
-// throw new IllegalStateException("The use of <id> in
<exclude> tag should be exclusive");
-// }
-
- if (exclude.getIds() != null)
- {
- for (String id : exclude.getIds())
- {
- javaBuilder.addExcludeID(id);
- }
-
- }
- if (exclude.getKeywords() != null)
- {
- for (String keyword : exclude.getKeywords())
- {
- javaBuilder.addExcludeKeyword(keyword);
- }
- }
-// if (exclude.getId() != null)
-// {
-// javaBuilder.addIncludeID(exclude.getId());
-// }
- }
-
- // Properties
-
- if (testsuite.getProperties().size() > 0)
- {
-
- for (Object propertyName : testsuite.getProperties().keySet())
- {
-
javaBuilder.addProperty(propertyName.toString(),testsuite.getProperties().get(propertyName).toString());
- }
-
- javaBuilder.updateFQNProperties(project.getProperties());
- }
-
-
-
- //Parameters
-
- for (Parameter parameter : testsuite.getParameters())
- {
- javaBuilder.addParameter(parameter.getName(),
Arrays.asList(parameter.getValues()));
- }
-
- javaBuilder.updateFQNParameters(project.getProperties());
-
-
- }
-}
Copied:
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/maven2/TestSuiteExecutor.java
(from rev 9409,
modules/test/trunk/tooling/src/main/java/org/jboss/unit/tooling/maven2/TestSuiteExecutor.java)
===================================================================
---
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/maven2/TestSuiteExecutor.java
(rev 0)
+++
modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/maven2/TestSuiteExecutor.java 2008-01-02
18:25:20 UTC (rev 9410)
@@ -0,0 +1,303 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.unit.tooling.maven2;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DependencyResolutionRequiredException;
+import org.apache.maven.model.Resource;
+import org.apache.maven.project.MavenProject;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.taskdefs.Java;
+import org.apache.tools.ant.types.Path;
+import org.jboss.unit.tooling.JavaBuilder;
+import org.jboss.unit.tooling.TaskExecutingThread;
+import org.jboss.unit.tooling.maven2.configuration.CasesDescription;
+import org.jboss.unit.tooling.maven2.configuration.Parameter;
+import org.jboss.unit.tooling.maven2.configuration.Reports;
+import org.jboss.unit.tooling.maven2.configuration.Testsuite;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class TestSuiteExecutor
+{
+ private final MavenProject project;
+
+ private final Reports reports;
+
+ private final Testsuite testsuite;
+
+ private TestSuiteExecutor()
+ {
+ project = null;
+ reports = null;
+ testsuite = null;
+ }
+
+ public TestSuiteExecutor(MavenProject project, Reports reports, Testsuite testsuite)
+ {
+ this.project = project;
+ this.reports = reports;
+ this.testsuite = testsuite;
+ }
+
+ public void execute()
+ {
+ Java javaTask = createJavaTask();
+
+ System.out.println("Executing very first....");
+
+ try
+ {
+ System.out.println("Invoking java: " +
javaTask.getCommandLine().toString());
+
+
+ // This is really stupid workaround to the fact that maven eats whole output of
invoked java task.
+ // Should be investigated and fixed in more proper way ...
+
+ javaTask.setFork(true);
+
+ File log = File.createTempFile("jboss-unit-" +
System.currentTimeMillis(), "log");
+
+ javaTask.setOutput(log);
+ javaTask.setError(log);
+
+ javaTask.setAppend(true);
+ javaTask.setLogError(true);
+
+
+ // Execution of jboss-unit
+
+ TaskExecutingThread executor = new TaskExecutingThread(javaTask);
+ executor.run();
+
+ // Print the collected output
+ BufferedReader br = new BufferedReader(new FileReader(log));
+ String line = null;
+ while (( line = br.readLine()) != null){
+ System.out.println(line);
+ }
+
+ // Cleanup
+ log.delete();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private Java createJavaTask()
+ {
+ Java javaTask = null;
+ try
+ {
+
+ JavaBuilder javaBuilder = new JavaBuilder();
+
+ addArguments(javaBuilder);
+
+ javaTask = javaBuilder.buildJava();
+
+
+ Path path = javaTask.createClasspath();
+
+ // Apply task classpath
+
+// System.out.println("Creating classpath: ");
+
+// for (Artifact artifact :
(Collection<Artifact>)project.getCompileArtifacts())
+// {
+// System.out.println("Compile Artifact: " + artifact.getGroupId() +
":" + artifact.getArtifactId());
+// path.createPathElement().setLocation(artifact.getFile());
+// }
+//
+// for (Artifact artifact :
(Collection<Artifact>)project.getTestArtifacts())
+// {
+//// System.out.println("Test Artifact: " + artifact.getGroupId() +
":" + artifact.getArtifactId());
+// path.createPathElement().setLocation(artifact.getFile());
+// }
+//
+// for (Artifact artifact :
(Collection<Artifact>)project.getRuntimeArtifacts())
+// {
+//// System.out.println("Runtime Artifact: " + artifact.getGroupId()
+ ":" + artifact.getArtifactId());
+// path.createPathElement().setLocation(artifact.getFile());
+// }
+//
+// for (Artifact artifact :
(Collection<Artifact>)project.getSystemArtifacts())
+// {
+//// System.out.println("System Artifact: " + artifact.getGroupId()
+ ":" + artifact.getArtifactId());
+// path.createPathElement().setLocation(artifact.getFile());
+// }
+//
+// for (Artifact artifact :
(Collection<Artifact>)project.getDependencyArtifacts())
+// {
+//// System.out.println("Dependency Artifact: " +
artifact.getGroupId() + ":" + artifact.getArtifactId());
+// path.createPathElement().setLocation(artifact.getFile());
+// }
+//
+// for (Resource resource :
(Collection<Resource>)project.getTestResources())
+// {
+//// System.out.println("Test Resource: " +
resource.getDirectory());
+// path.createPathElement().setLocation(new File(resource.getDirectory()));
+// }
+
+ try
+ {
+ for (String element :
(Collection<String>)project.getTestClasspathElements())
+ {
+// System.out.println("TestClasspathElement: " + element);
+ path.createPathElement().setLocation(new File(element));
+ }
+ }
+ catch (DependencyResolutionRequiredException e)
+ {
+ e.printStackTrace();
+ }
+
+ }
+ catch (BuildException e)
+ {
+ throw new IllegalStateException("Failed to create <java> ant task:
", e);
+ }
+
+ return javaTask;
+ }
+
+ private void addArguments(JavaBuilder javaBuilder)
+ {
+ javaBuilder.setConfig(testsuite.getConfig());
+
+// if (getSuiteName() != null)
+// {
+// javaBuilder.setSuiteName(getSuiteName());
+// }
+
+ if (reports != null && reports.getXml() != null)
+ {
+ javaBuilder.setXmlReportDir(reports.getXml());
+ }
+
+ if (reports != null && reports.getHtml() != null)
+ {
+ javaBuilder.setHtmlReportDir(reports.getHtml());
+ }
+
+ javaBuilder.setJPDA(testsuite.isJPDA());
+
+ for (CasesDescription include : testsuite.getIncludes())
+ {
+ //Check attributes consistency
+
+// if (include.getId() != null && (include.getIds() != null ||
include.getKeywords() != null))
+// {
+// throw new IllegalStateException("The use of <id> in
<include> tag should be exclusive");
+// }
+
+
+ if (include.getIds() != null)
+ {
+ for (String id : include.getIds())
+ {
+ javaBuilder.addIncludeID(id);
+ }
+
+ }
+ if (include.getKeywords() != null)
+ {
+ for (String keyword : include.getKeywords())
+ {
+ javaBuilder.addIncludeKeyword(keyword);
+ }
+ }
+// if (include.getId() != null)
+// {
+// javaBuilder.addIncludeID(include.getId());
+// }
+ }
+
+ for (CasesDescription exclude : testsuite.getExcludes())
+ {
+
+// if (exclude.getId() != null && (exclude.getIds() != null ||
exclude.getKeywords() != null))
+// {
+// throw new IllegalStateException("The use of <id> in
<exclude> tag should be exclusive");
+// }
+
+ if (exclude.getIds() != null)
+ {
+ for (String id : exclude.getIds())
+ {
+ javaBuilder.addExcludeID(id);
+ }
+
+ }
+ if (exclude.getKeywords() != null)
+ {
+ for (String keyword : exclude.getKeywords())
+ {
+ javaBuilder.addExcludeKeyword(keyword);
+ }
+ }
+// if (exclude.getId() != null)
+// {
+// javaBuilder.addIncludeID(exclude.getId());
+// }
+ }
+
+ // Properties
+
+ if (testsuite.getProperties().size() > 0)
+ {
+
+ for (Object propertyName : testsuite.getProperties().keySet())
+ {
+
javaBuilder.addProperty(propertyName.toString(),testsuite.getProperties().get(propertyName).toString());
+ }
+
+ javaBuilder.updateFQNProperties(project.getProperties());
+ }
+
+
+
+ //Parameters
+
+ for (Parameter parameter : testsuite.getParameters())
+ {
+ javaBuilder.addParameter(parameter.getName(),
Arrays.asList(parameter.getValues()));
+ }
+
+ javaBuilder.updateFQNParameters(project.getProperties());
+
+
+ }
+}
Modified: modules/test/trunk/tooling/pom.xml
===================================================================
--- modules/test/trunk/tooling/pom.xml 2008-01-02 15:56:01 UTC (rev 9409)
+++ modules/test/trunk/tooling/pom.xml 2008-01-02 18:25:20 UTC (rev 9410)
@@ -13,6 +13,7 @@
<name>JBoss Unit Tooling (aggregator)</name>
<version>1.1.0-SNAPSHOT</version>
<modules>
+ <module>core</module>
<module>ant</module>
<module>maven2</module>
</modules>