You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2012/05/03 00:45:08 UTC
svn commit: r1333232 [25/34] - in /incubator/flex/trunk: ./
frameworks/tests/ frameworks/tests/basicTests/
frameworks/tests/basicTests/dmv/ frameworks/tests/basicTests/dmv/scripts/
frameworks/tests/basicTests/dmv/views/ frameworks/tests/basicTests/fxg/...
Added: incubator/flex/trunk/mustella/java/src/utils/P12Reader.java
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/java/src/utils/P12Reader.java?rev=1333232&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/java/src/utils/P12Reader.java (added)
+++ incubator/flex/trunk/mustella/java/src/utils/P12Reader.java Wed May 2 22:44:38 2012
@@ -0,0 +1,142 @@
+/*************************************************************************
+ * ADOBE CONFIDENTIAL
+ * ___________________
+ *
+ * Copyright 2010 Adobe Systems Incorporated
+ * All Rights Reserved.
+ *
+ * NOTICE: All information contained herein is, and remains
+ * the property of Adobe Systems Incorporated and its suppliers,
+ * if any. The intellectual and technical concepts contained
+ * herein are proprietary to Adobe Systems Incorporated and its
+ * suppliers and may be covered by U.S. and Foreign Patents,
+ * patents in process, and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * from Adobe Systems Incorporated.
+ **************************************************************************/
+
+package utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.util.Enumeration;
+
+/**
+ * Class responsible for all interactions with the KeyStore class.
+ *
+ * Assumes the PFX file contains exactly one private key and certificate.
+ */
+public class P12Reader {
+
+ private static final String KEYSTORE_TYPE = "PKCS12"; //$NON-NLS-1$
+
+ private KeyStore keyStore;
+ private String password;
+ private String alias;
+
+ /**
+ * Creates a new instance of PFXReader.
+ *
+ * @throws CertificateException If any of the certificates in the certificate file
+ * could not be loaded.
+ * @throws FileNotFoundException If the certifcate file is not found.
+ * @throws IOException If there is an I/O or format problem with the certificate file or
+ * if the password is incorrect.
+ * @throws NoSuchAlgorithmException If the algorithm used to check the integrity of
+ * the certificate file cannot be found.
+ * @throws KeyStoreException
+ */
+ public P12Reader( File file, String password ) throws GeneralSecurityException, IOException {
+ this( new FileInputStream( file ), password );
+ }
+
+ /**
+ * Creates a new instance of PFXReader.
+ *
+ * @throws CertificateException If any of the certificates in the certificate file
+ * could not be loaded.
+ * @throws IOException If there is an I/O or format problem with the certificate file or
+ * if the password is incorrect.
+ * @throws NoSuchAlgorithmException If the algorithm used to check the integrity of
+ * the certificate file cannot be found.
+ * @throws KeyStoreException
+ */
+ public P12Reader( InputStream inputStream, String password ) throws GeneralSecurityException, IOException {
+ this.password = password;
+
+ // try {
+ keyStore = KeyStore.getInstance(KEYSTORE_TYPE);
+ keyStore.load( inputStream, password.toCharArray() );
+ Enumeration aliases = keyStore.aliases();
+ if( aliases.hasMoreElements() ) alias = (String) aliases.nextElement();
+ //} catch( KeyStoreException e ) {
+ // assert false; // should never get here
+ //}
+ }
+
+ /**
+ * Returns the private key or <code>null</code> if it does not exist.
+ *
+ * @throws NoSuchAlgorithmException If the algorithm for recovering the key cannot be found.
+ * @throws UnrecoverableKeyException If the key cannot be recovered (e.g., the given password is wrong).
+ */
+ public PrivateKey getPrivateKey() throws GeneralSecurityException {
+ Key key = null;
+
+ //try {
+ if( alias != null ) key = keyStore.getKey( alias, password.toCharArray() );
+ //} catch( KeyStoreException e ) {
+ // assert false; // should never get here
+ //}
+
+ return ( PrivateKey ) key;
+ }
+
+ /*
+ * Returns the certificate or <code>null</code> if it does not exist.
+ *
+ */
+ public Certificate getCertificate() throws KeyStoreException {
+ Certificate certificate = null;
+
+ //try {
+ if( alias != null ) certificate = keyStore.getCertificate( alias );
+ //} catch( KeyStoreException e ) {
+ // assert false; // should never get here
+ //}
+
+ return certificate;
+ }
+
+ /**
+ * Returns the certificate chain or <code>null</code> if it does not exist.
+ * @throws KeyStoreException
+ */
+ public Certificate[] getCertificateChain() throws KeyStoreException {
+ Certificate[] certificates = null;
+
+ //try {
+ if( alias != null ) certificates = keyStore.getCertificateChain( alias );
+ // convert all zero-length arrays as null
+ if( ( certificates != null ) && ( certificates.length == 0 ) ) certificates = null;
+ //} catch( KeyStoreException e ) {
+ // assert false; // should never get here
+ //}
+
+ return certificates;
+ }
+}
+
Propchange: incubator/flex/trunk/mustella/java/src/utils/P12Reader.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/flex/trunk/mustella/java/src/utils/RuntimeExecHelper.java
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/java/src/utils/RuntimeExecHelper.java?rev=1333232&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/java/src/utils/RuntimeExecHelper.java (added)
+++ incubator/flex/trunk/mustella/java/src/utils/RuntimeExecHelper.java Wed May 2 22:44:38 2012
@@ -0,0 +1,318 @@
+/*
+ *
+ * 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 utils;
+
+import java.io.*;
+import java.net.InetAddress;
+import java.net.Socket;
+
+/**
+ * User: dschaffer
+ * Date: Mar 7, 2005
+ * Time: 11:17:42 AM
+ */
+public class RuntimeExecHelper {
+ boolean running = false;
+ boolean output = false;
+ int timeout = 300; // timeout in seconds
+ int exitValue = -1;
+
+ String inputText = null;
+ String outputText;
+ String errorText;
+ String command[];
+ String environment[];
+ String dir;
+ protected Process browserProcess;
+ protected long startTime;
+ protected ThreadReader outThreadReader;
+ protected ThreadReader errThreadReader;
+
+ private boolean printOutput = false;
+ private boolean stop = false;
+
+ public int browserServerID;
+
+ public RuntimeExecHelper(String command[],String environment[],String dir) {
+ setCommand(command);
+ setEnvironment(environment);
+ setDir(dir);
+ }
+ public RuntimeExecHelper(String command[],String dir) {
+ this(command,null,dir);
+ }
+
+ public void setOutput(boolean output) {
+ this.output=output;
+ }
+
+ public void setTimeout(int timeout) {
+ this.timeout=timeout;
+ }
+
+ public void setInputText(String inputText) {
+ this.inputText=inputText;
+ }
+
+ public void setDir(String dir) {
+ this.dir=dir;
+ }
+ public void setCommand(String command[]) {
+ this.command=command;
+ }
+
+ public void setEnvironment(String environment[]) {
+ this.environment=environment;
+ }
+
+ public void setPrintOutput(boolean printOutput) {
+ this.printOutput=printOutput;
+ }
+
+ public boolean getRunning() {
+ return running;
+ }
+
+ public String getOutputText() {
+ refreshStreams();
+ return outputText;
+ }
+
+ public String getErrorText() {
+ refreshStreams();
+ return errorText;
+ }
+
+ public int getExitValue() {
+ return exitValue;
+ }
+
+
+ public void refreshStreams() {
+ outputText = outThreadReader.getOutput();
+ errorText = errThreadReader.getOutput();
+ try {
+ exitValue = browserProcess.exitValue();
+
+ } catch (Exception e) {
+ }
+
+ if (exitValue != -1)
+ running=false;
+ }
+
+
+ public void stop() {
+ stop = true;
+ }
+
+
+ public void kill() throws Exception {
+ if (browserProcess != null && exitValue == -1)
+ browserProcess.destroy();
+
+ outputText = outThreadReader.getOutput();
+ errorText = errThreadReader.getOutput();
+ }
+
+
+ public void runInBackground() throws Exception {
+ browserProcess = Runtime.getRuntime().exec(command,environment,new File(dir));
+ running=true;
+ if (inputText != null) {
+ Thread.sleep(1000);
+ OutputStreamWriter osw = new OutputStreamWriter(browserProcess.getOutputStream());
+ osw.write(inputText);
+ osw.flush();
+ osw.close();
+ }
+
+ InputStreamReader outReader = new InputStreamReader(browserProcess.getInputStream());
+ outThreadReader = new ThreadReader(outReader);
+ Thread outTR = new Thread(outThreadReader);
+ outTR.setName("Out-" + command[command.length - 1]);
+ outTR.start();
+ InputStreamReader errReader = new InputStreamReader(browserProcess.getErrorStream());
+ errThreadReader = new ThreadReader(errReader);
+ Thread errTR = new Thread(errThreadReader);
+ errTR.setName("Err-" + command[command.length - 1]);
+ errTR.start();
+ startTime = System.currentTimeMillis();
+ exitValue = -1;
+ }
+
+
+ public void run() throws Exception {
+ runInBackground();
+ waitFor();
+ }
+
+
+ public void waitFor() throws Exception {
+ int outputCounter=0;
+
+ while (!stop && System.currentTimeMillis() - startTime < timeout * 1000L) {
+ try {
+ exitValue = browserProcess.exitValue();
+ } catch (Exception e) {
+ }
+
+ if (exitValue > -1)
+ break;
+
+ if (output) {
+ String out = outThreadReader.getOutput();
+ System.out.print(out.substring(outputCounter));
+ outputCounter = out.length();
+ }
+
+ Thread.sleep(300);
+ }
+
+ if (exitValue==-1) {
+ kill();
+ }
+
+ Thread.sleep(1000);
+ outputText = outThreadReader.getOutput();
+ errorText = errThreadReader.getOutput();
+
+ }
+
+
+ public void runBrowserServerTest(String test, String browserType, String browserServer, int browserServerPort) {
+
+ String id="";
+ try {
+ if (test.indexOf("localhost")>-1) {
+ try {
+ String ipaddress = InetAddress.getLocalHost().getHostAddress();
+ test = test.substring(0,test.indexOf("localhost")) + ipaddress + test.substring(test.indexOf("localhost") + 9);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ System.out.println("starting test "+test);
+ Socket s = new Socket(browserServer,browserServerPort);
+
+ BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
+ bw.write("cmd=start browser=" + browserType + " url=" + test + " timeout=300 pingTimeout=300 ;");
+ bw.newLine();
+ bw.flush();
+ BufferedReader br=new BufferedReader(new InputStreamReader(s.getInputStream()));
+ String line;
+
+ while ((line = br.readLine()) != null) {
+
+ if (line.indexOf("id=")>-1) {
+ line = line.substring(line.indexOf("id") + 3);
+ line = line.substring(0, line.indexOf(" "));
+ id=line;
+ break;
+ }
+ }
+
+ s.close();
+/*
+ Thread.sleep(2000);
+
+ while (true) {
+ s=new Socket(browserServer,browserServerPort);
+ bw=new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
+ bw.write("cmd=status id="+id+";");
+ bw.newLine();
+ bw.flush();
+
+ br=new BufferedReader(new InputStreamReader(s.getInputStream()));
+ done=false;
+ while ((line=br.readLine())!=null) {
+ if (line.indexOf(": true :")>-1) {
+ System.out.println("test is still running...");
+ break;
+ } else if (line.indexOf(": false :")>-1) {
+ System.out.println("test finished...");
+ done=true;
+ break;
+ }
+ }
+ s.close();
+ if (done) break;
+ Thread.sleep(5000);
+ }
+
+*/
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ browserServerID = Integer.parseInt(id);
+ }
+
+
+ public class ThreadReader implements Runnable {
+ Reader reader;
+ String output = "";
+ boolean running = true;
+
+ public ThreadReader(Reader reader) {
+ this.reader = reader;
+ }
+
+ public String getOutput() {
+ return output;
+ }
+
+ public void run() {
+ int len;
+ char ch[] = new char[8192];
+
+ while (true) {
+ try {
+ len = reader.read(ch, 0, 8192);
+ if (len == -1)
+ break;
+
+ String newOut=new String(ch, 0, len);
+
+ if (printOutput)
+ System.out.print(newOut);
+
+ output = output + newOut;
+
+ if (!running)
+ break;
+
+ if (len==0)
+ Thread.sleep(100);
+
+ } catch (Exception e) {
+ String errorString = "===============================\n" + Thread.currentThread().toString() +
+ "\n======Error Marker Start=======" +
+ "\n" + output +
+ "\n=======Error Marker End========";
+ System.out.println(errorString);
+ e.printStackTrace();
+ break;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
Propchange: incubator/flex/trunk/mustella/java/src/utils/RuntimeExecHelper.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/flex/trunk/mustella/java/src/utils/StringUtils.java
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/java/src/utils/StringUtils.java?rev=1333232&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/java/src/utils/StringUtils.java (added)
+++ incubator/flex/trunk/mustella/java/src/utils/StringUtils.java Wed May 2 22:44:38 2012
@@ -0,0 +1,216 @@
+/*
+ *
+ * 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 utils;
+
+import java.util.*;
+import java.net.InetAddress;
+
+/**
+ * User: dschaffer
+ * Date: Mar 8, 2005
+ * Time: 11:22:03 AM
+ */
+public class StringUtils {
+ public static String arrayToString(String[] arr) {
+ String str = "";
+ for (int i = 0; i < arr.length; i++) {
+ str += arr[i] + " ";
+ }
+ if (arr.length>0)
+ str += str.substring(str.length() - 1);
+ return str;
+ }
+
+ public static String formatTime(long t) {
+ String out = "";
+ int days = (int) (t / (24 * 60 * 60 * 1000));
+ t = t % (24 * 60 * 60 * 1000);
+ int hours = (int) (t / (60 * 60 * 1000));
+ t = t % (60 * 60 * 1000);
+ int mins = (int) (t / (60 * 1000));
+ t = t % (60 * 1000);
+ if (days > 0) out += "" + days + "d ";
+ if (hours > 0) out += "" + hours + "h ";
+ if (mins > 0) out += "" + mins + "m ";
+ out += ((t + 50) / 100) / 10.0 + "s";
+ return out;
+ }
+
+ public static String getDate() {
+ return getDate(System.currentTimeMillis());
+ }
+
+ public static String getSqlDate() {
+ GregorianCalendar gc = new GregorianCalendar();
+ gc.setTimeInMillis(System.currentTimeMillis());
+ String ret = "" + gc.get(Calendar.YEAR) + "-" + (gc.get(Calendar.MONTH)+1) + "-" + gc.get(Calendar.DAY_OF_MONTH) + " " + gc.get(Calendar.HOUR_OF_DAY) + ":";
+ if (gc.get(Calendar.MINUTE) > 9)
+ ret += gc.get(Calendar.MINUTE);
+ else
+ ret += "0" + gc.get(Calendar.MINUTE);
+ return ret;
+ }
+
+ public static String getDate(long time) {
+ String months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+ GregorianCalendar gc = new GregorianCalendar();
+ gc.setTimeInMillis(time);
+ String ret = "" + months[gc.get(Calendar.MONTH)] + " " + gc.get(Calendar.DAY_OF_MONTH) + ", " + gc.get(Calendar.YEAR) + " " + gc.get(Calendar.HOUR_OF_DAY) + ":";
+ if (gc.get(Calendar.MINUTE) > 9)
+ ret += gc.get(Calendar.MINUTE);
+ else
+ ret += "0" + gc.get(Calendar.MINUTE);
+ return ret;
+ }
+
+ private static String hostname = null;
+ public static String getHostName() {
+ if(hostname == null) {
+ hostname = "localhost";
+ try {
+ hostname = InetAddress.getLocalHost().getHostName();
+ String ip=InetAddress.getLocalHost().getHostAddress();
+ hostname+="/"+ip;
+ } catch (Exception e) {
+ }
+ }
+ return hostname;
+ }
+ public static String replaceString(String line, String search, String replace) {
+ int ctr = 0;
+ while (line.indexOf(search, ctr) > -1) {
+ int newctr=line.indexOf(search,ctr)+replace.length();
+ line = line.substring(0, line.indexOf(search,ctr)) + replace + line.substring(line.indexOf(search,ctr) + search.length());
+ ctr=newctr;
+ }
+ return line;
+ }
+ public static String[] StringToArray(String contents) {
+ if (contents.startsWith("\"")) contents=contents.substring(1);
+ if (contents.endsWith("\"")) contents=contents.substring(0,contents.length()-1);
+ StringTokenizer stok=new StringTokenizer(contents);
+ String ret[]=new String[stok.countTokens()];
+ int n=0;
+ while (stok.hasMoreTokens()) {
+ ret[n++]=stok.nextToken();
+ }
+ return ret;
+ }
+ public static String[] StringToArray(String contents,String linematch) throws Exception {
+ List matches=new Vector();
+ while (true) {
+ if (contents.indexOf("\n")>-1) {
+ String line=contents.substring(0,contents.indexOf("\n")).trim();
+ contents=contents.substring(contents.indexOf("\n")).trim();
+ if (line.equals("") || line.indexOf(linematch)>-1) {
+ matches.add(line);
+ }
+ } else {
+ contents=contents.trim();
+ if (contents.indexOf(linematch)>-1) {
+ matches.add(contents);
+ }
+ break;
+ }
+ }
+ String ret[]=new String[matches.size()];
+ matches.toArray(ret);
+ return ret;
+ }
+
+ public static String[] StringToArrayIgnoreLineForSomeFiles(String contents,String linematch, String ignoreLineForFile) throws Exception {
+ List matches=new Vector();
+ while (true) {
+ if (contents.indexOf("\n")>-1) {
+ String line=contents.substring(0,contents.indexOf("\n")).trim();
+ contents=contents.substring(contents.indexOf("\n")).trim();
+ if (line.equals("") || (line.indexOf(linematch)>-1 &&
+ (line.indexOf(ignoreLineForFile) == -1 || line.indexOf(ignoreLineForFile) > line.indexOf(linematch)) ) )
+ {
+ matches.add(line);
+ }
+ } else {
+ contents=contents.trim();
+ if (contents.indexOf(linematch)>-1 &&
+ (contents.indexOf(ignoreLineForFile) == -1 || contents.indexOf(ignoreLineForFile) > contents.indexOf(linematch)) )
+ {
+ matches.add(contents);
+ }
+ break;
+ }
+ }
+ String ret[]=new String[matches.size()];
+ matches.toArray(ret);
+ return ret;
+ }
+
+ public static String compareArrays(String expectedArray[],String[] actualArray) {
+ String diffs="";
+ List expected=new Vector();
+ for (int i=0;i<expectedArray.length;i++) expected.add(expectedArray[i]);
+ List actual=new Vector();
+ for (int i=0;i<actualArray.length;i++) actual.add(actualArray[i]);
+ Iterator it=expected.iterator();
+ boolean found;
+ while (it.hasNext()) {
+ found=false;
+ String exp=(String)it.next();
+ Iterator it2=actual.iterator();
+ while (it2.hasNext()) {
+ String act=(String)it2.next();
+ if (act.indexOf(exp)>-1) {
+ actual.remove(act);
+ found=true;
+ break;
+ }
+ }
+ if (found==false) {
+ diffs+="expected string not match: '"+exp+"'\n";
+ }
+ }
+ if (actual.size()>0) {
+ it=actual.iterator();
+ while (it.hasNext()) {
+ diffs+="actual string not matched: '"+it.next()+"'\n";
+ }
+ }
+ return diffs;
+ }
+
+ // fix double characters in string where they should be in UTF-8 representation.
+ public static String fixString(String str) {
+ StringBuffer result = new StringBuffer();
+ for (int i=0; i<str.length(); i++)
+ {
+ char c = str.charAt(i);
+ if (c < 127)
+ {
+ // in ascii range
+ result.append(c);
+ }
+ else
+ {
+ // multibyte char. output in XML escape code to work around JUnit bug.
+ String digits = Integer.toHexString(c);
+ result.append("&#x" + digits + ";");
+ }
+ }
+ return result.toString();
+ }
+}
Propchange: incubator/flex/trunk/mustella/java/src/utils/StringUtils.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/flex/trunk/mustella/local.properties
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/local.properties?rev=1333232&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/local.properties (added)
+++ incubator/flex/trunk/mustella/local.properties Wed May 2 22:44:38 2012
@@ -0,0 +1,33 @@
+################################################################################
+##
+## 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.
+##
+################################################################################
+
+# See local-template.properties for all available options.
+
+#sdk.dir=/Users/cframpto/dev/apache
+#frameworks=${sdk.dir}/frameworks
+#sdk.bin.dir=${sdk.dir}/bin
+#mxmlc.dir=${sdk.bin.dir}
+#player.dir=${sdk.dir}/in/player/11.1/mac/Flash Player Debugger.app/Contents/MacOS/
+#player=${player.dir}/Flash Player Debugger
+#use_browser=false
+browser=/Applications/Firefox.app/Contents/MacOS/firefox-bin
+
+# AIR used to be named Apollo.
+use_apollo=false
+apollo_location=${sdk.dir}
Propchange: incubator/flex/trunk/mustella/local.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/flex/trunk/mustella/mini_run.sh
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/mini_run.sh?rev=1333232&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/mini_run.sh (added)
+++ incubator/flex/trunk/mustella/mini_run.sh Wed May 2 22:44:38 2012
@@ -0,0 +1,1113 @@
+#!/bin/bash
+################################################################################
+##
+## 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.
+##
+################################################################################
+##
+## mini_run.sh - does an ant run on subdirectories.
+##
+
+if [ $# -lt 1 ]
+ then
+ echo "usage: mini_run.sh [FLAGS] <dir>|<file> ... "
+ echo ""
+ echo " where <dir> represents a top-level test directory. For example: "
+ echo " components/Menu"
+ echo ""
+ echo " or where <file> represents a specific test file. For example: "
+ echo " components/Menu/Properties/Menu_Properties.mxml"
+ echo ""
+ echo " You can specify any number of directories or files. (Delimited by spaces)"
+ echo " if you designate -caseName, you should only indicate one file"
+ echo ""
+ echo " where [FLAGS] represents optional flags (before other args). Currently supported: "
+ echo ""
+ echo " -addAntArg=<-Darg=val> - pass this arg to the ant script. may be repeated."
+ echo ""
+ echo " -addArg=<compilerArg> - pass this arg to the compile for this run. may be repeated."
+ echo ""
+ echo " -all - run ALL TESTCASES locally. Report only failures. "
+ echo " No other args should be used. This takes a long while. "
+ echo ""
+ echo " -apollo - (AIR) compile and run for AIR"
+ echo ""
+ echo " -bug=<bugID> - excludes normally, but include testcases associated with <bugID>"
+ echo ""
+ echo " -branch=<branch> - fetch excludes for the given branch "
+ echo ""
+ echo " -browser - run in default browser"
+ echo ""
+ echo " -caseName=<testcase> - runs <testcase>, if you have also designated a file. "
+ echo ""
+ echo " -covtimeout - add a 30 second additional timeout to run. separate from other timeouts"
+ echo ""
+ echo " -createImages - mixin the CreateBitmapReferences, to create baselines image files"
+ echo ""
+ echo " -doCheck - insert tests to database, checking keywords & duplicate testIDs"
+ echo ""
+ echo " -debug - add \"-debug\" to swf compilation "
+ echo ""
+ echo " -failures - run tests that failed last run (mini_run run)"
+ echo " 'Timed out' type failures will not be rerun"
+ echo ""
+ echo " -hurricane - ZIP and SEND files to hurricane server to create baselines."
+ echo " Use regular file/directory arguments."
+ echo " Will not run the tests locally. "
+ echo ""
+ echo " -imageDiff - mixin the EnableRemoteImageDiff include, to debug image compares"
+ echo ""
+
+ echo " -keep - (AIR) keep generated xml files in apollo run"
+ echo ""
+ echo " -kw=<keyword> - limit run to test cases with <keyword>"
+ echo " You can optionally indicate directories or files with -kw flags."
+ echo ""
+ echo " -mail=name@address send mail, if any, to this address only"
+ echo ""
+ echo " -myExcludes - do not fetch excludes from the database; use the ones already present in"
+ echo " qa/sdk/testsuites/mustella/tests"
+ echo ""
+ echo " -nofail - ignore failures and continue processesing. "
+ echo " REPORTS NO FAILURES. (useful for bitmap regeneration)"
+ echo ""
+ echo " -norun - don't run anything. If -doCheck, stop after that"
+ echo ""
+ echo " -port=<runner port> - specify a port that the Runner will listen on. Ordinarily"
+ echo " a user won't have to set this. "
+ echo " because this is passed at compile time as a mixin, the"
+ echo " only supported ports are 9999 and 10001"
+ echo ""
+ echo " -quick - Non-connectivity option: use existing excludes, skip cleanup"
+ echo ""
+ echo " -results=log - get results via flashlog. (server style. Not always possible)"
+ echo " -results=wire- get results over the wire. (the default)"
+ echo ""
+ echo " -retest=<bugID> - Run only the testcases associated with <bugID>. No file or dir args needed."
+ echo " This is a rather narrow sense of retest. Cannot be used detached from db"
+ echo ""
+ echo " -rerun - run cases already compiled. Useful if re-configuring runtimes"
+ echo " such as comparing standalone to browser, or browser to browser"
+ echo ""
+ echo " -skipExclude - run testcases, ignoring any exclusions in the database"
+ echo ""
+ echo " -smoke - run the testcases designated in smoke.properties. must"
+ echo " designate one or more directory arguments with this flag or use -all"
+ echo " also currently requires the presence of c:/tmp or /tmp on your machine"
+ echo " smoke.properties must be in the include text file format".
+ echo " designate directories or one or more smoke.properties files"
+ echo " for example: "
+ echo " ./mini_run.sh -smoke tests/components runs all of the smoke properties"
+ echo " found in the subdirectories under components"
+ echo " see: http://flexteam.macromedia.com/flexwiki/index.php/SDK:QA:mustella#Smoke_Tests"
+
+ echo " -sniffers - mixin ALL sniffers (Event,Mouse,Pixel,Object) and playback control"
+ echo ""
+
+ echo " -step_timeout=<seconds> - ADD <seconds> to every test case step to avoid timeouts. "
+ echo " useful in the context of running code coverage, etc. when "
+ echo " things can get rather slow"
+ echo ""
+ echo " -tier2 - run the testcases designated in tier2.properties files"
+ echo " See -smoke for expected behavior"
+ echo " "
+
+ echo ""
+ echo " -timeout=<seconds> - set global test timeout to <seconds> (an int value). "
+ echo ""
+ echo " -verbose - Show more console output"
+ echo ""
+ echo ""
+ echo ""
+
+ exit
+fi
+
+if [ "$ANT_HOME" = "" ]
+ then
+ echo "ANT_HOME is not set. Please set this variable"
+ exit
+fi
+
+propfile=properties/mustella_tmp.properties
+inherit_propfile=properties/mustella1.properties
+
+
+hurricane=0
+use_wire=true
+propfileName=mustella_tmp
+newFile=""
+cleanFile=""
+testName=""
+seenFile=""
+run_one_file=""
+skipcheck=1;
+skipexclude=false
+imageDiff=0
+sniffers=0
+createImages=0
+timeout=10000
+smoke=""
+print_passes=true
+run_all=0
+ant_target=run
+browser_run=""
+apollo_run=""
+exit_on_compile_error=true
+extra_arg=""
+port=9999
+keep=false
+find_our_own_files=false
+
+failed_only=0
+no_run=0
+
+beliteral=0
+
+check_air=`egrep "use_air" local.properties | egrep -v "^#" | awk -F"=" '{print $2}'`
+run_mobile_tests=`egrep "run_mobile_tests" local.properties | egrep -v "^#" | awk -F"=" '{print $2}'`
+
+os=`uname -s | tr '[A-Z]' '[a-z]'`
+tmp=`echo $os | egrep "cygwin"`
+
+if [ "$tmp" = "" ]
+ then
+ tmp=/tmp
+else
+ tmp=c:/tmp
+fi
+
+mkdir $tmp 2>/dev/null
+
+
+
+# arg_list=`echo "$*" | awk -f cleanup.awk `
+
+
+# echo "here is the arg list: $arg_list"
+
+# exit
+
+for i in "$@"
+do
+
+
+
+ if [ "$i" = "-docheck" ] || [ "$i" = "-doCheck" ]
+ then
+ skipcheck=0
+ continue
+ fi
+
+ if [ "$i" = "-skipexclude" ] || [ "$i" = "-skipExclude" ] || [ "$i" = "-skipexcludes" ] || [ "$i" = "-skipExcludes" ]
+ then
+ skipexclude=true
+ continue
+ fi
+
+ if [ "$i" = "-myExcludes" ]
+ then
+ antArgs="$antArgs -Dexcludes_done=true"
+ continue
+ fi
+
+ if [ "$i" = "-compileOnly" ]
+ then
+ compileOnly=1
+ continue
+ fi
+
+
+ if [ "$i" = "-failures" ]
+ then
+ failed_only=1
+
+ tmp0=-includes=IncludeFileLocation
+
+ if [ "$extra_arg" = "" ]
+ then
+ extra_arg="${tmp0}"
+ else
+ extra_arg="${extra_arg} $tmp0"
+ fi
+ continue
+ fi
+
+
+ if [ "$i" = "-verbose" ]
+ then
+ beVerbose=true
+ antArgs="$antArgs -Ddebug=true"
+ continue
+ fi
+
+ if [ "$i" = "-hurricane" ]
+ then
+ echo "HURRICANE noted, no local run"
+ hurricane=1
+
+ fi
+
+ if [ "$i" = "-nofail" ]
+ then
+ extra_arg=" ${extra_arg} -includes=NoFail "
+
+ fi
+
+ if [ "$i" = "-imageDiff" ]
+ then
+ imageDiff=1
+ extra_arg=" ${extra_arg} -includes=EnableRemoteImageDiff "
+ timeout=1440000
+ continue
+ fi
+
+ if [ "$i" = "-rerun" ]
+ then
+ ant_target=rerun
+ continue
+ fi
+
+ if [ "$i" = "-results=log" ]
+ then
+ antArgs="$antArgs -Dresult_include=-includes=SendFormattedResultsToLog -Dget_results_from_log=true"
+ use_wire=false
+ continue
+ fi
+
+ if [ "$i" = "-results=wire" ]
+ then
+ ## with vetting runs, use the log
+ if [ "$TEST_REVIEW" != "1" ]
+ then
+ antArgs="$antArgs -Dresult_include=-includes=SendResultsToRunner -Dget_results_from_log=false"
+ use_wire=true
+ fi
+ continue
+ fi
+
+ if [ "$run_mobile_tests" = "true" ]
+ then
+ use_wire=false
+ fi
+
+
+ if [ "$i" = "-keep" ]
+ then
+ keep=true
+ continue
+ fi
+
+ if [ "$i" = "-apollo" ]
+ then
+ apollo_run=" -Duse_apollo=true"
+ check_air=true
+ continue
+ fi
+
+ if [ "$i" = "-browser" ]
+ then
+ browser_run=" -Duse_browser=true"
+ continue
+ fi
+
+ if [ "$i" = "-norun" ]
+ then
+ no_run=1
+ continue
+ fi
+
+
+
+
+ if [ "$i" = "-all" ]
+ then
+ run_all=1
+ skipcheck=1
+ timeout=45
+ propfileName=mustella1
+ exit_on_compile_error=false
+ break_early=1
+ continue
+ fi
+
+
+ if [ "$i" = "-createImages" ]
+ then
+ createImages=1
+ extra_arg=" ${extra_arg} -includes=CreateBitmapReferences "
+ continue
+ fi
+
+ if [ "$i" = "-sniffers" ]
+ then
+ sniffers=1
+ extra_arg=" ${extra_arg} -includes=SendResultsToSnifferClient,SendFormattedResultsToLog,PlaybackControl,VerboseMode,EventSnifferRemote,ObjectSnifferRemote,PixelSnifferRemote,MouseSnifferRemote "
+ # antArgs=" ${antArgs} -Dexit_include=false"
+ antArgs=" ${antArgs} -Dexit_include=-includes=UnitTester"
+ timeout=1440000
+ continue
+ fi
+
+
+ if [ "$i" = "-smoke" ]
+ then
+ target=smoke
+ smoke=1
+ extra_arg=" ${extra_arg} -includes=IncludeFileLocation"
+ rm $tmp/IncludeList.txt
+ continue
+ fi
+
+ if [ "$i" = "-tier2" ]
+ then
+ target=tier2
+ smoke=1
+ extra_arg=" ${extra_arg} -includes=IncludeFileLocation"
+ rm $tmp/IncludeList.txt
+ continue
+ fi
+
+ if [ "$i" = "-debug" ]
+ then
+ extra_arg=" ${extra_arg} -debug"
+
+ fi
+
+
+ if [ "$i" = "-covtimeout" ]
+ then
+ extra_arg=" ${extra_arg} -includes=CoverageTimeout"
+ antArgs="$antArgs -Dcoverage_timeout=30000"
+
+ fi
+
+ if [ "$i" = "-quick" ]
+ then
+ antArgs="$antArgs -Dexcludes_done=true -Dnoclean.set=true"
+ fi
+
+
+
+ startsArgWith=`echo $i | awk '{printf ("%s", substr($1, 0, 4))}'`
+ if [ "$startsArgWith" = "-kw=" ]
+ then
+ echo "we are here: $i"
+ tmp0=`echo "$i" | sed -e 's/-kw=//' -e 's/ /@/g'`
+ # tmp0=`echo "$i" | awk '{printf ("%s", substr($1, 5))}'`
+ echo "we are here: $tmp0"
+
+ if [ "$keyword_list" != "" ]
+ then
+ keyword_list="$keyword_list,$tmp0"
+ else
+ keyword_list="$tmp0"
+ fi
+
+ echo $keyword_list
+
+ fi
+
+
+
+ startsArgWith=`echo $i | awk '{printf ("%s", substr($1, 0, 5))}'`
+
+ if [ "$startsArgWith" = "-port" ]
+ then
+ port=`echo $i | awk '{printf ("%s", substr($1, 7))}'`
+
+ ## we can only toggle port. the default is 9999;
+ ## if we want to change it, toggle
+ if [ "$port" != "9999" ]
+ then
+ [ "$extra_arg" = "" ] && extra_arg=" -Duser_args=-includes=RunnerPortAlt" || extra_arg=" ${extra_arg} -includes=RunnerPortAlt"
+
+ fi
+
+ continue
+ fi
+
+ if [ "$startsArgWith" = "-mail" ]
+ then
+ recip=`echo $i | awk '{printf ("%s", substr($1, 7))}'`
+
+ mailto=" -Drecipients=$recip -Dqa_recipients=$recip -Dalways_recipients=$recip "
+ echo "saw -mail, set to: $mailto"
+
+ continue
+ fi
+
+
+ startsArgWith=`echo $i | awk '{printf ("%s", substr($1, 0, 8))}'`
+
+ if [ "$startsArgWith" = "-branch=" ]
+ then
+ aBranch=`echo $i | awk '{ printf ("%s", substr($1, index($1, "=")+1))}'`
+
+ useBranch=$aBranch
+ antArgs=" ${antArgs} -Dbranch_name=${aBranch}"
+
+ fi
+
+ if [ "$startsArgWith" = "-retest=" ]
+ then
+ theBugID=`echo $i | awk '{ printf ("%s", substr($1, index($1, "=")+1))}'`
+ antArgs=" ${antArgs} -Dbug_retry=${theBugID} "
+ find_our_own_files=true
+
+ tmp0=-includes=IncludeFileLocation
+
+ if [ "$extra_arg" = "" ]
+ then
+ extra_arg="${tmp0}"
+ else
+ extra_arg="${extra_arg} $tmp0"
+ fi
+
+ # used to continue, but allow users to narrow the run
+ fi
+
+ startsArgWith=`echo $i | awk '{printf ("%s", substr($1, 0, 5))}'`
+ if [ "$startsArgWith" = "-bug=" ]
+ then
+ theBugID=`echo $i | awk '{ printf ("%s", substr($1, index($1, "=")+1))}'`
+ antArgs=" ${antArgs} -Dbug_retry=${theBugID} "
+ continue
+ fi
+
+
+ startsArgWith=`echo $i | awk '{printf ("%s", substr($1, 0, 9))}'`
+
+
+ if [ "$startsArgWith" = "-caseName" ]
+ then
+ testName=`echo $i | awk '{printf ("%s", substr($1, 11))}'`
+ continue
+ fi
+
+ if [ "$startsArgWith" = "-timeout=" ]
+ then
+ timeout=`echo $i | awk '{printf ("%s", substr($1, 10))}'`
+ continue
+ fi
+
+ if [ "$startsArgWith" = "-addAntAr" ]
+ then
+ tmp0=`echo $i | awk '{printf ("%s", substr($1, 12))}'`
+ antArgs="$antArgs $tmp0"
+ continue
+ fi
+
+ if [ "$startsArgWith" = "-step_tim" ]
+ then
+ tmp0=`echo $i | awk '{printf ("%s", substr($1, 15))}'`
+ antArgs="$antArgs -Dstep_timeout=$tmp0"
+ continue
+ fi
+
+ startsArgWith=`echo $i | awk '{printf ("%s", substr($1, 0, 7))}'`
+
+ if [ "$startsArgWith" = "-addArg" ]
+ then
+ tmp0=`echo $i | awk '{printf ("%s", substr($1, 9))}'`
+ if [ "$extra_arg" = "" ]
+ then
+ extra_arg="${tmp0}"
+ else
+ extra_arg="${extra_arg} $tmp0"
+ fi
+ continue
+ fi
+
+ startsWith=`echo $i | awk '{
+ x=$1;
+ y=substr($1, 0, index($1, "/"));
+ if (index(y, "/") > 0)
+ printf ( "%s", substr(y, 0, length(y)-1) )
+ else
+ printf ( "%s", y)}'`
+
+
+ if [ "$startsWith" = "tests" ]
+ then
+ ## trim it for Ant.
+ newi=`echo $i | awk '{printf ("%s", substr($1, 7))}'`
+ i=$newi
+ fi
+
+
+
+ ### okay, we dug this up, if it's a -f, we should
+ ### set a -D property for ant run_this_script.
+ ### otherwise, run a whole directory
+ ### the other args are the same, however. :(
+
+ tmpx=tests/${i}
+ # echo "Looking for $tmpx"
+
+ end=`echo $tmpx | awk -F"." '{print $NF}'`
+
+ if [ ! -f "$tmpx" ] && [ ! -d "$tmpx" ]
+ then
+ continue
+ fi
+
+
+ ## The case when a baseline or other asset gets checked in makes it difficult to
+ ## know what test to run. Lacking such definition, we run
+ ## all tests in that area.
+ if [ "$end" != "mxml" ] && [ ! -d "$tmpx" ]
+ then
+
+
+
+ dir=$tmpx
+ while :
+ do
+
+ ## this fails if the name contains a SWF already.
+ ## we're headed for a directory
+ correctspot=`ls $dir 2>/dev/null | egrep -i "SWFs|swfs"`
+
+ # echo "transform with correctspot: $correctspot"
+ #
+ # don't get fooled by files with "swf" in them
+ # move up until we find a swfs directory, or end up
+ # with nowhere to go
+ #
+ if [ "$correctspot" = "" ] || [ -f "$dir" ] && [ "$dir" != "." ]
+ then
+ # echo "doing dirname on $dir"
+ dir=`dirname $dir`
+ elif [ "$correctspot" != "" ] || [ "$dir" = "." ]
+ then
+ tmpx=$dir
+ # get rid of the leading /tests/
+ i=`echo $dir | awk '{printf ("%s", substr($1, 7))}'`
+ break
+ fi
+
+ done
+ # echo "result: $i"
+
+
+ fi
+
+
+ ## if break_early, we probably don't want to descend into this stuff.
+ ##
+
+
+ if [ "$break_early" = "1" ]
+ then
+ break
+ fi
+
+
+ if [ -f "$tmpx" ] || [ "$smoke" = "1" ]
+ then
+
+ # echo "It's a file"
+
+ ### new.
+
+ # was:
+ dir=`dirname $i`
+ dir=`dirname $dir`
+
+ is_mobile_test=`echo $dir | egrep "mobile"`
+ has_air=`echo $dir | egrep "apollo"`
+
+ if [ "$check_air" = "true" ] && [ "$has_air" = "" ] && [ "$TEST_REVIEW" = "1" ] && [ "$run_mobile_tests" != "true" ]
+ then
+ echo "AIR vetting run, but directory $dir is not an air test. Will not run it"
+ continue
+ fi
+
+ if [ "${run_mobile_tests}" != "true" ] && [ "$is_mobile_test" != "" ]
+ then
+ echo "Not a mobile server, and $dir is a mobile directory. Will not run it"
+ continue
+ fi
+
+ if [ "${run_mobile_tests}" = "true" ] && [ "$is_mobile_test" = "" ]
+ then
+ echo "Mobile server, and $dir is not a mobile directory. Will not run it."
+ continue
+ fi
+
+ end=`echo $tmpx | awk -F"." '{print $NF}'`
+
+ ## if it's not a .png file, just run the file. If it is a png file, we'll generalize the run
+ ## to the directory (not knowing any better)
+ if [ "$end" != "png" ]
+ then
+
+ ## append to a semicolon delimted list of individual files
+ if [ "$run_one_file" != "" ]
+ then
+ tmpz=`basename $i`
+ run_one_file="${run_one_file};${tmpz}"
+ else
+ run_one_file=`basename $i`
+ fi
+
+
+ fi
+
+ if [ "$smoke" = "1" ]
+ then
+
+
+ # constrain original directory
+
+ . ./make_smoke.sh $i $target
+
+ sdk_mustella_includes="${sdk_mustella_includes},${tmp_result}"
+ sdk_mustella_swfs="${sdk_mustella_swfs},${tmp_dir}"
+
+ else
+
+ sdk_mustella_includes="${sdk_mustella_includes},${i}"
+ sdk_mustella_swfs="${sdk_mustella_swfs},${dir}/**/*.swf"
+
+ fi
+
+ elif [ -d "$tmpx" ]
+ then
+
+
+ ### Figure out where we might be.
+ ### if this directory has .mxml or .png, we have to move up
+ ### to include the swfs directory.
+ ### anything else, we can assume they gave us the right thing
+
+ val=`ls $tmpx/*.mxml 2>/dev/null`
+ ret1=$?
+ val=`ls $tmpx/*.png 2>/dev/null`
+ ret2=$?
+
+
+ if [ $ret1 != 0 ] && [ $ret2 != 0 ]
+ then
+ beliteral=1
+ fi
+
+
+ dir=$tmpx
+ adjusted=0
+ lastdir=""
+ while :
+ do
+ if [ $beliteral = 1 ]
+ then
+ break
+ fi
+
+ correctspot=`ls $dir | egrep -i "SWFs|swfs"`
+
+ echo "at correctspot: $correctspot"
+
+
+ if [ "$correctspot" = "" ]
+ then
+ adjusted=1
+ dir=`dirname $dir`
+ [ "$beVerbose" = "true" ] && echo "at adjust dir: $dir"
+
+ [ "$dir" = "$lastdir" ] && echo "no change, abort" : lastdir=$dir
+ [ "$beVerbose" = "true" ] && echo " last dir: $lastdir"
+ [ "$lastdir" = "" ] && lastdir=$dir && echo "lastdir empty!"
+
+ else
+ ## clean off the "tests" front
+ tmpx=$dir
+ dir=`echo $dir | awk '{printf ("%s", substr($1, 7))}'`
+ break
+ fi
+
+ done
+
+ run_mobile_tests=`egrep "run_mobile_tests" local.properties | egrep -v "^#" | awk -F"=" '{print $2}'`
+ is_mobile_test=`echo $dir | egrep "mobile"`
+
+ if [ "$check_air" = "true" ] && [ "$has_air" = "" ] && [ "$TEST_REVIEW" = "1" ] && [ "$run_mobile_tests" != "true" ]
+ then
+ echo "AIR vetting run, but directory $dir is not an air test. Will not run it"
+ continue
+ fi
+
+ if [ "${run_mobile_tests}" != "true" ] && [ "$is_mobile_test" != "" ]
+ then
+ echo "Not a mobile server, and $dir is a mobile directory. Will not run it"
+ continue
+ fi
+
+ if [ "${run_mobile_tests}" = "true" ] && [ "$is_mobile_test" = "" ]
+ then
+ echo "Mobile server, and $dir is not a mobile directory. Will not run it."
+ continue
+ fi
+
+ if [ $adjusted = 1 ]
+ then
+
+ ## we need to add a swf directory
+ ##
+
+ sdk_mustella_includes=${dir}/${correctspot}/**/*.mxml,${sdk_mustella_includes}
+ sdk_mustella_swfs=${dir}/${correctspot}/**/*.swf,${sdk_mustella_swfs}
+
+
+ fi
+
+
+ ### can we lighten up about the commas? just have a leading comma, big deal
+
+ if [ "$sdk_mustella_includes" != "" ]
+ then
+ sdk_mustella_includes="${sdk_mustella_includes},${i}/**/*.mxml"
+ sdk_mustella_swfs="${sdk_mustella_swfs},${i}/**/*.swf"
+ else
+ sdk_mustella_includes="${i}/**/*.mxml"
+ sdk_mustella_swfs="${i}/**/*.swf"
+ fi
+
+ else
+
+ echo "Not found"
+
+ fi
+
+
+
+done
+
+
+
+### special case: the -smoke and -all case is problematic
+if [ "$smoke" = "1" ] && [ "$run_all" = "1" ]
+ then
+
+ ## special case, all and smoke
+ propfileName=mustella_tmp
+ print_passes=true
+
+ # make smoke sets tmp_result and tmp_dir
+ . ./make_smoke.sh tests $target
+
+
+ sdk_mustella_includes="${tmp_result}"
+ sdk_mustella_swfs="${tmp_dir}"
+
+
+fi
+
+
+
+rm $propfile 2>/dev/null
+
+
+if [ "$sdk_mustella_includes" = "" ] && [ "$run_all" = "0" ] && [ "$find_our_own_files" = "false" ] && [ "$failed_only" = "0" ] && [ "$keyword_list" = "" ]
+ then
+ echo "Nothing was found to include. Will exit"
+ exit 1
+fi
+
+
+egrep "sdk.mustella.excludes" $inherit_propfile | awk -f clobber.awk > $propfile
+egrep "apollo_only_excludes" $inherit_propfile | awk -f clobber.awk >> $propfile
+
+
+
+if [ "$find_our_own_files" = "true" ]
+ then
+
+ echo "Querying for test files..."
+
+ $ANT_HOME/bin/ant -Dbug_retry=$theBugID query_from_bug_id
+
+
+ ### if there's nothing to run, figure out the includes automatically.
+ ### Otherwise, use what we're given
+ if [ "$sdk_mustella_includes" = "" ]
+ then
+
+ echo " " >> $propfile
+ echo " " >> $propfile
+ echo "sdk.mustella.swfs=**/*.swf" >> $propfile
+ sort -u tmp_mustella_tmp | egrep -v "rows affected" | awk 'BEGIN { printf ("sdk.mustella.includes=")}{printf ("%s,", $NF)}' >> $propfile
+
+ egrep -v "rows affected" ${tmp}/IncludeList.txt.tmp > ${tmp}/IncludeList.txt
+ else
+
+ egrep -v "rows affected" ${tmp}/IncludeList.txt.tmp > ${tmp}/IncludeList.txt
+ echo "sdk.mustella.includes=${sdk_mustella_includes}" >> $propfile
+ echo "sdk.mustella.swfs=${sdk_mustella_swfs}" >> $propfile
+
+
+ fi
+
+elif [ "$failed_only" = "1" ]
+ then
+
+ input=failures.txt
+
+
+ list_of_files=`awk '{if (NF > 1) {print $1}}' $input | sort -u`
+
+
+ for i in $list_of_files
+ do
+
+
+ derived_swf=`dirname $i`
+ derived_swf=`dirname $derived_swf`
+
+ ## create the ant fileset type includes
+
+ tmp0list="$tmp0list,${i}.mxml"
+
+
+ if [ -d "tests/${derived_swf}/SWFs" ]
+ then
+ ## backflips for windows because it will match either:
+ f_lower=`ls "tests/${derived_swf}" | egrep "swfs"`
+ [ $? = 0 ] && swf0list="$swf0list,$derived_swf/swfs/*.swf" || swf0list="$swf0list,$derived_swf/SWFs/*.swf"
+
+
+ ## on unix(mac) the guess is that it would actually match correctly
+ elif [ -d "tests/${derived_swf}/swfs" ]
+ then
+ echo "Matched lower"
+ swf0list="$swf0list,$derived_swf/swfs/*.swf"
+
+
+ fi
+
+ done
+
+ ## write properties file
+ echo "sdk.mustella.includes=${tmp0list}" >> $propfile
+ # echo "sdk.mustella.swfs=**/*.swf" >> $propfile
+ echo "sdk.mustella.swfs=$swf0list" >> $propfile
+
+
+ ## write include file
+ outfile=$tmp/IncludeList.txt
+ cat $input | sed -e '/^$/d' -e 's/ /$/' > $outfile
+
+elif [ "$keyword_list" != "" ]
+ then
+
+ ## this target calls a task that takes the keywords and
+ ## creates an include list
+ ## and uses any includes to limit the include set
+
+
+ echo "Feeding mustella includes: $sdk_mustella_includes"
+
+ if [ "$sdk_mustella_includes" = "" ]
+ then
+ "$ANT_HOME/bin/ant" write_keyword_includes -Dkeyword_list=$keyword_list
+ else
+ "$ANT_HOME/bin/ant" write_keyword_includes -Dkeyword_list=$keyword_list -Dsdk.mustella.includes="$sdk_mustella_includes"
+ fi
+
+ ret=$?
+ echo "Return from ant was: $ret"
+
+
+ if [ "$ret" != "0" ]
+ then
+ echo "Failure in the keyword run setup. See above errors. Sorry, exiting"
+ exit 1;
+ fi
+
+ egrep "sdk.mustella.includes" .tmp_file_list >> $propfile
+ ## this one is a bit of a hack:
+ echo "sdk.mustella.swfs=**/*.swf" >> $propfile
+
+
+
+ here=`pwd`
+
+ ## clean that out.
+
+ cleaning=`echo $here | egrep "cygdrive"`
+
+ if [ "$cleaning" != "" ]
+ then
+ # /cygdrive/c/depot_tmp/depot/flex/qa/sdk/testsuites/mustella
+ here=`echo $here | sed -e 's/\/cygdrive\/\([A-Za-z]\)/\1:/'`
+
+ fi
+
+
+ [ -d classes ] || mkdir classes
+
+
+
+ extra_arg="${extra_arg} -includes=CurrentIncludeList"
+ extra_arg="${extra_arg} -source-path+=${here}/classes";
+
+ ### NEED THE ARGS
+
+else
+
+
+echo "sdk.mustella.includes=${sdk_mustella_includes}" >> $propfile
+echo "sdk.mustella.swfs=${sdk_mustella_swfs}" >> $propfile
+
+
+
+fi
+
+
+# echo "sdk.mustella.includes=${sdk_mustella_includes}"
+# echo "sdk.mustella.swfs=${sdk_mustella_swfs}"
+
+
+
+## defaults for results fetching.
+# mini run defaults to over-the-wire results fetching (except for vetting (TEST_REVIEW))
+if [ "$use_wire" = "true" ]
+ then
+
+ rezIsSet=`echo "$antArgs" | egrep "SendResultsToRunner"`
+
+ if [ "$rezIsSet" = "" ] && [ "$TEST_REVIEW" != "1" ]
+ then
+ antArgs="$antArgs -Dresult_include=-includes=SendResultsToRunner -Dget_results_from_log=false"
+ fi
+
+
+fi
+
+
+
+
+
+# avoid race to know where the build lives (hack)
+mkdir build 2>/dev/null
+mkdir build/lib 2>/dev/null
+
+## give a run id so it doesn't bother getting one (we don't care).
+
+if [ "$skipcheck" = "0" ] || [ "$TEST_REVIEW" = "1" ]
+ then
+ echo "Running testcase checks/inserts...."
+
+ ## test review implies an attended, server run
+ if [ "$TEST_REVIEW" = "1" ]
+ then
+ echo "As test review"
+ echo "$ANT_HOME/bin/ant $mailto -Dfork_compile=true -Dsend_check_email=true -Dfeature=mustella_tmp -Dport=${port} insert_tests"
+ "$ANT_HOME/bin/ant" $mailto $antArgs -Dfork_compile=true -Dsend_check_email=true -Dfeature=mustella_tmp -Dport=${port} insert_tests
+ ret=$?
+ else
+ echo "$ANT_HOME/bin/ant $mailto $antArgs -Dfail_on_testcase_check=true -Dfork_compile=true -Dsend_check_email=false -Ddebug_insert=true -Dfeature=mustella_tmp -Dport=$port insert_tests"
+ "$ANT_HOME/bin/ant" $mailto $antArgs -Dfail_on_testcase_check=true -Dfork_compile=true -Dsend_check_email=false -Ddebug_insert=true -Dfeature=mustella_tmp -Dport=${port} insert_tests
+ ret=$?
+ fi
+
+ ### NEED THE ARGS
+
+ if [ "$ret" != "0" ]
+ then
+ echo "Bad return from testcase check. exiting."
+ exit 1
+ fi
+else
+ echo "Skipping testcase check"
+
+fi
+
+
+
+if [ "$TEST_REVIEW" = "1" ]
+ then
+
+ echo "Doing this as a Test Review."
+ ant_target=sendResults
+
+ ## let it mail a compile error
+ ## we'll do a comparison, so we need the database
+
+ timeout=45
+
+ echo $ANT_HOME/bin/ant -Dsave_failures=true $mailto -Dfork_compile=true -Drun_type=mini -Dexit_on_compile_error=false -Dinsert_results=true -Dfeature=mustella_tmp -Dsubject="$subject" -Dsocket_mixin=SocketAddress -Dport=${port} -Dauto_exclude=true -Dflex_version=$flex_version -Dbuild_version=$build_version -Duser_args=${extra_arg} $recipients $qa_recipients $always_recipients $antArgs -Dserver_time="$server_time" -Ddb_time="$db_time" $ant_target -Dplayer.timeout=$timeout $apollo_run
+
+ "$ANT_HOME/bin/ant" -Dsave_failures=true $mailto -Dfork_compile=true -Drun_type=mini -Dexit_on_compile_error=false -Dinsert_results=true -Dfeature=mustella_tmp -Dsocket_mixin=SocketAddress -Dport=${port} -Dauto_exclude=true -Dflex_version=$flex_version -Dbuild_version=$build_version -Duser_args=${extra_arg} $recipients $qa_recipients $always_recipients $antArgs -Dserver_time="$server_time" -Ddb_time="$db_time" $ant_target -Dplayer.timeout=$timeout $apollo_run
+
+elif [ "$hurricane" = "1" ]
+ then
+ echo "hurricane!"
+
+
+ ## the generalized swfs piece:
+ # tmp_hur=`echo ${sdk_mustella_swfs} | sed -e 's/\*\*/swfs/' -e 's/\*.swf/**/'`
+ tmp_hur=`echo ${sdk_mustella_swfs} | sed -e 's/\*\*/swfs/' -e 's/\*\*/swfs/' -e 's/\*.swf/**/'`
+ tmp_hur2=`echo ${sdk_mustella_swfs} | sed -e 's/\*\*/SWFs/'`
+
+
+ if [ "$useBranch" = "" ]
+ then
+ branchArg=""
+ else
+ branchArg="-Dbranch_name=$useBranch"
+ fi
+
+
+
+ $ANT_HOME/bin/ant zip_materials $branchArg -Dsdk.mustella.includes.send="${sdk_mustella_includes},${tmp_hur},${tmp_hur2}"
+
+
+else
+
+
+
+ if [ "$compileOnly" = "1" ]
+ then
+ ant_target=compileLite
+ exit_on_compile_error=false
+ fi
+
+ if [ "$extra_arg" = "" ]
+ then
+ extra_arg="-includes=SetShowRTE"
+ else
+ extra_arg="${extra_arg} -includes=SetShowRTE"
+ fi
+
+
+ echo "Doing a regular mini run"
+
+
+ if [ "$beVerbose" = "true" ]
+ then
+ echo $ANT_HOME/bin/ant $mailto -Dfork_compile=true -Dcurrent.run.id=-1 -Dexit_on_compile_error=$exit_on_compile_error -Dinsert_results=false -Dokay_to_exit=true -Dskip_exclude=${skipexclude} -Dfeature=${propfileName} -Dinclude_list=${testName} -Dplayer.timeout=$timeout -Dprint_passes=$print_passes -Dsave_failures=true $browser_run $apollo_run -Duser_args="${extra_arg}" -Dport=${port} -Dflex_version=$flex_version -Dbuild_version=$build_version $antArgs $ant_target -Dkeep_air=$keep
+ fi
+
+
+ "$ANT_HOME/bin/ant" $mailto -Dfork_compile=true -Dcurrent.run.id=-1 -Dexit_on_compile_error=$exit_on_compile_error -Dinsert_results=false -Dokay_to_exit=true -Dskip_exclude=${skipexclude} -Dfeature=${propfileName} -Dinclude_list=${testName} -Dplayer.timeout=$timeout -Dprint_passes=$print_passes -Dsave_failures=true $browser_run $apollo_run -Duser_args="${extra_arg}" -Dport=${port} -Dflex_version=$flex_version -Dbuild_version=$build_version $antArgs -Dserver_time="$server_time" $ant_target -Dkeep_air=$keep
+
+fi
+
+
+
+
+
Propchange: incubator/flex/trunk/mustella/mini_run.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/flex/trunk/mustella/mini_run.sh
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/flex/trunk/mustella/properties/mustella1.properties
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/properties/mustella1.properties?rev=1333232&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/properties/mustella1.properties (added)
+++ incubator/flex/trunk/mustella/properties/mustella1.properties Wed May 2 22:44:38 2012
@@ -0,0 +1,25 @@
+################################################################################
+##
+## 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.
+##
+################################################################################
+sdk.mustella.excludes=LangPacks/Danish/**/*.mxml,LangPacks/German/**/*.mxml,LangPacks/Spanish/**/*.mxml,LangPacks/Finnish/**/*.mxml,LangPacks/French/**/*.mxml,LangPacks/Italian/**/*.mxml,LangPacks/Korean/**/*.mxml,LangPacks/Norwegian/**/*.mxml,LangPacks/Dutch/**/*.mxml,LangPacks/Portuguese/**/*.mxml,LangPacks/Russian/**/*.mxml,LangPacks/Swedish/**/*.mxml,LangPacks/ChineseSimplified/**/*.mxml,LangPacks/ChineseTraditional/**/*.mxml,DMV/**/*.mxml,charts/**/*.mxml,components/**/Backups/**/*.mxml,components/SWFLoader/SWFs/assets/*.swf,components/HorizontalList/**/HorizontalList_DataProvider.mxml,components/TileList/**/TileList_DataProvider.mxml,containers/Panel/**/Panel_ConstraintBindingTests.mxml,components/DataGrid/Bugs/datagrid_Bugs_bc.mxml,SkinningImprovements/**/*.mxml,SkinStates/**/*.mxml,components/TreeDMV/**/*.mxml,genericloader/**/*.mxml,Samples/Flexstore/**/*.mxml,gumbo/components/Button/styles/FxButton_textStyles_tester.mxml,gumbo/components/CheckBox/styles/FxCheckBox_
textStyles_tester.mxml,spark/effects/AnimateTransformRotate3D/**/*.mxml,gumbo/components/PopUpAnchor/Properties/PopUpAnchor_Properties_MP.mxml,CompiletimeLocalization/**/*.mxml,resources/ResourceBundle/Methods/**/*.mxml,spark/components/VideoPlayer/**/*.mxml,spark/components/VideoDisplay/**/*.mxml,LangPacks/Spark/**/*.mxml
+
+
+apollo_only_excludes=resources/Integration/Compiler/**/*.mxml
+
+sdk.mustella.swfs=**/*.swf
+sdk.mustella.includes=**/*.mxml
Propchange: incubator/flex/trunk/mustella/properties/mustella1.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/flex/trunk/mustella/properties/mustella_tmp.properties
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/properties/mustella_tmp.properties?rev=1333232&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/properties/mustella_tmp.properties (added)
+++ incubator/flex/trunk/mustella/properties/mustella_tmp.properties Wed May 2 22:44:38 2012
@@ -0,0 +1,4 @@
+sdk.mustella.excludes=LangPacks/Spark/**/*.mxml,spark/components/VideoDisplay/**/*.mxml,spark/components/VideoPlayer/**/*.mxml,resources/ResourceBundle/Methods/**/*.mxml,CompiletimeLocalization/**/*.mxml,gumbo/components/PopUpAnchor/Properties/PopUpAnchor_Properties_MP.mxml,spark/effects/AnimateTransformRotate3D/**/*.mxml,gumbo/components/CheckBox/styles/FxCheckBox_textStyles_tester.mxml,gumbo/components/Button/styles/FxButton_textStyles_tester.mxml,Samples/Flexstore/**/*.mxml,genericloader/**/*.mxml,components/TreeDMV/**/*.mxml,SkinStates/**/*.mxml,SkinningImprovements/**/*.mxml,components/DataGrid/Bugs/datagrid_Bugs_bc.mxml,containers/Panel/**/Panel_ConstraintBindingTests.mxml,components/TileList/**/TileList_DataProvider.mxml,components/HorizontalList/**/HorizontalList_DataProvider.mxml,components/SWFLoader/SWFs/assets/*.swf,components/**/Backups/**/*.mxml,charts/**/*.mxml,DMV/**/*.mxml,LangPacks/ChineseTraditional/**/*.mxml,LangPacks/ChineseSimplified/**/*.mxml,LangPacks/
Swedish/**/*.mxml,LangPacks/Russian/**/*.mxml,LangPacks/Portuguese/**/*.mxml,LangPacks/Dutch/**/*.mxml,LangPacks/Norwegian/**/*.mxml,LangPacks/Korean/**/*.mxml,LangPacks/Italian/**/*.mxml,LangPacks/French/**/*.mxml,LangPacks/Finnish/**/*.mxml,LangPacks/Spanish/**/*.mxml,LangPacks/German/**/*.mxml,LangPacks/Danish/**/*.mxml,
+apollo_only_excludes=resources/Integration/Compiler/**/*.mxml,
+sdk.mustella.includes=components/Button//**/*.mxml
+sdk.mustella.swfs=components/Button//**/*.swf
Propchange: incubator/flex/trunk/mustella/properties/mustella_tmp.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/flex/trunk/mustella/scripts/shellrunner.sh
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/scripts/shellrunner.sh?rev=1333232&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/scripts/shellrunner.sh (added)
+++ incubator/flex/trunk/mustella/scripts/shellrunner.sh Wed May 2 22:44:38 2012
@@ -0,0 +1,99 @@
+#!/bin/sh
+################################################################################
+##
+## 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.
+##
+################################################################################
+
+
+### multi process shellrunner
+
+max=${NUMBER_OF_PROCESSORS:=1}
+j=0
+i=0
+
+list=($*)
+
+len=${#list[*]}
+
+while [ $i -lt $len ]
+do
+
+
+while [ $j -lt $max ]
+do
+
+
+dir=`dirname ${list[$i]} 2>/dev/null`
+file=`basename ${list[$i]} 2>/dev/null`
+
+cd $dir
+ret=$?
+if [ $ret != 0 ]
+ then
+ echo "Error, could not cd to $dir. Skipping $i"
+ i=$((i+1))
+ continue
+fi
+
+
+if [ -f $file ] && [ "$file" != "" ]
+ then
+ echo "next: $file $i"
+ ./$file > ${file}.${i}.log 2>&1 &
+else
+ echo "skipping $file not found"
+fi
+
+
+j=$((j+1))
+i=$((i+1))
+
+done
+
+j=`jobs -pr | wc -l`
+# echo $maybe
+
+while [ $j -ge $max ]
+do
+
+# echo "j is $j, sleeping 5"
+sleep 5
+j=`jobs -pr | wc -l`
+
+done
+
+
+done
+
+
+## now we have to wait for them to be done
+
+j=`jobs -pr | wc -l`
+while [ $j -gt 0 ]
+do
+j=`jobs -pr | wc -l`
+
+# echo "waiting for processes to finish, j is $j"
+
+sleep 5
+
+
+done
+
+echo "done with pre compile step"
+
+# jobs
Propchange: incubator/flex/trunk/mustella/scripts/shellrunner.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/flex/trunk/mustella/scripts/shellrunner.sh
------------------------------------------------------------------------------
svn:executable = *