Commit:    602c823016582d3f1aa28a898f4a8a35476951e6
Author:    Matt Ficken <v-maf...@microsoft.com>         Tue, 24 Sep 2013 
11:15:24 -0700
Parents:   7e27a9bccb6ca6785a9f4caedc4021a8784fdf19
Branches:  master

Link:       
http://git.php.net/?p=pftt2.git;a=commitdiff;h=602c823016582d3f1aa28a898f4a8a35476951e6

Log:
updating application test-packs


Former-commit-id: 75f37baaa571158b6f43f504af9caaf76652bec2

Changed paths:
  D  app/Joomla_3.0.2-Stable-Full_Package.7z
  D  app/SemanticMediaWiki1.8.7z
  D  app/azure-sdk-for-php-master.7z
  D  app/drupal-7.18.7z
  D  app/mediawiki-1.20.2.7z.REMOVED.git-id
  D  app/phpBB-3.0.11.7z
  D  app/phpMyAdmin-3.4.9-all-languages.7z
  D  app/symfony-standard-2.1.8.7z
  D  app/wordpress-tests.7z.REMOVED.git-id
  M  conf/app/appleseed.groovy
  M  conf/app/azure_sdk.groovy
  M  conf/app/drupal.groovy
  M  conf/app/joomla.groovy
  M  conf/app/mediawiki.groovy
  M  conf/app/phpbb3.groovy
  M  conf/app/phpmyadmin.groovy
  M  conf/app/semantic_mediawiki.groovy
  M  conf/app/typo3.groovy
  M  conf/app/wordpress.groovy
  M  conf/cake_php.groovy
  M  src/com/mostc/pftt/host/AHost.java
  M  src/com/mostc/pftt/model/app/PhpUnitSourceTestPack.java

diff --git a/app/Joomla_3.0.2-Stable-Full_Package.7z 
b/app/Joomla_3.0.2-Stable-Full_Package.7z
deleted file mode 100644
index 4189748..0000000
Binary files a/app/Joomla_3.0.2-Stable-Full_Package.7z and /dev/null differ
diff --git a/app/SemanticMediaWiki1.8.7z b/app/SemanticMediaWiki1.8.7z
deleted file mode 100644
index 2ded692..0000000
Binary files a/app/SemanticMediaWiki1.8.7z and /dev/null differ
diff --git a/app/azure-sdk-for-php-master.7z b/app/azure-sdk-for-php-master.7z
deleted file mode 100644
index 642e47b..0000000
Binary files a/app/azure-sdk-for-php-master.7z and /dev/null differ
diff --git a/app/drupal-7.18.7z b/app/drupal-7.18.7z
deleted file mode 100644
index 992cccb..0000000
Binary files a/app/drupal-7.18.7z and /dev/null differ
diff --git a/app/mediawiki-1.20.2.7z.REMOVED.git-id 
b/app/mediawiki-1.20.2.7z.REMOVED.git-id
deleted file mode 100644
index 0923473..0000000
--- a/app/mediawiki-1.20.2.7z.REMOVED.git-id
+++ /dev/null
@@ -1 +0,0 @@
-f368df7c62ff59f724e16db7d1ecd13f1cfed3ea
\ No newline at end of file
diff --git a/app/phpBB-3.0.11.7z b/app/phpBB-3.0.11.7z
deleted file mode 100644
index 60c2c9a..0000000
Binary files a/app/phpBB-3.0.11.7z and /dev/null differ
diff --git a/app/phpMyAdmin-3.4.9-all-languages.7z 
b/app/phpMyAdmin-3.4.9-all-languages.7z
deleted file mode 100644
index 18723e4..0000000
Binary files a/app/phpMyAdmin-3.4.9-all-languages.7z and /dev/null differ
diff --git a/app/symfony-standard-2.1.8.7z b/app/symfony-standard-2.1.8.7z
deleted file mode 100644
index d9cd08e..0000000
Binary files a/app/symfony-standard-2.1.8.7z and /dev/null differ
diff --git a/app/wordpress-tests.7z.REMOVED.git-id 
b/app/wordpress-tests.7z.REMOVED.git-id
deleted file mode 100644
index 1f7fc77..0000000
--- a/app/wordpress-tests.7z.REMOVED.git-id
+++ /dev/null
@@ -1 +0,0 @@
-17f4adbfbde0050c3a4f5a46a234107e46d55364
\ No newline at end of file
diff --git a/conf/app/appleseed.groovy b/conf/app/appleseed.groovy
index 9559cae..c4af9a0 100644
--- a/conf/app/appleseed.groovy
+++ b/conf/app/appleseed.groovy
@@ -19,7 +19,7 @@ class AppleseedPhpUnitTestPack extends PhpUnitSourceTestPack {
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
                return host.getPfttDir()+"/cache/working/Appleseed";
        }
        
diff --git a/conf/app/azure_sdk.groovy b/conf/app/azure_sdk.groovy
index 86decb9..2fd6d43 100644
--- a/conf/app/azure_sdk.groovy
+++ b/conf/app/azure_sdk.groovy
@@ -15,7 +15,9 @@ class AzureSDKPhpUnitTestPack extends PhpUnitSourceTestPack {
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
+               ensureAppDecompressed(cm, host, "azure-sdk-for-php.7z")
+               
                return host.getPfttDir()+"/cache/working/azure-sdk-for-php";
        }
        
diff --git a/conf/app/drupal.groovy b/conf/app/drupal.groovy
index 0a16071..8d1762b 100644
--- a/conf/app/drupal.groovy
+++ b/conf/app/drupal.groovy
@@ -19,8 +19,10 @@ class DrupalPhpUnitTestPack extends 
RequiredDatabasePhpUnitSourceTestPack {
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
-               return host.getPfttDir()+"/cache/working/drupal-8.x-dev";
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
+               ensureAppDecompressed(cm, host, "drupal-8.7z")
+               
+               return host.getPfttDir()+"/cache/working/drupal-8";
        }
        
        @Override
diff --git a/conf/app/joomla.groovy b/conf/app/joomla.groovy
index 55fe851..ca3141f 100644
--- a/conf/app/joomla.groovy
+++ b/conf/app/joomla.groovy
@@ -26,7 +26,9 @@ class JoomlaPlatformPhpUnitTestPack extends 
OptionalDatabasePhpUnitSourceTestPac
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
+               ensureAppDecompressed(cm, host, "joomla-platform.7z")
+               
                return host.getPfttDir()+"/cache/working/joomla-platform";
        }
 
diff --git a/conf/app/mediawiki.groovy b/conf/app/mediawiki.groovy
index aa0af99..a9abf80 100644
--- a/conf/app/mediawiki.groovy
+++ b/conf/app/mediawiki.groovy
@@ -16,8 +16,10 @@ class MediaWikiPhpUnitTestPack extends 
RequiredDatabasePhpUnitSourceTestPack {
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
-               return host.getPfttDir()+"/cache/working/mediawiki-1.20.2";
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
+               ensureAppDecompressed(cm, host, "mediawiki")
+               
+               return host.getPfttDir()+"/cache/working/mediawiki";
        }
        
        @Override
diff --git a/conf/app/phpbb3.groovy b/conf/app/phpbb3.groovy
index 688b358..c67b75d 100644
--- a/conf/app/phpbb3.groovy
+++ b/conf/app/phpbb3.groovy
@@ -22,7 +22,9 @@ class PhpBB3PhpUnitTestPack extends 
RequiredDatabasePhpUnitSourceTestPack {
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
+               ensureAppDecompressed(cm, host, "phpbb3.7z")
+               
                return host.getPfttDir()+"/cache/working/phpbb3";
        }
        
diff --git a/conf/app/phpmyadmin.groovy b/conf/app/phpmyadmin.groovy
index 2715423..7d66b66 100644
--- a/conf/app/phpmyadmin.groovy
+++ b/conf/app/phpmyadmin.groovy
@@ -15,7 +15,7 @@ class PhpMyAdminPhpUnitTestPack extends 
RequiredDatabasePhpUnitSourceTestPack {
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
                return host.getPfttDir()+"/cache/working/phpmyadmin";
        }
        
diff --git a/conf/app/semantic_mediawiki.groovy 
b/conf/app/semantic_mediawiki.groovy
index de5c4ff..cec084c 100644
--- a/conf/app/semantic_mediawiki.groovy
+++ b/conf/app/semantic_mediawiki.groovy
@@ -19,8 +19,10 @@ class SemanticMediaWikiPhpUnitTestPack extends 
RequiredDatabasePhpUnitSourceTest
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
-               return host.getPfttDir()+"/cache/working/SemanticMediaWiki1.8";
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
+               ensureAppDecompressed(cm, host, "SemanticMediaWiki.7z")
+               
+               return host.getPfttDir()+"/cache/working/SemanticMediaWiki";
        }
        
        @Override
diff --git a/conf/app/typo3.groovy b/conf/app/typo3.groovy
index 10b6892..731716f 100644
--- a/conf/app/typo3.groovy
+++ b/conf/app/typo3.groovy
@@ -7,7 +7,7 @@ class Typo3PhpUnitTestPack extends PhpUnitSourceTestPack {
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
                return host.getPfttDir()+"/cache/working/typo3";
        }
        
diff --git a/conf/app/wordpress.groovy b/conf/app/wordpress.groovy
index ff7dc84..bfd6ce4 100644
--- a/conf/app/wordpress.groovy
+++ b/conf/app/wordpress.groovy
@@ -23,7 +23,9 @@ class WordpressPhpUnitTestPack extends 
RequiredDatabasePhpUnitSourceTestPack {
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
+               ensureAppDecompressed(cm, host, "wordpress-tests.7z")
+               
                return host.getPfttDir()+"/cache/working/wordpress-tests";
        }
        
diff --git a/conf/cake_php.groovy b/conf/cake_php.groovy
index 08b2174..adf4c3f 100644
--- a/conf/cake_php.groovy
+++ b/conf/cake_php.groovy
@@ -7,7 +7,7 @@ class CakePhpUnitTestPack extends PhpUnitSourceTestPack {
        }
        
        @Override
-       protected String getSourceRoot(AHost host) {
+       protected String getSourceRoot(ConsoleManager cm, AHost host) {
                return host.getPfttDir()+"/cache/working/cakephp";
        }
        
diff --git a/src/com/mostc/pftt/host/AHost.java 
b/src/com/mostc/pftt/host/AHost.java
index d7d2c0a..71461e4 100644
--- a/src/com/mostc/pftt/host/AHost.java
+++ b/src/com/mostc/pftt/host/AHost.java
@@ -716,9 +716,12 @@ public abstract class AHost extends Host implements 
IProgramRunner {
        public boolean decompress(ConsoleManager cm, AHost ohost, String 
zip7_file, String dst) throws IllegalStateException, IOException, Exception {
                ensure7Zip(cm, ohost);
                
+               zip7_file = fixPath(zip7_file);
+               dst = fixPath(dst);
+               
                String output_dir = dst;
                mkdirs(output_dir);
-               
+
                if (cm!=null)
                        cm.println(EPrintType.IN_PROGRESS, getClass(), 
"decompress output_dir="+output_dir+" zip7_file="+zip7_file);
                
diff --git a/src/com/mostc/pftt/model/app/PhpUnitSourceTestPack.java 
b/src/com/mostc/pftt/model/app/PhpUnitSourceTestPack.java
index 4e5facc..a0cb140 100644
--- a/src/com/mostc/pftt/model/app/PhpUnitSourceTestPack.java
+++ b/src/com/mostc/pftt/model/app/PhpUnitSourceTestPack.java
@@ -428,7 +428,7 @@ public abstract class PhpUnitSourceTestPack implements 
SourceTestPack<PhpUnitAct
 
        @Override
        public PhpUnitActiveTestPack installInPlace(ConsoleManager cm, AHost 
host) throws Exception {
-               final String src_root = getSourceRoot(new LocalHost());
+               final String src_root = getSourceRoot(cm, new LocalHost());
                addIncludeDirectory(src_root);
                if (!new File(src_root).isDirectory()) {
                        throw new IOException("source-test-pack not found: 
"+src_root);
@@ -442,7 +442,7 @@ public abstract class PhpUnitSourceTestPack implements 
SourceTestPack<PhpUnitAct
 
        @Override
        public PhpUnitActiveTestPack installNamed(ConsoleManager cm, AHost 
host, String string, List<PhpUnitTestCase> test_cases) throws 
IllegalStateException, IOException, Exception {
-               final String src_root = getSourceRoot(new LocalHost());
+               final String src_root = getSourceRoot(cm, new LocalHost());
                addIncludeDirectory(src_root);
                if (!new File(src_root).isDirectory()) {
                        throw new IOException("source-test-pack not found: 
"+src_root);
@@ -459,7 +459,7 @@ public abstract class PhpUnitSourceTestPack implements 
SourceTestPack<PhpUnitAct
                        String local_test_pack_dir, String remote_test_pack_dir)
                        throws IllegalStateException, IOException, Exception {
                LocalHost local_host = new LocalHost();
-               final String src_root = getSourceRoot(local_host);
+               final String src_root = getSourceRoot(cm, local_host);
                addIncludeDirectory(src_root);
                if (!new File(src_root).isDirectory()) {
                        throw new IOException("source-test-pack not found: 
"+src_root);
@@ -476,13 +476,27 @@ public abstract class PhpUnitSourceTestPack implements 
SourceTestPack<PhpUnitAct
                return new PhpUnitActiveTestPack(local_test_pack_dir, 
remote_test_pack_dir);
        }
        
+       private boolean decompressed = false;
+       protected void ensureAppDecompressed(ConsoleManager cm, AHost host, 
String zip7_file) throws IllegalStateException, IOException, Exception {
+               if (decompressed)
+                       return;
+               decompressed = true;
+               if (!StringUtil.endsWithIC(zip7_file, ".7z"))
+                       zip7_file += ".7z";
+               
+               host.decompress(cm, host, host.getPfttDir()+"/app/"+zip7_file, 
host.getPfttDir()+"/cache/working/");
+       }
+       
        /** the base directory within the PFTT directory to find the phpunit 
and required php files
         * 
+        * Typically, test-packs will call #ensureAppDecompressed
+        * 
+        * @param cm
         * @param host - determine the absolute path on this host
         * @see AHost#getPfttDir
         * @return
         */
-       protected abstract String getSourceRoot(AHost host);
+       protected abstract String getSourceRoot(ConsoleManager cm, AHost host);
 
        /** installs the tests after they have been copied to storage (if 
needed)
         *

Reply via email to