You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2013/03/04 20:32:50 UTC

[81/91] [abbrv] git commit: Fixed up some tests and added bb10 to the dummyplugin for testing

Fixed up some tests and added bb10 to the dummyplugin for testing


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/0682f0fa
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/0682f0fa
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/0682f0fa

Branch: refs/heads/master
Commit: 0682f0fa20987f5b37eecd6fc7c8012131d55e1a
Parents: 6e16d96
Author: Tim Kim <ti...@adobe.com>
Authored: Tue Feb 12 12:27:00 2013 -0800
Committer: Tim Kim <ti...@adobe.com>
Committed: Tue Feb 12 12:27:00 2013 -0800

----------------------------------------------------------------------
 platforms/bb10.js                   |    5 +----
 test/bb10-install.js                |   14 ++++++++++++++
 test/bb10-uninstall.js              |   26 ++++++++++++--------------
 test/plugins/DummyPlugin/plugin.xml |   12 ++++++++++++
 4 files changed, 39 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0682f0fa/platforms/bb10.js
----------------------------------------------------------------------
diff --git a/platforms/bb10.js b/platforms/bb10.js
index 81cc551..f53ce8c 100644
--- a/platforms/bb10.js
+++ b/platforms/bb10.js
@@ -3,8 +3,6 @@ var fs = require('fs')  // use existsSync in 0.6.x
    , shell = require('shelljs')
    , et = require('elementtree')
    , getConfigChanges = require('../util/config-changes')
-
-   , assetsDir = 'www'  // relative path to project's web assets
    , sourceDir = 'src'
    , xml_helpers = require(path.join(__dirname, '..', 'util', 'xml-helpers'));
 
@@ -43,13 +41,12 @@ exports.handlePlugin = function (action, project_dir, plugin_dir, plugin_et) {
 
         var targetPath = path.resolve(
                             project_dir,
-                            assetsDir,
                             asset.attrib['target']);
         var stats = fs.statSync(srcPath);
         if (action == 'install') {
             if(stats.isDirectory()) {
                 shell.mkdir('-p', targetPath);
-                shell.cp('-R', srcPath, path.join(project_dir, assetsDir));
+                shell.cp('-R', srcPath, project_dir);
             } else {
                 shell.cp(srcPath, targetPath);
             }

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0682f0fa/test/bb10-install.js
----------------------------------------------------------------------
diff --git a/test/bb10-install.js b/test/bb10-install.js
index f49ae1c..a07efe3 100644
--- a/test/bb10-install.js
+++ b/test/bb10-install.js
@@ -45,6 +45,20 @@ exports['should move the source files'] = function (test) {
     test.done();
 }
 
+exports['should move the js file'] = function (test) {
+    // setting up a DummyPlugin
+    var dummy_plugin_dir = path.join(test_dir, 'plugins', 'DummyPlugin')
+    var dummy_xml_path = path.join(test_dir, 'plugins', 'DummyPlugin', 'plugin.xml')
+    var dummy_plugin_et  = new et.ElementTree(et.XML(fs.readFileSync(dummy_xml_path, 'utf-8')));
+
+    // run the platform-specific function
+    bb10.handlePlugin('install', test_project_dir, dummy_plugin_dir, dummy_plugin_et);
+
+    var jsPath = path.join(test_project_dir, 'dummyplugin.js');
+    test.ok(fs.existsSync(jsPath));
+    test.done();
+}
+
 exports['should edit config.xml'] = function (test) {
     bb10.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et);
     

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0682f0fa/test/bb10-uninstall.js
----------------------------------------------------------------------
diff --git a/test/bb10-uninstall.js b/test/bb10-uninstall.js
index b4fe1e2..ac5198c 100644
--- a/test/bb10-uninstall.js
+++ b/test/bb10-uninstall.js
@@ -34,29 +34,27 @@ exports.tearDown = function(callback) {
 }
 
 exports['should remove cordova echo plugin'] = function (test) {
-    
-    // setting up a DummyPlugin
-    var dummy_plugin_dir = path.join(test_dir, 'plugins', 'cordova.echo')
-    var dummy_xml_path = path.join(test_dir, 'plugins', 'cordova.echo', 'plugin.xml')
-    var dummy_plugin_et  = new et.ElementTree(et.XML(fs.readFileSync(dummy_xml_path, 'utf-8')));
-
-    bb10.handlePlugin('install', test_project_dir, dummy_plugin_dir, dummy_plugin_et);
-    bb10.handlePlugin('uninstall', test_project_dir, dummy_plugin_dir, dummy_plugin_et);
+    // run the platform-specific function
+    bb10.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et);
+    bb10.handlePlugin('uninstall', test_project_dir, test_plugin_dir, plugin_et);
 
     test.done();
 }
 
-/*
+
 exports['should remove the js file'] = function (test) {
-    // run the platform-specific function
-    ios.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et);
-    ios.handlePlugin('uninstall', test_project_dir, test_plugin_dir, plugin_et);
 
-    var jsPath = path.join(test_dir, 'projects', 'ios', 'www', 'childbrowser.js');
+    var dummy_plugin_dir = path.join(test_dir, 'plugins', 'DummyPlugin')
+    var dummy_xml_path = path.join(test_dir, 'plugins', 'DummyPlugin', 'plugin.xml')
+    var dummy_plugin_et  = new et.ElementTree(et.XML(fs.readFileSync(dummy_xml_path, 'utf-8')));
+
+    bb10.handlePlugin('install', test_project_dir, dummy_plugin_dir, dummy_plugin_et);
+    bb10.handlePlugin('uninstall', test_project_dir, dummy_plugin_dir, dummy_plugin_et);
+    var jsPath = path.join(test_dir, 'projects', 'bb10', 'www', 'dummyplugin.js');
     test.ok(!fs.existsSync(jsPath))
     test.done();
 }
-*/
+
 
 exports['should remove the source files'] = function (test) {
     // run the platform-specific function

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0682f0fa/test/plugins/DummyPlugin/plugin.xml
----------------------------------------------------------------------
diff --git a/test/plugins/DummyPlugin/plugin.xml b/test/plugins/DummyPlugin/plugin.xml
index 7e9cd3d..702c24c 100644
--- a/test/plugins/DummyPlugin/plugin.xml
+++ b/test/plugins/DummyPlugin/plugin.xml
@@ -38,6 +38,18 @@
                 target-dir="src/com/phonegap/plugins/dummyplugin" />
     </platform>
 
+    <!-- BlackBerry10 -->
+    <platform name="BlackBerry10">
+        <config-file target="config.xml" parent="/widget">
+            <feature id="dummyPlugin" required="true" version="1.0.0.0"/>
+        </config-file>
+
+        <source-file src="client.js" target-dir="ext-qnx/cordova.echo" />
+        <source-file src="index.js" target-dir="ext-qnx/cordova.echo" />
+        <source-file src="manifest.json" target-dir="ext-qnx/cordova.echo" />
+    </platform>
+
+        
     <!-- ios -->
     <platform name="ios">
         <plugins-plist key="com.phonegap.plugins.dummyplugin"

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0682f0fa/test/plugins/DummyPlugin/src/BlackBerry10/client.js
----------------------------------------------------------------------
diff --git a/test/plugins/DummyPlugin/src/BlackBerry10/client.js b/test/plugins/DummyPlugin/src/BlackBerry10/client.js
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0682f0fa/test/plugins/DummyPlugin/src/BlackBerry10/index.js
----------------------------------------------------------------------
diff --git a/test/plugins/DummyPlugin/src/BlackBerry10/index.js b/test/plugins/DummyPlugin/src/BlackBerry10/index.js
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0682f0fa/test/plugins/DummyPlugin/src/BlackBerry10/manifest.json
----------------------------------------------------------------------
diff --git a/test/plugins/DummyPlugin/src/BlackBerry10/manifest.json b/test/plugins/DummyPlugin/src/BlackBerry10/manifest.json
new file mode 100644
index 0000000..e69de29