Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1ED8CF96 for ; Tue, 10 Sep 2013 19:26:01 +0000 (UTC) Received: (qmail 80779 invoked by uid 500); 10 Sep 2013 19:25:58 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 80763 invoked by uid 500); 10 Sep 2013 19:25:57 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 80599 invoked by uid 99); 10 Sep 2013 19:25:55 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Sep 2013 19:25:55 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C5B2A89FB68; Tue, 10 Sep 2013 19:25:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: commits@cordova.apache.org Message-Id: <0ec50158bda3405bbb506fff9c68246b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: android commit: Remove out-of-date create script tests. Date: Tue, 10 Sep 2013 19:25:54 +0000 (UTC) Updated Branches: refs/heads/master 483dd3435 -> 3df09eacf Remove out-of-date create script tests. They have clearly not been run in a long time. We verify create script output manually during releases, and I think that's more meaningful. Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/3df09eac Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/3df09eac Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/3df09eac Branch: refs/heads/master Commit: 3df09eacf2c4c48990d2569300f20e907d7855f5 Parents: 483dd34 Author: Andrew Grieve Authored: Tue Sep 10 15:25:01 2013 -0400 Committer: Andrew Grieve Committed: Tue Sep 10 15:25:01 2013 -0400 ---------------------------------------------------------------------- bin/tests/test_create_unix.js | 152 ------------------------------------ bin/tests/test_create_win.js | 155 ------------------------------------- 2 files changed, 307 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-android/blob/3df09eac/bin/tests/test_create_unix.js ---------------------------------------------------------------------- diff --git a/bin/tests/test_create_unix.js b/bin/tests/test_create_unix.js deleted file mode 100644 index 5d8dcd4..0000000 --- a/bin/tests/test_create_unix.js +++ /dev/null @@ -1,152 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -var build_path = __dirname + '/../..', - project_path = '/tmp/example', - package_name = 'org.apache.cordova.example', - package_as_path = 'org/apache/cordova/example', - project_name = 'cordovaExample'; - -var path = require('path'), - fs = require('fs'), - util = require('util'), - assert = require('assert'), - spawn = require('child_process').spawn; - -var version = fs.readFileSync(build_path + '/VERSION').toString().replace('\n', ''); - -assert(version !== undefined); -assert(version !== ''); - -var create_project = spawn(build_path + '/bin/create', - [project_path, - package_name, - project_name]); - -process.on('uncaughtException', function (err) { - console.log('Caught exception: ' + err); - spawn('rm', ['-rf', project_path], function(code) { - if(code != 0) { - console.log("Could not delete project directory"); - } - }); -}); - -create_project.on('exit', function(code) { - - assert.equal(code, 0, 'Project did not get created'); - - // make sure the project was created - path.exists(project_path, function(exists) { - assert(exists, 'Project path does not exist'); - }); - - // make sure the build directory was cleaned up -// path.exists(build_path + '/framework/libs', function(exists) { -// assert(!exists, 'libs directory did not get cleaned up'); -// }); - path.exists(build_path + util.format('/framework/assets/cordova-%s.js', version), function(exists) { - assert(!exists, 'javascript file did not get cleaned up'); - }); - path.exists(build_path + util.format('/framework/cordova-%s.jar', version), function(exists) { - assert(!exists, 'jar file did not get cleaned up'); - }); - - // make sure AndroidManifest.xml was added - path.exists(util.format('%s/AndroidManifest.xml', project_path), function(exists) { - assert(exists, 'AndroidManifest.xml did not get created'); - // TODO check that the activity name was properly substituted - }); - - // make sure main Activity was added - path.exists(util.format('%s/src/%s/%s.java', project_path, package_as_path, project_name), function(exists) { - assert(exists, 'Activity did not get created'); - // TODO check that package name and activity name were substituted properly - }); - - // make sure plugins.xml was added - path.exists(util.format('%s/res/xml/plugins.xml', project_path), function(exists) { - assert(exists, 'plugins.xml did not get created'); - }); - - // make sure cordova.xml was added - path.exists(util.format('%s/res/xml/cordova.xml', project_path), function(exists) { - assert(exists, 'plugins.xml did not get created'); - }); - - // make sure cordova.jar was added - path.exists(util.format('%s/libs/cordova-%s.jar', project_path, version), function(exists) { - assert(exists, 'cordova.jar did not get added'); - }); - - // make sure cordova.js was added - path.exists(util.format('%s/assets/www/cordova-%s.js', project_path, version), function(exists) { - assert(exists, 'cordova.js did not get added'); - }); - - // make sure cordova master script was added - path.exists(util.format('%s/cordova/cordova', project_path), function(exists) { - assert(exists, 'cordova script did not get added'); - }); - - // make sure debug script was added - path.exists(util.format('%s/cordova/debug', project_path), function(exists) { - assert(exists, 'debug script did not get added'); - }); - - // make sure BOOM script was added - path.exists(util.format('%s/cordova/BOOM', project_path), function(exists) { - assert(exists, 'BOOM script did not get added'); - }); - - // make sure log script was added - path.exists(util.format('%s/cordova/log', project_path), function(exists) { - assert(exists, 'log script did not get added'); - }); - - // make sure clean script was added - path.exists(util.format('%s/cordova/clean', project_path), function(exists) { - assert(exists, 'clean script did not get added'); - }); - - // make sure emulate script was added - path.exists(util.format('%s/cordova/emulate', project_path), function(exists) { - assert(exists, 'emulate script did not get added'); - }); - - // make sure appinfo.jar script was added - path.exists(util.format('%s/cordova/appinfo.jar', project_path), function(exists) { - assert(exists, 'appinfo.jar script did not get added'); - }); - - // check that project compiles && creates a cordovaExample-debug.apk - var compile_project = spawn('ant', ['debug'], {cwd: project_path}); - - compile_project.on('exit', function(code) { - assert.equal(code, 0, 'Cordova Android Project does not compile'); - // make sure cordovaExample-debug.apk was created - path.exists(util.format('%s/bin/%s-debug.apk', project_path, project_name), function(exists) { - assert(exists, 'Package did not get created'); - - // if project compiles properly just AXE it - spawn('rm', ['-rf', project_path], function(code) { - assert.equal(code, 0, 'Could not remove project directory'); - }); - }); - }); - -}); http://git-wip-us.apache.org/repos/asf/cordova-android/blob/3df09eac/bin/tests/test_create_win.js ---------------------------------------------------------------------- diff --git a/bin/tests/test_create_win.js b/bin/tests/test_create_win.js deleted file mode 100644 index c634a94..0000000 --- a/bin/tests/test_create_win.js +++ /dev/null @@ -1,155 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -var build_path = __dirname + '/../..' - project_path = process.env.Temp + '\\example', - package_name = 'org.apache.cordova.example', - package_as_path = 'org/apache/cordova/example', - project_name = 'cordovaExample'; - -var path = require('path'), - fs = require('fs'), - util = require('util'), - assert = require('assert'), - exec = require('child_process').exec, - spawn = require('child_process').spawn; - -var version = fs.readFileSync(build_path + '/VERSION').toString().replace('\r\n', ''); - -assert(version !== undefined); -assert(version !== ''); - -process.on('uncaughtException', function (err) { - console.log('Caught exception: ' + err); - exec('rd /s /q ' + project_path); -}); - -var create_project = spawn('cscript', - [build_path + '/bin/create.js', - project_path, - package_name, - project_name] - ); - -create_project.stderr.on('data', function (data) { - console.log('ps stderr: ' + data); -}); - -create_project.stderr.on('data', function(data) { - console.log(data.toString()); -}); - -create_project.stdout.on('data', function(data) { - console.log(data.toString()); -}); - -create_project.on('exit', function(code) { - assert.equal(code, 0, 'Project did not get created'); - - // make sure the project was created - path.exists(project_path, function(exists) { - assert(exists, 'Project path does not exist'); - }); - - // make sure the build directory was cleaned up - // path.exists(build_path + '/framework/libs', function(exists) { - // assert(!exists, 'libs directory did not get cleaned up'); - // }); - path.exists(build_path + util.format('/framework/assets/cordova-%s.js', version), function(exists) { - assert(!exists, 'javascript file did not get cleaned up'); - }); - path.exists(build_path + util.format('/framework/cordova-%s.jar', version), function(exists) { - assert(!exists, 'jar file did not get cleaned up'); - }); - - // make sure AndroidManifest.xml was added - path.exists(util.format('%s/AndroidManifest.xml', project_path), function(exists) { - assert(exists, 'AndroidManifest.xml did not get created'); - // TODO check that the activity name was properly substituted - }); - - // make sure main Activity was added - path.exists(util.format('%s/src/%s/%s.java', project_path, package_as_path, project_name), function(exists) { - assert(exists, 'Activity did not get created'); - // TODO check that package name and activity name were substituted properly - }); - - // make sure config.xml was added - path.exists(util.format('%s/res/xml/config.xml', project_path), function(exists) { - assert(exists, 'config.xml did not get created'); - }); - - // make sure cordova.jar was added - path.exists(util.format('%s/libs/cordova-%s.jar', project_path, version), function(exists) { - assert(exists, 'cordova.jar did not get added'); - }); - - // make sure cordova.js was added - path.exists(util.format('%s/assets/www/cordova-%s.js', project_path, version), function(exists) { - assert(exists, 'cordova.js did not get added'); - }); - - // make sure cordova master script was added - path.exists(util.format('%s/cordova/cordova.bat', project_path), function(exists) { - assert(exists, 'cordova script did not get added'); - }); - - // make sure debug script was added - path.exists(util.format('%s/cordova/debug.bat', project_path), function(exists) { - assert(exists, 'debug script did not get added'); - }); - - // make sure BOOM script was added - path.exists(util.format('%s/cordova/BOOM.bat', project_path), function(exists) { - assert(exists, 'BOOM script did not get added'); - }); - - // make sure log script was added - path.exists(util.format('%s/cordova/log.bat', project_path), function(exists) { - assert(exists, 'log script did not get added'); - }); - - // make sure clean script was added - path.exists(util.format('%s/cordova/clean.bat', project_path), function(exists) { - assert(exists, 'clean script did not get added'); - }); - - // make sure emulate script was added - path.exists(util.format('%s/cordova/emulate.bat', project_path), function(exists) { - assert(exists, 'emulate script did not get added'); - }); - - // make sure appinfo.jar script was added - path.exists(util.format('%s/cordova/appinfo.jar', project_path), function(exists) { - assert(exists, 'appinfo.jar script did not get added'); - }); - - // check that project compiles && creates a cordovaExample-debug.apk - // XXX: !@##!@# WINDOWS - exec('ant debug -f ' + project_path + "\\build.xml", function(error, stdout, stderr) { - assert(error == null, "Cordova Android Project does not compile"); - path.exists(util.format('%s/bin/%s-debug.apk', project_path, project_name), - function(exists) { - assert(exists, 'Package did not get created'); - // if project compiles properly just AXE it - exec('rd /s /q ' + project_path); - }); - }); - - -}); -