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 12:12:24 UTC

[6/9] incubator-ignite git commit: #nodejs: rename directories nodejs to js.

#nodejs: rename directories nodejs to js.


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

Branch: refs/heads/ignite-nodejs
Commit: 0998c8be90587c906fe44da49ca8391e86b2f0a4
Parents: 15f07e1
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jun 8 13:00:42 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jun 8 13:00:42 2015 +0300

----------------------------------------------------------------------
 modules/nodejs/src/main/js/cache.js             |  56 ++++++++++
 modules/nodejs/src/main/js/ignition.js          |  50 +++++++++
 modules/nodejs/src/main/js/server.js            |  97 +++++++++++++++++
 modules/nodejs/src/main/nodejs/cache.js         |  56 ----------
 modules/nodejs/src/main/nodejs/ignition.js      |  50 ---------
 modules/nodejs/src/main/nodejs/server.js        |  97 -----------------
 modules/nodejs/src/test/js/rest-jetty.xml       |  53 +++++++++
 modules/nodejs/src/test/js/test-node.xml        |  97 +++++++++++++++++
 modules/nodejs/src/test/js/test.js              |  99 +++++++++++++++++
 modules/nodejs/src/test/js/test_ignition.js     |  32 ++++++
 modules/nodejs/src/test/js/test_runner.js       |  29 +++++
 modules/nodejs/src/test/js/test_utils.js        | 109 +++++++++++++++++++
 modules/nodejs/src/test/nodejs/rest-jetty.xml   |  53 ---------
 modules/nodejs/src/test/nodejs/test-node.xml    |  97 -----------------
 modules/nodejs/src/test/nodejs/test.js          |  99 -----------------
 modules/nodejs/src/test/nodejs/test_ignition.js |  32 ------
 modules/nodejs/src/test/nodejs/test_runner.js   |  29 -----
 modules/nodejs/src/test/nodejs/test_utils.js    | 109 -------------------
 18 files changed, 622 insertions(+), 622 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/main/js/cache.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/main/js/cache.js b/modules/nodejs/src/main/js/cache.js
new file mode 100644
index 0000000..59c8ece
--- /dev/null
+++ b/modules/nodejs/src/main/js/cache.js
@@ -0,0 +1,56 @@
+/**
+ * Creates an instance of Cache
+ *
+ * @constructor
+ * @this {Cache}
+ * @param {Server} server Server class
+ * @param {string} cacheName Cache name
+ */
+function Cache(server, cacheName) {
+    this._server = server;
+    this._cacheName = cacheName;
+    this._cacheNameParam = _pair("cacheName", this._cacheName);
+}
+
+/**
+ * Get cache value
+ *
+ * @this {Cache}
+ * @param {string} key Key
+ * @param {Cache~onGet} callback Called on finish
+ */
+Cache.prototype.get = function(key, callback) {
+    this._server.runCommand("get", [this._cacheNameParam, _pair("key", key)], callback);
+};
+
+/**
+ * Callback for cache get
+ * @callback Cache~onGet
+ * @param {string} error Error
+ * @param {string} result Result value
+ */
+
+/**
+ * Put cache value
+ *
+ * @this {Cache}
+ * @param {string} key Key
+ * @param {string} value Value
+ * @param {Cache~onPut} callback Called on finish
+ */
+Cache.prototype.put = function(key, value, callback) {
+    this._server.runCommand("put", [this._cacheNameParam, _pair("key", key), _pair("val", value)],
+        callback);
+}
+
+/**
+ * Callback for cache put
+ * @callback Cache~onPut
+ * @param {string} error Error
+ */
+
+function _pair(key, value) {
+    return {key: key, value: value}
+}
+
+exports.Cache = Cache
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/main/js/ignition.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/main/js/ignition.js b/modules/nodejs/src/main/js/ignition.js
new file mode 100644
index 0000000..72833a3
--- /dev/null
+++ b/modules/nodejs/src/main/js/ignition.js
@@ -0,0 +1,50 @@
+/**
+ * Creates an instance of Ignition
+ *
+ * @constructor
+ */
+function Ignition() {
+}
+
+/**
+ * Callback for Ignition start
+ *
+ * @callback Ignition~onStart
+ * @param {string} error Error
+ * @param {Server} server Connected server
+ */
+
+/**
+ * Open connection with server node
+ *
+ * @param {string[]} address List of nodes hosts with ports
+ * @param {Ignition~onStart} callback Called on finish
+ */
+Ignition.start = function(address, callback) {
+    var Server = require("./server").Server;
+    var numConn = address.length;
+    for (var addr of address) {
+        var params = addr.split(":");
+        var server = new Server(params[0], params[1]);
+        server.checkConnection(onConnect.bind(null, server));
+    }
+
+    function onConnect(server, error) {
+        if (!callback)
+            return;
+
+        numConn--;
+        if (!error) {
+            callback.call(null, null, server);
+            callback = null;
+            return;
+        }
+
+        console.log("onConnect:" + error);
+
+        if (!numConn)
+            callback.call(null, "Cannot connect to servers.", null);
+    }
+}
+
+exports.Ignition = Ignition;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/main/js/server.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/main/js/server.js b/modules/nodejs/src/main/js/server.js
new file mode 100644
index 0000000..3bb5f60
--- /dev/null
+++ b/modules/nodejs/src/main/js/server.js
@@ -0,0 +1,97 @@
+/**
+ * Creates an instance of Server
+ *
+ * @constructor
+ * @this {Server}
+ * @param {string} host Host address
+ * @param {number} port Port
+ */
+function Server(host, port) {
+    this._host = host;
+    this._port = port;
+}
+
+/**
+ * Host value
+ *
+ * @this {Server}
+ * @returns {string} Host value
+ */
+Server.prototype.host = function()
+{
+    return this._host;
+}
+
+/**
+ * Callback for Server runCommand
+ *
+ * @callback Server~onRunCommand
+ * @param {string} error Error
+ * @param {string} result Result value
+ */
+
+/**
+ * Run http request
+ *
+ * @this {Server}
+ * @param {string} cmdName command name.
+ * @param params Parameters for command.
+ * @param {Server~onRunCommand} Called on finish
+ */
+Server.prototype.runCommand = function(cmdName, params, callback) {
+    var paramsString = "";
+
+    for (var p of params)
+        //TODO: escape value
+        paramsString += "&" + p.key + "=" + p.value;
+
+    var requestQry = "cmd=" + cmdName + paramsString;
+
+    var http = require('http');
+
+    var options = {
+        host: this._host,
+        port: this._port,
+        path: "/ignite?" + requestQry
+    };
+
+    function streamCallback(response) {
+        var fullResponseString = '';
+
+        response.on('data', function (chunk) {
+            fullResponseString += chunk;
+        });
+
+        response.on('end', function () {
+            try {
+                var response = JSON.parse(fullResponseString);
+                if (response.successStatus)
+                    callback.call(null, response.error, null)
+                else
+                    callback.call(null, null, response.response);
+            } catch (e) {
+                console.log("fail on json parse: " + fullResponseString)
+                callback.call(null, e, null);
+            }
+        });
+    }
+
+    var request = http.request(options, streamCallback);
+
+    request.setTimeout(5000, callback.bind(null, "Request timeout: >5 sec"));
+
+    request.on('error', callback);
+    request.end();
+}
+
+/**
+ * Check the connection with server node.
+ *
+ * @this {Server}
+ * @param {Server~onRunCommand} callback Called on finish
+ */
+Server.prototype.checkConnection = function(callback) {
+    this.runCommand("version", [], callback);
+}
+
+exports.Server = Server;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/main/nodejs/cache.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/main/nodejs/cache.js b/modules/nodejs/src/main/nodejs/cache.js
deleted file mode 100644
index 59c8ece..0000000
--- a/modules/nodejs/src/main/nodejs/cache.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Creates an instance of Cache
- *
- * @constructor
- * @this {Cache}
- * @param {Server} server Server class
- * @param {string} cacheName Cache name
- */
-function Cache(server, cacheName) {
-    this._server = server;
-    this._cacheName = cacheName;
-    this._cacheNameParam = _pair("cacheName", this._cacheName);
-}
-
-/**
- * Get cache value
- *
- * @this {Cache}
- * @param {string} key Key
- * @param {Cache~onGet} callback Called on finish
- */
-Cache.prototype.get = function(key, callback) {
-    this._server.runCommand("get", [this._cacheNameParam, _pair("key", key)], callback);
-};
-
-/**
- * Callback for cache get
- * @callback Cache~onGet
- * @param {string} error Error
- * @param {string} result Result value
- */
-
-/**
- * Put cache value
- *
- * @this {Cache}
- * @param {string} key Key
- * @param {string} value Value
- * @param {Cache~onPut} callback Called on finish
- */
-Cache.prototype.put = function(key, value, callback) {
-    this._server.runCommand("put", [this._cacheNameParam, _pair("key", key), _pair("val", value)],
-        callback);
-}
-
-/**
- * Callback for cache put
- * @callback Cache~onPut
- * @param {string} error Error
- */
-
-function _pair(key, value) {
-    return {key: key, value: value}
-}
-
-exports.Cache = Cache
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/main/nodejs/ignition.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/main/nodejs/ignition.js b/modules/nodejs/src/main/nodejs/ignition.js
deleted file mode 100644
index 72833a3..0000000
--- a/modules/nodejs/src/main/nodejs/ignition.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Creates an instance of Ignition
- *
- * @constructor
- */
-function Ignition() {
-}
-
-/**
- * Callback for Ignition start
- *
- * @callback Ignition~onStart
- * @param {string} error Error
- * @param {Server} server Connected server
- */
-
-/**
- * Open connection with server node
- *
- * @param {string[]} address List of nodes hosts with ports
- * @param {Ignition~onStart} callback Called on finish
- */
-Ignition.start = function(address, callback) {
-    var Server = require("./server").Server;
-    var numConn = address.length;
-    for (var addr of address) {
-        var params = addr.split(":");
-        var server = new Server(params[0], params[1]);
-        server.checkConnection(onConnect.bind(null, server));
-    }
-
-    function onConnect(server, error) {
-        if (!callback)
-            return;
-
-        numConn--;
-        if (!error) {
-            callback.call(null, null, server);
-            callback = null;
-            return;
-        }
-
-        console.log("onConnect:" + error);
-
-        if (!numConn)
-            callback.call(null, "Cannot connect to servers.", null);
-    }
-}
-
-exports.Ignition = Ignition;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/main/nodejs/server.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/main/nodejs/server.js b/modules/nodejs/src/main/nodejs/server.js
deleted file mode 100644
index 3bb5f60..0000000
--- a/modules/nodejs/src/main/nodejs/server.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Creates an instance of Server
- *
- * @constructor
- * @this {Server}
- * @param {string} host Host address
- * @param {number} port Port
- */
-function Server(host, port) {
-    this._host = host;
-    this._port = port;
-}
-
-/**
- * Host value
- *
- * @this {Server}
- * @returns {string} Host value
- */
-Server.prototype.host = function()
-{
-    return this._host;
-}
-
-/**
- * Callback for Server runCommand
- *
- * @callback Server~onRunCommand
- * @param {string} error Error
- * @param {string} result Result value
- */
-
-/**
- * Run http request
- *
- * @this {Server}
- * @param {string} cmdName command name.
- * @param params Parameters for command.
- * @param {Server~onRunCommand} Called on finish
- */
-Server.prototype.runCommand = function(cmdName, params, callback) {
-    var paramsString = "";
-
-    for (var p of params)
-        //TODO: escape value
-        paramsString += "&" + p.key + "=" + p.value;
-
-    var requestQry = "cmd=" + cmdName + paramsString;
-
-    var http = require('http');
-
-    var options = {
-        host: this._host,
-        port: this._port,
-        path: "/ignite?" + requestQry
-    };
-
-    function streamCallback(response) {
-        var fullResponseString = '';
-
-        response.on('data', function (chunk) {
-            fullResponseString += chunk;
-        });
-
-        response.on('end', function () {
-            try {
-                var response = JSON.parse(fullResponseString);
-                if (response.successStatus)
-                    callback.call(null, response.error, null)
-                else
-                    callback.call(null, null, response.response);
-            } catch (e) {
-                console.log("fail on json parse: " + fullResponseString)
-                callback.call(null, e, null);
-            }
-        });
-    }
-
-    var request = http.request(options, streamCallback);
-
-    request.setTimeout(5000, callback.bind(null, "Request timeout: >5 sec"));
-
-    request.on('error', callback);
-    request.end();
-}
-
-/**
- * Check the connection with server node.
- *
- * @this {Server}
- * @param {Server~onRunCommand} callback Called on finish
- */
-Server.prototype.checkConnection = function(callback) {
-    this.runCommand("version", [], callback);
-}
-
-exports.Server = Server;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/js/rest-jetty.xml
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/js/rest-jetty.xml b/modules/nodejs/src/test/js/rest-jetty.xml
new file mode 100644
index 0000000..1ea2a38
--- /dev/null
+++ b/modules/nodejs/src/test/js/rest-jetty.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
+<Configure id="Server" class="org.eclipse.jetty.server.Server">
+    <Arg name="threadPool">
+        <!-- Default queued blocking thread pool -->
+        <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
+            <Set name="minThreads">20</Set>
+            <Set name="maxThreads">200</Set>
+        </New>
+    </Arg>
+    <New id="httpCfg" class="org.eclipse.jetty.server.HttpConfiguration">
+        <Set name="secureScheme">https</Set>
+        <Set name="securePort">8443</Set>
+        <Set name="sendServerVersion">true</Set>
+        <Set name="sendDateHeader">true</Set>
+    </New>
+    <Call name="addConnector">
+        <Arg>
+            <New class="org.eclipse.jetty.server.ServerConnector">
+                <Arg name="server"><Ref refid="Server"/></Arg>
+                <Arg name="factories">
+                    <Array type="org.eclipse.jetty.server.ConnectionFactory">
+                        <Item>
+                            <New class="org.eclipse.jetty.server.HttpConnectionFactory">
+                                <Ref refid="httpCfg"/>
+                            </New>
+                        </Item>
+                    </Array>
+                </Arg>
+                <Set name="host">
+                    <SystemProperty name="IGNITE_JETTY_HOST" default="localhost"/>
+                </Set>
+                <Set name="port">
+                    <SystemProperty name="IGNITE_JETTY_PORT" default="9095"/>
+                </Set>
+                <Set name="idleTimeout">30000</Set>
+                <Set name="reuseAddress">true</Set>
+            </New>
+        </Arg>
+    </Call>
+    <Set name="handler">
+        <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
+            <Set name="handlers">
+                <Array type="org.eclipse.jetty.server.Handler">
+                    <Item>
+                        <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
+                    </Item>
+                </Array>
+            </Set>
+        </New>
+    </Set>
+    <Set name="stopAtShutdown">false</Set>
+</Configure>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/js/test-node.xml
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/js/test-node.xml b/modules/nodejs/src/test/js/test-node.xml
new file mode 100644
index 0000000..a1a17e4
--- /dev/null
+++ b/modules/nodejs/src/test/js/test-node.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  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.
+-->
+
+<!--
+    Ignite configuration with all defaults and enabled p2p deployment and enabled events.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <!-- Set to true to enable distributed class loading for examples, default is false. -->
+        <property name="peerClassLoadingEnabled" value="true"/>
+
+        <property name="cacheConfiguration">
+            <list>
+                <!-- Partitioned cache example configuration (Atomic mode). -->
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="mycache"/>
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="backups" value="1"/>
+                </bean>
+            </list>
+        </property>
+
+        <property name="marshaller">
+            <bean class="org.apache.ignite.marshaller.optimized.OptimizedMarshaller">
+                <!-- Set to false to allow non-serializable objects in examples, default is true. -->
+                <property name="requireSerializable" value="false"/>
+            </bean>
+        </property>
+
+        <property name="connectorConfiguration">
+            <bean class="org.apache.ignite.configuration.ConnectorConfiguration">
+                <property name="jettyPath" value="rest-jetty.xml"/>
+            </bean>
+        </property>
+
+        <!-- Enable task execution events for examples. -->
+        <property name="includeEventTypes">
+            <list>
+                <!--Task execution events-->
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/>
+
+                <!--Cache events-->
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_REMOVED"/>
+            </list>
+        </property>
+
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <!--
+                        Ignite provides several options for automatic discovery that can be used
+                        instead os static IP based discovery. For information on all options refer
+                        to our documentation: http://apacheignite.readme.io/docs/cluster-config
+                    -->
+                    <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
+                    <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+                        <constructor-arg>
+                            <value>true</value>
+                        </constructor-arg>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/js/test.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/js/test.js b/modules/nodejs/src/test/js/test.js
new file mode 100644
index 0000000..bdce21d
--- /dev/null
+++ b/modules/nodejs/src/test/js/test.js
@@ -0,0 +1,99 @@
+module.exports = {
+    'Test put/get' : function(test) {
+        test.expect(1);
+
+        var TestUtils = require("./test_utils").TestUtils;
+        var Cache = require(TestUtils.scriptPath() + "cache").Cache;
+        var Server = require(TestUtils.scriptPath() + "server").Server;
+
+        var assert = require('assert');
+
+        //var node = startIgniteNode();
+
+        setTimeout(initCache, 10000); //If start node from javascrip set timeout 10000);
+
+        function initCache() {
+            var server = new Server('127.0.0.1', 9090);
+            var cache = new Cache(server, "mycache");
+            cache.put("mykey", "6", onPut.bind(null, cache));
+        }
+
+        function onPut(cache, error) {
+            if (error) {
+                console.error("Failed to put " + error);
+                finishTest(test/*, node*/);
+                return;
+            }
+
+            console.log("Put finished");
+            cache.get("mykey", onGet);
+        }
+
+        function onGet(error, value) {
+            if (error) {
+                console.error("Failed to get " + error);
+                finishTest(test/*, node*/);
+                return;
+            }
+
+            console.log("Get finished");
+            test.ok(value === "6", "This shouldn't fail " + value + "<>6");
+            finishTest(test/*, node*/);
+        }
+    },
+    'Test connection' : function(test) {
+        test.expect(0);
+
+        //var node = startIgniteNode();
+        var TestUtils = require("./test_utils").TestUtils;
+        var Server = require(TestUtils.scriptPath() + "server").Server;
+
+        setTimeout(initServer, 10000);
+
+        function initServer() {
+            var server = new Server('127.0.0.1', 9090);
+
+            console.log("Try to check connection");
+
+            server.checkConnection(onConnect);
+        }
+
+        function onConnect(error) {
+            if (error) {
+                finishWithError(test/*, node*/, error);
+                return;
+            }
+            console.log("Successfully connected");
+            finishTest(test/*, node*/);
+        }
+    },
+    'Test ignition' : function(test) {
+        test.expect(1);
+
+        //var node = startIgniteNode('127.0.0.1', 9090);
+        var TestUtils = require("./test_utils").TestUtils;
+        var Ignition = require(TestUtils.scriptPath() + "ignition").Ignition;
+
+        setTimeout(Ignition.start.bind(null, 9090, ['127.0.0.0', '127.0.0.1'], onConnect), 5000);
+
+        function onConnect(error, server) {
+            if (error) {
+                finishWithError(test/*, node*/, error);
+                return;
+            }
+            test.ok(server.host() === '127.0.0.1')
+            finishTest(test/*, node*/);
+        }
+    }
+ };
+
+function finishWithError(test/*, node*/, error) {
+    console.log("Error: " + error);
+    test.ok(false);
+    finishTest(test/*, node*/);
+}
+
+function finishTest(test/*, node*/) {
+    //node.kill();
+    test.done();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/js/test_ignition.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/js/test_ignition.js b/modules/nodejs/src/test/js/test_ignition.js
new file mode 100644
index 0000000..baa9615
--- /dev/null
+++ b/modules/nodejs/src/test/js/test_ignition.js
@@ -0,0 +1,32 @@
+var TestUtils = require("./test_utils").TestUtils;
+var Ignition = require(TestUtils.scriptPath() + "ignition").Ignition;
+
+exports.test_ignition_fail = function ()  {
+    Ignition.start(['127.0.0.3:9091', '127.0.0.1:9092'], onConnect);
+
+    function onConnect(error, server) {
+        if (error) {
+            if (error.indexOf("Cannot connect to servers.") == -1)
+                TestUtils.testFails("Incorrect error message: " + error);
+            else
+                TestUtils.testDone();
+
+            return;
+        }
+
+        TestUtils.testFails("Test should fail.");
+    }
+}
+
+exports.ignition_start_success = function() {
+    Ignition.start(['127.0.0.1:9095'], onConnect);
+
+    function onConnect(error, server) {
+        if (error) {
+            TestUtils.testFails(error);
+
+            return;
+        }
+        TestUtils.testDone();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/js/test_runner.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/js/test_runner.js b/modules/nodejs/src/test/js/test_runner.js
new file mode 100644
index 0000000..6f2cf2b
--- /dev/null
+++ b/modules/nodejs/src/test/js/test_runner.js
@@ -0,0 +1,29 @@
+/**
+ * Create instance of TestUtils
+ *
+ * @constructor
+ */
+function TestRunner() {
+}
+
+/**
+ * Test routine.
+ */
+TestRunner.runTest = function() {
+    var fileName = process.argv[2].toString().trim();
+
+    console.log("FileName " + fileName);
+
+    var test = require("./" + fileName);
+
+    var functionName = process.argv[3].toString().trim();
+
+    if (!test[functionName]) {
+        console.log("node js test failed: function with name " + functionName + " not found");
+        return;
+    }
+    test[functionName]();
+}
+
+
+TestRunner.runTest();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/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
new file mode 100644
index 0000000..dca6603
--- /dev/null
+++ b/modules/nodejs/src/test/js/test_utils.js
@@ -0,0 +1,109 @@
+/**
+ * Create instance of TestUtils
+ *
+ * @constructor
+ */
+function TestUtils() {
+}
+
+/**
+ * @returns {string} Path to script dir
+ */
+TestUtils.scriptPath = function() {
+    return TestUtils.igniteHome() +
+       TestUtils.sep() + "modules" +
+       TestUtils.sep() + "nodejs" +
+       TestUtils.sep() + "src" +
+       TestUtils.sep() + "main" +
+       TestUtils.sep() + "nodejs" + TestUtils.sep();
+}
+
+/**
+ * @returns {string} Ignite home path
+ */
+TestUtils.igniteHome = function() {
+    return process.env.IGNITE_HOME;
+}
+
+/**
+ * @returns {string} Path separator
+ */
+TestUtils.sep = function() {
+    return require('path').sep;
+}
+
+/**
+ * @param {string} dir Directory with all ignite libs
+ * @returns {string} Classpath for ignite node start
+ */
+TestUtils.classpath = function(dir) {
+    var fs = require('fs');
+    var path = require('path');
+    function walk(dir, done) {
+        var results = [];
+        var list = fs.readdirSync(dir)
+        for (var i = 0; i < list.length; ++i) {
+            file = path.resolve(dir, list[i]);
+            var stat = fs.statSync(file);
+            if (stat && stat.isDirectory()) {
+                if (list[i] != "optional" && file.indexOf("optional") !== -1 && file.indexOf("rest") == -1 )
+                    continue;
+
+                var sublist = walk(file);
+                results = results.concat(sublist);
+            } else {
+                if (file.indexOf(".jar") !== -1) {
+                    results.push(file);
+                }
+            }
+        }
+        return results;
+    };
+
+    return walk(dir);
+};
+
+/**
+ * @returns Process that starts ignite node
+ */
+TestUtils.startIgniteNode = function() {
+    var libs = classpath(igniteHome() +  TestUtils.sep() + "target" +
+        TestUtils.sep() + "bin" +
+        TestUtils.sep() + "apache-ignite-fabric-1.1.1-SNAPSHOT-bin" +
+        TestUtils.sep() + "libs");
+
+    var cp = libs.join(require('path').delimiter);
+
+    var spawn = require('child_process').spawn;
+
+    var child = spawn('java',['-classpath', cp, 'org.apache.ignite.startup.cmdline.CommandLineStartup',
+        "test-node.xml"]);
+
+    child.stdout.on('data', function (data) {
+        console.log("" + data);
+    });
+
+    child.stderr.on('data', function (data) {
+        console.log("" + data);
+    });
+
+    return child;
+}
+
+/**
+ * Print error to console
+ *
+ * @param {string} error Error
+ */
+TestUtils.testFails = function(error) {
+    console.log("Node JS test failed: " + error);
+}
+
+/**
+ * Print ok message to console
+ */
+TestUtils.testDone = function() {
+    console.log("Node JS test finished.")
+}
+
+exports.TestUtils = TestUtils;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/nodejs/rest-jetty.xml
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/nodejs/rest-jetty.xml b/modules/nodejs/src/test/nodejs/rest-jetty.xml
deleted file mode 100644
index 1ea2a38..0000000
--- a/modules/nodejs/src/test/nodejs/rest-jetty.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
-<Configure id="Server" class="org.eclipse.jetty.server.Server">
-    <Arg name="threadPool">
-        <!-- Default queued blocking thread pool -->
-        <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
-            <Set name="minThreads">20</Set>
-            <Set name="maxThreads">200</Set>
-        </New>
-    </Arg>
-    <New id="httpCfg" class="org.eclipse.jetty.server.HttpConfiguration">
-        <Set name="secureScheme">https</Set>
-        <Set name="securePort">8443</Set>
-        <Set name="sendServerVersion">true</Set>
-        <Set name="sendDateHeader">true</Set>
-    </New>
-    <Call name="addConnector">
-        <Arg>
-            <New class="org.eclipse.jetty.server.ServerConnector">
-                <Arg name="server"><Ref refid="Server"/></Arg>
-                <Arg name="factories">
-                    <Array type="org.eclipse.jetty.server.ConnectionFactory">
-                        <Item>
-                            <New class="org.eclipse.jetty.server.HttpConnectionFactory">
-                                <Ref refid="httpCfg"/>
-                            </New>
-                        </Item>
-                    </Array>
-                </Arg>
-                <Set name="host">
-                    <SystemProperty name="IGNITE_JETTY_HOST" default="localhost"/>
-                </Set>
-                <Set name="port">
-                    <SystemProperty name="IGNITE_JETTY_PORT" default="9095"/>
-                </Set>
-                <Set name="idleTimeout">30000</Set>
-                <Set name="reuseAddress">true</Set>
-            </New>
-        </Arg>
-    </Call>
-    <Set name="handler">
-        <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
-            <Set name="handlers">
-                <Array type="org.eclipse.jetty.server.Handler">
-                    <Item>
-                        <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
-                    </Item>
-                </Array>
-            </Set>
-        </New>
-    </Set>
-    <Set name="stopAtShutdown">false</Set>
-</Configure>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/nodejs/test-node.xml
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/nodejs/test-node.xml b/modules/nodejs/src/test/nodejs/test-node.xml
deleted file mode 100644
index a1a17e4..0000000
--- a/modules/nodejs/src/test/nodejs/test-node.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  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.
--->
-
-<!--
-    Ignite configuration with all defaults and enabled p2p deployment and enabled events.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util
-        http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <!-- Set to true to enable distributed class loading for examples, default is false. -->
-        <property name="peerClassLoadingEnabled" value="true"/>
-
-        <property name="cacheConfiguration">
-            <list>
-                <!-- Partitioned cache example configuration (Atomic mode). -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="mycache"/>
-                    <property name="atomicityMode" value="ATOMIC"/>
-                    <property name="backups" value="1"/>
-                </bean>
-            </list>
-        </property>
-
-        <property name="marshaller">
-            <bean class="org.apache.ignite.marshaller.optimized.OptimizedMarshaller">
-                <!-- Set to false to allow non-serializable objects in examples, default is true. -->
-                <property name="requireSerializable" value="false"/>
-            </bean>
-        </property>
-
-        <property name="connectorConfiguration">
-            <bean class="org.apache.ignite.configuration.ConnectorConfiguration">
-                <property name="jettyPath" value="rest-jetty.xml"/>
-            </bean>
-        </property>
-
-        <!-- Enable task execution events for examples. -->
-        <property name="includeEventTypes">
-            <list>
-                <!--Task execution events-->
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/>
-
-                <!--Cache events-->
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_REMOVED"/>
-            </list>
-        </property>
-
-        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
-        <property name="discoverySpi">
-            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
-                <property name="ipFinder">
-                    <!--
-                        Ignite provides several options for automatic discovery that can be used
-                        instead os static IP based discovery. For information on all options refer
-                        to our documentation: http://apacheignite.readme.io/docs/cluster-config
-                    -->
-                    <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
-                    <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
-                        <constructor-arg>
-                            <value>true</value>
-                        </constructor-arg>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/nodejs/test.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/nodejs/test.js b/modules/nodejs/src/test/nodejs/test.js
deleted file mode 100644
index bdce21d..0000000
--- a/modules/nodejs/src/test/nodejs/test.js
+++ /dev/null
@@ -1,99 +0,0 @@
-module.exports = {
-    'Test put/get' : function(test) {
-        test.expect(1);
-
-        var TestUtils = require("./test_utils").TestUtils;
-        var Cache = require(TestUtils.scriptPath() + "cache").Cache;
-        var Server = require(TestUtils.scriptPath() + "server").Server;
-
-        var assert = require('assert');
-
-        //var node = startIgniteNode();
-
-        setTimeout(initCache, 10000); //If start node from javascrip set timeout 10000);
-
-        function initCache() {
-            var server = new Server('127.0.0.1', 9090);
-            var cache = new Cache(server, "mycache");
-            cache.put("mykey", "6", onPut.bind(null, cache));
-        }
-
-        function onPut(cache, error) {
-            if (error) {
-                console.error("Failed to put " + error);
-                finishTest(test/*, node*/);
-                return;
-            }
-
-            console.log("Put finished");
-            cache.get("mykey", onGet);
-        }
-
-        function onGet(error, value) {
-            if (error) {
-                console.error("Failed to get " + error);
-                finishTest(test/*, node*/);
-                return;
-            }
-
-            console.log("Get finished");
-            test.ok(value === "6", "This shouldn't fail " + value + "<>6");
-            finishTest(test/*, node*/);
-        }
-    },
-    'Test connection' : function(test) {
-        test.expect(0);
-
-        //var node = startIgniteNode();
-        var TestUtils = require("./test_utils").TestUtils;
-        var Server = require(TestUtils.scriptPath() + "server").Server;
-
-        setTimeout(initServer, 10000);
-
-        function initServer() {
-            var server = new Server('127.0.0.1', 9090);
-
-            console.log("Try to check connection");
-
-            server.checkConnection(onConnect);
-        }
-
-        function onConnect(error) {
-            if (error) {
-                finishWithError(test/*, node*/, error);
-                return;
-            }
-            console.log("Successfully connected");
-            finishTest(test/*, node*/);
-        }
-    },
-    'Test ignition' : function(test) {
-        test.expect(1);
-
-        //var node = startIgniteNode('127.0.0.1', 9090);
-        var TestUtils = require("./test_utils").TestUtils;
-        var Ignition = require(TestUtils.scriptPath() + "ignition").Ignition;
-
-        setTimeout(Ignition.start.bind(null, 9090, ['127.0.0.0', '127.0.0.1'], onConnect), 5000);
-
-        function onConnect(error, server) {
-            if (error) {
-                finishWithError(test/*, node*/, error);
-                return;
-            }
-            test.ok(server.host() === '127.0.0.1')
-            finishTest(test/*, node*/);
-        }
-    }
- };
-
-function finishWithError(test/*, node*/, error) {
-    console.log("Error: " + error);
-    test.ok(false);
-    finishTest(test/*, node*/);
-}
-
-function finishTest(test/*, node*/) {
-    //node.kill();
-    test.done();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/nodejs/test_ignition.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/nodejs/test_ignition.js b/modules/nodejs/src/test/nodejs/test_ignition.js
deleted file mode 100644
index baa9615..0000000
--- a/modules/nodejs/src/test/nodejs/test_ignition.js
+++ /dev/null
@@ -1,32 +0,0 @@
-var TestUtils = require("./test_utils").TestUtils;
-var Ignition = require(TestUtils.scriptPath() + "ignition").Ignition;
-
-exports.test_ignition_fail = function ()  {
-    Ignition.start(['127.0.0.3:9091', '127.0.0.1:9092'], onConnect);
-
-    function onConnect(error, server) {
-        if (error) {
-            if (error.indexOf("Cannot connect to servers.") == -1)
-                TestUtils.testFails("Incorrect error message: " + error);
-            else
-                TestUtils.testDone();
-
-            return;
-        }
-
-        TestUtils.testFails("Test should fail.");
-    }
-}
-
-exports.ignition_start_success = function() {
-    Ignition.start(['127.0.0.1:9095'], onConnect);
-
-    function onConnect(error, server) {
-        if (error) {
-            TestUtils.testFails(error);
-
-            return;
-        }
-        TestUtils.testDone();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/nodejs/test_runner.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/nodejs/test_runner.js b/modules/nodejs/src/test/nodejs/test_runner.js
deleted file mode 100644
index 6f2cf2b..0000000
--- a/modules/nodejs/src/test/nodejs/test_runner.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Create instance of TestUtils
- *
- * @constructor
- */
-function TestRunner() {
-}
-
-/**
- * Test routine.
- */
-TestRunner.runTest = function() {
-    var fileName = process.argv[2].toString().trim();
-
-    console.log("FileName " + fileName);
-
-    var test = require("./" + fileName);
-
-    var functionName = process.argv[3].toString().trim();
-
-    if (!test[functionName]) {
-        console.log("node js test failed: function with name " + functionName + " not found");
-        return;
-    }
-    test[functionName]();
-}
-
-
-TestRunner.runTest();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0998c8be/modules/nodejs/src/test/nodejs/test_utils.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/nodejs/test_utils.js b/modules/nodejs/src/test/nodejs/test_utils.js
deleted file mode 100644
index dca6603..0000000
--- a/modules/nodejs/src/test/nodejs/test_utils.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Create instance of TestUtils
- *
- * @constructor
- */
-function TestUtils() {
-}
-
-/**
- * @returns {string} Path to script dir
- */
-TestUtils.scriptPath = function() {
-    return TestUtils.igniteHome() +
-       TestUtils.sep() + "modules" +
-       TestUtils.sep() + "nodejs" +
-       TestUtils.sep() + "src" +
-       TestUtils.sep() + "main" +
-       TestUtils.sep() + "nodejs" + TestUtils.sep();
-}
-
-/**
- * @returns {string} Ignite home path
- */
-TestUtils.igniteHome = function() {
-    return process.env.IGNITE_HOME;
-}
-
-/**
- * @returns {string} Path separator
- */
-TestUtils.sep = function() {
-    return require('path').sep;
-}
-
-/**
- * @param {string} dir Directory with all ignite libs
- * @returns {string} Classpath for ignite node start
- */
-TestUtils.classpath = function(dir) {
-    var fs = require('fs');
-    var path = require('path');
-    function walk(dir, done) {
-        var results = [];
-        var list = fs.readdirSync(dir)
-        for (var i = 0; i < list.length; ++i) {
-            file = path.resolve(dir, list[i]);
-            var stat = fs.statSync(file);
-            if (stat && stat.isDirectory()) {
-                if (list[i] != "optional" && file.indexOf("optional") !== -1 && file.indexOf("rest") == -1 )
-                    continue;
-
-                var sublist = walk(file);
-                results = results.concat(sublist);
-            } else {
-                if (file.indexOf(".jar") !== -1) {
-                    results.push(file);
-                }
-            }
-        }
-        return results;
-    };
-
-    return walk(dir);
-};
-
-/**
- * @returns Process that starts ignite node
- */
-TestUtils.startIgniteNode = function() {
-    var libs = classpath(igniteHome() +  TestUtils.sep() + "target" +
-        TestUtils.sep() + "bin" +
-        TestUtils.sep() + "apache-ignite-fabric-1.1.1-SNAPSHOT-bin" +
-        TestUtils.sep() + "libs");
-
-    var cp = libs.join(require('path').delimiter);
-
-    var spawn = require('child_process').spawn;
-
-    var child = spawn('java',['-classpath', cp, 'org.apache.ignite.startup.cmdline.CommandLineStartup',
-        "test-node.xml"]);
-
-    child.stdout.on('data', function (data) {
-        console.log("" + data);
-    });
-
-    child.stderr.on('data', function (data) {
-        console.log("" + data);
-    });
-
-    return child;
-}
-
-/**
- * Print error to console
- *
- * @param {string} error Error
- */
-TestUtils.testFails = function(error) {
-    console.log("Node JS test failed: " + error);
-}
-
-/**
- * Print ok message to console
- */
-TestUtils.testDone = function() {
-    console.log("Node JS test finished.")
-}
-
-exports.TestUtils = TestUtils;
\ No newline at end of file