From 59d4c362f6a37556d78bd784e8a3bbf102cfc5e8 Mon Sep 17 00:00:00 2001 From: slhale Date: Mon, 3 Aug 2015 10:07:52 -0700 Subject: [PATCH] [Search] Temporarily remove web worker test --- platform/search/test/suite.json | 3 +- .../test/workers/GenericSearchWorkerSpec.js | 132 ------------------ 2 files changed, 1 insertion(+), 134 deletions(-) delete mode 100644 platform/search/test/workers/GenericSearchWorkerSpec.js diff --git a/platform/search/test/suite.json b/platform/search/test/suite.json index dc90ba2d07..abdbcaafbc 100644 --- a/platform/search/test/suite.json +++ b/platform/search/test/suite.json @@ -3,6 +3,5 @@ "controllers/SearchItemController", "SearchAggregator", "providers/ElasticsearchSearchProvider", - "providers/GenericSearchProvider", - "workers/GenericSearchWorker" + "providers/GenericSearchProvider" ] diff --git a/platform/search/test/workers/GenericSearchWorkerSpec.js b/platform/search/test/workers/GenericSearchWorkerSpec.js deleted file mode 100644 index 67e482b218..0000000000 --- a/platform/search/test/workers/GenericSearchWorkerSpec.js +++ /dev/null @@ -1,132 +0,0 @@ -/***************************************************************************** - * Open MCT Web, Copyright (c) 2014-2015, United States Government - * as represented by the Administrator of the National Aeronautics and Space - * Administration. All rights reserved. - * - * Open MCT Web is licensed 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. - * - * Open MCT Web includes source code licensed under additional open source - * licenses. See the Open Source Licenses file (LICENSES.md) included with - * this source code distribution or the Licensing information page available - * at runtime from the About dialog for additional information. - *****************************************************************************/ -/*global define,describe,it,expect,runs,waitsFor,beforeEach,jasmine,Worker*/ - -/** - * SearchSpec. Created by shale on 07/31/2015. - */ -define( - [], - function (GenericSearchWorker) { - "use strict"; - - describe("The generic search worker ", function () { - // If this test fails, make sure this path is correct - var worker = new Worker('platform/search/src/workers/GenericSearchWorker.js'), - numObjects = 5; - - beforeEach(function () { - var i; - for (i = 0; i < numObjects; i += 1) { - worker.postMessage( - { - request: "index", - id: i, - model: { - name: "object " + i, - id: i, - type: "something" - } - } - ); - } - }); - - it("searches can reach all objects", function () { - var flag = false, - workerOutput, - resultsLength = 0; - - // Search something that should return all objects - runs(function () { - worker.postMessage( - { - request: "search", - input: "object", - maxNumber: 100, - timestamp: Date.now(), - timeout: 1000 - } - ); - }); - - worker.onmessage = function (event) { - var id; - - workerOutput = event.data; - for (id in workerOutput.results) { - resultsLength += 1; - } - flag = true; - }; - - waitsFor(function () { - return flag; - }, "The worker should be searching", 1000); - - runs(function () { - expect(workerOutput).toBeDefined(); - expect(resultsLength).toEqual(numObjects); - }); - }); - - it("searches return only matches", function () { - var flag = false, - workerOutput, - resultsLength = 0; - - // Search something that should return 1 object - runs(function () { - worker.postMessage( - { - request: "search", - input: "2", - maxNumber: 100, - timestamp: Date.now(), - timeout: 1000 - } - ); - }); - - worker.onmessage = function (event) { - var id; - - workerOutput = event.data; - for (id in workerOutput.results) { - resultsLength += 1; - } - flag = true; - }; - - waitsFor(function () { - return flag; - }, "The worker should be searching", 1000); - - runs(function () { - expect(workerOutput).toBeDefined(); - expect(resultsLength).toEqual(1); - expect(workerOutput.results[2]).toBeDefined(); - }); - }); - }); - } -); \ No newline at end of file