You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2014/08/28 05:48:33 UTC

[26/51] [partial] rename folder /datajs into /odatajs. no file modification.

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/d5ec5557/datajs/tests/store-tests.js
----------------------------------------------------------------------
diff --git a/datajs/tests/store-tests.js b/datajs/tests/store-tests.js
deleted file mode 100644
index 48169c3..0000000
--- a/datajs/tests/store-tests.js
+++ /dev/null
@@ -1,705 +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.
- */
-
-// odata-tests.js
-(function (window, undefined) {
-
-    var cleanDomStorage = function () {
-        /** Cleans all the data saved in the browser's DOM Storage.
-        */
-        if (window.localStorage) {
-            window.localStorage.clear();
-        }
-    };
-
-    var cleanMemoryStorage = function () {
-        /** Clean memory storage is a no op.
-        */
-    };
-
-    var cleanIndexedDbStorage = function () {
-        var stores = this.stores;
-        $.each(stores, function (_, store) {
-            store.close();
-        });
-
-        djstest.wait(function (done) {
-            djstest.cleanStoreOnIndexedDb(stores, done);
-        });
-    };
-
-    var canCreateMemoryStore = function () {
-        /** Checks whether memory storage is supported by the browser.
-         * @returns {boolean} True
-         */
-        return true;
-    };
-
-    var canCreateDomStore = function () {
-        /** Checks whether Web Storage (DOM Storage) is supported by the browser.
-         * @returns {boolean} True if DOM Storage is supported by the browser; false otherwise.
-         */
-        return !!window.localStorage;
-    };
-
-    var canCreateIndexedDb = function () {
-        /** Checks whether Web Storage (DOM Storage) is supported by the browser.
-         * @returns {Boolean} True if IndexedDB is supported by the browser, false otherwise.
-         */
-        return !!djstest.indexedDB;
-    };
-
-    var canCreateStore = function (mechanism) {
-        /** Determines whether a particular mechanism is supported by the browser.
-         * @param {String} mechanism - Mechanism name.
-         * @returns {Boolean} True if the mechanism is supported by the browser; otherwise false.
-         */
-        var implementation = mechanismImplementations[mechanism];
-        return implementation && implementation.canCreate();
-    }
-    var makeUnexpectedErrorHandler = function (fail) {
-        return function (err) {
-            djstest.fail("error: " + err.name + " -- message: " + err.message);
-            fail();
-        };
-    };
-
-    var testJobDone = function (succeeded) {
-        if (!succeeded) {
-            djstest.fail("Job completed but some of the functions it called failed");
-        }
-        djstest.done();
-    };
-
-    var mechanismImplementations = {
-        indexeddb: { factory: odatajs.IndexedDBStore, canCreate: canCreateIndexedDb, cleanup: cleanIndexedDbStorage },
-        dom: { factory: odatajs.DomStore, canCreate: canCreateDomStore, cleanup: cleanDomStorage },
-        memory: { factory: odatajs.MemoryStore, canCreate: canCreateMemoryStore, cleanup: cleanMemoryStorage }
-    };
-
-    var oldWindowOnError;
-
-    for (var mechanism in mechanismImplementations) {
-        module("Unit", {
-            mechanism: mechanism,
-            createStore: function (name) {
-                var store = odatajs.store.createStore(name + "_" + this.mechanism, this.mechanism);
-                this.stores.push(store);
-                return store;
-            },
-            setup: function () {
-                this.stores = [];
-                mechanismImplementations[this.mechanism].cleanup.call(this);
-
-                // FireFox 7.0.1 bubbles an error event when there is an IndexedDB error, even when the error has been handled graciously.
-                // This is a work around to keep QUnit from reporting false failures in IndexedDB negative tests.
-                if (this.mechanism === "indexeddb") {
-                    oldWindowOnError = window.onerror;
-                    window.onerror = null;
-                }
-            },
-            teardown: function () {
-                mechanismImplementations[this.mechanism].cleanup.call(this);
-                this.stores = [];
-
-                // Restore QUnit's onerror handler.
-                if (this.mechanism === "indexeddb") {
-                    window.onerror = oldWindowOnError;
-                }
-            }
-        });
-
-        if (!canCreateStore(mechanism)) {
-            djstest.addTest(function (mechanism) {
-                djstest.expectException(function () {
-                    mechanismImplemenatations[mechanism].factory.create("my horrible not working store");
-                });
-                djstest.done();
-            }, "Local storage mechanism " + mechanism + " not supported by this browser", mechanism);
-        } else {
-
-            djstest.addTest(function storeAddTest(mechanism) {
-                var tuples = [
-                    { key: "null", value: null },
-                    { key: "undefined", value: undefined },
-                    { key: "number", value: 12345.678 },
-                    { key: "string", value: "String value" },
-                    { key: "date", value: new Date() },
-                    { key: "object", value: { p1: 1234, nested: { p1: "a", p2: "b"}} },
-                    { key: "array", value: [1, 2, 3, 4, 5] },
-                    { key: "key1", value: "some value" },
-                    { key: "key1", value: "this should fail", error: true },
-                    { key: ["key", "key2"], value: ["value", "value2"], error: mechanism !== "indexeddb" },
-                    { key: ["key6", "key7", "key6"], value: ["value", "value2", "value3"], error: true }
-                ];
-
-                var store = this.createStore("store1");
-                var job = new djstest.Job();
-
-                $.each(tuples, function (_, tuple) {
-                    job.queue(function task(success, fail) {
-
-                        var unexpectedError = makeUnexpectedErrorHandler(fail);
-                        djstest.log("running task");
-
-                        store.add(tuple.key, tuple.value,
-                            function (key, value) {
-                                djstest.assertAreEqual(key, tuple.key, "Keys match for " + mechanism + " - key = " + key.toString());
-                                djstest.assertAreEqualDeep(value, tuple.value, "Values match for " + mechanism + " - key = " + key.toString());
-
-                                job.queueNext(function (success, fail) {
-                                    store.read(tuple.key, function (key, value) {
-                                        djstest.assertAreEqualDeep(value, tuple.value, "Key: " + key + " is present in the store");
-                                        success();
-                                    }, makeUnexpectedErrorHandler(fail));
-                                });
-                                success();
-                            },
-                            function (err) {
-                                if (!tuple.error) {
-                                    unexpectedError(err);
-                                } else {
-                                    djstest.pass("error handler was called as expected");
-                                    success();
-                                }
-                            });
-                    });
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    testJobDone(succeeded);
-                });
-
-            }, "Store Add Test with mechanism " + mechanism, mechanism);
-
-            djstest.addTest(function storeAddOrUpdateTest(mechanism) {
-                var tuples = [
-                    { key: "null", value: null },
-                    { key: "undefined", value: undefined },
-                    { key: "number", value: 12345.678 },
-                    { key: "string", value: "String value" },
-                    { key: "date", value: new Date() },
-                    { key: "object", value: { p1: 1234, nested: { p1: "a", p2: "b"}} },
-                    { key: "array", value: [1, 2, 3, 4, 5] },
-                    { key: "key1", value: "some value" },
-                    { key: "key1", value: "this should not fail" },
-                    { key: ["key", "key2", "key3"], value: ["value", "value2", "value3"], error: mechanism !== "indexeddb" },
-                    { key: ["key", "key2", "key3"], value: ["value4", "value5", "value6"], error: mechanism !== "indexeddb" },
-                    { key: "key1", value: 456 }
-                ];
-
-                var store = this.createStore("store2");
-                var job = new djstest.Job();
-
-                $.each(tuples, function (_, tuple) {
-                    job.queue(function (success, fail) {
-
-                        var unexpectedError = makeUnexpectedErrorHandler(fail);
-
-                        store.addOrUpdate(tuple.key, tuple.value,
-                            function (key, value) {
-                                djstest.assert(!tuple.error, "success should be called");
-                                djstest.assertAreEqual(key, tuple.key, "Keys match");
-                                djstest.assertAreEqualDeep(value, tuple.value, "Values match");
-
-                                store.read(tuple.key, function (key, value) {
-                                    djstest.assertAreEqual(key, tuple.key, "Keys match");
-                                    djstest.assertAreEqualDeep(value, tuple.value, "Values match");
-                                    success();
-                                }, unexpectedError);
-                            },
-                            function (err) {
-                                if (!tuple.error) {
-                                    unexpectedError(err);
-                                } else {
-                                    djstest.pass("error handler was called as expected");
-                                    success();
-                                }
-                            });
-                    });
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    testJobDone(succeeded);
-                });
-            }, "Store Add or Update Test with mechanism " + mechanism, mechanism);
-
-            djstest.addTest(function storeContainsTest(mechanism) {
-                var store = this.createStore("store3");
-                var job = new djstest.Job();
-
-                job.queue(function (success, fail) {
-                    store.add("Key1", "Some value", success, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.contains("Key1", function (contained) {
-                        djstest.assert(contained, "Key is present in the store");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.contains("Key2", function (contained) {
-                        djstest.assert(!contained, "Key is not present in the store");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    testJobDone(succeeded);
-                });
-
-            }, "Store Contains Test with mechanism " + mechanism, mechanism);
-
-            djstest.addTest(function storeGetAllKeysTest(mechanism) {
-                var store = this.createStore("store4");
-                var store2 = this.createStore("store4_1");
-
-                var expectedKeys = [];
-                var job = new djstest.Job();
-
-                var i;
-                for (i = 1; i <= 20; i++) {
-                    (function (i) {
-                        job.queue(function (success, fail) {
-                            store.add(i.toString(), "value" + i, success, makeUnexpectedErrorHandler(fail));
-                        });
-
-                        job.queue(function (success, fail) {
-                            store2.add((i + 20).toString(), "value" + (i + 20), success, makeUnexpectedErrorHandler(fail));
-                        });
-                    })(i);
-
-                    expectedKeys.push(i.toString());
-                }
-
-                job.queue(function (success, fail) {
-                    store.getAllKeys(function (keys) {
-                        expectedKeys.sort();
-                        keys.sort();
-                        djstest.assertAreEqualDeep(keys, expectedKeys, "All expected keys where returned");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    store2.close();
-                    testJobDone(succeeded);
-                });
-            }, "Store Get All Keys Test with mechanism " + mechanism, mechanism);
-
-            djstest.addTest(function storeReadTest(mechanism) {
-                var tuples = [
-                    { key: "null", value: null },
-                    { key: "undefined", value: undefined },
-                    { key: "number", value: 12345.678 },
-                    { key: "string", value: "String value" },
-                    { key: "date", value: new Date() },
-                    { key: "dateOffset", value: (function () {
-                        var d = new Date();
-                        d.__type = "Edm.DateTimeOffset";
-                        d.__offset = "+03:30";
-                        return d;
-                    })()
-                    },
-                    { key: "complexDate", value: (function () {
-                        var d = new Date();
-                        d.nestedDate = new Date();
-                        d.nestedDate.__type = "Edm.DateTimeOffset";
-                        d.nestedDate.__offset = "+03:30";
-                        return d;
-                    })()
-                    },
-                    { key: "object", value: { p1: 1234, nested: { p1: "a", p2: "b", p3: new Date()}} },
-                    { key: "array", value: [1, 2, 3, 4, 5] }
-                ];
-
-                var store = this.createStore("store5");
-                var job = new djstest.Job();
-
-                $.each(tuples, function (_, tuple) {
-                    job.queue(function (success, fail) {
-                        store.add(tuple.key, tuple.value,
-                            function () {
-                                job.queue(function (success, fail) {
-                                    store.read(tuple.key, function (key, value) {
-                                        djstest.assertAreEqual(key, tuple.key, "Keys match");
-                                        djstest.assertAreEqualDeep(value, tuple.value, "Values match");
-                                        success();
-                                    }, makeUnexpectedErrorHandler(fail));
-                                });
-                                success();
-                            },
-                           function (err) {
-                               if (!tuple.error) {
-                                   djstest.fail(err.message);
-                                   fail();
-                               } else {
-                                   djstest.pass("error handler was called as expected");
-                                   success();
-                               }
-                           });
-                    });
-                });
-
-                job.queue(function (success, fail) {
-                    store.read("Unknown key", function (key, value) {
-                        djstest.assertAreEqual(value, undefined, "Store get returns undefined for keys that do not exist in the store");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    testJobDone(succeeded);
-                });
-
-            }, "Store Read Test with mechanism " + mechanism, mechanism);
-
-            djstest.addTest(function storeReadArrayTest(mechanism) {
-                var makeError = function (success, fail) {
-                    return function (err) {
-                        if (mechanism !== "indexeddb") {
-                            djstest.pass("Error callback called as expected");
-                            success();
-                        } else {
-                            djstest.fail(err.message);
-                            fail();
-                        }
-                    };
-                };
-
-                var store = this.createStore("store6");
-                var job = new djstest.Job();
-
-                job.queue(function (success, fail) {
-                    store.add(["key", "key2", "key3"], ["value", "value2", "value3"], success, makeError(success, fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.read(["key", "key2", "key3"], function (keys, values) {
-                        djstest.assertAreEqualDeep(keys, ["key", "key2", "key3"]);
-                        djstest.assertAreEqualDeep(values, ["value", "value2", "value3"]);
-                        success();
-                    }, makeError(success, fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.read(["key", "badkey"], function (keys, values) {
-                        djstest.assertAreEqualDeep(keys, ["key", "badkey"]);
-                        djstest.assertAreEqualDeep(values, ["value", undefined]);
-                        success();
-                    }, makeError(success, fail));
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    testJobDone(succeeded);
-                });
-            }, "Store Read Array Test with mechanism " + mechanism, mechanism);
-
-            djstest.addTest(function storeRemoveTest(mechanism) {
-                var store = this.createStore("store7");
-                var job = new djstest.Job();
-
-                job.queue(function (success, fail) {
-                    store.add("Key1", "Some value", success, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.add("Key2", "Some value", success, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.remove("Key1", function () {
-                        djstest.pass("Key1 was removed from the store")
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.contains("Key1", function (contained) {
-                        djstest.assert(!contained, "Key1 is not present in the store");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.remove("Key that has never been added", function () {
-                        djstest.pass('"Key that has never been added" was removed from the store');
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.contains("Key2", function (contained) {
-                        djstest.assert(contained, "Key2 is present in the store");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    testJobDone(succeeded);
-                });
-            }, "Store Remove Test with mechanism " + mechanism, mechanism);
-
-            djstest.addTest(function storeUpdateTest(mechanism) {
-                var store = this.createStore("store8");
-
-                var startKey = "Key1";
-                var startValue = "start value";
-                var updateKey = "Key2";
-                var updatedValue = "updated value";
-
-                var job = new djstest.Job();
-
-                job.queue(function (success, fail) {
-                    store.add(startKey, startValue, success, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.add(updateKey, startValue, success, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.update(updateKey, updatedValue, function (key, value) {
-                        djstest.assertAreEqual(key, updateKey, "Updated keys match");
-                        djstest.assertAreEqualDeep(value, updatedValue, "Updated values match");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.read(updateKey, function (key, value) {
-                        djstest.assertAreEqual(key, updateKey, "Updated keys match after get");
-                        djstest.assertAreEqualDeep(value, updatedValue, "Updated values match after get");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.read(startKey, function (key, value) {
-                        djstest.assertAreEqual(key, startKey, "Non updated keys match after get");
-                        djstest.assertAreEqualDeep(value, startValue, "Non updated values match after get");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    testJobDone(succeeded);
-                });
-            }, "Store Update Test with mechanism " + mechanism, mechanism);
-
-            djstest.addTest(function storeClearTest(mechanism) {
-                var store = this.createStore("store9");
-                var store2 = this.createStore("store9_1");
-
-                var job = new djstest.Job();
-                job.queue(function (success, fail) {
-                    store.add("Key1", "value in store", success, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.add("Key2", "value in store", success, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.add("Key3", "value in store", success, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store2.add("Key1", "value in store2", success, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.clear(function () {
-                        djstest.pass("Store was cleared");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.contains("Key1", function (contained) {
-                        djstest.assert(!contained, "Key1 was removed from store");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store2.contains("Key1", function (contained) {
-                        djstest.assert(contained, "Key1 still exists in store 2");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    store2.close();
-                    testJobDone(succeeded);
-                });
-            }, "Store Clear Test with mechanism " + mechanism, mechanism);
-
-            djstest.addTest(function storeUpdateNonExistentTest(mechanism) {
-                var store = this.createStore("store10");
-                var job = new djstest.Job();
-
-                job.queue(function (success, fail) {
-                    store.add("key", "value", success, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.update("badKey", "new value",
-                        function () {
-                            djstest.fail("Sucess handler called when not expected");
-                            fail();
-                        },
-                        function (err) {
-                            djstest.pass("Error callback called as expexted");
-                            success();
-                        });
-                });
-
-                job.queue(function (success, fail) {
-                    store.update(["key", "badkey"], ["value", "badvalue"],
-                        function () {
-                            djstest.fail("Sucess handler called when not expected");
-                            fail();
-                        },
-                        function (err) {
-                            djstest.pass("Error callback called as expected");
-                            success();
-                        });
-                });
-
-                job.queue(function (success, fail) {
-                    store.read("key", function (key, value) {
-                        djstest.assertAreEqual(value, "value", "value was not changed");
-                        success();
-                    }, makeUnexpectedErrorHandler(fail));
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    testJobDone(succeeded);
-                });
-            }, "Store Update Non-Existent Test with mechanism " + mechanism, mechanism);
-
-            djstest.addTest(function storeUpdateArrayTest(mechanism) {
-                var makeError = function (success, fail) {
-                    return function (err) {
-                        if (mechanism !== "indexeddb") {
-                            djstest.pass("Error callback called as expected");
-                            success();
-                        } else {
-                            djstest.fail(err.message);
-                            fail();
-                        }
-                    };
-                };
-
-                var store = this.createStore("store11");
-                var job = new djstest.Job();
-
-                job.queue(function (success, fail) {
-                    store.add(["key", "key2"], ["value1", "value2"], success, makeError(success, fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.update(["key", "key2"], ["value1", "value4"], success, makeError(success, fail));
-                });
-
-                job.queue(function (success, fail) {
-                    store.read(["key", "key2"], function (key, value) {
-                        djstest.assertAreEqualDeep(value, ["value1", "value4"], "value was not changed");
-                        success();
-                    }, makeError(success, fail));
-                });
-
-                job.run(function (succeeded) {
-                    store.close();
-                    testJobDone(succeeded);
-                });
-            }, "Store Update Array Test with mechanism " + mechanism, mechanism);
-        }
-    }
-
-    module("Unit");
-
-    djstest.addTest(function CreateStoreTest() {
-        var defaultExpected = canCreateDomStore() ? "dom" : "memory";
-        var tests = [
-            { mechanism: "dom", exception: !canCreateDomStore(), expected: "dom" },
-            { mechanism: "memory", exception: false, expected: "memory" },
-            { mechanism: "", exception: false, expected: defaultExpected },
-            { mechanism: null, exception: false, expected: defaultExpected },
-            { mechanism: "unknown", exception: true }
-       ];
-
-        var i, len;
-        for (i = 0, len = tests.length; i < len; i++) {
-            try {
-                var test = tests[i];
-                var store = odatajs.store.createStore("testStore" + i, tests[i].mechanism);
-
-                if (!test.exception) {
-                    djstest.assertAreEqual(store.mechanism, test.expected, "Created store of the expected mechanism");
-                } else {
-                    djstest.fail("Didn't get the expected exception");
-                }
-            }
-            catch (e) {
-                djstest.assert(test.exception, "Expected exception");
-            }
-        }
-        djstest.done();
-    });
-
-    djstest.addTest(function CreateBestStoreTest() {
-        var bestMechanism;
-
-        for (var name in mechanismImplementations) {
-            if (!bestMechanism && canCreateStore(name) && name !== "indexeddb") {
-                bestMechanism = name;
-            }
-        }
-
-        if (bestMechanism) {
-            var tests = [
-                "best",
-                undefined
-            ];
-
-            for (var i in tests) {
-                var store = odatajs.store.createStore("best store ever " + i, tests[i]);
-                djstest.assertAreEqual(store.mechanism, bestMechanism, "Mechanisms match");
-            }
-        } else {
-            djstest.pass("This browser doesn't support any of the implemented local storage mechanisms");
-        }
-        djstest.done();
-    });
-
-})(this);

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/d5ec5557/datajs/tests/test-list.js
----------------------------------------------------------------------
diff --git a/datajs/tests/test-list.js b/datajs/tests/test-list.js
deleted file mode 100644
index 3a69064..0000000
--- a/datajs/tests/test-list.js
+++ /dev/null
@@ -1,26 +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.
- */
-
-// Test list for datajs tests
-
-function getAllTestFiles() {
-    return [
-        "odata-qunit-tests.htm"
-    ];
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/d5ec5557/datajs/tests/test-manager.html
----------------------------------------------------------------------
diff --git a/datajs/tests/test-manager.html b/datajs/tests/test-manager.html
deleted file mode 100644
index 290f161..0000000
--- a/datajs/tests/test-manager.html
+++ /dev/null
@@ -1,108 +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.
-*/
--->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-    <title>datajs test manager</title>
-    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.js"></script>
-    <script type="text/javascript" src="test-list.js"></script>
-    <script type="text/javascript">
-        var serviceRoot = "./common/TestLogger.svc/";
-        $(function () {
-            $(getAllTestFiles()).each(function () {
-                $("#pages").append("<input type='checkbox' name='page' value='" + this + "' checked />" + this + "<br />");
-            });
-            refreshActiveRuns();
-        });
-
-        var createTestRun = function (form) {
-            $.getJSON(serviceRoot + "CreateTestRun", function (data) {
-                var testRunId = data.d;
-
-                // Build pages list
-                var pages = [];
-                $(form).find("input[name='page']:checked").each(function () {
-                    pages.push(this.value);
-                });
-
-                var firstPage = pages[0];
-                pages.shift();
-
-                $.get(serviceRoot + "MarkInProgress?testRunId=" + testRunId, function () {
-                    $.get(serviceRoot + "SetTestNamePrefix?testRunId=" + testRunId + "&prefix=" + $("#browser").val() + "-", function () {
-                        var renderLinks = function () {
-                            $("#runLink").attr("href", firstPage + "?testRunId=" + testRunId);
-                            $("#runLink").text(testRunId);
-                            $("#resultsLink").attr("href", serviceRoot + "GetTestRunResults?testRunId=" + testRunId);
-                            $("#resultsLink").text(testRunId);
-                            refreshActiveRuns();
-                        };
-
-                        if (pages.length > 0) {
-                            $.get(serviceRoot + "AddTestPages?testRunId=" + testRunId + "&pages=" + pages.join(","), renderLinks);
-                        }
-                        else {
-                            renderLinks();
-                        }
-                    });
-                });
-            });
-        };
-
-        var refreshActiveRuns = function () {
-            $("#activeRuns").empty();
-            $.getJSON(serviceRoot + "GetActiveTestRuns", function (data) {
-                if (data.d.length === 0) {
-                    $("#activeRuns").text("There are no active runs");
-                } else {
-                    $.each(data.d, function (_, id) {
-                        $("#activeRuns").append("<a href='" + serviceRoot + "GetTestRunResults?testRunId=" + id + "'>" + id + "</a><br />");
-                    })
-                };
-            });
-        };
-    </script>
-</head>
-<body>
-    <h1>datajs test manager</h1>
-    <table style="width:100%"><tr><td style="vertical-align:top">
-        <h4>1. Create Test Run</h4>
-        <form onsubmit="createTestRun(this); return false;">
-            <div>Pages</div>
-            <div id="pages"></div>
-            <br />
-            <div>Browser: <input type="text" id="browser" /></div>
-            <br />
-            <input type="submit" value="Create Test Run" />
-        </form>
-
-        <h4>2. Run Tests</h4>
-        Test Run ID: <a id="runLink"></a>
-
-        <h4>3. View Results</h4>
-        Test Run ID: <a id="resultsLink"></a>
-
-    </td><td style="vertical-align:top">
-        <h4>Active Runs <input type="button" value="Refresh" onclick="refreshActiveRuns()" /></h4>
-        <div id="activeRuns"></div>
-    </td></tr></table>
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/d5ec5557/odatajs/.gitignore
----------------------------------------------------------------------
diff --git a/odatajs/.gitignore b/odatajs/.gitignore
new file mode 100644
index 0000000..d7c3df6
--- /dev/null
+++ b/odatajs/.gitignore
@@ -0,0 +1,9 @@
+node_modules/
+build
+dist
+localgrunt.config
+bin/
+obj/
+packages/
+JSLib.suo
+JSLib.csproj.user

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/d5ec5557/odatajs/Gruntfile.js
----------------------------------------------------------------------
diff --git a/odatajs/Gruntfile.js b/odatajs/Gruntfile.js
new file mode 100644
index 0000000..bc300e5
--- /dev/null
+++ b/odatajs/Gruntfile.js
@@ -0,0 +1,227 @@
+module.exports = function(grunt) {
+  'use strict';
+  var init = {
+    pkg: grunt.file.readJSON('package.json'),
+    banner: grunt.file.read('src/banner.txt'),
+    filename : '<%= pkg.name %>-<%= pkg.version %>-<%= pkg.postfix %>',
+
+    browserify: {
+      // start with index.js and follow all required source in order pack them together 
+      datajs: {
+        files: {
+          'build/<%= filename %>.js': ['src/index.js'],
+        },
+        options: {
+          transform: ['./grunt-config/browserify_transforms/stripheader/stripheader.js'],
+          browserifyOptions: {
+          } ,
+          bundleOptions: {
+          },
+        }
+      }
+    },
+    uglify: {
+      options: {
+        sourceMap : true,
+        sourceMapName :  'build/<%= filename %>.map',
+        sourceMapIncludeSources :true,
+      },
+      // uglify and compress the packed sources
+      build: {
+        src: 'build/<%= filename %>.js',
+        dest: 'build/<%= filename %>.min.js'
+      }
+    },
+    concat : {
+      options : {
+        banner : '<%= banner %>'
+      },
+      licence_min: {
+        src: 'build/<%= filename %>.min.js',
+        dest: 'build/<%= filename %>.min.js',
+      },
+      licence: {
+        src: 'build/<%= filename %>.js',
+        dest: 'build/<%= filename %>.js',
+      }
+    },
+    copy: {
+      forDemo: {
+        files: [
+          // includes files within path
+          {expand: true, cwd: 'build/', src: ['**'], dest: 'demo/scripts/', filter: 'isFile'},
+        ]
+      }
+    },
+    connect: {
+      demo: {
+        options: {
+          port: 4001 ,
+          hostname: "localhost",
+          base: "demo",
+          keepalive : true,
+          middleware: function (connect, options) {
+            return [
+              require("grunt-connect-proxy/lib/utils").proxyRequest ,
+              connect.static(options.base),   // static content
+              connect.directory(options.base) // browse directories
+            ];
+          },
+        },
+      },
+      // start a node webserver with proxy to host the qunit-test html files
+      'test-browser': {             
+        options: {
+          port: 4003 ,
+          hostname: "localhost",
+          base: "",
+          keepalive : true,
+          //changeOrigin: true,
+          middleware: function (connect, options) {
+            return [
+              require("grunt-connect-proxy/lib/utils").proxyRequest ,
+              connect.static(options.base),   // static content
+              connect.directory(options.base) // browse directories
+            ];
+          },
+        },
+        // proxy all request going to /tests/endpoints/ to the .net data services
+        proxies: [{
+          context: "/tests/endpoints/",  // When the url contains this...
+          host: "localhost",
+          changeOrigin: true,
+          https: false,
+          port: 46541,
+          rejectUnauthorized: false, 
+        }],
+      },
+    },
+    'node-qunit': {   
+      //used to run some background qunit test on node         
+      'default-tests': {
+        setup: {
+          log: {
+            summary: true,
+            assertions: true,
+            errors: true,
+            globalSummary: true,
+            coverage: false,
+            globalCoverage: false,
+            testing: true
+          },
+          coverage: false,
+          deps: null,
+          namespace: null
+        },
+        deps: '',
+        code: './tests-tmp/common/node-test-setup.js',
+        tests: ['./tests-tmp/odata-json-tests.js'],
+        done: function(err, res){
+            !err && publishResults("node", res, this.async());
+        }
+      },
+    },
+    jsdoc : {
+        src : {
+            src: ['src/**/*.js'], 
+            options: {
+                destination: 'build/doc',
+                verbose : false 
+            }
+        },
+        test : {
+            src: ['tests/**/*.js'], 
+            options: {
+                destination: 'build/doc-test',
+                verbose : false 
+            }
+        }
+    },
+    "npm-clean": {
+      tmp: {
+        src: [ "build/tmp"]
+      },
+      doc: {
+        src: ["build/doc"],
+          options: {
+                force: true
+            }
+      },
+      "doc-test": {
+        src: ["build/doc-test"],
+          options: {
+                force: true
+            }
+      },
+    },
+    compress: {
+      build: {
+        options: {archive: 'dist/<%= filename %>-lib.zip'},
+        files: [{expand: true, cwd: 'build/', src: ['*'], filter: 'isFile', dest: '<%= filename %>-lib/'}]
+      },
+      doc: {
+        options: {archive: 'dist/<%= filename %>-doc.zip'},
+        files: [{expand: true, cwd: 'build/doc/', src: ['**'], dest: '<%= filename %>-doc/'}]
+      },
+      src: {
+        options: {archive: 'dist/<%= filename %>-source.zip'},
+        files: [{expand: true, cwd: 'src/', src: ['**'], dest: '<%= filename %>-src/'}]
+      }
+    }
+  };
+  
+  /*** Join local configuration for proxies and local test servers ***/
+  if (grunt.file.exists('localgrunt.config')) {
+    console.log("merge localgrunt.config");
+    var localGrundConfig = grunt.file.read('localgrunt.config');
+    init.connect['test-browser'].proxies = init.connect['test-browser'].proxies.concat(JSON.parse(localGrundConfig).proxies);
+  }
+
+  /*** Init ***/
+  grunt.initConfig(init);
+
+  /*** Load tasks from npm modules ***/
+  grunt.loadNpmTasks('grunt-browserify');
+  grunt.loadNpmTasks('grunt-contrib-uglify');
+  grunt.loadNpmTasks("grunt-connect-proxy");
+  grunt.loadNpmTasks("grunt-contrib-connect");
+  grunt.loadNpmTasks("grunt-contrib-copy");
+  grunt.loadNpmTasks("grunt-contrib-concat");
+  grunt.loadNpmTasks('grunt-contrib-compress');
+  grunt.loadNpmTasks("grunt-jsdoc");
+
+
+  //    Start Qunit tests direcly in node js, internally qunit (npm qunit) 
+  //    is used, no phantomjs instance required
+  grunt.loadNpmTasks('grunt-node-qunit'); 
+  grunt.loadNpmTasks('grunt-contrib-clean');
+
+  //    Load the custom-* tasks from the grunt-config directory
+  grunt.loadTasks('grunt-config');
+
+  //    rename some tasks to avoid name clashes with the user tasks
+  grunt.renameTask('clean','npm-clean');
+  
+
+  /*** E N D U S E R   T A S K S ***/
+
+  grunt.registerTask('clean', ['npm-clean:doc','npm-clean:tmp']);
+
+  //    Runs the license header check to verify the any source file contains a license header
+  grunt.registerTask('license-check', ['custom-license-check']);
+
+  //    Create documentation in /build/doc
+  grunt.registerTask('doc', [/*'npm-clean:doc',*/'jsdoc:src']);
+  grunt.registerTask('doc-test', [/*'npm-clean:doc-test',*/'jsdoc:test']);
+
+  //    Build the odatajs library
+  grunt.registerTask('build', ['browserify:datajs', 'uglify:build', 'concat','copy:forDemo']);
+
+
+  grunt.registerTask('test-browser', ['configureProxies:test-browser', 'connect:test-browser']);
+  grunt.registerTask('test-node', ['node-qunit:default-tests']);
+  grunt.registerTask('release', ['build','doc','compress']);
+
+  
+};
+

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/d5ec5557/odatajs/JSLib.csproj
----------------------------------------------------------------------
diff --git a/odatajs/JSLib.csproj b/odatajs/JSLib.csproj
new file mode 100644
index 0000000..c2c3906
--- /dev/null
+++ b/odatajs/JSLib.csproj
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>
+    </ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}</ProjectGuid>
+    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>JSLib</RootNamespace>
+    <AssemblyName>JSLib</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <SccProjectName>SAK</SccProjectName>
+    <SccLocalPath>SAK</SccLocalPath>
+    <SccAuxPath>SAK</SccAuxPath>
+    <SccProvider>SAK</SccProvider>
+    <UseIISExpress>false</UseIISExpress>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Content Include="src\index.js" />
+    <Content Include="src\banner.txt" />
+    <Content Include="src\lib\cache.js" />
+    <Content Include="src\lib\datajs.js" />
+    <Content Include="src\lib\odata.js" />
+    <Content Include="src\lib\store.js" />
+    <Content Include="src\lib\cache\source.js" />
+    <Content Include="src\lib\datajs\deferred.js" />
+    <Content Include="src\lib\datajs\utils.js" />
+    <Content Include="src\lib\datajs\xml.js" />
+    <Content Include="src\lib\odata\batch.js" />
+    <Content Include="src\lib\odata\handler.js" />
+    <Content Include="src\lib\odata\json.js" />
+    <Content Include="src\lib\odata\metadata.js" />
+    <Content Include="src\lib\odata\net.js" />
+    <Content Include="src\lib\odata\utils.js" />
+    <Content Include="src\lib\store\dom.js" />
+    <Content Include="src\lib\store\indexeddb.js" />
+    <Content Include="src\lib\store\memory.js" />
+    <Content Include="tests\cache-tests.js" />
+    <Content Include="tests\common\CacheOracle.js" />
+    <Content Include="tests\common\common.js" />
+    <Content Include="tests\common\Instrument.svc" />
+    <Content Include="tests\common\Instrument.js" />
+    <Content Include="tests\common\mockXMLHttpRequest.js" />
+    <Content Include="tests\common\mockHttpClient.js" />
+    <Content Include="tests\common\djstest.js" />
+    <Content Include="tests\common\gpo-ie8-tour-disable.reg" />
+    <Content Include="tests\common\ObservableHttpClient.js" />
+    <Content Include="tests\common\ODataReadOracle.js" />
+    <Content Include="tests\common\ODataReadOracle.svc" />
+    <Content Include="tests\common\rx.js" />
+    <Content Include="tests\common\TestLogger.svc" />
+    <Content Include="tests\common\TestSynchronizerClient.js" />
+    <Content Include="tests\e2etest\Test.html" />
+    <Content Include="tests\odata-json-light-tests.js" />
+    <Content Include="tests\datajs-startup-perf-test.html" />
+    <Content Include="tests\endpoints\BasicAuthDataService.svc" />
+    <Content Include="tests\endpoints\FoodStoreDataServiceV4.svc" />
+    <Content Include="tests\endpoints\CustomAnnotations.xml" />
+    <Content Include="tests\endpoints\CustomDataService.svc" />
+    <Content Include="tests\endpoints\EpmDataService.svc" />
+    <Content Include="tests\endpoints\ErrorDataService.svc" />
+    <Content Include="tests\endpoints\LargeCollectionService.svc" />
+    <Content Include="tests\endpoints\web.config" />
+    <Content Include="tests\datajs-cache-large-collection-functional-tests.html" />
+    <Content Include="tests\datajs-cache-large-collection-functional-tests.js" />
+    <Content Include="tests\datajs-cache-long-haul-tests.html" />
+    <Content Include="tests\odata-batch-functional-tests.html" />
+    <Content Include="tests\odata-batch-functional-tests.js" />
+    <Content Include="tests\odata-batch-tests.js" />
+    <Content Include="tests\odata-cache-filter-functional-tests.html" />
+    <Content Include="tests\odata-cache-filter-functional-tests.js" />
+    <Content Include="tests\odata-cache-fperf-tests.html" />
+    <Content Include="tests\odata-cache-fperf-tests.js" />
+    <Content Include="tests\odata-cache-functional-tests.html" />
+    <Content Include="tests\odata-cache-functional-tests.js" />
+    <Content Include="tests\odata-cache-rx-functional-tests.html" />
+    <Content Include="tests\odata-cache-rx-functional-tests.js" />
+    <Content Include="tests\odata-fuzz.html" />
+    <Content Include="tests\odata-metadata-tests.js" />
+    <Content Include="tests\odata-handler-tests.js" />
+    <Content Include="tests\odata-json-tests.js" />
+    <Content Include="tests\odata-links-functional-tests.html" />
+    <Content Include="tests\odata-links-functional-tests.js" />
+    <Content Include="tests\odata-metadata-awareness-functional-tests.html" />
+    <Content Include="tests\odata-metadata-awareness-functional-tests.js" />
+    <Content Include="tests\odata-net-tests.js" />
+    <Content Include="tests\odata-perf-tests.html" />
+    <Content Include="tests\odata-perf-tests.js" />
+    <Content Include="tests\odata-read-crossdomain-functional-tests.html" />
+    <Content Include="tests\odata-read-crossdomain-functional-tests.js" />
+    <Content Include="tests\odata-read-functional-tests.html" />
+    <Content Include="tests\odata-request-functional-tests.html" />
+    <Content Include="tests\odata-request-functional-tests.js" />
+    <Content Include="tests\odata-read-functional-tests.js" />
+    <Content Include="tests\odata-qunit-tests.htm" />
+    <Content Include="tests\odata-tests.js" />
+    <Content Include="tests\odata-xml-tests.js" />
+    <Content Include="tests\run-tests.wsf" />
+    <Content Include="tests\store-indexeddb-tests.js" />
+    <Content Include="tests\store-tests.js" />
+    <Content Include="tests\test-list.js" />
+    <Content Include="tests\test-manager.html" />
+    <!-- Configuration file for the web project. -->
+    <Content Include="Web.config">
+      <SubType>Designer</SubType>
+    </Content>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="tests\code\CsdlReader.cs" />
+    <Compile Include="tests\code\JsDate.cs" />
+    <Compile Include="tests\code\JsonObject.cs" />
+    <Compile Include="tests\code\ReaderUtils.cs" />
+    <Compile Include="tests\code\ReflectionDataContext.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.OData.Client, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.OData.Client.6.5.0\lib\net40\Microsoft.OData.Client.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.OData.Core">
+      <HintPath>packages\Microsoft.OData.Core.6.5.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.OData.Edm">
+      <HintPath>packages\Microsoft.OData.Edm.6.5.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.OData.Service, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.OData.Service.6.5.0\lib\net40\Microsoft.OData.Service.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Spatial">
+      <HintPath>packages\Microsoft.Spatial.6.5.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Net" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.ServiceModel" />
+    <Reference Include="System.ServiceModel.Activation" />
+    <Reference Include="System.ServiceModel.Web" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Xml.Linq" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+        <WebProjectProperties>
+          <UseIIS>False</UseIIS>
+          <AutoAssignPort>True</AutoAssignPort>
+          <DevelopmentServerPort>4002</DevelopmentServerPort>
+          <DevelopmentServerVPath>/</DevelopmentServerVPath>
+          <IISUrl>
+          </IISUrl>
+          <NTLMAuthentication>False</NTLMAuthentication>
+          <UseCustomServer>False</UseCustomServer>
+          <CustomServerUrl>
+          </CustomServerUrl>
+          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+        </WebProjectProperties>
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/d5ec5557/odatajs/JSLib.sln
----------------------------------------------------------------------
diff --git a/odatajs/JSLib.sln b/odatajs/JSLib.sln
new file mode 100644
index 0000000..d265e52
--- /dev/null
+++ b/odatajs/JSLib.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JSLib", "JSLib.csproj", "{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/d5ec5557/odatajs/Web.config
----------------------------------------------------------------------
diff --git a/odatajs/Web.config b/odatajs/Web.config
new file mode 100644
index 0000000..e45c79e
--- /dev/null
+++ b/odatajs/Web.config
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <system.web>
+    <compilation debug="true" targetFramework="4.0">
+      <assemblies>
+        <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
+        <add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
+        <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+        <add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
+        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
+        <add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
+        <add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+        <add assembly="Microsoft.OData.Core, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+        <add assembly="Microsoft.OData.Service, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+        <add assembly="Microsoft.OData.Client, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+      </assemblies>
+    </compilation>
+  </system.web>
+  <system.webServer>
+    <directoryBrowse enabled="true" />
+  </system.webServer>
+  <system.codedom>
+    <compilers>
+      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+        <providerOption name="CompilerVersion" value="v4.0" />
+      </compiler>
+    </compilers>
+  </system.codedom>
+  <system.net>
+    <defaultProxy>
+      <proxy autoDetect="True" />
+    </defaultProxy>
+  </system.net>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/d5ec5557/odatajs/demo/mypage.html
----------------------------------------------------------------------
diff --git a/odatajs/demo/mypage.html b/odatajs/demo/mypage.html
new file mode 100644
index 0000000..16517a4
--- /dev/null
+++ b/odatajs/demo/mypage.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <title>data js demo</title>
+    <script type="text/javascript" src="scripts/datajs-2.0.0.js"></script>
+    <script type="text/javascript" src="scripts/jquery-2.0.3.js"></script>
+    <script type="text/javascript" src="scripts/datajs_demo.js"></script>
+    <style type="text/css">.title { font-size: 30px;font-style: italic;}</style>
+</head>
+<body onload="run()"> 
+    <div>
+        <span class="title">Simple Read</span>
+        <pre id="simpleRead"></pre>
+    </div>
+    <div>
+        <span class="title">Simple Read With Metadata</span>
+        <pre id="simpleReadWithMetadata"></pre>
+    </div>
+    <div>
+        <span class="title">Simple Read with JSONP</span>
+        <pre id="simpleReadWithJSONP"></pre>
+    </div>
+    <div>
+        <span class="title">Metadata</span>
+        <pre id="metadata"></pre>
+    </div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/d5ec5557/odatajs/demo/scripts/.gitignore
----------------------------------------------------------------------
diff --git a/odatajs/demo/scripts/.gitignore b/odatajs/demo/scripts/.gitignore
new file mode 100644
index 0000000..f7f55d4
--- /dev/null
+++ b/odatajs/demo/scripts/.gitignore
@@ -0,0 +1,2 @@
+datajs-2*
+tmp/