Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 28E5F10BD0 for ; Mon, 15 Apr 2013 18:51:53 +0000 (UTC) Received: (qmail 85361 invoked by uid 500); 15 Apr 2013 18:51:51 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 85315 invoked by uid 500); 15 Apr 2013 18:51:51 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 84424 invoked by uid 99); 15 Apr 2013 18:51:50 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Apr 2013 18:51:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1251E1B600; Mon, 15 Apr 2013 18:51:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: timkim@apache.org To: commits@cordova.apache.org Date: Mon, 15 Apr 2013 18:52:33 -0000 Message-Id: <0ad854dc71784add9bf6778c71fe765f@git.apache.org> In-Reply-To: <9ce8167dc0c84a57a01fbbfad64cc72d@git.apache.org> References: <9ce8167dc0c84a57a01fbbfad64cc72d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [46/54] [abbrv] git commit: fixed android two install tests fixed android two install tests Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/0ca14e5c Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/0ca14e5c Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/0ca14e5c Branch: refs/heads/future Commit: 0ca14e5c2a680324ceddb941744e841cda6f1789 Parents: 9383c7b Author: Tim Kim Authored: Fri Apr 12 13:51:01 2013 -0700 Committer: Tim Kim Committed: Fri Apr 12 13:51:01 2013 -0700 ---------------------------------------------------------------------- test/android-two-install.js | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0ca14e5c/test/android-two-install.js ---------------------------------------------------------------------- diff --git a/test/android-two-install.js b/test/android-two-install.js index b8b4c9d..b0975f0 100644 --- a/test/android-two-install.js +++ b/test/android-two-install.js @@ -27,7 +27,7 @@ var fs = require('fs') , shell = require('shelljs') , et = require('elementtree') , android = require(path.join(__dirname, '..', 'platforms', 'android')) - + , plugin_loader = require('../util/plugin_loader') , test_dir = path.join(osenv.tmpdir(), 'test_plugman') , test_project_dir = path.join(test_dir, 'projects', 'android_two') , test_plugin_dir = path.join(test_dir, 'plugins', 'ChildBrowser') @@ -71,9 +71,13 @@ exports['should install webless plugin'] = function (test) { } exports['should move the js file'] = function (test) { + var pluginsPath = path.join(test_dir, 'plugins'); + var wwwPath = path.join(test_dir, 'projects', 'android_two', 'assets', 'www'); var jsPath = path.join(test_dir, 'projects', 'android_two', 'assets', 'www', 'childbrowser.js'); android.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et, { APP_ID: 12345 }); + plugin_loader.handlePrepare(test_project_dir, pluginsPath, wwwPath, 'android'); + console.log(wwwPath + ' ' + fs.readdirSync(wwwPath)); fs.stat(jsPath, function(err, stats) { test.ok(!err); test.ok(stats.isFile()); @@ -82,10 +86,13 @@ exports['should move the js file'] = function (test) { } exports['should move the directory'] = function (test) { + var pluginsPath = path.join(test_dir, 'plugins'); + var wwwPath = path.join(test_dir, 'projects', 'android_two', 'assets', 'www'); + android.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et); - + plugin_loader.handlePrepare(test_project_dir, pluginsPath, wwwPath, 'android'); + var assetPath = path.join(test_dir, 'projects', 'android_two', 'assets', 'www', 'childbrowser'); - var assets = fs.statSync(assetPath); test.ok(assets.isDirectory()); @@ -94,7 +101,11 @@ exports['should move the directory'] = function (test) { } exports['should move the src file'] = function (test) { + var pluginsPath = path.join(test_dir, 'plugins'); + var wwwPath = path.join(test_dir, 'projects', 'android_two', 'assets', 'www'); + android.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et, { APP_ID: 12345 }); + plugin_loader.handlePrepare(test_project_dir, pluginsPath, wwwPath, 'android'); var javaPath = path.join(test_dir, 'projects', 'android_two', 'src', 'com', 'phonegap', 'plugins', 'childBrowser', 'ChildBrowser.java'); test.ok(fs.statSync(javaPath)); @@ -134,9 +145,12 @@ exports['should add ChildBrowser to AndroidManifest.xml'] = function (test) { } exports['should not install a plugin that is already installed'] = function (test) { + var pluginsPath = path.join(test_dir, 'plugins'); + var wwwPath = path.join(test_dir, 'projects', 'android_two', 'assets', 'www'); var jsPath = path.join(test_dir, 'projects', 'android_two', 'assets', 'www', 'childbrowser.js'); android.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et, { APP_ID: 12345 }); + plugin_loader.handlePrepare(test_project_dir, pluginsPath, wwwPath, 'android'); test.throws(function() {android.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et);}, /already installed/);