incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liu...@apache.org
Subject svn commit: r1386482 - in /incubator/ooo/trunk/test: ./ testcommon/source/org/openoffice/test/ testcommon/source/org/openoffice/test/common/
Date Mon, 17 Sep 2012 05:56:32 GMT
Author: liuzhe
Date: Mon Sep 17 05:56:32 2012
New Revision: 1386482

URL: http://svn.apache.org/viewvc?rev=1386482&view=rev
Log:
#120987 - Enable test automation framework to group test cases. Part 1

Added:
    incubator/ooo/trunk/test/run
      - copied unchanged from r1385278, incubator/ooo/trunk/test/test
    incubator/ooo/trunk/test/run.bat
      - copied, changed from r1385278, incubator/ooo/trunk/test/test.bat
Removed:
    incubator/ooo/trunk/test/test
    incubator/ooo/trunk/test/test.bat
Modified:
    incubator/ooo/trunk/test/build.xml
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/Run.java
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/CSVReporter.java
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/Installer.java
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/NamedRequest.java
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/ReportUploader.java
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.java
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl

Modified: incubator/ooo/trunk/test/build.xml
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/build.xml?rev=1386482&r1=1386481&r2=1386482&view=diff
==============================================================================
--- incubator/ooo/trunk/test/build.xml (original)
+++ incubator/ooo/trunk/test/build.xml Mon Sep 17 05:56:32 2012
@@ -32,7 +32,7 @@
 	<path id="uno.classpath">
 		<fileset dir="${env.OUTDIR}/bin" erroronmissingdir="false">
 			<include name="juh.jar" />
-			<include name="noil.jar" />
+			<include name="unoil.jar" />
 			<include name="ridl.jar" />
 			<include name="jurt.jar" />
 		</fileset>
@@ -152,11 +152,11 @@
 			<isset property="openoffice.pack" />
 		</condition>
 		<fail message="No OpenOffice available!" unless="test.arg0"/>
-	    <condition property="test.executable" value="./test.bat">
+	    <condition property="test.executable" value="./run.bat">
 			<os family="windows" />
 		</condition>
 		<echo>${test.arg0}</echo>
-        <property name="test.executable" value="./test"/>
+        <property name="test.executable" value="./run"/>
         <exec executable="${test.executable}">
 			<arg value="${test.arg0}"/>
 			<arg value="-tp"/>
@@ -188,28 +188,4 @@
 		<mkdir dir="${upgrade.to}"/>
 		<unzip src="${testack.temp}" dest="${upgrade.to}"/>
 	</target>
-    
-  
-
-	<target name="check.build" description="Check the build context">
-		<condition property="openoffice.pack.dir" value="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/OpenOffice/archive/install/en-US">
-			<isset property="env.SRC_ROOT" />
-		</condition>
-		<condition property="find.build.skip">
-			<or>
-				<isset property="openoffice.pack.url" />
-				<isset property="openoffice.pack.dir" />
-				<isset property="openoffice.home" />
-			</or>
-		</condition>
-		<condition property="download.build.skip">
-			<or>
-				<isset property="openoffice.pack.dir" />
-				<isset property="openoffice.home" />
-			</or>
-		</condition>
-		<condition property="install.build.skip">
-            <isset property="openoffice.home" />
-		</condition>
-	</target>
 </project>

Copied: incubator/ooo/trunk/test/run.bat (from r1385278, incubator/ooo/trunk/test/test.bat)
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/run.bat?p2=incubator/ooo/trunk/test/run.bat&p1=incubator/ooo/trunk/test/test.bat&r1=1385278&r2=1386482&rev=1386482&view=diff
==============================================================================
--- incubator/ooo/trunk/test/test.bat (original)
+++ incubator/ooo/trunk/test/run.bat Mon Sep 17 05:56:32 2012
@@ -1,3 +1,3 @@
 @echo OFF
 set BASE=%~pd0%
-java -cp %BASE%/lib/junit.jar;%BASE%/testcommon/bin;%BASE%/testgui/bin;%BASE%/testuno/bin;%BASE%/testgui/data;%BASE%/testuno/data
org.openoffice.test.Run -r org.openoffice.test.common.Installer -l org.openoffice.test.common.XMLReporter
-l org.openoffice.test.common.ReportUploader "$*"
+java -cp "%BASE%\lib\junit.jar;%BASE%\testcommon\bin;%BASE%\testgui\bin;%BASE%\testuno\bin;%BASE%\testgui\data;%BASE%\testuno\data"
org.openoffice.test.Run -r org.openoffice.test.common.Installer -l org.openoffice.test.common.XMLReporter
-l org.openoffice.test.common.ReportUploader %*

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/Run.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/Run.java?rev=1386482&r1=1386481&r2=1386482&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/Run.java (original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/Run.java Mon Sep 17 05:56:32
2012
@@ -1,3 +1,23 @@
+/**************************************************************
+ * 
+ * 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.
+ * 
+ *************************************************************/
 package org.openoffice.test;
 
 import java.util.ArrayList;

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/CSVReporter.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/CSVReporter.java?rev=1386482&r1=1386481&r2=1386482&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/CSVReporter.java
(original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/CSVReporter.java
Mon Sep 17 05:56:32 2012
@@ -1,3 +1,23 @@
+/**************************************************************
+ * 
+ * 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.
+ * 
+ *************************************************************/
 package org.openoffice.test.common;
 
 import java.io.File;

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java?rev=1386482&r1=1386481&r2=1386482&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java (original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java Mon
Sep 17 05:56:32 2012
@@ -894,6 +894,10 @@ public class FileUtil {
 		return download(urlString, output, false);
 	}
 	
+	public static File download(String urlString, File output, boolean usetimestamp) {
+		return download(urlString, output, false, null);
+	}
+	
 	/**
 	 * Download a file from a url to the local file system
 	 * @param urlString
@@ -901,7 +905,7 @@ public class FileUtil {
 	 * @param usetimestamp
 	 * @return
 	 */
-	public static File download(String urlString, File output, boolean usetimestamp) {
+	public static File download(String urlString, File output, boolean usetimestamp, boolean[]
skip) {
 		InputStream in = null;
 		OutputStream out = null;
 		try {
@@ -915,6 +919,8 @@ public class FileUtil {
 			if (usetimestamp && output.exists()) {
 				if (output.lastModified() == urlConnection.getLastModified()) {
 					log.info(MessageFormat.format(" Skip! Download {0} -> {1}", urlString, output));
+					if (skip != null && skip.length > 0)
+						skip[0] = true;
 					return output;
 				}
 			}
@@ -939,6 +945,8 @@ public class FileUtil {
 			if (urlConnection.getLastModified() >= 0)
 				output.setLastModified(urlConnection.getLastModified());
 			log.info(MessageFormat.format("OK! Download {0} -> {1}", urlString, output));
+			if (skip != null && skip.length > 0)
+				skip[0] = false;
 			return output;
 		} catch (Exception e) {
 			log.log(Level.SEVERE, MessageFormat.format("Fail! Download {0} -> {1}", urlString,
output), e);

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/Installer.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/Installer.java?rev=1386482&r1=1386481&r2=1386482&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/Installer.java (original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/Installer.java Mon
Sep 17 05:56:32 2012
@@ -1,3 +1,23 @@
+/**************************************************************
+ * 
+ * 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.
+ * 
+ *************************************************************/
 package org.openoffice.test.common;
 
 import java.io.File;
@@ -5,6 +25,10 @@ import java.io.IOException;
 import java.text.MessageFormat;
 import java.util.logging.Level;
 
+/**
+ * Install openoffice from installation package before running test
+ *
+ */
 public class Installer implements Runnable {
 	private static Logger log = Logger.getLogger(Installer.class);
 	File downloadDir = Testspace.getFile("download");
@@ -21,8 +45,10 @@ public class Installer implements Runnab
 			}
 		}
 		if ((prop = System.getProperty("openoffice.pack")) != null) {
+			String onlyNewProp = System.getProperty("only.new");
 			File packFile = null;
 			if (FileUtil.isUrl(prop)) {
+				log.log(Level.INFO, MessageFormat.format("Try to download {0}...", prop));
 				String url = FileUtil.readFileAsString(downloadUrl);
 				if (!prop.equals(url)) {
 					FileUtil.deleteFile(downloadDir);
@@ -32,9 +58,12 @@ public class Installer implements Runnab
 						throw new RuntimeException(MessageFormat.format("{0} can not be downloaded!", prop));
 					FileUtil.writeStringToFile(downloadUrl, prop);
 				} else {
-					packFile = FileUtil.download(prop, downloadDir, true);
+					boolean[] skipped = {false};
+					packFile = FileUtil.download(prop, downloadDir, true, skipped);
 					if (packFile == null)
 						throw new RuntimeException(MessageFormat.format("{0} can not be downloaded!", prop));
+					if (("true".equalsIgnoreCase(onlyNewProp) || "yes".equalsIgnoreCase(onlyNewProp)) &&
skipped[0]) 
+						throw new RuntimeException(MessageFormat.format("{0} is old. Test is allowed only on
new build.", prop));
 				}
 			} else {
 				packFile = new File(prop);

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/NamedRequest.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/NamedRequest.java?rev=1386482&r1=1386481&r2=1386482&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/NamedRequest.java
(original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/NamedRequest.java
Mon Sep 17 05:56:32 2012
@@ -1,3 +1,23 @@
+/**************************************************************
+ * 
+ * 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.
+ * 
+ *************************************************************/
 package org.openoffice.test.common;
 
 import java.text.MessageFormat;

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/ReportUploader.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/ReportUploader.java?rev=1386482&r1=1386481&r2=1386482&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/ReportUploader.java
(original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/ReportUploader.java
Mon Sep 17 05:56:32 2012
@@ -1,3 +1,23 @@
+/**************************************************************
+ * 
+ * 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.
+ * 
+ *************************************************************/
 package org.openoffice.test.common;
 
 import java.io.File;

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.java?rev=1386482&r1=1386481&r2=1386482&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.java
(original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.java
Mon Sep 17 05:56:32 2012
@@ -1,3 +1,23 @@
+/**************************************************************
+ * 
+ * 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.
+ * 
+ *************************************************************/
 package org.openoffice.test.common;
 
 import java.io.File;
@@ -17,8 +37,6 @@ public class XMLReporter extends RunList
 
 	private File outputDir = Testspace.getFile("output");
 	
-	private File reportDir = new File(outputDir, "result");
-	
 	private File file = null;
 	
 	private Document doc = null;
@@ -123,7 +141,7 @@ public class XMLReporter extends RunList
 		tests = 0;
 		ignored = 0;
 		
-		file = new File(reportDir, suiteName + ".xml");
+		file = new File(outputDir, "result.xml");
 		doc = FileUtil.newXML();
 	
 		testsuiteEl = doc.createElement("testsuite");
@@ -154,7 +172,7 @@ public class XMLReporter extends RunList
 	private void store() {
 		if (doc != null) {
 			FileUtil.storeXML(doc, file);
-			File htmlFile = new File(reportDir, file.getName() + ".html");
+			File htmlFile = new File(outputDir, "result.html");
 			InputStream is = getClass().getResourceAsStream("XMLReporter.xsl");
 			if (is != null) {
 				FileUtil.storeXML(doc, htmlFile, is);

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl?rev=1386482&r1=1386481&r2=1386482&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
(original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
Mon Sep 17 05:56:32 2012
@@ -256,11 +256,11 @@ function refresh() {
 		if (c = $$(e, 'failure')) {
 			status = 'Failure';
 			message = text(c.getAttribute("message"));
-			screenshot = '<a href="../screenshot/' + e.getAttribute("name") + '.png">Screenshot</a>';
+			screenshot = '<a href="screenshot/' + e.getAttribute("name") + '.png">Screenshot</a>';
 		} else if (c = $$(e, 'error')) {
 			status = 'Error';
 			message = text(c.getAttribute("message"));
-			screenshot = '<a href="../screenshot/' + e.getAttribute("name") + '.png">Screenshot</a>';
+			screenshot = '<a href="screenshot/' + e.getAttribute("name") + '.png">Screenshot</a>';
 		} else if (c = $$(e, 'ignored')) {
 			status = 'Ignored';
 			message = text(c.getAttribute("message"));



Mime
View raw message