diff --git a/archive/org.eclipse.wtp.releng/buildAll.xml b/archive/org.eclipse.wtp.releng/buildAll.xml
index c7cfab8ea21405dd522e9803c1b168386b9ab771..85cb220e4ec2b0b4d2eca1cfc3b0a4bf6192e572 100644
--- a/archive/org.eclipse.wtp.releng/buildAll.xml
+++ b/archive/org.eclipse.wtp.releng/buildAll.xml
@@ -121,7 +121,7 @@
         <target name="runAll" depends="init">
                 <antcall target="buildAll"/>
                 <antcall target="checkpii"/>
-                <antcall target="checkInternalReference"/>
+
         		<!-- first push -->
 	            <antcall target="publish"/>
     		    <antcall target="notify">
@@ -130,7 +130,8 @@
 	            <antcall target="push"/>
         	
         	
-                <antcall target="test"/>    
+                <antcall target="test"/>  
+                <antcall target="checkInternalReference"/>  
 
         		<!--
                 <antcall target="eclipsePerf"/>
@@ -156,8 +157,9 @@
         <target name="build" depends="init">
                 <antcall target="buildAll"/>
                 <antcall target="checkpii"/>
-                <antcall target="checkInternalReference"/>
+
                 <antcall target="test"/>
+                <antcall target="checkInternalReference"/>
         
                 <!--
                 <antcall target="eclipsePerf"/>
@@ -310,6 +312,8 @@
                         <fileset dir="${basedir}/testScripts">
                         </fileset>
                 </copy>
+                <copy file="buildAll.properties" tofile="${testDir}/buildAll.properties" overwrite="true"/>
+                <copy file="maps/build.cfg" tofile="${testDir}/build.cfg" overwrite="true"/>
 
                 <available file="${testDir}/eclipse/startup.jar" property="test.eclipse.exists"/>
 
@@ -359,6 +363,8 @@
                                         <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="${testDir}"/>
                                         <sysproperty key="buildId" value="${buildType}${date}-${time}"/>
                                         <sysproperty key="eclipseBuilderDirectory" value="${build.home}/${eclipse.builder}"/>
diff --git a/archive/org.eclipse.wtp.releng/maps/build.cfg b/archive/org.eclipse.wtp.releng/maps/build.cfg
index 152bf2c77bc63ae14e8524362b601f93f459a6c2..b2e3ced3d1c13469e254599f71ddf3417b6e15fc 100644
--- a/archive/org.eclipse.wtp.releng/maps/build.cfg
+++ b/archive/org.eclipse.wtp.releng/maps/build.cfg
@@ -98,8 +98,8 @@ internalRefToolURL=http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/jdt-core-
 internalRefToolFile=internal-200302241157.zip
 
 #URL to TPTP
-piAgentURL.linux=http://download.eclipse.org/tools/downloads/hyades/3.0.2/3.0.2_20050225_1641/hyades.rac.linux_3.0.2_20050225_1641.zip
-piAgentURL.win32=http://download.eclipse.org/tools/downloads/hyades/3.0.2/3.0.2_20050225_1641/hyades.rac.nt_3.0.2_20050225_1641.zip
+piAgentURL.linux=http://download.eclipse.org/tptp/4.0/TPTP-4.0-200504151511/tptpdc.linux_ia32-TPTP-4.0-200504151511.zip
+piAgentURL.win32=http://download.eclipse.org/tptp/4.0/TPTP-4.0-200504151511/tptpdc.win_ia32-TPTP-4.0-200504151511.zip
 
-piAgentFile.linux=hyades.rac.linux_3.0.2_20050225_1641.zip
-piAgentFile.win32=hyades.rac.nt_3.0.2_20050225_1641.zip
\ No newline at end of file
+piAgentFile.linux=tptpdc.linux_ia32-TPTP-4.0-200504151511.zip
+piAgentFile.win32=tptpdc.win_ia32-TPTP-4.0-200504151511.zip
\ No newline at end of file
diff --git a/archive/org.eclipse.wtp.releng/testScripts/api-tests.xml b/archive/org.eclipse.wtp.releng/testScripts/api-tests.xml
new file mode 100644
index 0000000000000000000000000000000000000000..106f1abf3eff939c84bb19d9016e0e0af1343265
--- /dev/null
+++ b/archive/org.eclipse.wtp.releng/testScripts/api-tests.xml
@@ -0,0 +1,152 @@
+<?xml version="1.0"?>
+<project name="API tests" default="default" basedir="." >
+
+  <property file="${testDir}/buildAll.properties"/>
+  <property file="${testDir}/build.cfg"/>
+
+  <property name="library-xml-file" value="${basedir}/plugins/org.eclipse.test_3.1.0/library.xml"/>
+  <import file="${library-xml-file}"/>
+
+  <target name="ui-test">
+    <antcall target="runPIAgent">
+      <param name="application" value="org.eclipse.test.uitestapplication"/>
+    </antcall>
+  </target>
+
+  <target name="core-test">
+    <antcall target="runPIAgent">
+      <param name="application" value="org.eclipse.test.coretestapplication"/>
+    </antcall>
+  </target>
+
+  <target name="init">
+    <property name="piagentDir" value="${testDir}/piagent"/>
+    <property name="component.core" value="org.eclipse.wtp.releng/apitools/org.eclipse.wtp.releng.tools.component.core"/>
+    <condition property="piAgent.exists">
+      <or>
+        <available property="piAgent.dll.exists" file="${piagentDir}/piAgent.dll"/>
+        <available property="libpiAgent.so.exists" file="${piagentDir}/libpiAgent.so"/>
+      </or>
+    </condition>
+    <antcall target="init2"/>
+  </target>
+
+  <target name="init2" unless="piAgent.exists">
+    <mkdir dir="${piagentDir}"/>
+    <cvs
+      cvsRoot=":pserver:anonymous@dev.eclipse.org:/home/webtools"
+      package="${component.core}"
+      dest="${piagentDir}"
+      command="export"
+      tag="HEAD"
+    />
+    <mkdir dir="${piagentDir}/${component.core}/bin"/>
+    <javac
+      srcdir="${piagentDir}/${component.core}/src"
+      destdir="${piagentDir}/${component.core}/bin"
+      fork="true">
+      <classpath>
+        <fileset dir="${baseLocation}/plugins">
+          <include name="**/*.jar" />
+        </fileset>
+      </classpath>
+    </javac>
+    <condition property="piAgentURL" value="${piAgentURL.linux}">
+      <equals arg1="${os}" arg2="linux" />
+    </condition>
+    <condition property="piAgentURL" value="${piAgentURL.win32}">
+      <equals arg1="${os}" arg2="win32" />
+    </condition>
+    <condition property="piAgentFile" value="${piAgentFile.linux}">
+      <equals arg1="${os}" arg2="linux" />
+    </condition>
+    <condition property="piAgentFile" value="${piAgentFile.win32}">
+      <equals arg1="${os}" arg2="win32" />
+    </condition>
+    <condition property="os.linux">
+      <equals arg1="${os}" arg2="linux" />
+    </condition>
+    <condition property="os.win32">
+      <equals arg1="${os}" arg2="win32" />
+    </condition>
+    <available file="${build.home}/${build.drivers}/${piAgentFile}" property="piAgent.exists"/>
+    <antcall target="getPIAgent"/>
+    <antcall target="setupPIAgentLinux"/>
+    <antcall target="setupPIAgentWin32"/>
+  </target>
+
+  <target name="getPIAgent" unless="piAgent.exists">
+    <get src="${piAgentURL}" dest="${build.home}/${build.drivers}/${piAgentFile}"/>
+  </target>
+
+  <target name="setupPIAgentLinux" if="os.linux">
+    <unzip dest="${piagentDir}" src="${build.home}/${build.drivers}/${piAgentFile}">
+      <patternset>
+        <include name="**/*.so"/>
+      </patternset>
+    </unzip>
+    <move todir="${piagentDir}" flatten="true">
+      <fileset dir="${piagentDir}/lib"/>
+    </move>
+    <copy file="${piagentDir}/${component.core}/apiagent/libpiAgent.so" tofile="${piagentDir}/libpiAgent.so" overwrite="true"/>
+  </target>
+
+  <target name="setupPIAgentWin32" if="os.win32">
+    <unzip dest="${piagentDir}" src="${build.home}/${build.drivers}/${piAgentFile}">
+      <patternset>
+        <include name="**/*.dll"/>
+      </patternset>
+    </unzip>
+    <move todir="${piagentDir}" flatten="true">
+      <fileset dir="${piagentDir}/bin"/>
+    </move>
+    <copy file="${piagentDir}/${component.core}/apiagent/piAgent.dll" tofile="${piagentDir}/piAgent.dll" overwrite="true"/>
+  </target>
+
+  <target name="runPIAgent" depends="init">
+    <property name="piagentDir" value="${testDir}/piagent"/>
+    <property name="component.core" value="org.eclipse.wtp.releng/apitools/org.eclipse.wtp.releng.tools.component.core"/>
+    <condition property="piAgent.exists">
+      <and>
+        <or>
+          <available property="piAgent.dll.exists" file="${piagentDir}/piAgent.dll"/>
+          <available property="libpiAgent.so.exists" file="${piagentDir}/libpiAgent.so"/>
+        </or>
+        <available property="buildDirectory.exists" file="${buildDirectory}"/>
+        <isset property="package.includes"/>
+      </and>
+    </condition>
+    <antcall target="runPIAgent2"/>
+  </target>
+
+  <target name="runPIAgent2" if="piAgent.exists">
+    <java classname="org.eclipse.wtp.releng.tools.component.piagent.PIAgentFiltersEmitter" fork="true" maxmemory="256m">
+      <arg line="-eclipseDirs ${buildDirectory}/plugins -compXMLDirs ${buildDirectory}/plugins -outputFile ${piagentDir}/piagent_filters.txt -includes ${package.includes}" />
+      <classpath>
+        <pathelement path="${piagentDir}/${component.core}/bin"/>
+        <fileset dir="${baseLocation}/plugins">
+          <include name="**/*.jar" />
+        </fileset>
+      </classpath>
+    </java>
+  	<tstamp>
+      <format property="TIMENOW" pattern="HHmmssSSSS"/>
+    </tstamp>
+    <property name="vmargs" value=""/>
+    <property name="launcher" value="org.eclipse.core.launcher.Main"/>
+    <property name="formatter" value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter"/>
+    <property name="extraVMargs" value=""/>
+    <property name="plugin-path" value=""/>
+    <property name="timeout" value="7200000"/>
+    <property file="${testDir}/eclipse/configuration/config.ini"/>
+	<echo message="Running ${classname}"/>
+	<mkdir dir="${buildDirectory}/apitools/piagentoutput"/>
+    <exec dir="${piagentDir}" executable="java" timeout="${timeout}">
+      <env key="LD_LIBRARY_PATH" value="${piagentDir}"/>
+      <env key="java.library.path" value="${piagentDir}"/>
+      <env key="PLUGIN_PATH" value="${plugin-path}"/>
+      <arg line="-cp ${testDir}/eclipse/startup.jar -XrunpiAgent:server=standalone,profile=${piagentDir}/${component.core}/apiagent/piagent_options.txt,filters=${piagentDir}/piagent_filters.txt,file=${buildDirectory}/apitools/piagentoutput/${classname}.trcxml -Xmx512M ${vmargs} ${extraVMargs} ${launcher} -application ${application} -dev bin -data ${data-dir} formatter=${formatter},${testDir}/eclipse/${classname}.xml -testPluginName ${plugin-name} -className ${classname} -os ${os} -ws ${ws} -arch ${arch} -consolelog"/>
+    </exec>
+  </target>
+
+</project>
\ No newline at end of file
diff --git a/archive/org.eclipse.wtp.releng/testScripts/test.xml b/archive/org.eclipse.wtp.releng/testScripts/test.xml
index daa9d62dad02ced780177bfebb51f9cb278eea6e..bae03a444397cea172d907b0abe59b663620f5ce 100644
--- a/archive/org.eclipse.wtp.releng/testScripts/test.xml
+++ b/archive/org.eclipse.wtp.releng/testScripts/test.xml
@@ -45,6 +45,29 @@
 
   	</target>
 
+	<target name="runapitests" depends="setup">
+		<condition property="usepiagent">
+			<and>
+				<available file="${eclipse-home}/plugins/${testPlugin}/test.xml" property="test.xml.exists"/>
+				<isset property="package.includes"/>
+			</and>
+		</condition>
+		<antcall target="runapitests2"/>
+		<antcall target="runapitests3"/>
+	</target>
+
+	<target name="runapitests2" if="usepiagent">
+		<ant antfile="${eclipse-home}/plugins/${testPlugin}/test.xml" dir="${eclipse-home}">
+			<property name="library-file" value="${testDir}/api-tests.xml"/>
+		</ant>
+		<copy file="${eclipse-home}/${report}.xml" tofile="${results}/xml/${report}_${platform}.xml" failonerror="false"/>
+		<antcall target="genHtml" />
+	</target>
+
+	<target name="runapitests3" unless="usepiagent">
+		<antcall target="runtests"/>
+	</target>
+
 	<target name="runtests" depends="setup" description="Runs ant on the test.xml for a specified plugin.  Requires a property value setting for testPlugin only if test.properties is not available.  The property testPlugin represents a directory name made up of the plugin id and plugin version.  This directory must contain a valid test.xml.">
 		<available file="${eclipse-home}/plugins/${testPlugin}/test.xml" property="test.xml.exists"/>
 		<antcall target="runtests2"/>