harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r605885 - in /harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching: ./ build.xml patch/ patch/data/ patch/data/org.eclipse.swt.tests.Data.patch patch/tests/ patch/tests/org.eclipse.swt.tests.Tests.patch properties
Date Thu, 20 Dec 2007 11:03:14 GMT
Author: smishura
Date: Thu Dec 20 03:03:11 2007
New Revision: 605885

URL: http://svn.apache.org/viewvc?rev=605885&view=rev
Log:
Apply slightly modified patch from HARMONY-5306:
[buildtest][EUT] swt suite intermittently crashes by timeout

Added:
    harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/
    harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/build.xml
  (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/
    harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/data/
    harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/data/org.eclipse.swt.tests.Data.patch
    harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/tests/
    harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/tests/org.eclipse.swt.tests.Tests.patch
    harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/properties

Added: harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/build.xml?rev=605885&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/build.xml
(added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/build.xml
Thu Dec 20 03:03:11 2007
@@ -0,0 +1,348 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+     
+         http://www.apache.org/licenses/LICENSE-2.0
+     
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<project name="eut.swt.patch" default="default" basedir=".">
+<description>Apply patches to Eclipse Unit Tests swt suite in order to pass with proxy</description>
+
+    <!-- Global settings -->
+    <property file="${basedir}/properties"/>
+
+    <property name="work.dir" location="${basedir}"/>
+    <mkdir dir="${work.dir}"/>
+
+    <!-- Patches specific settings -->
+    <property name="patch.location" location="${basedir}/patch"/>
+    <patternset id="to.patch.patterns">
+       <patternset id="to.patch.pattern.tests">
+           <include name="**/org/eclipse/swt/tests/junit/browser/Browser*"/>
+           <include name="**/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser*"/>
+       </patternset>
+       <patternset id="to.patch.pattern.data">
+           <include name="**/data/browser3.html"/>
+       </patternset>
+   </patternset>
+
+    <property name="plugin.sources.to.patch" value="eclipse/plugins/org.eclipse.sdk.tests.source_3.2.0.v20070607/src/org.eclipse.swt.tests_3.1.0/swttestssrc.zip"/>
+
+    <property name="plugin.to.patch.dir" value="eclipse/plugins/org.eclipse.swt.tests_3.1.0"/>
+    <property name="plugin.to.patch" value="${plugin.to.patch.dir}/swttests.jar"/>
+
+    <!-- Define architecture/platform -->
+    <condition property="arch" value="x86">
+        <and>
+            <contains string="${os.arch}" substring="86" />
+            <not>
+                <contains string="${os.arch}" substring="64" />
+            </not>
+        </and>
+    </condition>
+    <condition property="arch" value="x86_64">
+        <or>
+            <contains string="${os.arch}" substring="86_64" />
+            <contains string="${os.arch}" substring="amd64" />
+        </or>
+    </condition>
+    <condition property="is.windows">
+        <os family="windows" />
+    </condition>
+    <condition property="is.linux">
+        <and>
+            <os family="unix" />
+            <os name="linux" />
+        </and>
+    </condition>
+    <condition property="is.windows.x86">
+        <and>
+            <isset property="is.windows" />
+            <equals arg1="${arch}" arg2="x86" />
+        </and>
+    </condition>
+    <condition property="is.linux.x86">
+        <and>
+            <isset property="is.linux" />
+            <equals arg1="${arch}" arg2="x86" />
+        </and>
+    </condition>
+    <condition property="is.linux.x86_64">
+        <and>
+            <isset property="is.linux" />
+            <equals arg1="${arch}" arg2="x86_64" />
+        </and>
+    </condition>
+
+    <!--  Define arch/os -specific properties -->
+    <condition property="eclipse.filename" value="${eclipse.filename.prefix}-win32.zip">
+        <isset property="is.windows.x86" />
+    </condition>
+    <condition property="eclipse.filename" value="${eclipse.filename.prefix}-linux-gtk.tar.gz">
+        <isset property="is.linux.x86" />
+    </condition>
+    <condition property="eclipse.filename" value="${eclipse.filename.prefix}-linux-gtk-x86_64.tar.gz">
+        <isset property="is.linux.x86_64" />
+    </condition>
+
+    <condition property="eclipse.exists">
+        <available file="${work.dir}/${eclipse.filename}"/>
+    </condition>
+
+    <property
+        name="eut.filename"
+        value="eclipse-Automated-Tests-3.3.zip"/>
+
+    <condition property="eut.exists">
+        <available file="${work.dir}/${eut.filename}"/>
+    </condition>
+
+    <property
+        name="eut.tests.archive.filename"
+        value="eclipse-junit-tests-I20070625-1500.zip"/>
+     <property
+        name="eut.dir"
+        location="${work.dir}/eclipse-testing"/>
+
+    <property
+        name="eclipse.dir"
+        value="${work.dir}/eclipse"/>
+
+<!-- ======== Setup: download and unpack prerequisites (EUT and Eclipse) ======== -->
+
+    <target name="download.eclipse" unless="eclipse.exists">
+        <get src="${eclipse.location}/${eclipse.filename}" dest="${work.dir}/${eclipse.filename}"
usetimestamp="true" verbose="true" />
+    </target>
+
+    <target name="download.eut" unless="eut.exists">
+        <get src="${eut.location}/${eut.filename}" dest="${work.dir}/${eut.filename}"
usetimestamp="true" verbose="true" />
+    </target>
+
+    <target name="unpack.eclipse.windows" if="is.windows">
+         <unzip
+            src="${work.dir}/${eclipse.filename}"
+            dest="${work.dir}"
+            overwrite="true"/>
+    </target>
+
+    <target name="unpack.eclipse.linux" if="is.linux">
+         <untar
+            src="${work.dir}/${eclipse.filename}"
+            dest="${work.dir}"
+            compression="gzip"
+            overwrite="true"/>
+    </target>
+
+    <target name="unpack.eclipse" depends="unpack.eclipse.windows,unpack.eclipse.linux"/>
+
+    <target name="unpack.eut">
+        <unzip
+            src="${work.dir}/${eut.filename}"
+            dest="${work.dir}"
+            overwrite="true"/>
+        <unzip
+            src="${work.dir}/eclipse-testing/${eut.tests.archive.filename}"
+            dest="${work.dir}/eclipse-testing"
+            overwrite="true"/>
+    </target>
+
+    <target name="setup" depends="download.eclipse,unpack.eclipse,download.eut,unpack.eut">
+    </target>
+
+<!-- ======== Extract sources and apply patches ======== -->
+
+    <target name="extract.sources.to.patch">
+        <delete dir="${work.dir}/sources_to_patch"/>
+        <mkdir dir="${work.dir}/sources_to_patch"/>
+        <unzip
+            src="${eut.dir}/${plugin.sources.to.patch}"
+            dest="${work.dir}/sources_to_patch">
+            <patternset refid="to.patch.pattern.tests"/>
+        </unzip>
+    </target>
+
+    <target name="concat.patches">
+        <concat destfile="${work.dir}/all.patches" append="false">
+            <fileset dir="${patch.location}/tests"/>
+        </concat>
+    </target>
+
+    <target name="process.patches">
+        <replace file="${work.dir}/all.patches" token="SWTLOCALURL" value="${swt.local.url}"/>
+    </target>
+
+    <target name="try.patch.sources" depends="concat.patches">
+        <delete failonerror="false">
+            <fileset dir="${work.dir}" includes="patched.tmp,patched.tmp.rej"/>
+        </delete>
+        <patch
+            dir="${work.dir}/sources_to_patch"
+            patchfile="${work.dir}/all.patches"
+            strip="2"
+            destfile="${work.dir}/patched.tmp"
+        />
+        <fail message="Patch wasn't applied successfully (see output for details)! Check
that you use valid original EUT archive and the patches from ${work.dir}/patch don't interfere.">
+            <condition>
+                <available file="${work.dir}/patched.tmp.rej"/>
+            </condition>
+        </fail>
+        <delete file="${work.dir}/patched.tmp"/>
+    </target>
+
+    <target name="patch.sources" depends="concat.patches,process.patches,try.patch.sources">
+        <delete dir="${work.dir}/sources_patched" failonerror="false"/>
+        <copy todir="${work.dir}/sources_patched" overwrite="true">
+            <fileset dir="${work.dir}/sources_to_patch"/>
+        </copy>
+        <patch
+            dir="${work.dir}/sources_patched"
+            patchfile="${work.dir}/all.patches"
+            strip="2"
+        />
+    </target>
+
+    <!-- tests data - specific for swt suite -->
+    <target name="concat.data.patches">
+        <concat destfile="${work.dir}/all.data.patches" append="false">
+            <fileset dir="${patch.location}/data"/>
+        </concat>
+    </target>
+
+    <target name="process.data.patches">
+        <replace file="${work.dir}/all.data.patches" token="SWTLOCALURL" value="${swt.local.url}"/>
+    </target>
+
+    <target name="try.patch.data" depends="concat.data.patches">
+        <delete failonerror="false">
+            <fileset dir="${work.dir}" includes="data.patched.tmp,data.patched.tmp.rej"/>
+        </delete>
+        <patch
+            dir="${eut.dir}/${plugin.to.patch.dir}"
+            patchfile="${work.dir}/all.data.patches"
+            strip="1"
+            destfile="${work.dir}/data.patched.tmp"
+        />
+        <fail message="Patch wasn't applied successfully (see output for details)! Check
that you use valid original EUT archive and the patches from ${work.dir}/patch don't interfere.">
+            <condition>
+                <available file="${work.dir}/data.patched.tmp.rej"/>
+            </condition>
+        </fail>
+        <delete file="${work.dir}/data.patched.tmp"/>
+    </target>
+
+    <target name="patch.data" depends="concat.data.patches,process.data.patches,try.patch.data">
+        <patch
+            dir="${eut.dir}/${plugin.to.patch.dir}"
+            patchfile="${work.dir}/all.data.patches"
+            strip="1"
+        />
+    </target>
+    <!-- end od jdtdebug suite specific stuff -->
+
+<!-- ======== Compile patched sources ======== -->
+
+    <target name="compile.patched.sources">
+         <fail message="The Eclipse compiler class for Ant could not be found. Please
place the ECJ JAR in ANT_HOME/lib">
+            <condition>
+                <not>
+                    <available classname="org.eclipse.jdt.core.JDTCompilerAdapter"/>
+                </not>
+            </condition>
+        </fail>
+        <property name="javac.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"
/>
+        <property name="javac.source" value="1.5" />
+        <property name="javac.target" value="1.5" />
+        <property name="destdir" value="${work.dir}/classes_patched" />
+        <mkdir dir="${destdir}"/>
+        <javac compiler="${javac.compiler}"
+            srcdir="${work.dir}/sources_patched"
+            destdir="${destdir}"
+            includeAntRuntime="no">
+            <compilerarg line="" />
+            <classpath>
+                <fileset dir="${eclipse.dir}/plugins"
+                    includes="**/*.jar" />
+                <fileset dir="${eut.dir}/eclipse/plugins"
+                    includes="**/*.jar" />
+            </classpath>
+        </javac>
+    </target>
+
+<!-- ======== Pack patched files to EUT archive ======== -->
+
+    <target name="pack.patched.sources">
+        <zip
+            update="true"
+            basedir="${work.dir}/sources_patched"
+            keepcompression="true"
+            destfile="${eut.dir}/${plugin.sources.to.patch}">
+            <patternset refid="to.patch.pattern.tests"/>
+        </zip>
+    </target>
+
+    <target name="pack.patched.classes">
+        <zip
+            update="true"
+            basedir="${work.dir}/classes_patched"
+            keepcompression="true"
+            destfile="${eut.dir}/${plugin.to.patch}">
+            <patternset refid="to.patch.pattern.tests"/>
+        </zip>
+    </target>
+
+    <target name="pack.eut">
+        <zip
+            destfile="${eut.dir}/${eut.tests.archive.filename}"
+            update="false"
+            keepcompression="true">
+            <zipfileset dir="${eut.dir}/eclipse" prefix="eclipse"/>
+        </zip>
+        <delete dir="${eut.dir}/eclipse"/>
+        <delete dir="${work.dir}/patched" failonerror="false"/>
+        <mkdir dir="${work.dir}/patched"/>
+        <zip
+            destfile="${work.dir}/patched/${eut.filename}"
+            update="false"
+            duplicate="preserve"
+            keepcompression="true">
+            <zipfileset dir="${eut.dir}" excludes="runtests" prefix="eclipse-testing"/>
+            <zipfileset dir="${eut.dir}" includes="runtests" prefix="eclipse-testing"
filemode="755"/>
+        </zip>
+    </target>
+
+<!-- ======== Clean work files/directories ======== -->
+
+    <target name="-clean">
+        <delete failonerror="false" includeemptydirs="true">
+            <fileset dir="${work.dir}/sources_to_patch"/>
+            <fileset dir="${work.dir}/sources_patched"/>
+            <fileset dir="${work.dir}/classes_patched"/>
+            <fileset dir="${work.dir}" includes="patched.tmp,patched.tmp.rej"/>
+            <fileset dir="${work.dir}" includes="all.patches,all.data.patches"/>
+            <fileset dir="${eut.dir}"/>
+        </delete>
+    </target>
+
+<!-- ======== Clean work and results files/directories ======== -->
+    <target name="clean" depends="-clean">
+        <delete failonerror="false" includeemptydirs="true">
+            <fileset dir="${eclipse.dir}"/>
+            <fileset dir="${work.dir}/patched"/>
+        </delete>
+    </target>
+
+    <target name="default" depends="setup,extract.sources.to.patch,patch.sources,patch.data,compile.patched.sources,pack.patched.sources,pack.patched.classes,pack.eut,-clean">
+    </target>
+
+</project>

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/data/org.eclipse.swt.tests.Data.patch
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/data/org.eclipse.swt.tests.Data.patch?rev=605885&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/data/org.eclipse.swt.tests.Data.patch
(added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/data/org.eclipse.swt.tests.Data.patch
Thu Dec 20 03:03:11 2007
@@ -0,0 +1,10 @@
+diff -r -u org.eclipse.swt.tests/data/browser3.html org.eclipse.swt.tests/data/browser3.html
+--- org.eclipse.swt.tests/data/browser3.html	2007-12-14 20:51:57.000000000 +0300
++++ org.eclipse.swt.tests/data/browser3.html	2007-12-17 03:24:01.944717000 +0300
+@@ -1,5 +1,5 @@
+ <html>
+-<script type="text/javascript">window.open("http://www.google.com", "Dialog")</script>
++<script type="text/javascript">window.open("SWTLOCALURL", "Dialog")</script>
+ <body>
+ This test uses javascript to open a new window.
+ </body>

Added: harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/tests/org.eclipse.swt.tests.Tests.patch
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/tests/org.eclipse.swt.tests.Tests.patch?rev=605885&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/tests/org.eclipse.swt.tests.Tests.patch
(added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/patch/tests/org.eclipse.swt.tests.Tests.patch
Thu Dec 20 03:03:11 2007
@@ -0,0 +1,48 @@
+diff -r -u org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/browser/Browser1.java
org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/browser/Browser1.java
+--- org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/browser/Browser1.java
2007-12-14 20:51:58.000000000 +0300
++++ org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/browser/Browser1.java
2007-12-14 20:03:03.000000000 +0300
+@@ -192,7 +192,8 @@
+ 	
+ 	public static boolean test() {
+ 		int fail = 0;
+-		String[] urls = {"http://www.google.com"};
++//		String[] urls = {"http://www.google.com"};
++		String[] urls = {"SWTLOCALURL"};
+ 		for (int i = 0; i < urls.length; i++) {
+ 			boolean result = test1(urls[i]); 
+ 			if (verbose) System.out.print(result ? "." : "E");
+diff -r -u org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/browser/Browser6.java
org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/browser/Browser6.java
+--- org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/browser/Browser6.java
2007-12-14 20:51:58.000000000 +0300
++++ org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/browser/Browser6.java
2007-12-14 20:02:49.000000000 +0300
+@@ -121,7 +121,8 @@
+ 	public static boolean test() {
+ 		int fail = 0;
+ 		
+-		String[] urls = {"http://www.google.com"};
++//		String[] urls = {"http://www.google.com"};
++		String[] urls = {"SWTLOCALURL"};
+ 		for (int i = 0; i < urls.length; i++) {
+ 			boolean result = test1(urls[i]); 
+ 			if (verbose) System.out.print(result ? "." : "E");
+diff -r -u org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
+--- org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
2007-12-14 20:51:57.000000000 +0300
++++ org.eclipse.swt.tests/src-swttests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
2007-12-17 03:21:19.459393000 +0300
+@@ -361,14 +361,16 @@
+ 	
+ 	
+ 	/* THIS TEST REQUIRES WEB ACCESS! How else can we really test the http:// part of a browser
widget? */
+-	browser.setUrl("http://www.eclipse.org/swt");
++//	browser.setUrl("http://www.eclipse.org/swt");
++	browser.setUrl("SWTLOCALURL");
+ 	runLoopTimer(10);
+ }
+ 
+ public void test_stop() {
+ 	shell.setText("test_stop");
+ 	/* THIS TEST REQUIRES WEB ACCESS! How else can we really test the http:// part of a browser
widget? */
+-	browser.setUrl("http://www.eclipse.org/swt");
++//	browser.setUrl("http://www.eclipse.org/swt");
++	browser.setUrl("SWTLOCALURL");
+ 	runLoopTimer(1);
+ 	browser.stop();
+ 	runLoopTimer(10);

Added: harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/properties?rev=605885&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/properties
(added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/eut/extra/eut.3.3.swt.patching/properties
Thu Dec 20 03:03:11 2007
@@ -0,0 +1,30 @@
+##     Licensed to the Apache Software Foundation (ASF) under one
+##     or more contributor license agreements.  See the NOTICE file
+##     distributed with this work for additional information
+##     regarding copyright ownership.  The ASF licenses this file
+##     to you under the Apache License, Version 2.0 (the
+##     "License"); you may not use this file except in compliance
+##     with the License.  You may obtain a copy of the License at
+##
+##         http://www.apache.org/licenses/LICENSE-2.0
+##
+##     Unless required by applicable law or agreed to in writing,
+##     software distributed under the License is distributed on an
+##     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+##     KIND, either express or implied.  See the License for the
+##     specific language governing permissions and limitations
+##     under the License.
+## ======================================================================================
+##
+
+#Where to fetch from EUT & Eclipse. Specify remote location (using protocol
+#prefix http://, ftp://) or local machine location (using absolute path and
+#file: prefix).
+
+#Eclipse filename prefix should be of the form: eclipse-SDK-<version>
+eclipse.filename.prefix=eclipse-SDK-3.3
+eut.location=http://download.eclipse.org/eclipse/downloads/drops/R-3.3-200706251500/
+eclipse.location=http://download.eclipse.org/eclipse/downloads/drops/R-3.3-200706251500/
+
+# This property should be set to some locally accessible host
+swt.local.url=http://www.google.com
\ No newline at end of file



Mime
View raw message