Compare commits

..

4 Commits
6.1.2 ... 6.0.x

Author SHA1 Message Date
Joe Bowser
355aae7b4b Fix for broken testUrl test 2016-10-20 12:47:55 -07:00
Joe Bowser
5b4524ae12 Last minute change of test targets 2016-10-20 12:26:10 -07:00
Joe Bowser
33ac5c20b5 Set VERSION to 6.0.0 (via coho) 2016-10-20 11:49:03 -07:00
Joe Bowser
3ac3688d8c Update JS snapshot to version 6.0.0 (via coho) 2016-10-20 11:49:03 -07:00
30 changed files with 217 additions and 305 deletions

6
.gitignore vendored
View File

@@ -40,9 +40,10 @@ Desktop.ini
*.iml
.idea
npm-debug.log
/framework/build
node_modules/jshint
node_modules/promise-matchers
node_modules/jasmine
node_modules/jasmine-node
node_modules/rewire
node_modules/istanbul
node_modules/.bin/cake
@@ -53,7 +54,7 @@ node_modules/.bin/esparse
node_modules/.bin/esvalidate
node_modules/.bin/handlebars
node_modules/.bin/istanbul
node_modules/.bin/jasmine
node_modules/.bin/jasmine-node
node_modules/.bin/js-yaml
node_modules/.bin/jshint
node_modules/.bin/mkdirp
@@ -128,6 +129,5 @@ node_modules/which/
node_modules/window-size/
node_modules/wordwrap/
node_modules/yargs/
node_modules/jasmine-core/
node_modules/fs.realpath/
/coverage

View File

@@ -4,4 +4,3 @@ gen
proguard-project.txt
spec
appveyor.yml
framework/build

View File

@@ -8,7 +8,7 @@ before_install:
install:
- npm install
- npm install -g codecov
- echo y | android update sdk -u --filter android-22,android-23,android-24,android-25
- echo y | android update sdk -u --filter android-22,android-23,android-24
android:
components:
- tools

View File

@@ -20,28 +20,6 @@
-->
## 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
* Fixed `AndroidStudio` tests to actually run, removed `app/src/main/assets/` as a requirement and added `app/src/main/res` instead, added placeholder for `build/` folder, Removed dupe `gitignore`
### 6.1.0 (Nov 02, 2016)
* [CB-12108](https://issues.apache.org/jira/browse/CB-12108) Updating gradle files to work with the latest version of Android Studio
* [CB-12102](https://issues.apache.org/jira/browse/CB-12102) Bump travis to build to API 25
* Bumping up the version
* [CB-12101](https://issues.apache.org/jira/browse/CB-12101) Fix so that CLI builds don't conflict with Android Studio builds
* [CB-12077](https://issues.apache.org/jira/browse/CB-12077) Fix paths for Android icons/splashscreens
* added framework/build to .ratignore
* Fix for broken testUrl test
* Last minute change of test targets
* Update JS snapshot to version 6.1.0-dev (via coho)
* Set VERSION to 6.1.0-dev (via coho)
### 6.0.0 (Oct 20, 2016)
This release adds significant functionality, and also introduces a number
@@ -61,31 +39,31 @@ Changes For Third-Party WebView Developers:
#### Curated Changes from the Git Commit Logs ####
* Updating the gradle build for test to use the latest
* [CB-11083](https://issues.apache.org/jira/browse/CB-11083) Fixing syncronous file check and future-proofing the JS for Travis
* [CB-11083](https://issues.apache.org/jira/browse/CB-11083) Reading files to check for CordovaLib dependency, if so, we exclude CordovaLib to be safe
* [CB-11083](https://issues.apache.org/jira/browse/CB-11083) Plugin build script for dependencies without a gradle file
* [CB-11083](https://issues.apache.org/jira/browse/CB-11083) The GradleBuidler can tell the difference between a Cordova Plugin Framework and a regular framework based on the name
* [CB-11083](https://issues.apache.org/jira/browse/CB-11083) Fix to deal with custom frameworks with their own Gradle configuration
* [CB-12003](https://issues.apache.org/jira/browse/CB-12003) updated node_modules
* [CB-11771](https://issues.apache.org/jira/browse/CB-11771) Deep symlink directories to target project instead of linking the directory itself
* [CB-11880](https://issues.apache.org/jira/browse/CB-11880) android: Fail-safe for cordova.exec()
* [CB-11999](https://issues.apache.org/jira/browse/CB-11999) add message, catch exception if require fails
* CB-11083: Fixing syncronous file check and future-proofing the JS for Travis
* CB-11083: Reading files to check for CordovaLib dependency, if so, we exclude CordovaLib to be safe
* CB-11083: Plugin build script for dependencies without a gradle file
* CB-11083: The GradleBuidler can tell the difference between a Cordova Plugin Framework and a regular framework based on the name
* CB-11083 Fix to deal with custom frameworks with their own Gradle configuration
* CB-12003 updated node_modules
* CB-11771 Deep symlink directories to target project instead of linking the directory itself
* CB-11880 android: Fail-safe for cordova.exec()
* CB-11999 add message, catch exception if require fails
* fix issue with app_name containing apostrophes
* [CB-8722](https://issues.apache.org/jira/browse/CB-8722) - Move icons from drawable to mipmap
* [CB-11964](https://issues.apache.org/jira/browse/CB-11964) Call clean after plugin install and mock it in tests
* CB-8722 - Move icons from drawable to mipmap
* CB-11964 Call clean after plugin install and mock it in tests
* Did a try/catch to deal with the unit tests vs actual project environment, code duplication is needed because of builderEnv
* [CB-11964](https://issues.apache.org/jira/browse/CB-11964) Do a clean when installing a plugin to et around the bug
* [CB-11921](https://issues.apache.org/jira/browse/CB-11921) - Add github pull request template
* [CB-11935](https://issues.apache.org/jira/browse/CB-11935) Does a best-effort attempt to pause any processing that can be paused safely, such as animations and geolocation.
* [CB-11640](https://issues.apache.org/jira/browse/CB-11640) Fixing check_reqs.js so it actually works
* [CB-11640](https://issues.apache.org/jira/browse/CB-11640) Changing requirements check to ask for Java 8
* [CB-11869](https://issues.apache.org/jira/browse/CB-11869) Fix cordova-js android exec tests
* [CB-11907](https://issues.apache.org/jira/browse/CB-11907) Bumping Gradle to work with Android Studio 2.2 and the Android Gradle Plugin
* CB-11964: Do a clean when installing a plugin to et around the bug
* CB-11921 - Add github pull request template
* CB-11935 Does a best-effort attempt to pause any processing that can be paused safely, such as animations and geolocation.
* CB-11640: Fixing check_reqs.js so it actually works
* CB-11640: Changing requirements check to ask for Java 8
* CB-11869 Fix cordova-js android exec tests
* CB-11907: Bumping Gradle to work with Android Studio 2.2 and the Android Gradle Plugin
* Enable background start of Cordova Android apps
* fixing jshint issues
* replace Integer.parseInt with BigInteger so that you can use longer Android version codes
* [CB-11828](https://issues.apache.org/jira/browse/CB-11828) Adding dirty userAgent checking to see if we're running Jellybean or not for bridge modes
* [CB-11828](https://issues.apache.org/jira/browse/CB-11828) Switching default bridge back to ONLINE_BRIDGE
* CB-11828: Adding dirty userAgent checking to see if we're running Jellybean or not for bridge modes
* CB-11828: Switching default bridge back to ONLINE_BRIDGE
* Add gradle build flag to enable dex in process for large projects
* added ability for cordova activity to be viewed in a real full screen regardless of android version (as was the case in previous cordova versions)
* Updating travis
@@ -93,23 +71,23 @@ Changes For Third-Party WebView Developers:
* Bump Target and Min API levels
* Make evaluateJavaScript brige default
* Creating an evaluateJavascript branch
* [CB-11727](https://issues.apache.org/jira/browse/CB-11727) - travis ci setup is still using 0.10.32 node
* [CB-11726](https://issues.apache.org/jira/browse/CB-11726) - Update appveyor node versions to 4 and 6, so they will always use the latest versions
* CB-11727 - travis ci setup is still using 0.10.32 node
* CB-11726 - Update appveyor node versions to 4 and 6, so they will always use the latest versions
* Close invalid PRs
* [CB-11683](https://issues.apache.org/jira/browse/CB-11683) Fixed linking to directories during plugin installation.
* fixed [CB-11078](https://issues.apache.org/jira/browse/CB-11078) Empty string for BackgroundColor preference crashes application This closes #316
* CB-11683 Fixed linking to directories during plugin installation.
* fixed CB-11078 Empty string for BackgroundColor preference crashes application This closes #316
* Update JS snapshot to version 5.3.0-dev (via coho)
* Set VERSION to 5.3.0-dev (via coho)
* [CB-11626](https://issues.apache.org/jira/browse/CB-11626) Updated RELEASENOTES and Version for release 5.2.2
* CB-11626 Updated RELEASENOTES and Version for release 5.2.2
* updated cordoova-common to 1.4.0
* This closes #195
* Updaing the gradle for the tests to the latest
* [CB-11550](https://issues.apache.org/jira/browse/CB-11550) Updated RELEASENOTES for release 5.2.1
* [CB-9489](https://issues.apache.org/jira/browse/CB-9489) Fixed "endless waiting for emulator" issue
* CB-11550 Updated RELEASENOTES for release 5.2.1
* CB-9489 Fixed "endless waiting for emulator" issue
* Update JS snapshot to version 5.3.0-dev (via coho)
* Set VERSION to 5.3.0-dev (via coho)
* [CB-11444](https://issues.apache.org/jira/browse/CB-11444) Updated RELEASENOTES and Version for release 5.2.0
* [CB-11481](https://issues.apache.org/jira/browse/CB-11481) android-library is deprecated use com.android.library instead
* CB-11444 Updated RELEASENOTES and Version for release 5.2.0
* CB-11481: android-library is deprecated use com.android.library instead
### 5.2.2 (Jul 26, 2016)
* [CB-11615](https://issues.apache.org/jira/browse/CB-11615) updated `cordoova-common` to `1.4.0`

View File

@@ -1 +1 @@
6.1.2
6.0.0

View File

@@ -66,13 +66,12 @@ function Api(platform, platformRootDir, events) {
this.locations = {
root: self.root,
www: path.join(self.root, 'assets/www'),
res: path.join(self.root, 'res'),
res: path.relative(self.root, path.join(self.root, 'res')),
platformWww: path.join(self.root, 'platform_www'),
configXml: path.join(self.root, 'res/xml/config.xml'),
defaultConfigXml: path.join(self.root, 'cordova/defaults.xml'),
strings: path.join(self.root, 'res/values/strings.xml'),
manifest: path.join(self.root, 'AndroidManifest.xml'),
build: path.join(self.root, 'build'),
// NOTE: Due to platformApi spec we need to return relative paths here
cordovaJs: 'bin/templates/project/assets/www/cordova.js',
cordovaJsSrc: 'cordova-js-src'
@@ -86,7 +85,7 @@ function Api(platform, platformRootDir, events) {
this.locations.strings = path.join(self.root, 'app/src/main/res/xml/strings.xml');
this.locations.manifest = path.join(self.root, 'app/src/main/AndroidManifest.xml');
this.locations.www = path.join(self.root, 'app/src/main/assets/www');
this.locations.res = path.join(self.root, 'app/src/main/res');
this.locations.res = path.relative(self.root, path.join(self.root, 'app/src/main/res'));
}
}
@@ -242,12 +241,10 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
// Do some basic argument parsing
var opts = {};
// Skip cleaning prepared files when not invoking via cordova CLI.
// Skip cleaning prepared files when not invoking via cordova CLI.
opts.noPrepare = true;
if(!AndroidStudio.isAndroidStudioProject(self.root) && !project.isClean()) {
return self.clean(opts);
}
return self.clean(opts);
})
.then(function () {
return PluginManager.get(self.platform, self.locations, project)
@@ -398,8 +395,6 @@ Api.prototype.clean = function(cleanOptions) {
});
};
/**
* Performs a requirements check for current platform. Each platform defines its
* own set of requirements, which should be resolved before platform can be

View File

@@ -197,14 +197,5 @@ AndroidProject.prototype.getUninstaller = function (type) {
return pluginHandlers.getUninstaller(type);
};
/*
* This checks if an Android project is clean or has old build artifacts
*/
AndroidProject.prototype.isClean = function() {
var build_path = path.join(this.projectDir, 'build');
//If the build directory doesn't exist, it's clean
return !(fs.existsSync(build_path));
};
module.exports = AndroidProject;

View File

@@ -4,39 +4,26 @@
* @param {String} root Root folder of the project
*/
/*jshint esnext: false */
/*jshint esversion: 6 */
var path = require('path');
var fs = require('fs');
var CordovaError = require('cordova-common').CordovaError;
module.exports.isAndroidStudioProject = function isAndroidStudioProject(root) {
function isAndroidStudioProject(root) {
var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res', 'project.properties', 'platform_www'];
var androidStudioFiles = ['app', 'gradle', 'app/src/main/res'];
// assume it is an AS project and not an Eclipse project
var isEclipse = false;
var isAS = true;
if(!fs.existsSync(root)) {
throw new CordovaError('AndroidStudio.js:inAndroidStudioProject root does not exist: ' + root);
var androidStudioFiles = ['app', 'gradle', 'build', 'app/src/main/assets'];
var file;
for(file of eclipseFiles) {
if(fs.existsSync(path.join(root, file))) {
return false;
}
}
// if any of the following exists, then we are not an ASProj
eclipseFiles.forEach(function(file) {
if(fs.existsSync(path.join(root, file))) {
isEclipse = true;
}
});
// if it is NOT an eclipse project, check that all required files exist
if(!isEclipse) {
androidStudioFiles.forEach(function(file){
if(!fs.existsSync(path.join(root, file))) {
console.log('missing file :: ' + file);
isAS = false;
}
});
for(file of androidStudioFiles) {
if(!fs.existsSync(path.join(root, file))) {
return false;
}
}
return (!isEclipse && isAS);
};
return true;
}
module.exports.isAndroidStudioProject = isAndroidStudioProject;

View File

@@ -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'] || 'https\\://services.gradle.org/distributions/gradle-2.14.1-all.zip';
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'http\\://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);

View File

@@ -46,8 +46,8 @@ module.exports.prepare = function (cordovaProject, options) {
return updateProjectAccordingTo(self._config, self.locations);
})
.then(function () {
updateIcons(cordovaProject, path.relative(cordovaProject.root, self.locations.res));
updateSplashes(cordovaProject, path.relative(cordovaProject.root, self.locations.res));
updateIcons(cordovaProject, self.locations.res);
updateSplashes(cordovaProject, self.locations.res);
})
.then(function () {
events.emit('verbose', 'Prepared android project successfully');
@@ -70,8 +70,8 @@ module.exports.clean = function (options) {
var self = this;
return Q().then(function () {
cleanWww(projectRoot, self.locations);
cleanIcons(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res));
cleanSplashes(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res));
cleanIcons(projectRoot, projectConfig, self.locations.res);
cleanSplashes(projectRoot, projectConfig, self.locations.res);
});
};

View File

@@ -20,7 +20,7 @@
*/
// Coho updates this line:
var VERSION = "6.1.2";
var VERSION = "6.0.0";
module.exports.version = VERSION;

View File

@@ -1,5 +1,5 @@
// Platform: android
// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20
// 53ea1913735222d326e65326e03391405df3cd4e
/*
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.2';
var PLATFORM_VERSION_BUILD_LABEL = '6.0.0';
// file: src/scripts/require.js
/*jshint -W079 */
@@ -330,7 +330,7 @@ module.exports = cordova;
});
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
define("cordova/android/nativeapiprovider", function(require, exports, module) {
/**
@@ -353,7 +353,7 @@ module.exports = {
});
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
/**
@@ -886,7 +886,7 @@ module.exports = channel;
});
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/exec.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) {
/**
@@ -1649,7 +1649,7 @@ exports.reset();
});
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/platform.js
define("cordova/platform", function(require, exports, module) {
// The last resume event that was received that had the result of a plugin call.
@@ -1759,7 +1759,7 @@ function onMessageFromNative(msg) {
});
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/plugin/android/app.js
define("cordova/plugin/android/app", function(require, exports, module) {
var exec = require('cordova/exec');

View File

@@ -30,7 +30,7 @@ buildscript {
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.android.tools.build:gradle:2.2.0'
}
}
@@ -264,7 +264,7 @@ def promptForReleaseKeyPassword() {
gradle.taskGraph.whenReady { taskGraph ->
taskGraph.getAllTasks().each() { task ->
if (task.name == 'validateReleaseSigning' || task.name == 'validateSigningRelease') {
if (task.name == 'validateReleaseSigning') {
promptForReleaseKeyPassword()
}
}

View File

@@ -21,11 +21,10 @@
buildscript {
repositories {
mavenCentral()
jcenter();
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.android.tools.build:gradle:2.1.0'
}
}

View File

@@ -10,7 +10,7 @@
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-25
target=android-24
apk-configurations=
renderscript.opt.level=O0
android.library=true

View File

@@ -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.2";
public static final String CORDOVA_VERSION = "6.0.0";
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);

View File

@@ -1,49 +1,49 @@
{
"name": "cordova-android",
"version": "6.1.2",
"description": "cordova-android release",
"bin": {
"create": "bin/create"
},
"main": "bin/templates/cordova/Api.js",
"repository": {
"type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git"
},
"keywords": [
"android",
"cordova",
"apache"
],
"scripts": {
"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",
"dependencies": {
"cordova-common": "^1.5.0",
"elementtree": "^0.1.6",
"nopt": "^3.0.1",
"properties-parser": "^0.2.3",
"q": "^1.4.1",
"shelljs": "^0.5.3"
},
"bundledDependencies": [
"cordova-common",
"elementtree",
"nopt",
"properties-parser",
"q",
"shelljs"
],
"devDependencies": {
"istanbul": "^0.4.2",
"jasmine": "^2.5.2",
"jshint": "^2.6.0",
"promise-matchers": "~0",
"rewire": "^2.1.3"
}
}
"name": "cordova-android",
"version": "6.0.0",
"description": "cordova-android release",
"bin": {
"create": "bin/create"
},
"main": "bin/templates/cordova/Api.js",
"repository": {
"type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git"
},
"keywords": [
"android",
"cordova",
"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"
},
"author": "Apache Software Foundation",
"license": "Apache-2.0",
"dependencies": {
"cordova-common": "^1.5.0",
"elementtree": "^0.1.6",
"nopt": "^3.0.1",
"properties-parser": "^0.2.3",
"q": "^1.4.1",
"shelljs": "^0.5.3"
},
"bundledDependencies": [
"cordova-common",
"elementtree",
"nopt",
"properties-parser",
"q",
"shelljs"
],
"devDependencies": {
"istanbul": "^0.4.2",
"jasmine-node": "^1.14.5",
"jshint": "^2.6.0",
"promise-matchers": "~0",
"rewire": "^2.1.3"
}
}

View File

@@ -35,42 +35,42 @@ function createAndBuild(projectname, projectid, done) {
describe('create', function() {
it('Test#001 : create project with ascii name, no spaces', function(done) {
it('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('Test#002 : create project with ascii name, and spaces', function(done) {
it('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('Test#003 : create project with unicode name, no spaces', function(done) {
it('create project with unicode name, no spaces', function(done) {
var projectname = '応応応応用用用用';
var projectid = 'com.test.create.app3';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
it('Test#004 : create project with unicode name, and spaces', function(done) {
it('create project with unicode name, and spaces', function(done) {
var projectname = '応応応応 用用用用';
var projectid = 'com.test.create.app4';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
it('Test#005 : create project with ascii+unicode name, no spaces', function(done) {
it('create project with ascii+unicode name, no spaces', function(done) {
var projectname = '応応応応hello用用用用';
var projectid = 'com.test.create.app5';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
it('Test#006 : create project with ascii+unicode name, and spaces', function(done) {
it('create project with ascii+unicode name, and spaces', function(done) {
var projectname = '応応応応 hello 用用用用';
var projectid = 'com.test.create.app6';

View File

@@ -20,11 +20,11 @@
var path = require('path'),
actions = require('./helpers/projectActions.js');
var PLUGIN_ADD_TIMEOUT = 90000;
var PLUGIN_ADD_TIMEOUT = 60000;
describe('plugin add', function() {
it('Test#001 : create project and add a plugin with framework', function(done) {
it('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');

View File

@@ -56,7 +56,7 @@ function testUpdate(projectname, projectid, createfrom, updatefrom, doBuild, don
describe('preparing fixtures', function () {
it('Test#001 : cloning old platform', function (done) {
it('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('Test#002 : should update major version and build the project', function(done) {
it('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('Test#003 : should downgrade major version and build the project', function(done) {
it('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('Test#004 : remove cloned old platform', function() {
it('remove cloned old platform', function() {
shell.rm('-rf', platformOld.path);
});

View File

@@ -1 +0,0 @@
Tests require that this folder exists.

View File

@@ -1,8 +0,0 @@
{
"spec_dir": "spec",
"spec_files": [
"unit/**/*[sS]pec.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}

View File

@@ -23,7 +23,7 @@ var android_project = path.join(__dirname, '../fixtures/android_project');
describe('AndroidProject class', function() {
describe('getPackageName method', function() {
it('Test#001 : should return an android project\'s proper package name', function() {
it('should return an android project\'s proper package name', function() {
expect(AndroidProject.getProjectFile(android_project).getPackageName())
.toEqual('com.alunny.childapp');
});

View File

@@ -0,0 +1,14 @@
var AndroidStudio = require('../../bin/templates/cordova/lib/AndroidStudio');
describe('AndroidStudio module', function () {
it('should detect Android Studio project', function() {
var root = './fixtures/android_studio_project';
spyOn(AndroidStudio, 'isAndroidStudioProject').andReturn(true);
AndroidStudio.isAndroidStudioProject(root);
});
it('should detect non Android Studio project', function() {
var root = './fixtures/android_project';
spyOn(AndroidStudio, 'isAndroidStudioProject').andReturn(false);
AndroidStudio.isAndroidStudioProject(root);
});
});

View File

@@ -1,17 +0,0 @@
var path = require('path');
var AndroidStudio = require('../../bin/templates/cordova/lib/AndroidStudio');
describe('AndroidStudio module', function () {
it('should return true for Android Studio project', function() {
var root = path.join(__dirname,'../fixtures/android_studio_project/');
var isAndStud = AndroidStudio.isAndroidStudioProject(root);
expect(isAndStud).toBe(true);
});
it('should return false non Android Studio project', function() {
var root = path.join(__dirname,'../fixtures/android_project/');
var isAndStud = AndroidStudio.isAndroidStudioProject(root);
expect(isAndStud).toBe(false);
});
});

View File

@@ -39,11 +39,11 @@ describe('addPlugin method', function () {
beforeEach(function() {
var pluginManager = jasmine.createSpyObj('pluginManager', ['addPlugin']);
pluginManager.addPlugin.and.returnValue(Q());
spyOn(common.PluginManager, 'get').and.returnValue(pluginManager);
pluginManager.addPlugin.andReturn(Q());
spyOn(common.PluginManager, 'get').andReturn(pluginManager);
var projectSpy = jasmine.createSpyObj('AndroidProject', ['getPackageName', 'write', 'isClean']);
spyOn(AndroidProject, 'getProjectFile').and.returnValue(projectSpy);
var projectSpy = jasmine.createSpyObj('AndroidProject', ['getPackageName', 'write']);
spyOn(AndroidProject, 'getProjectFile').andReturn(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').and.returnValue(gradleBuilder);
spyOn(builders, 'getBuilder').andReturn(gradleBuilder);
});
afterEach(function () {
Api.__set__('Api.prototype.clean', oldClean);
});
it('Test#001 : should call gradleBuilder.prepBuildFiles for every plugin with frameworks', function(done) {
it('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('Test#002 : shouldn\'t trigger gradleBuilder.prepBuildFiles for plugins without android frameworks', function(done) {
it('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 () {

View File

@@ -18,6 +18,8 @@
*/
/* jshint laxcomma:true */
require("promise-matchers");
var create = require("../../bin/lib/create");
describe("create", function () {
@@ -46,27 +48,14 @@ describe("create", function () {
];
valid.forEach(function(package_name) {
it("Test#001 : should accept " + package_name, function(done) {
return create.validatePackageName(package_name)
.then(function() {
//resolved
done();
}).fail(function(err) {
expect(err).toBeUndefined();
});
it("should accept " + package_name, function(done) {
expect(create.validatePackageName(package_name)).toHaveBeenResolved(done);
});
});
invalid.forEach(function(package_name) {
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();
});
it("should reject " + package_name, function(done) {
expect(create.validatePackageName(package_name)).toHaveBeenRejected(done);
});
});
});
@@ -84,29 +73,15 @@ describe("create", function () {
];
valid.forEach(function(project_name) {
it("Test#003 : should accept " + project_name, function(done) {
return create.validateProjectName(project_name)
.then(function() {
//resolved
done();
}).fail(function(err) {
expect(err).toBeUndefined();
});
it("should accept " + project_name, function(done) {
expect(create.validateProjectName(project_name)).toHaveBeenResolved(done);
});
});
invalid.forEach(function(project_name) {
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();
});
it("should reject " + project_name, function(done) {
expect(create.validateProjectName(project_name)).toHaveBeenRejected(done);
});
});
});
});

View File

@@ -38,13 +38,13 @@ var copyNewFile = common.__get__('copyNewFile');
describe('common platform handler', function() {
describe('copyFile', function() {
it('Test#001 : should throw if source path not found', function(){
it('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('Test#002 : should throw if src not in plugin directory', function(){
it('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('Test#003 : should allow symlink src, if inside plugin', function(){
it('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('Test#004 : should throw if symlink is linked to a file outside the plugin', function(){
it('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('Test#005 : should throw if dest is outside the project directory', function(){
it('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('Test#006 : should call mkdir -p on target path', function(){
it('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').and.callThrough();
var s = spyOn(shell, 'mkdir').andCallThrough();
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('Test#007 : should call cp source/dest paths', function(){
it('should call cp source/dest paths', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
var s = spyOn(shell, 'cp').and.callThrough();
var s = spyOn(shell, 'cp').andCallThrough();
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('Test#008 : should throw if target path exists', function(){
it('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('Test#009 : should call fs.unlinkSync on the provided paths', function(){
var s = spyOn(fs, 'unlinkSync').and.callThrough();
it('should call fs.unlinkSync on the provided paths', function(){
var s = spyOn(fs, 'unlinkSync').andCallThrough();
deleteJava(project_dir, java_file);
expect(s).toHaveBeenCalled();
expect(s).toHaveBeenCalledWith(path.resolve(project_dir, java_file));
});
it('Test#010 : should delete empty directories after removing source code in a java src path hierarchy', function(){
it('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('Test#011 : should never delete the top-level src directory, even if all plugins added were removed', function(){
it('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);
});

View File

@@ -50,7 +50,7 @@ describe('android project handler', function() {
beforeEach(function() {
shell.mkdir('-p', temp);
dummyProject = AndroidProject.getProjectFile(temp);
copyFileSpy.calls.reset();
copyFileSpy.reset();
common.__set__('copyFile', copyFileSpy);
});
@@ -60,18 +60,18 @@ describe('android project handler', function() {
});
describe('of <lib-file> elements', function() {
it('Test#001 : should copy files', function () {
it('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('Test#002 : should copy files for Android Studio projects', function () {
it('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('Test#003 : should copy files', function () {
it('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('Test#004 : should copy stuff from one location to another by calling common.copyFile', function() {
it('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('Test#005 : should install source files to the right location for Android Studio projects', function() {
it('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('Test#006 : should throw if source file cannot be found', function() {
it('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(new Error('"' + path.resolve(faultyplugin, 'src/android/NotHere.java') + '" not found!'));
}).toThrow('"' + path.resolve(faultyplugin, 'src/android/NotHere.java') + '" not found!');
});
it('Test#007 : should throw if target file already exists', function() {
it('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(new Error ('"' + target + '" already exists!'));
}).toThrow('"' + target + '" already exists!');
});
});
@@ -134,23 +134,23 @@ describe('android project handler', function() {
common.__set__('copyNewFile', copyNewFileOrig);
});
it('Test#008 : should throw if framework doesn\'t have "src" attribute', function() {
it('should throw if framework doesn\'t have "src" attribute', function() {
expect(function() { android.framework.install({}, dummyPluginInfo, dummyProject); }).toThrow();
});
it('Test#009 : should install framework without "parent" attribute into project root', function() {
it('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('Test#010 : should install framework with "parent" attribute into parent framework dir', function() {
it('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('Test#011 : should not copy anything if "custom" attribute is not set', function() {
it('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('Test#012 : should copy framework sources if "custom" attribute is set', function() {
it('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('Test#013 : should install gradleReference using project.addGradleReference', function() {
it('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('Test#014 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
it('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('Test#015 : should put module to www only when options.usePlatformWww flag is not specified', function () {
it('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('Test#016 : should put asset to both www and platform_www when options.usePlatformWww flag is specified', function () {
it('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('Test#017 : should put asset to www only when options.usePlatformWww flag is not specified', function () {
it('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() {
it('Test#018 : should remove jar files', function () {
describe('of <lib-file> elements', function(done) {
it('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('Test#019 : should remove jar files for Android Studio projects', function () {
it('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() {
it('Test#020 : should remove files', function () {
describe('of <resource-file> elements', function(done) {
it('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('Test#021 : should remove stuff by calling common.deleteJava', function() {
it('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('Test#022 : should remove stuff by calling common.deleteJava for Android Studio projects', function() {
it('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('Test#023 : should throw if framework doesn\'t have "src" attribute', function() {
it('should throw if framework doesn\'t have "src" attribute', function() {
expect(function() { android.framework.uninstall({}, dummyPluginInfo, dummyProject); }).toThrow();
});
it('Test#024 : should uninstall framework without "parent" attribute into project root', function() {
it('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('Test#025 : should uninstall framework with "parent" attribute into parent framework dir', function() {
it('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('Test#026 : should remove framework sources if "custom" attribute is set', function() {
it('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('Test#27 : should install gradleReference using project.removeGradleReference', function() {
it('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').and.callFake(function (file) {
spyOn(fs, 'existsSync').andCallFake(function (file) {
if ([wwwDest, platformWwwDest].indexOf(file) >= 0 ) return true;
return existsSyncOrig.call(fs, file);
});
});
it('Test#028 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
it('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('Test#29 : should put module to www only when options.usePlatformWww flag is not specified', function () {
it('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').and.callFake(function (file) {
spyOn(fs, 'existsSync').andCallFake(function (file) {
if ([wwwDest, platformWwwDest].indexOf(file) >= 0 ) return true;
return existsSyncOrig.call(fs, file);
});
});
it('Test#030 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
it('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('Test#31 : should put module to www only when options.usePlatformWww flag is not specified', function () {
it('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);

View File

@@ -28,7 +28,7 @@ describe("run", function () {
var emulatorOpts = { emulator: true };
var emptyOpts = {};
it("Test#001 : should select correct target based on the run opts", function() {
it("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");