You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/08 16:43:51 UTC

incubator-ignite git commit: #ignite-961: add method startIgniteNode to node js test-utils.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-961 84ffe4358 -> 040bfde03


#ignite-961: add method startIgniteNode to node js test-utils.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/040bfde0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/040bfde0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/040bfde0

Branch: refs/heads/ignite-961
Commit: 040bfde038739f43f784dfc4c6677b0b43a640d2
Parents: 84ffe43
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jun 8 17:43:43 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jun 8 17:43:43 2015 +0300

----------------------------------------------------------------------
 modules/nodejs/src/test/js/test-put-get.js |  6 +++---
 modules/nodejs/src/test/js/test-utils.js   | 11 +++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/040bfde0/modules/nodejs/src/test/js/test-put-get.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/js/test-put-get.js b/modules/nodejs/src/test/js/test-put-get.js
index 4ea0764..12a9530 100644
--- a/modules/nodejs/src/test/js/test-put-get.js
+++ b/modules/nodejs/src/test/js/test-put-get.js
@@ -18,16 +18,15 @@
 var TestUtils = require("./test-utils").TestUtils;
 
 var Apache = require(TestUtils.scriptPath());
-var Ignition = Apache.Ignition;
 var Cache = Apache.Cache;
 var Server = Apache.Server;
 
 testPutGet = function() {
-  Ignition.start(['127.0.0.1:9095'], onStart.bind(null, onPut, "mycache"));
+  TestUtils.startIgniteNode(onStart.bind(null, onPut, "mycache"));
 }
 
 testIncorrectCacheName = function() {
-  Ignition.start(['127.0.0.1:9095'], onStart.bind(null, onIncorrectPut, "mycache1"));
+  TestUtils.startIgniteNode(onStart.bind(null, onIncorrectPut, "mycache1"));
 }
 
 function onStart(onPut1, cacheName, error, ignite) {
@@ -51,6 +50,7 @@ function onGet(error, value) {
     console.error("Failed to get " + error);
 
     TestUtils.testFails("Incorrect error message: " + error);
+
     return;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/040bfde0/modules/nodejs/src/test/js/test-utils.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/js/test-utils.js b/modules/nodejs/src/test/js/test-utils.js
index 9534ce6..d0785be 100644
--- a/modules/nodejs/src/test/js/test-utils.js
+++ b/modules/nodejs/src/test/js/test-utils.js
@@ -123,4 +123,15 @@ TestUtils.testDone = function() {
     console.log("Node JS test finished.")
 }
 
+/**
+ * Starts ignite node with default config
+ *
+ * @param {Ignition~onStart} callback Called on connect
+ */
+TestUtils.startIgniteNode = function(callback) {
+  var Apache = require(TestUtils.scriptPath());
+  var Ignition = Apache.Ignition;
+  Ignition.start(['127.0.0.1:9095'], callback);
+}
+
 exports.TestUtils = TestUtils;