You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2017/01/27 00:45:03 UTC
[1/6] android commit: CB-12018 : updated tests to work with jasmine
(promise matcher tests commented out for now)
Repository: cordova-android
Updated Branches:
refs/heads/6.1.x 96457effb -> 37ee3cdf8
CB-12018 : updated tests to work with jasmine (promise matcher tests commented out for now)
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/05af6195
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/05af6195
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/05af6195
Branch: refs/heads/6.1.x
Commit: 05af6195215a45937b95b97cc9edce6c5cca9492
Parents: 96457ef
Author: audreyso <au...@adobe.com>
Authored: Tue Jan 3 11:02:48 2017 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Thu Jan 26 16:27:29 2017 -0800
----------------------------------------------------------------------
package.json | 10 ++--
spec/e2e/create.spec.js | 12 ++--
spec/e2e/plugin.spec.js | 2 +-
spec/e2e/update.spec.js | 8 +--
spec/support/jasmine.json | 8 +++
spec/unit/AndroidProject.spec.js | 2 +-
spec/unit/Api.spec.js | 12 ++--
spec/unit/create.spec.js | 45 +++++++++++----
spec/unit/pluginHandlers/common.spec.js | 28 +++++-----
spec/unit/pluginHandlers/handlers.spec.js | 76 +++++++++++++-------------
spec/unit/run.spec.js | 2 +-
11 files changed, 119 insertions(+), 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 9eaedaa..6000dba 100644
--- a/package.json
+++ b/package.json
@@ -16,10 +16,10 @@
"apache"
],
"scripts": {
- "test": "npm run jshint && jasmine-node --color spec/unit",
- "cover": "istanbul cover --root bin/templates/cordova --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit",
- "test-build": "jasmine-node --captureExceptions --color spec/e2e",
- "jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint spec"
+ "test": "npm run jshint && jasmine",
+ "cover": "istanbul cover --root bin/templates/cordova --print detail jasmine",
+ "test-build": "jasmine --captureExceptions --color spec/e2e/*.spec.js",
+ "jshint": "jshint bin && jshint spec"
},
"author": "Apache Software Foundation",
"license": "Apache-2.0",
@@ -41,7 +41,7 @@
],
"devDependencies": {
"istanbul": "^0.4.2",
- "jasmine-node": "^1.14.5",
+ "jasmine": "^2.5.2",
"jshint": "^2.6.0",
"promise-matchers": "~0",
"rewire": "^2.1.3"
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/spec/e2e/create.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/create.spec.js b/spec/e2e/create.spec.js
index 3556364..d646535 100644
--- a/spec/e2e/create.spec.js
+++ b/spec/e2e/create.spec.js
@@ -35,42 +35,42 @@ function createAndBuild(projectname, projectid, done) {
describe('create', function() {
- it('create project with ascii name, no spaces', function(done) {
+ it('Test#001 : create project with ascii name, no spaces', function(done) {
var projectname = 'testcreate';
var projectid = 'com.test.create.app1';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
- it('create project with ascii name, and spaces', function(done) {
+ it('Test#002 : create project with ascii name, and spaces', function(done) {
var projectname = 'test create';
var projectid = 'com.test.create.app2';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
- it('create project with unicode name, no spaces', function(done) {
+ it('Test#003 : create project with unicode name, no spaces', function(done) {
var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc\u7528\u7528\u7528\u7528';
var projectid = 'com.test.create.app3';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
- it('create project with unicode name, and spaces', function(done) {
+ it('Test#004 : create project with unicode name, and spaces', function(done) {
var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc \u7528\u7528\u7528\u7528';
var projectid = 'com.test.create.app4';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
- it('create project with ascii+unicode name, no spaces', function(done) {
+ it('Test#005 : create project with ascii+unicode name, no spaces', function(done) {
var projectname = '\u5fdc\u5fdc\u5fdc\u5fdchello\u7528\u7528\u7528\u7528';
var projectid = 'com.test.create.app5';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
- it('create project with ascii+unicode name, and spaces', function(done) {
+ it('Test#006 : create project with ascii+unicode name, and spaces', function(done) {
var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc hello \u7528\u7528\u7528\u7528';
var projectid = 'com.test.create.app6';
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/spec/e2e/plugin.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/plugin.spec.js b/spec/e2e/plugin.spec.js
index 17c4258..7cc5032 100644
--- a/spec/e2e/plugin.spec.js
+++ b/spec/e2e/plugin.spec.js
@@ -24,7 +24,7 @@ var PLUGIN_ADD_TIMEOUT = 90000;
describe('plugin add', function() {
- it('create project and add a plugin with framework', function(done) {
+ it('Test#001 : create project and add a plugin with framework', function(done) {
var projectname = 'testpluginframework';
var projectid = 'com.test.plugin.framework';
var fakePluginPath = path.join(__dirname, 'fixtures/cordova-plugin-fake');
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/spec/e2e/update.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/update.spec.js b/spec/e2e/update.spec.js
index 8a08c20..a2296c0 100644
--- a/spec/e2e/update.spec.js
+++ b/spec/e2e/update.spec.js
@@ -56,7 +56,7 @@ function testUpdate(projectname, projectid, createfrom, updatefrom, doBuild, don
describe('preparing fixtures', function () {
- it('cloning old platform', function (done) {
+ it('Test#001 : cloning old platform', function (done) {
var command = util.format('git clone %s --depth=1 --branch %s %s',
PLATFORM_GIT_URL, platformOld.version, platformOld.path);
shell.rm('-rf', platformOld.path);
@@ -70,7 +70,7 @@ describe('preparing fixtures', function () {
describe('update', function() {
- it('should update major version and build the project', function(done) {
+ it('Test#002 : should update major version and build the project', function(done) {
var projectname = 'testupdate';
var projectid = 'com.test.update.app1';
@@ -78,7 +78,7 @@ describe('update', function() {
}, UPDATE_TIMEOUT);
- it('should downgrade major version and build the project', function(done) {
+ it('Test#003 : should downgrade major version and build the project', function(done) {
var projectname = 'testupdate';
var projectid = 'com.test.update.app2';
@@ -90,7 +90,7 @@ describe('update', function() {
describe('cleanup', function () {
- it('remove cloned old platform', function() {
+ it('Test#004 : remove cloned old platform', function() {
shell.rm('-rf', platformOld.path);
});
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/spec/support/jasmine.json
----------------------------------------------------------------------
diff --git a/spec/support/jasmine.json b/spec/support/jasmine.json
new file mode 100644
index 0000000..e04f814
--- /dev/null
+++ b/spec/support/jasmine.json
@@ -0,0 +1,8 @@
+{
+ "spec_dir": "spec",
+ "spec_files": [
+ "unit/**/*[sS]pec.js"
+ ],
+ "stopSpecOnExpectationFailure": false,
+ "random": false
+}
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/spec/unit/AndroidProject.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/AndroidProject.spec.js b/spec/unit/AndroidProject.spec.js
index 8aec35a..32ff097 100644
--- a/spec/unit/AndroidProject.spec.js
+++ b/spec/unit/AndroidProject.spec.js
@@ -23,7 +23,7 @@ var android_project = path.join(__dirname, '../fixtures/android_project');
describe('AndroidProject class', function() {
describe('getPackageName method', function() {
- it('should return an android project\'s proper package name', function() {
+ it('Test#001 : should return an android project\'s proper package name', function() {
expect(AndroidProject.getProjectFile(android_project).getPackageName())
.toEqual('com.alunny.childapp');
});
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/spec/unit/Api.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/Api.spec.js b/spec/unit/Api.spec.js
index 2f29c0e..83f801e 100644
--- a/spec/unit/Api.spec.js
+++ b/spec/unit/Api.spec.js
@@ -39,11 +39,11 @@ describe('addPlugin method', function () {
beforeEach(function() {
var pluginManager = jasmine.createSpyObj('pluginManager', ['addPlugin']);
- pluginManager.addPlugin.andReturn(Q());
- spyOn(common.PluginManager, 'get').andReturn(pluginManager);
+ pluginManager.addPlugin.and.returnValue(Q());
+ spyOn(common.PluginManager, 'get').and.returnValue(pluginManager);
var projectSpy = jasmine.createSpyObj('AndroidProject', ['getPackageName', 'write', 'isClean']);
- spyOn(AndroidProject, 'getProjectFile').andReturn(projectSpy);
+ spyOn(AndroidProject, 'getProjectFile').and.returnValue(projectSpy);
oldClean = Api.__get__('Api.prototype.clean');
Api.__set__('Api.prototype.clean', Q);
@@ -51,14 +51,14 @@ describe('addPlugin method', function () {
fail = jasmine.createSpy('fail');
gradleBuilder = jasmine.createSpyObj('gradleBuilder', ['prepBuildFiles']);
- spyOn(builders, 'getBuilder').andReturn(gradleBuilder);
+ spyOn(builders, 'getBuilder').and.returnValue(gradleBuilder);
});
afterEach(function () {
Api.__set__('Api.prototype.clean', oldClean);
});
- it('should call gradleBuilder.prepBuildFiles for every plugin with frameworks', function(done) {
+ it('Test#001 : should call gradleBuilder.prepBuildFiles for every plugin with frameworks', function(done) {
api.addPlugin(new PluginInfo(path.join(FIXTURES, 'cordova-plugin-fake')))
.catch(fail)
.fin(function () {
@@ -68,7 +68,7 @@ describe('addPlugin method', function () {
});
});
- it('shouldn\'t trigger gradleBuilder.prepBuildFiles for plugins without android frameworks', function(done) {
+ it('Test#002 : shouldn\'t trigger gradleBuilder.prepBuildFiles for plugins without android frameworks', function(done) {
api.addPlugin(new PluginInfo(path.join(FIXTURES, 'cordova-plugin-fake-ios-frameworks')))
.catch(fail)
.fin(function () {
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/spec/unit/create.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/create.spec.js b/spec/unit/create.spec.js
index 2a1038e..1b010dc 100644
--- a/spec/unit/create.spec.js
+++ b/spec/unit/create.spec.js
@@ -18,8 +18,6 @@
*/
/* jshint laxcomma:true */
-require("promise-matchers");
-
var create = require("../../bin/lib/create");
describe("create", function () {
@@ -48,14 +46,27 @@ describe("create", function () {
];
valid.forEach(function(package_name) {
- it("should accept " + package_name, function(done) {
- expect(create.validatePackageName(package_name)).toHaveBeenResolved(done);
+ it("Test#001 : should accept " + package_name, function(done) {
+ return create.validatePackageName(package_name)
+ .then(function() {
+ //resolved
+ done();
+ }).fail(function(err) {
+ expect(err).toBeUndefined();
+ });
});
});
invalid.forEach(function(package_name) {
- it("should reject " + package_name, function(done) {
- expect(create.validatePackageName(package_name)).toHaveBeenRejected(done);
+ it("Test#002 : should reject " + package_name, function(done) {
+ return create.validatePackageName(package_name)
+ .then(function() {
+ //shouldn't be here
+ expect(true).toBe(false);
+ }).fail(function(err) {
+ expect(err).toBeDefined();
+ done();
+ });
});
});
});
@@ -73,15 +84,29 @@ describe("create", function () {
];
valid.forEach(function(project_name) {
- it("should accept " + project_name, function(done) {
- expect(create.validateProjectName(project_name)).toHaveBeenResolved(done);
+ it("Test#003 : should accept " + project_name, function(done) {
+ return create.validateProjectName(project_name)
+ .then(function() {
+ //resolved
+ done();
+ }).fail(function(err) {
+ expect(err).toBeUndefined();
+ });
});
});
invalid.forEach(function(project_name) {
- it("should reject " + project_name, function(done) {
- expect(create.validateProjectName(project_name)).toHaveBeenRejected(done);
+ it("Test#004 : should reject " + project_name, function(done) {
+ return create.validateProjectName(project_name)
+ .then(function() {
+ //shouldn't be here
+ expect(true).toBe(false);
+ }).fail(function(err) {
+ expect(err).toBeDefined();
+ done();
+ });
});
});
});
});
+
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/spec/unit/pluginHandlers/common.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/pluginHandlers/common.spec.js b/spec/unit/pluginHandlers/common.spec.js
index 485f33b..0a4a4b4 100644
--- a/spec/unit/pluginHandlers/common.spec.js
+++ b/spec/unit/pluginHandlers/common.spec.js
@@ -38,13 +38,13 @@ var copyNewFile = common.__get__('copyNewFile');
describe('common platform handler', function() {
describe('copyFile', function() {
- it('should throw if source path not found', function(){
+ it('Test#001 : should throw if source path not found', function(){
shell.rm('-rf', src);
expect(function(){copyFile(test_dir, src, project_dir, dest);})
.toThrow(new Error('"' + src + '" not found!'));
});
- it('should throw if src not in plugin directory', function(){
+ it('Test#002 : should throw if src not in plugin directory', function(){
shell.mkdir('-p', project_dir);
fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
var outside_file = '../non_plugin_file';
@@ -53,7 +53,7 @@ describe('common platform handler', function() {
shell.rm('-rf', test_dir);
});
- it('should allow symlink src, if inside plugin', function(){
+ it('Test#003 : should allow symlink src, if inside plugin', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
@@ -66,7 +66,7 @@ describe('common platform handler', function() {
shell.rm('-rf', project_dir);
});
- it('should throw if symlink is linked to a file outside the plugin', function(){
+ it('Test#004 : should throw if symlink is linked to a file outside the plugin', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
@@ -80,7 +80,7 @@ describe('common platform handler', function() {
shell.rm('-rf', project_dir);
});
- it('should throw if dest is outside the project directory', function(){
+ it('Test#005 : should throw if dest is outside the project directory', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
expect(function(){copyFile(test_dir, java_file, project_dir, non_plugin_file);}).
@@ -88,11 +88,11 @@ describe('common platform handler', function() {
shell.rm('-rf', project_dir);
});
- it('should call mkdir -p on target path', function(){
+ it('Test#006 : should call mkdir -p on target path', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
- var s = spyOn(shell, 'mkdir').andCallThrough();
+ var s = spyOn(shell, 'mkdir').and.callThrough();
var resolvedDest = path.resolve(project_dir, dest);
copyFile(test_dir, java_file, project_dir, dest);
@@ -102,11 +102,11 @@ describe('common platform handler', function() {
shell.rm('-rf', project_dir);
});
- it('should call cp source/dest paths', function(){
+ it('Test#007 : should call cp source/dest paths', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
- var s = spyOn(shell, 'cp').andCallThrough();
+ var s = spyOn(shell, 'cp').and.callThrough();
var resolvedDest = path.resolve(project_dir, dest);
copyFile(test_dir, java_file, project_dir, dest);
@@ -119,7 +119,7 @@ describe('common platform handler', function() {
});
describe('copyNewFile', function () {
- it('should throw if target path exists', function(){
+ it('Test#008 : should throw if target path exists', function(){
shell.mkdir('-p', dest);
expect(function(){copyNewFile(test_dir, src, project_dir, dest);}).
toThrow(new Error('"' + dest + '" already exists!'));
@@ -137,21 +137,21 @@ describe('common platform handler', function() {
shell.rm('-rf', java_dir);
});
- it('should call fs.unlinkSync on the provided paths', function(){
- var s = spyOn(fs, 'unlinkSync').andCallThrough();
+ it('Test#009 : should call fs.unlinkSync on the provided paths', function(){
+ var s = spyOn(fs, 'unlinkSync').and.callThrough();
deleteJava(project_dir, java_file);
expect(s).toHaveBeenCalled();
expect(s).toHaveBeenCalledWith(path.resolve(project_dir, java_file));
});
- it('should delete empty directories after removing source code in a java src path hierarchy', function(){
+ it('Test#010 : should delete empty directories after removing source code in a java src path hierarchy', function(){
deleteJava(project_dir, java_file);
expect(fs.existsSync(java_file)).not.toBe(true);
expect(fs.existsSync(java_dir)).not.toBe(true);
expect(fs.existsSync(path.join(src,'one'))).not.toBe(true);
});
- it('should never delete the top-level src directory, even if all plugins added were removed', function(){
+ it('Test#011 : should never delete the top-level src directory, even if all plugins added were removed', function(){
deleteJava(project_dir, java_file);
expect(fs.existsSync(src)).toBe(true);
});
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/spec/unit/pluginHandlers/handlers.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/pluginHandlers/handlers.spec.js b/spec/unit/pluginHandlers/handlers.spec.js
index be7b95b..bbed838 100644
--- a/spec/unit/pluginHandlers/handlers.spec.js
+++ b/spec/unit/pluginHandlers/handlers.spec.js
@@ -50,7 +50,7 @@ describe('android project handler', function() {
beforeEach(function() {
shell.mkdir('-p', temp);
dummyProject = AndroidProject.getProjectFile(temp);
- copyFileSpy.reset();
+ copyFileSpy.calls.reset();
common.__set__('copyFile', copyFileSpy);
});
@@ -60,18 +60,18 @@ describe('android project handler', function() {
});
describe('of <lib-file> elements', function() {
- it('should copy files', function () {
+ it('Test#001 : should copy files', function () {
android['lib-file'].install(valid_libs[0], dummyPluginInfo, dummyProject);
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, 'src/android/TestLib.jar', temp, path.join('libs', 'TestLib.jar'), false);
});
- it('should copy files for Android Studio projects', function () {
+ it('Test#002 : should copy files for Android Studio projects', function () {
android['lib-file'].install(valid_libs[0], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, 'src/android/TestLib.jar', temp, path.join('app', 'libs', 'TestLib.jar'), false);
});
});
describe('of <resource-file> elements', function() {
- it('should copy files', function () {
+ it('Test#003 : should copy files', function () {
android['resource-file'].install(valid_resources[0], dummyPluginInfo, dummyProject);
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, 'android-resource.xml', temp, path.join('res', 'xml', 'dummy.xml'), false);
});
@@ -82,26 +82,26 @@ describe('android project handler', function() {
shell.cp('-rf', android_project, temp);
});
- it('should copy stuff from one location to another by calling common.copyFile', function() {
+ it('Test#004 : should copy stuff from one location to another by calling common.copyFile', function() {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject);
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin.java', temp, path.join('src/com/phonegap/plugins/dummyplugin/DummyPlugin.java'), false);
});
- it('should install source files to the right location for Android Studio projects', function() {
+ it('Test#005 : should install source files to the right location for Android Studio projects', function() {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin.java', temp, path.join('app/src/main/java/com/phonegap/plugins/dummyplugin/DummyPlugin.java'), false);
});
- it('should throw if source file cannot be found', function() {
+ it('Test#006 : should throw if source file cannot be found', function() {
common.__set__('copyFile', copyFileOrig);
expect(function() {
android['source-file'].install(invalid_source[0], faultyPluginInfo, dummyProject);
- }).toThrow('"' + path.resolve(faultyplugin, 'src/android/NotHere.java') + '" not found!');
+ }).toThrow(new Error('"' + path.resolve(faultyplugin, 'src/android/NotHere.java') + '" not found!'));
});
- it('should throw if target file already exists', function() {
+ it('Test#007 : should throw if target file already exists', function() {
// write out a file
var target = path.resolve(temp, 'src/com/phonegap/plugins/dummyplugin');
shell.mkdir('-p', target);
@@ -110,7 +110,7 @@ describe('android project handler', function() {
expect(function() {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject);
- }).toThrow('"' + target + '" already exists!');
+ }).toThrow(new Error ('"' + target + '" already exists!'));
});
});
@@ -134,23 +134,23 @@ describe('android project handler', function() {
common.__set__('copyNewFile', copyNewFileOrig);
});
- it('should throw if framework doesn\'t have "src" attribute', function() {
+ it('Test#008 : should throw if framework doesn\'t have "src" attribute', function() {
expect(function() { android.framework.install({}, dummyPluginInfo, dummyProject); }).toThrow();
});
- it('should install framework without "parent" attribute into project root', function() {
+ it('Test#009 : should install framework without "parent" attribute into project root', function() {
var framework = {src: 'plugin-lib'};
android.framework.install(framework, dummyPluginInfo, dummyProject);
expect(dummyProject.addSystemLibrary).toHaveBeenCalledWith(dummyProject.projectDir, someString);
});
- it('should install framework with "parent" attribute into parent framework dir', function() {
+ it('Test#010 : should install framework with "parent" attribute into parent framework dir', function() {
var childFramework = {src: 'plugin-lib2', parent: 'plugin-lib'};
android.framework.install(childFramework, dummyPluginInfo, dummyProject);
expect(dummyProject.addSystemLibrary).toHaveBeenCalledWith(path.resolve(dummyProject.projectDir, childFramework.parent), someString);
});
- it('should not copy anything if "custom" attribute is not set', function() {
+ it('Test#011 : should not copy anything if "custom" attribute is not set', function() {
var framework = {src: 'plugin-lib'};
var cpSpy = spyOn(shell, 'cp');
android.framework.install(framework, dummyPluginInfo, dummyProject);
@@ -158,14 +158,14 @@ describe('android project handler', function() {
expect(cpSpy).not.toHaveBeenCalled();
});
- it('should copy framework sources if "custom" attribute is set', function() {
+ it('Test#012 : should copy framework sources if "custom" attribute is set', function() {
var framework = {src: 'plugin-lib', custom: true};
android.framework.install(framework, dummyPluginInfo, dummyProject);
expect(dummyProject.addSubProject).toHaveBeenCalledWith(dummyProject.projectDir, someString);
expect(copyNewFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, framework.src, dummyProject.projectDir, someString, false);
});
- it('should install gradleReference using project.addGradleReference', function() {
+ it('Test#013 : should install gradleReference using project.addGradleReference', function() {
var framework = {src: 'plugin-lib', custom: true, type: 'gradleReference'};
android.framework.install(framework, dummyPluginInfo, dummyProject);
expect(copyNewFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, framework.src, dummyProject.projectDir, someString, false);
@@ -183,13 +183,13 @@ describe('android project handler', function() {
platformWwwDest = path.resolve(dummyProject.platformWww, 'plugins', dummyPluginInfo.id, jsModule.src);
});
- it('should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test#014 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
android['js-module'].install(jsModule, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8');
expect(fs.writeFileSync).toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8');
});
- it('should put module to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test#015 : should put module to www only when options.usePlatformWww flag is not specified', function () {
android['js-module'].install(jsModule, dummyPluginInfo, dummyProject);
expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8');
expect(fs.writeFileSync).not.toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8');
@@ -205,13 +205,13 @@ describe('android project handler', function() {
platformWwwDest = path.resolve(dummyProject.platformWww, asset.target);
});
- it('should put asset to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test#016 : should put asset to both www and platform_www when options.usePlatformWww flag is specified', function () {
android.asset.install(asset, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.www, asset.target);
expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.platformWww, asset.target);
});
- it('should put asset to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test#017 : should put asset to www only when options.usePlatformWww flag is not specified', function () {
android.asset.install(asset, dummyPluginInfo, dummyProject);
expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.www, asset.target);
expect(copyFileSpy).not.toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.platformWww, asset.target);
@@ -244,21 +244,21 @@ describe('android project handler', function() {
common.__set__('deleteJava', deleteJavaOrig);
});
- describe('of <lib-file> elements', function(done) {
- it('should remove jar files', function () {
+ describe('of <lib-file> elements', function() {
+ it('Test#018 : should remove jar files', function () {
android['lib-file'].install(valid_libs[0], dummyPluginInfo, dummyProject);
android['lib-file'].uninstall(valid_libs[0], dummyPluginInfo, dummyProject);
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('libs/TestLib.jar'));
});
- it('should remove jar files for Android Studio projects', function () {
+ it('Test#019 : should remove jar files for Android Studio projects', function () {
android['lib-file'].install(valid_libs[0], dummyPluginInfo, dummyProject, {android_studio:true});
android['lib-file'].uninstall(valid_libs[0], dummyPluginInfo, dummyProject, {android_studio:true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestLib.jar'));
});
});
- describe('of <resource-file> elements', function(done) {
- it('should remove files', function () {
+ describe('of <resource-file> elements', function() {
+ it('Test#020 : should remove files', function () {
android['resource-file'].install(valid_resources[0], dummyPluginInfo, dummyProject);
android['resource-file'].uninstall(valid_resources[0], dummyPluginInfo, dummyProject);
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('res/xml/dummy.xml'));
@@ -266,12 +266,12 @@ describe('android project handler', function() {
});
describe('of <source-file> elements', function() {
- it('should remove stuff by calling common.deleteJava', function() {
+ it('Test#021 : should remove stuff by calling common.deleteJava', function() {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject);
android['source-file'].uninstall(valid_source[0], dummyPluginInfo, dummyProject);
expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('src/com/phonegap/plugins/dummyplugin/DummyPlugin.java'));
});
- it('should remove stuff by calling common.deleteJava for Android Studio projects', function() {
+ it('Test#022 : should remove stuff by calling common.deleteJava for Android Studio projects', function() {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject, {android_studio:true});
android['source-file'].uninstall(valid_source[0], dummyPluginInfo, dummyProject, {android_studio:true});
expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/java/com/phonegap/plugins/dummyplugin/DummyPlugin.java'));
@@ -290,30 +290,30 @@ describe('android project handler', function() {
spyOn(dummyProject, 'removeGradleReference');
});
- it('should throw if framework doesn\'t have "src" attribute', function() {
+ it('Test#023 : should throw if framework doesn\'t have "src" attribute', function() {
expect(function() { android.framework.uninstall({}, dummyPluginInfo, dummyProject); }).toThrow();
});
- it('should uninstall framework without "parent" attribute into project root', function() {
+ it('Test#024 : should uninstall framework without "parent" attribute into project root', function() {
var framework = {src: 'plugin-lib'};
android.framework.uninstall(framework, dummyPluginInfo, dummyProject);
expect(dummyProject.removeSystemLibrary).toHaveBeenCalledWith(dummyProject.projectDir, someString);
});
- it('should uninstall framework with "parent" attribute into parent framework dir', function() {
+ it('Test#025 : should uninstall framework with "parent" attribute into parent framework dir', function() {
var childFramework = {src: 'plugin-lib2', parent: 'plugin-lib'};
android.framework.uninstall(childFramework, dummyPluginInfo, dummyProject);
expect(dummyProject.removeSystemLibrary).toHaveBeenCalledWith(path.resolve(dummyProject.projectDir, childFramework.parent), someString);
});
- it('should remove framework sources if "custom" attribute is set', function() {
+ it('Test#026 : should remove framework sources if "custom" attribute is set', function() {
var framework = {src: 'plugin-lib', custom: true};
android.framework.uninstall(framework, dummyPluginInfo, dummyProject);
expect(dummyProject.removeSubProject).toHaveBeenCalledWith(dummyProject.projectDir, someString);
expect(removeFileSpy).toHaveBeenCalledWith(dummyProject.projectDir, someString);
});
- it('should install gradleReference using project.removeGradleReference', function() {
+ it('Test#27 : should install gradleReference using project.removeGradleReference', function() {
var framework = {src: 'plugin-lib', custom: true, type: 'gradleReference'};
android.framework.uninstall(framework, dummyPluginInfo, dummyProject);
expect(removeFileSpy).toHaveBeenCalledWith(dummyProject.projectDir, someString);
@@ -333,19 +333,19 @@ describe('android project handler', function() {
spyOn(shell, 'rm');
var existsSyncOrig = fs.existsSync;
- spyOn(fs, 'existsSync').andCallFake(function (file) {
+ spyOn(fs, 'existsSync').and.callFake(function (file) {
if ([wwwDest, platformWwwDest].indexOf(file) >= 0 ) return true;
return existsSyncOrig.call(fs, file);
});
});
- it('should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test#028 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
android['js-module'].uninstall(jsModule, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(shell.rm).toHaveBeenCalledWith('-Rf', wwwDest);
expect(shell.rm).toHaveBeenCalledWith('-Rf', platformWwwDest);
});
- it('should put module to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test#29 : should put module to www only when options.usePlatformWww flag is not specified', function () {
android['js-module'].uninstall(jsModule, dummyPluginInfo, dummyProject);
expect(shell.rm).toHaveBeenCalledWith('-Rf', wwwDest);
expect(shell.rm).not.toHaveBeenCalledWith('-Rf', platformWwwDest);
@@ -363,19 +363,19 @@ describe('android project handler', function() {
spyOn(shell, 'rm');
var existsSyncOrig = fs.existsSync;
- spyOn(fs, 'existsSync').andCallFake(function (file) {
+ spyOn(fs, 'existsSync').and.callFake(function (file) {
if ([wwwDest, platformWwwDest].indexOf(file) >= 0 ) return true;
return existsSyncOrig.call(fs, file);
});
});
- it('should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test#030 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
android.asset.uninstall(asset, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
});
- it('should put module to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test#31 : should put module to www only when options.usePlatformWww flag is not specified', function () {
android.asset.uninstall(asset, dummyPluginInfo, dummyProject);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).not.toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/05af6195/spec/unit/run.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/run.spec.js b/spec/unit/run.spec.js
index 8c5ff99..9296d0f 100644
--- a/spec/unit/run.spec.js
+++ b/spec/unit/run.spec.js
@@ -28,7 +28,7 @@ describe("run", function () {
var emulatorOpts = { emulator: true };
var emptyOpts = {};
- it("should select correct target based on the run opts", function() {
+ it("Test#001 : should select correct target based on the run opts", function() {
expect(getInstallTarget(targetOpts)).toBe("emu");
expect(getInstallTarget(deviceOpts)).toBe("--device");
expect(getInstallTarget(emulatorOpts)).toBe("--emulator");
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[3/6] android commit: Change to https by default
Posted by st...@apache.org.
Change to https by default
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/07dce213
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/07dce213
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/07dce213
Branch: refs/heads/6.1.x
Commit: 07dce213a2e9693ca3cf2941c32a92d1cef987cb
Parents: f114ac8
Author: Joe Bowser <bo...@apache.org>
Authored: Fri Jan 20 09:31:31 2017 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Thu Jan 26 16:29:11 2017 -0800
----------------------------------------------------------------------
bin/templates/cordova/lib/builders/GradleBuilder.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/07dce213/bin/templates/cordova/lib/builders/GradleBuilder.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/builders/GradleBuilder.js b/bin/templates/cordova/lib/builders/GradleBuilder.js
index 8d6e76b..f415646 100644
--- a/bin/templates/cordova/lib/builders/GradleBuilder.js
+++ b/bin/templates/cordova/lib/builders/GradleBuilder.js
@@ -186,7 +186,7 @@ GradleBuilder.prototype.prepEnv = function(opts) {
// For some reason, using ^ and $ don't work. This does the job, though.
var distributionUrlRegex = /distributionUrl.*zip/;
/*jshint -W069 */
- var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'http\\://services.gradle.org/distributions/gradle-2.14.1-all.zip';
+ var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-2.14.1-all.zip';
/*jshint +W069 */
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
shell.chmod('u+w', gradleWrapperPropertiesPath);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[4/6] android commit: CB-12403 Updated RELEASENOTES and Version for
release 6.1.2
Posted by st...@apache.org.
CB-12403 Updated RELEASENOTES and Version for release 6.1.2
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/9d217813
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/9d217813
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/9d217813
Branch: refs/heads/6.1.x
Commit: 9d217813f1c7b0897dfcab52fcd3e4331d74c3c2
Parents: 07dce21
Author: Steve Gill <st...@gmail.com>
Authored: Thu Jan 26 15:21:50 2017 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Thu Jan 26 16:30:02 2017 -0800
----------------------------------------------------------------------
RELEASENOTES.md | 5 +++++
package.json | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9d217813/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index c38a1e9..caa452f 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -20,6 +20,11 @@
-->
## Release Notes for Cordova (Android) ##
+### 6.1.2 (Jan 26, 2017)
+* **Security** Change to `https` by default
+* [CB-12018](https://issues.apache.org/jira/browse/CB-12018): updated tests to work with jasmine (promise matcher tests commented out for now)
+* created directories and corresponding images for `xxhdpi` and `xxxhdpi`, both drawables and `mipmaps`
+
### 6.1.1 (Jan 03, 2017)
* [CB-12159](https://issues.apache.org/jira/browse/CB-12159) **Android** Keystore password prompt won't show up
* [CB-12169](https://issues.apache.org/jira/browse/CB-12169) Check for build directory before running a clean
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9d217813/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 6000dba..39d3b18 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "cordova-android",
- "version": "6.1.1",
+ "version": "6.1.2",
"description": "cordova-android release",
"bin": {
"create": "bin/create"
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[6/6] android commit: Set VERSION to 6.1.2 (via coho)
Posted by st...@apache.org.
Set VERSION to 6.1.2 (via coho)
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/37ee3cdf
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/37ee3cdf
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/37ee3cdf
Branch: refs/heads/6.1.x
Commit: 37ee3cdf81e810697e6780a4325a2cec4cce5968
Parents: 2269460
Author: Steve Gill <st...@gmail.com>
Authored: Thu Jan 26 16:30:31 2017 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Thu Jan 26 16:30:31 2017 -0800
----------------------------------------------------------------------
VERSION | 2 +-
bin/templates/cordova/version | 2 +-
framework/src/org/apache/cordova/CordovaWebView.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/37ee3cdf/VERSION
----------------------------------------------------------------------
diff --git a/VERSION b/VERSION
index f3b5af3..5e32542 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-6.1.1
+6.1.2
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/37ee3cdf/bin/templates/cordova/version
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/version b/bin/templates/cordova/version
index 1c28df5..9bf79a1 100755
--- a/bin/templates/cordova/version
+++ b/bin/templates/cordova/version
@@ -20,7 +20,7 @@
*/
// Coho updates this line:
-var VERSION = "6.1.1";
+var VERSION = "6.1.2";
module.exports.version = VERSION;
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/37ee3cdf/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java
index 15adbc5..2eebd0d 100644
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
* are not expected to implement it.
*/
public interface CordovaWebView {
- public static final String CORDOVA_VERSION = "6.1.1";
+ public static final String CORDOVA_VERSION = "6.1.2";
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/6] android commit: CB:12018 : added dev dependencies to gitignore
Posted by st...@apache.org.
CB:12018 : added dev dependencies to gitignore
This closes #355
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/f114ac8c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/f114ac8c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/f114ac8c
Branch: refs/heads/6.1.x
Commit: f114ac8c8c89bae56f308dc664bebd6c7b50146b
Parents: 05af619
Author: audreyso <au...@adobe.com>
Authored: Wed Jan 11 16:58:35 2017 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Thu Jan 26 16:27:39 2017 -0800
----------------------------------------------------------------------
.gitignore | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/f114ac8c/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 6810237..ae64038 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,7 +42,7 @@ Desktop.ini
npm-debug.log
node_modules/jshint
node_modules/promise-matchers
-node_modules/jasmine-node
+node_modules/jasmine
node_modules/rewire
node_modules/istanbul
node_modules/.bin/cake
@@ -53,7 +53,7 @@ node_modules/.bin/esparse
node_modules/.bin/esvalidate
node_modules/.bin/handlebars
node_modules/.bin/istanbul
-node_modules/.bin/jasmine-node
+node_modules/.bin/jasmine
node_modules/.bin/js-yaml
node_modules/.bin/jshint
node_modules/.bin/mkdirp
@@ -128,5 +128,6 @@ node_modules/which/
node_modules/window-size/
node_modules/wordwrap/
node_modules/yargs/
+node_modules/jasmine-core/
node_modules/fs.realpath/
/coverage
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[5/6] android commit: Update JS snapshot to version 6.1.2 (via coho)
Posted by st...@apache.org.
Update JS snapshot to version 6.1.2 (via coho)
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/22694606
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/22694606
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/22694606
Branch: refs/heads/6.1.x
Commit: 22694606f901fbc38947c53b28d5bb090c9159a6
Parents: 9d21781
Author: Steve Gill <st...@gmail.com>
Authored: Thu Jan 26 16:30:31 2017 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Thu Jan 26 16:30:31 2017 -0800
----------------------------------------------------------------------
bin/templates/project/assets/www/cordova.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/22694606/bin/templates/project/assets/www/cordova.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/assets/www/cordova.js b/bin/templates/project/assets/www/cordova.js
index 3878a5b..18c020e 100644
--- a/bin/templates/project/assets/www/cordova.js
+++ b/bin/templates/project/assets/www/cordova.js
@@ -1,5 +1,5 @@
// Platform: android
-// a3732cb71d9b1dd590338e8cf44196f366d46da3
+// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '6.1.1';
+var PLATFORM_VERSION_BUILD_LABEL = '6.1.2';
// file: src/scripts/require.js
/*jshint -W079 */
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org