[108259] Refactoring builds
diff --git a/releng.wtpbuilder/distribution/wtp.tests/build.xml b/releng.wtpbuilder/distribution/wtp.tests/build.xml
new file mode 100644
index 0000000..93cc3d5
--- /dev/null
+++ b/releng.wtpbuilder/distribution/wtp.tests/build.xml
@@ -0,0 +1,97 @@
+<project name="Build specific targets and properties" default="test">
+	<property name="postingDirectory" value="${buildDirectory}" />
+
+
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do after the build is done. -->
+	<!-- ===================================================================== -->
+	<target name="test">
+		<antcall target="runTest" />
+		<antcall target="gatherLogs" />
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do to test the build results -->
+	<!-- ===================================================================== -->
+	<target name="runTest">
+
+		<dirname file="${ant.file}" property="test.component.dir" />
+		<ant antfile="${test.component.dir}/../../scripts/build/label.xml" />
+		<property file="${buildDirectory}/label.properties" />
+
+		<mkdir dir="${testRoot}" />
+		<mkdir dir="${testRoot}/results" />
+		<mkdir dir="${testRoot}/results/consolelogs" />
+
+		<copy todir="${testRoot}" overwrite="true">
+			<fileset dir="${test.component.dir}/testScripts">
+			</fileset>
+		</copy>
+
+		<echo message="${baseos} ${basews} ${basearch} " />
+		<ant antfile="${test.component.dir}/testdependency.xml" target="get">
+			<property name="dependency.properties" value="${buildDirectory}/maps/releng.wtp/maps/dependencies.properties" />
+			<property name="base.install.dir" value="${testRoot}" />
+		</ant>
+		<unzip dest="${testRoot}" src="${postingDirectory}/${buildLabel}/wtp-${buildId}.zip" overwrite="true" />
+		<unzip dest="${testRoot}" src="${postingDirectory}/${buildLabel}/wtp-wst-Automated-Tests-${buildId}.zip" overwrite="true" />
+		<unzip dest="${testRoot}" src="${postingDirectory}/${buildLabel}/wtp-jst-Automated-Tests-${buildId}.zip" overwrite="true" />
+
+		<antcall target="runTestEclipse">
+			<param name="testTarget" value="all" />
+		</antcall>
+		<antcall target="postRunTestEclipse">
+			<param name="testTarget" value="all" />
+		</antcall>
+	</target>
+
+	<target name="runTestEclipse">
+		<java classpath="${testRoot}/eclipse/startup.jar" fork="true" classname="org.eclipse.core.launcher.Main" failonerror="true" timeout="3600000" output="${testRoot}/results/consolelogs/wtptestlog.txt" dir="${testRoot}">
+			<jvmarg value="-Dosgi.ws=${basews}" />
+			<jvmarg value="-Dosgi.os=${baseos}" />
+			<jvmarg value="-Dosgi.arch=${basearch}" />
+			<jvmarg value="-Dws=${basews}" />
+			<jvmarg value="-Dos=${baseos}" />
+			<jvmarg value="-Darch=${basearch}" />
+			<jvmarg value="-Dnoclean=true" />
+			<arg value="-propertyfile" />
+			<arg value="test.properties" />
+			<arg value="-application" />
+			<arg value="org.eclipse.ant.core.antRunner" />
+			<arg value="-file" />
+			<arg value="test.xml" />
+			<arg value="-logger" />
+			<arg value="org.apache.tools.ant.DefaultLogger" />
+			<arg value="${testTarget}" />
+			<sysproperty key="build.home" value="${build.home}" />
+			<sysproperty key="buildDirectory" value="${buildDirectory}" />
+			<sysproperty key="baseLocation" value="${baseLocation}" />
+			<sysproperty key="testDir" value="${testRoot}" />
+			<sysproperty key="perf.buildId" value="${buildType}${date}-${time}" />
+			<sysproperty key="eclipseBuilderDirectory" value="${build.home}/${eclipse.builder}" />
+		</java>
+	</target>
+
+	<target name="postRunTestEclipse">
+		<copy todir="${buildDirectory}/${buildLabel}/testResults" overwrite="true">
+			<fileset dir="${testRoot}/results">
+				<include name="**/*.*" />
+			</fileset>
+		</copy>
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do to publish the build results -->
+	<!-- ===================================================================== -->
+	<target name="publish">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Default target                                                        -->
+	<!-- ===================================================================== -->
+	<target name="noDefault">
+		<echo message="You must specify a target when invoking this file" />
+	</target>
+
+</project>