Author: mgencur(a)redhat.com
Date: 2009-09-29 11:03:56 -0400 (Tue, 29 Sep 2009)
New Revision: 11522
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeamGenTest.java
Log:
JBPAPP-2864 Replace ftest libraries with maven dependencies
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml 2009-09-29 14:14:01 UTC (rev
11521)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml 2009-09-29 15:03:56 UTC (rev
11522)
@@ -182,10 +182,24 @@
<undeployexample name="spring" />
<undeployexample name="todo" />
<undeployexample name="ui" />
+ </target>
+
+ <!-- Target for declaring needed libraries for tests to run -->
+ <target name="import.libraries">
+ <copyInlineDependencies id="selenium.server" scope="compile"
todir="${lib.dir}">
+ <dependency groupId="org.seleniumhq.selenium.server"
artifactId="selenium-server" version="1.0-beta-2"
classifier="standalone"/>
+ <dependency groupId="org.seleniumhq.selenium.client-drivers"
artifactId="selenium-java-client-driver" version="1.0-beta-2">
+ <exclusion groupId="org.codehaus.groovy.maven.runtime"
artifactId="gmaven-runtime-default"/>
+ </dependency>
+ <dependency groupId="org.jboss.test" artifactId="jboss-test"
version="1.1.0.GA"/>
+ <dependency groupId="org.testng" artifactId="testng"
version="5.9"/>
+ </copyInlineDependencies>
</target>
+ <target name="start.selenium.server">
+ <!-- Added for downloading libraries -->
+ <antcall target="import.libraries"> </antcall>
- <target name="start.selenium.server">
<java classpathref="selenium.server.classpath"
classname="org.openqa.selenium.server.SeleniumServer" fork="true"
spawn="true">
<arg line="-port ${selenium.server.port}" />
<arg line="${selenium.server.cmd.args}" />
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml 2009-09-29 14:14:01
UTC (rev 11521)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml 2009-09-29 15:03:56
UTC (rev 11522)
@@ -25,6 +25,9 @@
<!-- Location of Seam -->
<dirname property="seam.dir"
file="${ant.file.ftest.seamgen}/../../../../" />
+ <!-- Build resources -->
+ <import file="${seam.dir}/build/common.build.xml" />
+
<!-- default property setup -->
<property name="ftest.dir" value="${seam.dir}/src/test/ftest"
/>
<property name="common.src.dir" value="${ftest.dir}/src/main"
/>
@@ -60,6 +63,19 @@
<delete dir="${log.dir}" />
</target>
+ <!-- Target for declaring needed libraries for tests runs -->
+ <target name="import.libraries">
+ <copyInlineDependencies id="selenium.server" scope="compile"
todir="${ftest.lib.dir}">
+ <dependency groupId="org.seleniumhq.selenium.server"
artifactId="selenium-server" version="1.0-beta-2"
classifier="standalone"/>
+ <dependency groupId="org.seleniumhq.selenium.client-drivers"
artifactId="selenium-java-client-driver" version="1.0-beta-2">
+ <exclusion groupId="org.codehaus.groovy.maven.runtime"
artifactId="gmaven-runtime-default"/>
+ </dependency>
+ <dependency groupId="org.apache.ant" artifactId="ant"
version="1.7.0"/>
+ <dependency groupId="org.apache.ant" artifactId="ant-launcher"
version="1.7.0"/>
+ <dependency groupId="org.testng" artifactId="testng"
version="5.9"/>
+ </copyInlineDependencies>
+ </target>
+
<target name="build" depends="build.common"
description="Compiles the Test">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}"
classpathref="classpath.build" debug="true" />
@@ -71,6 +87,9 @@
</target>
<target name="build.common" description="Compiles the common selenium
test code">
+ <!-- Added for downloading libraries -->
+ <antcall target="import.libraries"> </antcall>
+
<mkdir dir="${classes.dir}" />
<javac srcdir="${common.src.dir}" destdir="${classes.dir}"
classpathref="classpath.build" debug="true" />
<copy todir="${classes.dir}">
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeamGenTest.java
===================================================================
---
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeamGenTest.java 2009-09-29
14:14:01 UTC (rev 11521)
+++
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeamGenTest.java 2009-09-29
15:03:56 UTC (rev 11522)
@@ -27,18 +27,6 @@
import java.io.IOException;
import java.util.Properties;
-import org.codehaus.cargo.container.ContainerType;
-import org.codehaus.cargo.container.InstalledLocalContainer;
-import org.codehaus.cargo.container.LocalContainer;
-import org.codehaus.cargo.container.configuration.ConfigurationType;
-import org.codehaus.cargo.container.configuration.LocalConfiguration;
-import org.codehaus.cargo.container.jboss.JBoss42xInstalledLocalContainer;
-import org.codehaus.cargo.container.jboss.JBoss5xInstalledLocalContainer;
-import org.codehaus.cargo.container.jboss.JBossExistingLocalConfiguration;
-import org.codehaus.cargo.container.jboss.JBossStandaloneLocalConfiguration;
-import org.codehaus.cargo.generic.DefaultContainerFactory;
-import org.codehaus.cargo.generic.configuration.ConfigurationFactory;
-import org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory;
import org.jboss.seam.test.functional.seamgen.utils.SeamGenAdapter;
import org.openqa.selenium.server.RemoteControlConfiguration;
import org.openqa.selenium.server.SeleniumServer;
@@ -76,8 +64,6 @@
protected static boolean WAR;
protected static boolean DELETE_PROJECT;
-
- protected static boolean CONTROL_CONTAINER;
protected static String TEST_SEAMGEN_PROPERTIES_FILE;
@@ -98,8 +84,6 @@
// Selenium server instance
protected static SeleniumServer seleniumServer;
- // Container instance
- protected static LocalContainer container;
@BeforeSuite
@Parameters("seam.dir")
@@ -125,19 +109,12 @@
loadFtestProperties();
createOutputDir();
startSeleniumServer();
- if (CONTROL_CONTAINER) {
- container = startContainer(CONTAINER, CONTAINER_LOCATION);
- }
}
@AfterSuite
public void afterSuite()
{
seleniumServer.stop();
- if (container != null)
- {
- stopContainer(container);
- }
}
@BeforeTest
@@ -181,7 +158,6 @@
CONTAINER_LOCATION = ftestProperties.getProperty(CONTAINER + ".home");
DEPLOY_TIMEOUT = Integer.parseInt(ftestProperties.getProperty(CONTAINER +
".deploy.waittime")) * 1000; // miliseconds
DELETE_PROJECT =
Boolean.valueOf(ftestProperties.getProperty("seamgen.delete.project",
"false"));
- CONTROL_CONTAINER =
Boolean.valueOf(ftestProperties.getProperty("seamgen.control.container",
"false"));
// load selenium constants
SELENIUM_HOST = ftestProperties.getProperty("selenium.host");
@@ -232,35 +208,4 @@
dir.mkdir();
}
}
-
- public LocalContainer startContainer(String containerName, String containerHome)
- {
-
- LocalConfiguration configuration = new
JBossExistingLocalConfiguration(containerHome + "/server/default");
-
- InstalledLocalContainer container;
-
- if (containerName.equals("jboss4"))
- {
- container = new JBoss42xInstalledLocalContainer(configuration);
-
- }
- else if (containerName.equals("jboss5"))
- {
- container = new JBoss5xInstalledLocalContainer(configuration);
- }
- else
- {
- throw new RuntimeException("Unknown container");
- }
- container.setHome(containerHome);
-
- container.start();
- return container;
- }
-
- public void stopContainer(LocalContainer container)
- {
- container.stop();
- }
-}
\ No newline at end of file
+}
Show replies by date