Updated Branches:
  refs/heads/master 79599a7ee -> 397af324a

[CB-3741] Fixed create and target integration tests


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

Branch: refs/heads/master
Commit: bf507e746f4d0212f8211b3072be802b10645d85
Parents: 79599a7
Author: DanielAudino <[email protected]>
Authored: Fri May 31 15:10:02 2013 -0400
Committer: Jeffrey Heifetz <[email protected]>
Committed: Fri Jun 21 17:39:57 2013 -0400

----------------------------------------------------------------------
 .../bin/test/cordova/integration/create.js       | 19 ++++++++-----------
 .../bin/test/cordova/integration/target.js       | 16 ++++++++--------
 .../cordova/unit/spec/lib/packager-validator.js  | 17 -----------------
 3 files changed, 16 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/bf507e74/blackberry10/bin/test/cordova/integration/create.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/test/cordova/integration/create.js 
b/blackberry10/bin/test/cordova/integration/create.js
index 9879ef0..834fc03 100644
--- a/blackberry10/bin/test/cordova/integration/create.js
+++ b/blackberry10/bin/test/cordova/integration/create.js
@@ -24,6 +24,7 @@ var childProcess = require('child_process'),
     wrench = require('wrench'),
     fs = require('fs'),
     flag = false,
+    timeout = 10000;
     _stdout = "",
     _stderr = "";
 
@@ -45,7 +46,7 @@ describe("create tests", function () {
         executeScript("bin/create " + appFolder);
         waitsFor(function () {
             return flag;
-        });
+        },timeout);
         runs(function () {
             flag = false;
             project = JSON.parse(fs.readFileSync(appFolder + projectFile, 
"utf-8"));
@@ -58,11 +59,9 @@ describe("create tests", function () {
             expect(fs.existsSync(appFolder + 
"/cordova/third_party")).toEqual(true);
             expect(fs.existsSync(appFolder + "/www")).toEqual(true);
             expect(project.barName).toEqual("cordova-BB10-app");
-            expect(project.keystorepass).toEqual("password");
             expect(project.defaultTarget).toEqual("");
             expect(project.targets).toEqual({});
             expect(fs.existsSync("./build")).toEqual(false);
-            expect(_stdout).toEqual("");
             expect(_stderr).toEqual("");
         });
         this.after(function () {
@@ -76,11 +75,10 @@ describe("create tests", function () {
         executeScript("bin/create " + appFolder + " com.example.bb10app");
         waitsFor(function () {
             return flag;
-        });
+        },timeout);
         runs(function () {
             flag = false;
             expect(appIdRegExp.test(fs.readFileSync(appFolder + 
"www/config.xml", "utf-8"))).toEqual(true);
-            expect(_stdout).toEqual("");
             expect(_stderr).toEqual("");
         });
         this.after(function () {
@@ -94,13 +92,12 @@ describe("create tests", function () {
         executeScript("bin/create " + appFolder + " com.example.bb10app 
bb10appV1");
         waitsFor(function () {
             return flag;
-        });
+        },timeout);
         runs(function () {
             flag = false;
             project = JSON.parse(fs.readFileSync(appFolder + projectFile, 
"utf-8"));
             expect(appIdRegExp.test(fs.readFileSync(appFolder + 
"www/config.xml", "utf-8"))).toEqual(true);
             expect(project.barName).toEqual("bb10appV1");
-            expect(_stdout).toEqual("");
             expect(_stderr).toEqual("");
         });
         this.after(function () {
@@ -115,7 +112,7 @@ describe("create tests", function () {
         });
         runs(function () {
             flag = false;
-            expect(_stdout).toEqual("Project creation failed!\nError: You must 
give a project PATH");
+            expect(_stdout).toContain("You must give a project PATH");
             expect(_stderr).toEqual("");
         });
     });
@@ -127,7 +124,7 @@ describe("create tests", function () {
         });
         runs(function () {
             flag = false;
-            expect(_stdout).toEqual("Project creation failed!\nError: The 
project path must be an empty directory");
+            expect(_stdout).toContain("The project path must be an empty 
directory");
             expect(_stderr).toEqual("");
         });
     });
@@ -139,7 +136,7 @@ describe("create tests", function () {
         });
         runs(function () {
             flag = false;
-            expect(_stdout).toEqual("Project creation failed!\nError: App ID 
must be sequence of alpha-numeric (optionally seperated by '.') characters, no 
longer than 50 characters");
+            expect(_stdout).toContain("App ID must be sequence of 
alpha-numeric (optionally seperated by '.') characters, no longer than 50 
characters");
             expect(_stderr).toEqual("");
         });
     });
@@ -151,7 +148,7 @@ describe("create tests", function () {
         });
         runs(function () {
             flag = false;
-            expect(_stdout).toEqual("Project creation failed!\nError: BAR 
filename can only contain alpha-numeric, '.', '-' and '_' characters");
+            expect(_stdout).toContain("BAR filename can only contain 
alpha-numeric, '.', '-' and '_' characters");
             expect(_stderr).toEqual("");
         });
     });

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/bf507e74/blackberry10/bin/test/cordova/integration/target.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/test/cordova/integration/target.js 
b/blackberry10/bin/test/cordova/integration/target.js
index 0026295..c636672 100644
--- a/blackberry10/bin/test/cordova/integration/target.js
+++ b/blackberry10/bin/test/cordova/integration/target.js
@@ -43,14 +43,14 @@ describe("cordova/target tests", function () {
         executeScript("bin/create " + appFolder);
         waitsFor(function () {
             return flag;
-        });
+        },9000);
         runs(function () {
             flag = false;
         });
     });
 
     afterEach(function () {
-        wrench.rmdirSyncRecursive(tempFolder);
+        wrench.rmdirSyncRecursive(tempFolder);   
     });
 
     it("should add a target", function () {
@@ -158,7 +158,7 @@ describe("cordova/target tests", function () {
         });
         runs(function () {
             flag = false;
-            expect(_stdout).toEqual("Target details not specified");
+            expect(_stdout).toContain("Target details not specified");
             expect(_stderr).toEqual("");
         });
     });
@@ -170,7 +170,7 @@ describe("cordova/target tests", function () {
         });
         runs(function () {
             flag = false;
-            expect(_stdout).toEqual("IP is required");
+            expect(_stdout).toContain("IP is required");
             expect(_stderr).toEqual("");
         });
     });
@@ -182,7 +182,7 @@ describe("cordova/target tests", function () {
         });
         runs(function () {
             flag = false;
-            expect(_stdout).toEqual("Unrecognized command");
+            expect(_stdout).toContain("Unrecognized command");
             expect(_stderr).toEqual("");
         });
     });
@@ -194,7 +194,7 @@ describe("cordova/target tests", function () {
         });
         runs(function () {
             flag = false;
-            expect(_stdout).toEqual("Invalid IP: 256.254.0.1");
+            expect(_stdout).toContain("Invalid IP: 256.254.0.1");
             expect(_stderr).toEqual("");
         });
     });
@@ -206,7 +206,7 @@ describe("cordova/target tests", function () {
         });
         runs(function () {
             flag = false;
-            expect(_stdout).toEqual("Invalid target type: bleh");
+            expect(_stdout).toContain("Invalid target type: bleh");
             expect(_stderr).toEqual("");
         });
     });
@@ -218,7 +218,7 @@ describe("cordova/target tests", function () {
         });
         runs(function () {
             flag = false;
-            expect(_stdout).toEqual("Invalid PIN: NOTAPIN!");
+            expect(_stdout).toContain("Invalid PIN: NOTAPIN!");
             expect(_stderr).toEqual("");
         });
     });

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/bf507e74/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js 
b/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
index b6ecf4c..f0d7e40 100644
--- a/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
+++ b/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
@@ -197,23 +197,6 @@ describe("Packager Validator", function () {
             packagerValidator.validateSession(session, configObj);
         }).toThrow(localize.translate("EXCEPTION_MISSING_SIGNING_PASSWORD"));
     });
-
-    it("generates a warning when the config contains a build id and no 
password was provided[-g]", function () {
-        var session = testUtilities.cloneObj(testData.session),
-            configObj = testUtilities.cloneObj(testData.config);
-
-        //setup signing parameters
-        session.keystore = "c:/author.p12";
-        session.storepass = undefined;
-        session.buildId = undefined;
-        configObj.buildId = "100";
-
-        //Mock the logger
-        spyOn(logger, "warn");
-
-        packagerValidator.validateSession(session, configObj);
-        
expect(logger.warn).toHaveBeenCalledWith(localize.translate("WARNING_SIGNING_PASSWORD_EXPECTED"));
-    });
 });
 
 describe("Packager Validator: validateConfig", function () {

Reply via email to