Updates to search
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/5066673d Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/5066673d Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/5066673d Branch: refs/heads/apache-blur-0.2 Commit: 5066673dd257e68b8e76764b4321b14476665320 Parents: e6061e1 Author: chrisrohr <[email protected]> Authored: Fri Apr 25 12:42:42 2014 +0000 Committer: chrisrohr <[email protected]> Committed: Fri Apr 25 12:42:42 2014 +0000 ---------------------------------------------------------------------- .gitignore | 1 + contrib/blur-console/ui/Gruntfile.js | 10 +++--- .../ui/app/scripts/blurconsole.fake.js | 13 +++++--- contrib/blur-console/ui/test/index.html | 2 ++ contrib/blur-console/ui/test/spec/utils.js | 33 ++++++++++++++++++++ 5 files changed, 50 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/5066673d/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 122a75a..af672ac 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .project .settings .idea +.codio *.ipr *.iws *.iml http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/5066673d/contrib/blur-console/ui/Gruntfile.js ---------------------------------------------------------------------- diff --git a/contrib/blur-console/ui/Gruntfile.js b/contrib/blur-console/ui/Gruntfile.js index cb002a8..8a7460e 100644 --- a/contrib/blur-console/ui/Gruntfile.js +++ b/contrib/blur-console/ui/Gruntfile.js @@ -79,14 +79,14 @@ module.exports = function (grunt) { // The actual grunt server settings connect: { options: { - port: 9000, - livereload: 35729, + port: 3000, + livereload: 4000, // Change this to '0.0.0.0' to access the server from outside - hostname: 'localhost' + hostname: '0.0.0.0' }, livereload: { options: { - open: true, + open: true, //true, base: [ '.tmp', '<%= yeoman.app %>' @@ -95,7 +95,7 @@ module.exports = function (grunt) { }, test: { options: { - port: 9001, + port: 4001, base: [ '.tmp', 'test', http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/5066673d/contrib/blur-console/ui/app/scripts/blurconsole.fake.js ---------------------------------------------------------------------- diff --git a/contrib/blur-console/ui/app/scripts/blurconsole.fake.js b/contrib/blur-console/ui/app/scripts/blurconsole.fake.js index ebc53e4..234bd04 100644 --- a/contrib/blur-console/ui/app/scripts/blurconsole.fake.js +++ b/contrib/blur-console/ui/app/scripts/blurconsole.fake.js @@ -20,7 +20,7 @@ under the License. /*global blurconsole:false */ blurconsole.fake = (function() { 'use strict'; - var getTableList, getNodeList, getQueryPerformance, getQueries, cancelQuery, disableTable, enableTable, deleteTable, getSchema, findTerms, + var getTableList, getNodeList, getQueryPerformance, getQueries, cancelQuery, disableTable, enableTable, deleteTable, getSchema, findTerms, sendSearch, randomNumber, randomBoolean, randomString; getTableList = function() { @@ -146,14 +146,18 @@ blurconsole.fake = (function() { terms.push(randStr); } - console.log(terms.length); - terms = terms.sort(function (a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()); }); callback(terms); }; + + sendSearch = function(query, table, args, callback) { + console.log('sending fake search [' + query + '] on table [' + table + ']'); + + + }; randomNumber = function(max, includeZero) { var random = Math.random()*max; @@ -190,6 +194,7 @@ blurconsole.fake = (function() { enableTable : enableTable, deleteTable : deleteTable, getSchema : getSchema, - findTerms : findTerms + findTerms : findTerms, + sendSearch : sendSearch }; }()); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/5066673d/contrib/blur-console/ui/test/index.html ---------------------------------------------------------------------- diff --git a/contrib/blur-console/ui/test/index.html b/contrib/blur-console/ui/test/index.html index 7a20c73..f04325e 100644 --- a/contrib/blur-console/ui/test/index.html +++ b/contrib/blur-console/ui/test/index.html @@ -37,9 +37,11 @@ under the License. </script> <!-- include source files here... --> + <script src="scripts/blurconsole.utils.js"></script> <!-- include spec files here... --> <script src="spec/test.js"></script> + <script src="spec/utils.js"></script> <script>mocha.run()</script> </body> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/5066673d/contrib/blur-console/ui/test/spec/utils.js ---------------------------------------------------------------------- diff --git a/contrib/blur-console/ui/test/spec/utils.js b/contrib/blur-console/ui/test/spec/utils.js new file mode 100644 index 0000000..7fa9665 --- /dev/null +++ b/contrib/blur-console/ui/test/spec/utils.js @@ -0,0 +1,33 @@ +/* + +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. +*/ +/* global describe, it */ + +(function () { + 'use strict'; + + var assert = require("assert"); + describe('Test blurconsole.utils', function () { + describe('inject', function () { + it('[1,2,3,4,5] should be 15 with simple summing', function () { + assert(blurconsole.utils.inject([1,2,3,4,5], 0, function(sum, item){ return sum + item; })); + }); + }); + }); +})();
