Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 270627 | Differences between
and this patch

Collapse All | Expand All

(-)eclipse/buildConfigs/sdk.tests/customTargets.xml (+3 lines)
Lines 225-230 Link Here
225
		<!--load the property file created with the directory names for all test plugins-->
225
		<!--load the property file created with the directory names for all test plugins-->
226
		<property file="${test.properties}" />
226
		<property file="${test.properties}" />
227
227
228
		<!--copy comparator log to test directory-->
229
		<copy file="${buildlogs}/comparatorlog.txt" todir="${workingDirectory}/eclipse-testing" failonerror="false"/>	
230
228
		<!--create properties file for use in equinoxp2 tests -->
231
		<!--create properties file for use in equinoxp2 tests -->
229
		<property name="equinoxp2tests.properties" value="${workingDirectory}/eclipse-testing/equinoxp2tests.properties" />
232
		<property name="equinoxp2tests.properties" value="${workingDirectory}/eclipse-testing/equinoxp2tests.properties" />
230
		<property name="org.eclipse.equinox.p2.reconciler.tests.platform.archive.win32" value="c:\\buildtest\\${buildId}\\eclipse-testing\\eclipse-platform-${buildId}-win32.zip" />
233
		<property name="org.eclipse.equinox.p2.reconciler.tests.platform.archive.win32" value="c:\\buildtest\\${buildId}\\eclipse-testing\\eclipse-platform-${buildId}-win32.zip" />
(-)compare.properties (-1 / +1 lines)
Lines 11-14 Link Here
11
compare.new=@new@
11
compare.new=@new@
12
compare.old=@old@
12
compare.old=@old@
13
compare.output=@output@
13
compare.output=@output@
14
compare.options=@compareoptions@
14
compare.options=@compareoptions@
(-)test.xml (-2 / +2 lines)
Lines 67-73 Link Here
67
		<property name="versionOutputFile" value="${versionOutputDir}/results.xml" />
67
		<property name="versionOutputFile" value="${versionOutputDir}/results.xml" />
68
		<echo message="locationcompare ${locationcompare} versionOutputDir ${versionOutputDir} versionOutputFile ${versionOutputFile}" />
68
		<echo message="locationcompare ${locationcompare} versionOutputDir ${versionOutputDir} versionOutputFile ${versionOutputFile}" />
69
		<replace file="${basedir}/plugins/${org.eclipse.releng.tests}/compare.properties" token="@output@" value="${versionOutputFile}" />
69
		<replace file="${basedir}/plugins/${org.eclipse.releng.tests}/compare.properties" token="@output@" value="${versionOutputFile}" />
70
		<replace file="${basedir}/plugins/${org.eclipse.releng.tests}/compare.properties" token="@compareoptions@" value="${basedir}/plugins/${org.eclipse.releng.tests}/compareoptions.properties" />
70
		<replace file="${basedir}/plugins/${org.eclipse.releng.tests}/compare.properties" token="@compareoptions@" value="${basedir}/plugins/${org.eclipse.releng.tests}/compareoptions.properties" />		
71
	</target>
71
	</target>
72
72
73
73
Lines 86-92 Link Here
86
			<property name="plugin-name" value="org.eclipse.releng.tests" />
86
			<property name="plugin-name" value="org.eclipse.releng.tests" />
87
			<property name="classname" value="org.eclipse.releng.tests.BuildTests" />
87
			<property name="classname" value="org.eclipse.releng.tests.BuildTests" />
88
			<property name="plugin-path" value="${eclipse-home}/plugins/${org.eclipse.releng.tests}" />
88
			<property name="plugin-path" value="${eclipse-home}/plugins/${org.eclipse.releng.tests}" />
89
			<property name="vmargs" value="-DRELENGTEST.JAVADOC.URLS=file:///${eclipse-home}/../../org.eclipse.platform.doc.isv.javadoc.txt,file:///${eclipse-home}/../../org.eclipse.jdt.doc.isv.javadoc.txt,file:///${eclipse-home}/../../org.eclipse.jdt.apt.javadoc.txt,file:///${eclipse-home}/../../org.eclipse.pde.doc.user.javadoc.txt" />
89
			<property name="vmargs" value="-DRELENGTEST.JAVADOC.URLS=file:///${eclipse-home}/../../org.eclipse.platform.doc.isv.javadoc.txt,file:///${eclipse-home}/../../org.eclipse.jdt.doc.isv.javadoc.txt,file:///${eclipse-home}/../../org.eclipse.jdt.apt.javadoc.txt,file:///${eclipse-home}/../../org.eclipse.pde.doc.user.javadoc.txt -DRELENGTEST.COMPARATOR.URL=file:///${eclipse-home}/../../comparatorlog.txt" />
90
		</ant>
90
		</ant>
91
	</target>
91
	</target>
92
92
(-)src/org/eclipse/releng/tests/BuildTests.java (-13 / +92 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2007 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 35-49 Link Here
35
35
36
import junit.framework.TestCase;
36
import junit.framework.TestCase;
37
37
38
import org.eclipse.core.runtime.FileLocator;
39
import org.eclipse.core.runtime.Platform;
38
import org.osgi.framework.Bundle;
40
import org.osgi.framework.Bundle;
39
import org.xml.sax.SAXException;
40
41
import org.w3c.dom.Document;
41
import org.w3c.dom.Document;
42
import org.w3c.dom.Element;
42
import org.w3c.dom.Element;
43
import org.w3c.dom.NodeList;
43
import org.w3c.dom.NodeList;
44
44
import org.xml.sax.SAXException;
45
import org.eclipse.core.runtime.FileLocator;
46
import org.eclipse.core.runtime.Platform;
47
45
48
public class BuildTests extends TestCase {
46
public class BuildTests extends TestCase {
49
47
Lines 52-57 Link Here
52
	private static final int PROPERTIES = 1;
50
	private static final int PROPERTIES = 1;
53
	private static final int XML = 2;
51
	private static final int XML = 2;
54
	URL[] javadocLogs = null;
52
	URL[] javadocLogs = null;
53
	URL comparatorLogs = null;
55
54
56
	private static FileTool.IZipFilter getTrueFilter() {
55
	private static FileTool.IZipFilter getTrueFilter() {
57
		return new FileTool.IZipFilter() {
56
		return new FileTool.IZipFilter() {
Lines 403-416 Link Here
403
	 */
402
	 */
404
	protected void setUp() throws Exception {
403
	protected void setUp() throws Exception {
405
404
406
		// Autoamted Test
405
		// Automated Test
407
		logFileName = Platform.getInstallLocation().getURL().getPath() + ".."
406
		logFileName = Platform.getInstallLocation().getURL().getPath() + ".."
408
				+ File.separator + ".." + File.separator + "results"
407
				+ File.separator + ".." + File.separator + "results"
409
				+ File.separator + "chkpii"; // A tad bogus but this is where
408
				+ File.separator + "chkpii"; // A tad bogus but this is where
410
		// the build wants to copy the
409
    	// the build wants to copy the
411
		// results from!
410
		// results from!
412
411
413
		String javadocUrls = System.getProperty("RELENGTEST.JAVADOC.URLS");
412
		String javadocUrls = System.getProperty("RELENGTEST.JAVADOC.URLS");
413
		String comparatorUrl = System.getProperty("RELENGTEST.COMPARATOR.URL");		
414
	
414
		if (javadocUrls != null) {
415
		if (javadocUrls != null) {
415
			String[] urls = javadocUrls.split(",");
416
			String[] urls = javadocUrls.split(",");
416
			javadocLogs = new URL[urls.length];
417
			javadocLogs = new URL[urls.length];
Lines 418-424 Link Here
418
				javadocLogs[i] = new URL(urls[i]);
419
				javadocLogs[i] = new URL(urls[i]);
419
			}
420
			}
420
		}
421
		}
421
422
		if (comparatorUrl != null) {
423
				comparatorLogs = new URL(comparatorUrl);
424
		}
422
		// Runtime Workbench - TODI Put me back to Automated status
425
		// Runtime Workbench - TODI Put me back to Automated status
423
		// logFileName = "d:\\results";
426
		// logFileName = "d:\\results";
424
		// sourceDirectoryName = "d:\\sourceFetch";
427
		// sourceDirectoryName = "d:\\sourceFetch";
Lines 719-726 Link Here
719
				}
722
				}
720
			}
723
			}
721
		}
724
		}
725
	} 
726
 
727
	
728
	public void testComparatorLogs() {
729
		
730
		String os = System.getProperty("os.name");
731
		
732
		// Only run compare tool on Linux to save time during tests 
733
			if (!os.equalsIgnoreCase("Linux")) {
734
				return;
735
			}
736
			
737
			// load the configuration and ensure the mandatory parameters were
738
			// specified
739
			Properties properties = loadCompareConfiguration();			
740
			String compareOldPath = properties.getProperty("compare.old");
741
			if (compareOldPath.indexOf("N2") > 0) { 
742
				// if nightly build, skip test
743
				return;
744
			}
745
		// skip this test if there are no logs to check
746
		if (comparatorLogs == null)
747
			assertTrue("", true);
748
		else {
749
			ComparatorLog comparatorLog = new ComparatorLog(comparatorLogs);
750
			String message = "comparator warnings in: \n";
751
			boolean problemLogsExist = comparatorLog.logs.size() > 0;			
752
			message = message
753
					.concat("See the comparator logs linked from the test results page for details");
754
			assertTrue(message, !problemLogsExist);
755
		}
756
	}
757
758
	private class ComparatorLog {
759
		private ArrayList logs = new ArrayList();
760
761
		private ComparatorLog(URL comparatorLogs) {
762
			findProblems(comparatorLogs);
763
		}
764
765
		private void findProblems(URL ComparatorLogs) {
766
		
767
			String COMPARATOR_ERROR = "canonical:";		
768
769
			BufferedReader in = null;
770
		
771
				try {
772
					in = new BufferedReader(new InputStreamReader(
773
							comparatorLogs.openStream()));
774
					String tmp;
775
					while ((tmp = in.readLine()) != null) {
776
						tmp = tmp.toLowerCase();
777
						if (tmp.indexOf(COMPARATOR_ERROR) != -1) {										
778
							String fileName = new File(comparatorLogs.getFile())
779
									.getName();
780
							if (!logs.contains(fileName))
781
								logs.add(fileName);
782
						}
783
					}
784
					in.close();
785
786
				} catch (FileNotFoundException e) {
787
					logs.add("Unable to find "
788
							+ new File(comparatorLogs.getFile()).getName()
789
							+ " to read.");
790
					e.printStackTrace();
791
				} catch (IOException e) {
792
					logs.add("Unable to read "
793
							+ new File(comparatorLogs.getFile()).getName());
794
					e.printStackTrace();
795
				}
796
			}		
722
	}
797
	}
723
798
799
	
800
	
724
	/*
801
	/*
725
	 * Load the configuration file which should be included in this bundle
802
	 * Load the configuration file which should be included in this bundle
726
	 */
803
	 */
Lines 862-869 Link Here
862
		 * Determine if the build is a nightly Nightly builds have qualifiers
939
		 * Determine if the build is a nightly Nightly builds have qualifiers
863
		 * identical the buildId - for instance N200612080010 which means that
940
		 * identical the buildId - for instance N200612080010 which means that
864
		 * they are lower than v20060921-1945 from an promoted integration build
941
		 * they are lower than v20060921-1945 from an promoted integration build
865
		 * and thus cannot be compared
942
		 * and thus cannot be compared 
866
		 */
943
		 */
944
		 
867
945
868
		// disable temporarily
946
		// disable temporarily
869
		if (compareOldPath.indexOf("N2") > 0) { 
947
		if (compareOldPath.indexOf("N2") > 0) { 
Lines 893-899 Link Here
893
		
971
		
894
		String compareOptions = properties.getProperty("compare.options");
972
		String compareOptions = properties.getProperty("compare.options");
895
				
973
				
896
		/*
974
	/*	
897
		 * String outputFileName =
975
		 * String outputFileName =
898
		 * Platform.getInstallLocation().getURL().getPath() + ".." +
976
		 * Platform.getInstallLocation().getURL().getPath() + ".." +
899
		 * File.separator + ".." + File.separator + "results" + File.separator +
977
		 * File.separator + ".." + File.separator + "results" + File.separator +
Lines 904-911 Link Here
904
		 * File(outputFileName); boolean created = outputfile.createNewFile();
982
		 * File(outputFileName); boolean created = outputfile.createNewFile();
905
		 * if (created) { } else { msg = "Output dir could not be created.";
983
		 * if (created) { } else { msg = "Output dir could not be created.";
906
		 * assertTrue(msg, msg == null); } } catch (IOException e) {
984
		 * assertTrue(msg, msg == null); } } catch (IOException e) {
907
		 * e.printStackTrace(); }
985
		 * e.printStackTrace(); } 
908
		 */
986
*/
987
		 
909
988
910
		String command = buildCommandLine(compareNewPath, compareOldPath,
989
		String command = buildCommandLine(compareNewPath, compareOldPath,
911
				outputFileName, compareOptions);
990
				outputFileName, compareOptions);

Return to bug 270627