Return-Path: X-Original-To: apmail-climate-commits-archive@minotaur.apache.org Delivered-To: apmail-climate-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 00BA111238 for ; Tue, 1 Jul 2014 14:49:27 +0000 (UTC) Received: (qmail 19120 invoked by uid 500); 1 Jul 2014 14:49:26 -0000 Delivered-To: apmail-climate-commits-archive@climate.apache.org Received: (qmail 19039 invoked by uid 500); 1 Jul 2014 14:49:26 -0000 Mailing-List: contact commits-help@climate.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.apache.org Delivered-To: mailing list commits@climate.apache.org Received: (qmail 18987 invoked by uid 99); 1 Jul 2014 14:49:26 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jul 2014 14:49:26 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AAC219914A9; Tue, 1 Jul 2014 14:49:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: joyce@apache.org To: commits@climate.apache.org Date: Tue, 01 Jul 2014 14:49:38 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [14/56] [partial] gh-pages clean up http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/controllers/DatasetDisplayCtrlTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/controllers/DatasetDisplayCtrlTest.js b/ocw-ui/frontend/test/unit/controllers/DatasetDisplayCtrlTest.js deleted file mode 100644 index b6fe620..0000000 --- a/ocw-ui/frontend/test/unit/controllers/DatasetDisplayCtrlTest.js +++ /dev/null @@ -1,65 +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. -**/ - -'use strict'; - -describe('OCW Controllers', function() { - - beforeEach(module('ocw.controllers')); - beforeEach(module('ocw.services')); - - describe('DatasetDisplayCtrl', function() { - it('should initialize the removeDataset function', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("DatasetDisplayCtrl", {$scope: scope}); - - scope.datasets.push(1); - scope.datasets.push(2); - - expect(scope.datasets[0]).toBe(1); - - scope.removeDataset(0); - - expect(scope.datasets[0]).toBe(2); - }); - }); - - it('should initialize the setRegridBase function', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("DatasetDisplayCtrl", {$scope: scope}); - - scope.datasets.push({regrid: false}); - scope.datasets.push({regrid: true}); - scope.datasets.push({regrid: true}); - scope.datasets.push({regrid: false}); - - expect(scope.datasets[1].regrid).toBe(true); - expect(scope.datasets[2].regrid).toBe(true); - - // setRegridBase should set all indices to 'false' if if it's not the passed index - scope.setRegridBase(2); - - expect(scope.datasets[1].regrid).toBe(false); - expect(scope.datasets[2].regrid).toBe(true); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/controllers/DatasetSelectCtrlTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/controllers/DatasetSelectCtrlTest.js b/ocw-ui/frontend/test/unit/controllers/DatasetSelectCtrlTest.js deleted file mode 100644 index 7091562..0000000 --- a/ocw-ui/frontend/test/unit/controllers/DatasetSelectCtrlTest.js +++ /dev/null @@ -1,51 +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. -**/ - -'use strict'; - -describe('OCW Controllers', function() { - - beforeEach(module('ocw.controllers')); - beforeEach(module('ocw.services')); - - describe('DatasetSelectCtrl', function() { - it('should initialize the disable clear button function', function() { - inject(function($rootScope, $controller, selectedDatasetInformation) { - var scope = $rootScope.$new(); - var ctrl = $controller('DatasetSelectCtrl', {$scope: scope}); - - expect(scope.shouldDisableClearButton()).toBe(true); - selectedDatasetInformation.addDataset({}); - expect(scope.shouldDisableClearButton()).toBe(false); - }); - }); - - it('should initialize the clear datasets function', function() { - inject(function($rootScope, $controller, selectedDatasetInformation) { - var scope = $rootScope.$new(); - var ctrl = $controller('DatasetSelectCtrl', {$rootScope: $rootScope, $scope: scope}); - - selectedDatasetInformation.addDataset({}); - expect(selectedDatasetInformation.getDatasetCount()).toBe(1); - scope.clearDatasets(); - expect(selectedDatasetInformation.getDatasetCount()).toBe(0); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/controllers/ObservationSelectCtrlTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/controllers/ObservationSelectCtrlTest.js b/ocw-ui/frontend/test/unit/controllers/ObservationSelectCtrlTest.js deleted file mode 100644 index e076eb0..0000000 --- a/ocw-ui/frontend/test/unit/controllers/ObservationSelectCtrlTest.js +++ /dev/null @@ -1,151 +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. -**/ - -'use strict'; - -describe('OCW Controllers', function() { - - beforeEach(module('ocw.controllers')); - beforeEach(module('ocw.services')); - - describe('ObservationSelectCtrl', function() { - it('should grab the default set of selected datasets from the service', function() { - inject(function($httpBackend, $rootScope, $controller) { - $rootScope.baseURL = "http://localhost:8082" - $httpBackend.expectJSONP($rootScope.baseURL + '/getPathLeader/?callback=JSON_CALLBACK'). - respond(200, {'leader': '/usr/local/rcmes'}); - - var scope = $rootScope.$new(); - var ctrl = $controller("ObservationSelectCtrl", {$scope: scope}); - $httpBackend.flush(); - - expect(typeof scope.datasetCount).toBe('object'); - expect(Object.keys(scope.datasetCount).length).toBe(0); - }); - }); - - it('should initialize option arrays and default to the first element', function() { - inject(function($httpBackend, $rootScope, $controller) { - $rootScope.baseURL = "http://localhost:8082" - $httpBackend.expectJSONP($rootScope.baseURL + '/getPathLeader/?callback=JSON_CALLBACK'). - respond(200, {'leader': '/usr/local/rcmes'}); - - var scope = $rootScope.$new(); - var ctrl = $controller("ObservationSelectCtrl", {$scope: scope}); - $httpBackend.flush(); - - expect(scope.params.length).toBe(1); - expect(scope.lats.length).toBe(1); - expect(scope.lons.length).toBe(1); - expect(scope.times.length).toBe(1); - - expect(scope.params[0]).toEqual("Please select a file above"); - expect(scope.lats[0]).toEqual("Please select a file above"); - expect(scope.lons[0]).toEqual("Please select a file above"); - expect(scope.times[0]).toEqual("Please select a file above"); - }); - }); - - it('should initialize scope attributes properly', function() { - inject(function($httpBackend, $rootScope, $controller) { - $rootScope.baseURL = "http://localhost:8082" - $httpBackend.expectJSONP($rootScope.baseURL + '/getPathLeader/?callback=JSON_CALLBACK'). - respond(200, {'leader': '/usr/local/rcmes'}); - - var scope = $rootScope.$new(); - var ctrl = $controller("ObservationSelectCtrl", {$scope: scope}); - $httpBackend.flush(); - - expect(scope.pathLeader).toEqual('/usr/local/rcmes'); - expect(scope.loadingFile).toBe(false); - expect(scope.fileAdded).toBe(false); - expect(typeof scope.latLonVals).toEqual('object'); - expect(scope.latLonVals.length).toBe(0); - expect(typeof scope.timeVals).toEqual('object'); - expect(scope.timeVals.length).toEqual(0); - expect(typeof scope.localSelectForm).toEqual('object'); - expect(Object.keys(scope.localSelectForm).length).toEqual(0); - }); - }); - - it('should initialize the uploadLocalFile function', function() { - inject(function($httpBackend, $rootScope, $controller) { - $rootScope.baseURL = "http://localhost:8082" - $httpBackend.expectJSONP($rootScope.baseURL + '/getPathLeader/?callback=JSON_CALLBACK'). - respond(200, {'leader': '/usr/local/rcmes'}); - - var scope = $rootScope.$new(); - var ctrl = $controller("ObservationSelectCtrl", {$scope: scope}); - $httpBackend.flush(); - - $httpBackend.expectJSONP($rootScope.baseURL + '/list/vars/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK'). - respond(200, {"variables": ["lat", "lon", "prec", "time" ]}); - $httpBackend.expectJSONP($rootScope.baseURL + '/list/latlon/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK'). - respond(200, {'latMax': '75.25', 'success': 1, 'latname': 'lat', 'lonMax': '-29.75', 'lonMin': '-159.75', 'lonname': 'lon', 'latMin': '15.25'}); - $httpBackend.expectJSONP($rootScope.baseURL + '/list/time/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK'). - respond(200, {"start_time": "1980-01-01 00:00:00", "timename": "time", "success": 1, "end_time": "2004-12-01 00:00:00"}); - - scope.uploadLocalFile(); - $httpBackend.flush(); - - expect(scope.latsSelect).toEqual("lat"); - expect(scope.lonsSelect).toEqual("lon"); - expect(scope.timeSelect).toEqual("time"); - expect(scope.paramSelect).toEqual("prec"); - - // Simulate failure on one of the backend calls. Should - $httpBackend.expectJSONP($rootScope.baseURL + '/list/vars/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK'). - respond(200, {}); - $httpBackend.expectJSONP($rootScope.baseURL + '/list/latlon/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK'). - respond(404, {}); - $httpBackend.expectJSONP($rootScope.baseURL + '/list/time/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK'). - respond(200, {}); - - scope.uploadLocalFile(); - $httpBackend.flush(); - - expect(scope.paramSelect).toEqual("Unable to load variable(s)"); - expect(scope.params.length).toEqual(1); - expect(scope.latsSelect).toEqual("Unable to load variable(s)"); - expect(scope.lats.length).toEqual(1); - expect(scope.lonsSelect).toEqual("Unable to load variable(s)"); - expect(scope.lons.length).toEqual(1); - expect(scope.timeSelect).toEqual("Unable to load variable(s)"); - expect(scope.times.length).toEqual(1); - }); - }); - - it('should initialize the addDatasets function', function() { - inject(function($httpBackend, $rootScope, $controller) { - $rootScope.baseURL = "http://localhost:8082" - $httpBackend.expectJSONP($rootScope.baseURL + '/getPathLeader/?callback=JSON_CALLBACK'). - respond(200, {'leader': '/usr/local/rcmes'}); - - var scope = $rootScope.$new(); - var ctrl = $controller("ObservationSelectCtrl", {$scope: scope}); - $httpBackend.flush(); - - // Add a bunch of bogus data as a dataset - scope.addDataSet(); - - expect(scope.datasetCount.length).toBe(1); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/controllers/ParameterSelectCtrlTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/controllers/ParameterSelectCtrlTest.js b/ocw-ui/frontend/test/unit/controllers/ParameterSelectCtrlTest.js deleted file mode 100644 index 6845245..0000000 --- a/ocw-ui/frontend/test/unit/controllers/ParameterSelectCtrlTest.js +++ /dev/null @@ -1,269 +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. -**/ - -'use strict'; - -describe('OCW Controllers', function() { - - beforeEach(module('ocw.controllers')); - beforeEach(module('ocw.services')); - - - describe('ParameterSelectCtrl', function() { - it('should initialize spatial and temporal range default values properly', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$scope: scope}); - - expect(scope.latMin).toBe(-90); - expect(scope.latMax).toBe(90); - expect(scope.lonMin).toBe(-180); - expect(scope.lonMax).toBe(180); - expect(scope.start).toBe("1980-01-01 00:00:00"); - expect(scope.end).toBe("2030-01-01 00:00:00"); - }); - }); - - it('should grab the default set of selected datasets from the service', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$scope: scope}); - - // We should get an object with no keys since the user hasn't selected any - // datasets by default. Object.keys returns an array of all the user defined - // keys in the object. - expect(typeof scope.datasets).toBe('object'); - expect(Object.keys(scope.datasets).length).toBe(0); - }); - }); - - it('should grab the default region select param object from the regionSelectParams service', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$scope: scope}); - - // The default display values aren't going to be changing any time soon. This test - // is a bit of a duplicate since this is really testing functionality of the service. - // Can't hurt to make sure that we're getting results though! - expect(typeof scope.displayParams).toBe('object'); - expect(Object.keys(scope.displayParams).length).toBe(7); - }); - }); - - it('should initialize misc. values properly', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$scope: scope}); - - expect(scope.runningEval).toBe(false); - expect(scope.areInUserRegridState).toBe(false); - expect(scope.latSliderVal).toBe(0); - expect(scope.lonSliderVal).toBe(0); - }); - }); - - it('should set the default datepicker settings', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$scope: scope}); - - // This tests the default values that get passed to the datepicker objects that we - // initialize with a directive. - expect(Object.keys(scope.datepickerSettings).length).toBe(2); - expect(scope.datepickerSettings.changeMonth).toBe(true); - expect(scope.datepickerSettings.changeYear).toBe(true); - }); - }); - - it('should define the slide "slide" callback functions', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$scope: scope}); - - expect(scope.latSliderVal).toBe(0); - expect(scope.lonSliderVal).toBe(0); - scope.updateLatSliderDisplayValue(1); - scope.updateLonSliderDisplayValue(2); - expect(scope.latSliderVal).toBe(1); - expect(scope.lonSliderVal).toBe(2); - }); - }); - - it('should initialize the control disable function', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$scope: scope}); - - expect(scope.shouldDisableControls()).toBe(true); - // Add to dummy values to datasets to make sure the disable function - // triggers properly. - scope.datasets.push(1); - scope.datasets.push(2); - expect(scope.shouldDisableControls()).toBe(false); - }); - }); - - it('should initialize the disable evaluation button function', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$scope: scope}); - - expect(scope.shouldDisableEvaluateButton()).toBe(true); - scope.datasets.push(1); - expect(scope.shouldDisableEvaluateButton()).toBe(true); - scope.datasets.push(2); - expect(scope.shouldDisableEvaluateButton()).toBe(false); - scope.runningEval = true; - expect(scope.shouldDisableEvaluateButton()).toBe(true); - }); - }); - - it('should initialize the disable results view function', function() { - inject(function($rootScope, $controller) { - $rootScope.evalResults = ""; - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$rootScope: $rootScope, $scope: scope}); - - expect(scope.shouldDisableResultsView()).toBe(true); - - // Set evalResults to something other than the default value - $rootScope.evalResults = "this is not an empty string"; - - expect(scope.shouldDisableResultsView()).toBe(false); - }); - }); - - it('should initialize the check parameters function', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$scope: scope}); - - // Set the displayParams values to be "out of bounds" values so checkParams - // adjusts them properly. - scope.displayParams.latMin = "-95"; - scope.displayParams.latMax = "95"; - scope.displayParams.lonMin = "-185"; - scope.displayParams.lonMax = "185"; - scope.displayParams.start = "1980-00-00 00:00:00"; - scope.displayParams.end = "2031-01-01 00:00:00"; - - // If we don't remove the watch on datasets we end up with displayParam values - // all being undefined (but only during testing, which is odd...) - scope.unwatchDatasets(); - scope.checkParameters(); - - expect(scope.displayParams.latMin).toBe(-90); - expect(scope.displayParams.latMax).toBe(90); - expect(scope.displayParams.lonMin).toBe(-180); - expect(scope.displayParams.lonMax).toBe(180); - expect(scope.displayParams.start).toBe('1980-01-01 00:00:00'); - expect(scope.displayParams.end).toBe('2030-01-01 00:00:00'); - }); - }); - - it('should properly set the results of running an evaluation', function() { - inject(function($rootScope, $controller, $httpBackend) { - var scope = $rootScope.$new(); - var ctrl = $controller("ParameterSelectCtrl", {$scope: scope}); - - // Seed rootScope with a known URL for test queries and holder for eval results - $rootScope.baseURL = "http://localhost:9876"; - $rootScope.evalResults = {}; - - // Seed the displayParams so the query is properly formatted - scope.displayParams.lonMin = -180; - scope.displayParams.lonMax = 180; - scope.displayParams.latMin = -90; - scope.displayParams.latMax = 90; - scope.displayParams.start = "1980-01-01"; - scope.displayParams.end = "2030-01-01"; - - // The expected URL string that the frontend generates given this example set - var urlString = "http://localhost:9876/rcmes/run/?" + - "callback=JSON_CALLBACK&" + - "endTime=2030-01-01%2000%3A00%3A00&" + - "filelist=%2Fusr%2Flocal%2Frcmes%2FmodelsForUI%2Fprec.HRM3.ncep.monavg.nc&" + - "latMax=90&" + - "latMin=-90&" + - "lonMax=180&" + - "lonMin=-180&" + - "metricOption=bias&" + - "modelLatVarName=lat&" + - "modelLonVarName=lon&" + - "modelTimeVarName=time&" + - "modelVarName=prec&" + - "obsDatasetId=3&" + - "obsParameterId=36&" + - "regridOption=model&" + - "startTime=1980-01-01%2000%3A00%3A00&" + - "timeRegridOption=monthly"; - - // Example dataset configuration for the test. - scope.datasets = [ - { - "isObs" : 1, - "id" : "3", - "name" : "Tropical Rainfall Measuring Mission Dataset", - "param" : "36", - "paramName" : "TRMM v.6 Monthly Precipitation", - "latlonVals" : {"latMin" : -90, "latMax" : 90, "lonMin" : -180, "lonMax" : 180}, - "lat" : "N/A", - "lon" : "N/A", - "timeVals" : {"start" : "1998-01-01 00:00:00", - "end" : "2010-01-01 00:00:00"}, - "time" : "N/A", - "shouldDisplay" : true, - "regrid" : false - },{ - "isObs" : 0, - "id" : "/usr/local/rcmes/modelsForUI/prec.HRM3.ncep.monavg.nc", - "name" : "prec.HRM3.ncep.monavg.nc", - "param" : "prec", - "paramName" : "prec", - "lat" : "lat", - "lon" : "lon", - "latlonVals" : {"latMin" : "15.25", - "latMax" : "75.25", - "lonMin" : "-159.75", - "lonMax" : "-29.75"}, - "time" : "time", - "timeVals" : {"start":"1980-01-01 00:00:00", - "end" : "2004-12-01 00:00:00"}, - "shouldDisplay" : true, - "regrid" : false - } - ]; - - // Mock return URLs that the frontend will parse - $httpBackend.expectJSONP(urlString).respond(200, - {'comparisonPath': '/fake/path1', - 'modelPath': '/fake/path2', - 'obsPath': '/fake/path3'}); - - - scope.runEvaluation(); - $httpBackend.flush(); - - expect($rootScope.evalResults.comparisonPath).toBe('path1'); - expect($rootScope.evalResults.modelPath).toBe('path2'); - expect($rootScope.evalResults.obsPath).toBe('path3'); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/controllers/RcmedSelectionCtrlTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/controllers/RcmedSelectionCtrlTest.js b/ocw-ui/frontend/test/unit/controllers/RcmedSelectionCtrlTest.js deleted file mode 100644 index 3279ecc..0000000 --- a/ocw-ui/frontend/test/unit/controllers/RcmedSelectionCtrlTest.js +++ /dev/null @@ -1,161 +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. -**/ - -'use strict'; - -describe('OCW Controllers', function() { - - beforeEach(module('ocw.controllers')); - beforeEach(module('ocw.services')); - - describe('RcmedSelectionCtrl', function() { - it('should automatically query RCMED on initialization', function() { - inject(function($rootScope, $controller, $httpBackend) { - $rootScope.baseURL = "http://localhost:8082" - $httpBackend.expectJSONP($rootScope.baseURL + '/getObsDatasets?callback=JSON_CALLBACK'). - respond(200, [{longname: 1}, {longname: 2}]); - - var scope = $rootScope.$new(); - var ctrl = $controller("RcmedSelectionCtrl", {$scope: scope}); - $httpBackend.flush(); - - expect(scope.availableObs.length).toBe(3); - expect(scope.availableObs[0]).toEqual({longname: "Please select an option"}); - expect(scope.availableObs[1]).toEqual({longname: 1}); - }); - }); - - it('should initialize the getObservations function', function() { - inject(function($rootScope, $controller, $httpBackend) { - $rootScope.baseURL = "http://localhost:8082" - $httpBackend.expectJSONP($rootScope.baseURL + '/getObsDatasets?callback=JSON_CALLBACK'). - respond(200, [{longname: 1}, {longname: 2}]); - - var scope = $rootScope.$new(); - var ctrl = $controller("RcmedSelectionCtrl", {$scope: scope}); - $httpBackend.flush(); - - expect(scope.availableObs.length).toBe(3); - expect(scope.availableObs[0]).toEqual({longname: "Please select an option"}); - expect(scope.availableObs[1]).toEqual({longname: 1}); - - // Set up a failed query - $httpBackend.expectJSONP($rootScope.baseURL + '/getObsDatasets?callback=JSON_CALLBACK'). - respond(404); - scope.getObservations(); - $httpBackend.flush(); - - expect(scope.availableObs.length).toBe(1); - expect(scope.availableObs[0]).toEqual('Unable to query RCMED'); - - }); - }); - - it('should initialze the getObservationTimeRange function', function() { - inject(function($rootScope, $controller, $httpBackend) { - $rootScope.baseURL = "http://localhost:8082" - $httpBackend.expectJSONP($rootScope.baseURL + '/getObsDatasets?callback=JSON_CALLBACK'). - respond(200, [{longname: 1}, {longname: 2}]); - - var scope = $rootScope.$new(); - var ctrl = $controller("RcmedSelectionCtrl", {$scope: scope}); - $httpBackend.flush(); - - expect(scope.getObservationTimeRange(1)).toEqual({'start' : '1989-01-01 00:00:00', - 'end' : '2009-12-31 00:00:00'}); - expect(scope.getObservationTimeRange(-1)).toEqual(false); - }); - }); - - it('should initialize dataSelectUpdated function', function() { - inject(function($rootScope, $controller, $httpBackend) { - $rootScope.baseURL = "http://localhost:8082" - $httpBackend.expectJSONP($rootScope.baseURL + '/getObsDatasets?callback=JSON_CALLBACK'). - respond(200, [{longname: 1}, {longname: 2}]); - - var scope = $rootScope.$new(); - var ctrl = $controller("RcmedSelectionCtrl", {$scope: scope}); - $httpBackend.flush(); - - // Add the test dataset to our scope - scope.datasetSelection = {shortname: 'TRMM'} - - // Test return with only single parameter - $httpBackend.expectJSONP($rootScope.baseURL + '/getDatasetParam?dataset=' + - scope.datasetSelection['shortname'] + - '&callback=JSON_CALLBACK'). - respond(200, ['pcp']); - scope.dataSelectUpdated(); - $httpBackend.flush(); - - expect(scope.parameterSelection).toEqual('pcp'); - - // Test return with multiple parameters - $httpBackend.expectJSONP($rootScope.baseURL + '/getDatasetParam?dataset=' + - scope.datasetSelection['shortname'] + - '&callback=JSON_CALLBACK'). - respond(200, ['pcp', 'pcp2']); - scope.dataSelectUpdated(); - $httpBackend.flush(); - - expect(scope.parameterSelection).toEqual({shortname: 'Please select a parameter'}); - }); - }); - - it('should initialze the addObservation function', function() { - inject(function($rootScope, $controller, $httpBackend) { - $rootScope.baseURL = "http://localhost:8082" - $httpBackend.expectJSONP($rootScope.baseURL + '/getObsDatasets?callback=JSON_CALLBACK'). - respond(200, [{longname: 1}, {longname: 2}]); - - var scope = $rootScope.$new(); - var ctrl = $controller("RcmedSelectionCtrl", {$scope: scope}); - $httpBackend.flush(); - - scope.datasetSelection = { - "dataset_id" : "3", - "shortname" : "TRMM", - "longname" : "Tropical Rainfall Measuring Mission Dataset", - "source" : "Readme for the Tropical Rainfall Measuring Mission (TRMM) Data Set" - }; - - scope.parameterSelection = { - "parameter_id":"36", - "shortname":"pcp", - "datasetshortname":"TRMM", - "longname":"TRMM v.6 Monthly Precipitation", - "units":"mm\/day" - }; - - // addObservations does a refresh of the selections with a re-query of the backend - // so we need to catch that call! - $httpBackend.expectJSONP($rootScope.baseURL + '/getObsDatasets?callback=JSON_CALLBACK'). - respond(200, [{longname: 1}, {longname: 2}]); - - scope.addObservation(); - $httpBackend.flush(); - - expect(scope.datasetCount.length).toBe(1); - // The selection observation should be reset so we shouldn't have - // any selected observation parameters. - expect(scope.retrievedObsParams).toEqual([]); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/controllers/SettingsCtrlTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/controllers/SettingsCtrlTest.js b/ocw-ui/frontend/test/unit/controllers/SettingsCtrlTest.js deleted file mode 100644 index 12c133d..0000000 --- a/ocw-ui/frontend/test/unit/controllers/SettingsCtrlTest.js +++ /dev/null @@ -1,47 +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. -**/ - -'use strict'; - -describe('OCW Controllers', function() { - - beforeEach(module('ocw.controllers')); - beforeEach(module('ocw.services')); - - describe('SettingsCtrl', function() { - it('should initialize settings object from evaluationSettings service', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("SettingsCtrl", {$scope: scope}); - - expect(Object.keys(scope.settings)).toEqual(["metrics", "temporal", "spatialSelect"]); - }); - }); - - it('should pull the dataset information', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("SettingsCtrl", {$scope: scope}); - - expect(typeof scope.datasets).toBe('object'); - expect(Object.keys(scope.datasets).length).toBe(0); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/controllers/WorldMapCtrlTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/controllers/WorldMapCtrlTest.js b/ocw-ui/frontend/test/unit/controllers/WorldMapCtrlTest.js deleted file mode 100644 index 805dc88..0000000 --- a/ocw-ui/frontend/test/unit/controllers/WorldMapCtrlTest.js +++ /dev/null @@ -1,48 +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. -**/ - -'use strict'; - -describe('OCW Controllers', function() { - - beforeEach(module('ocw.controllers')); - beforeEach(module('ocw.services')); - - describe('WorldMapCtrl', function() { - it('should initialize the updateMap function', function() { - inject(function($rootScope, $controller) { - var scope = $rootScope.$new(); - var ctrl = $controller("WorldMapCtrl", {$scope: scope}); - - // Set the important attributes for a fake dataset - scope.datasets.push({shouldDisplay: true, latlonVals: {latMin: 0, latMax: 0, lonMin: 0, lonMax: 0}}); - // Don't try to add the user defined region since we don't have one - scope.regionParams.areValid = false; - // We need to fake the map object. The only thing we care about is faking the "addLayer" function - // and the "fitBounds" functions which our map controllers makes use of. - $rootScope.map = {addLayer: function(){}, fitBounds: function(){}}; - $rootScope.fillColors = ['#ff0000']; - - expect("rectangleGroup" in $rootScope).toBe(false); - scope.updateMap(); - expect("rectangleGroup" in $rootScope).toBe(true); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/directives/BootstrapModalTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/directives/BootstrapModalTest.js b/ocw-ui/frontend/test/unit/directives/BootstrapModalTest.js deleted file mode 100644 index dacc74c..0000000 --- a/ocw-ui/frontend/test/unit/directives/BootstrapModalTest.js +++ /dev/null @@ -1,41 +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. -**/ -'use strict'; - -describe('directives', function() { - beforeEach(module('ocw')); - - describe('bootstrap-modal directive', function() { - it('should create a div element of the correct form', function() { - inject(function($compile, $rootScope) { - var element = $compile('')($rootScope); - expect(element.hasClass("modal")).toBeTruthy(); - expect(element.hasClass("hide")).toBeTruthy(); - expect(element.attr("id")).toEqual('{{modalId}}'); - }); - }); - - it('should properly wrap the interior html content' , function() { - inject(function($compile, $rootScope) { - var element = $compile('

Hello

')($rootScope); - expect(element.html()).toEqual("

Hello

"); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/directives/OnBlurTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/directives/OnBlurTest.js b/ocw-ui/frontend/test/unit/directives/OnBlurTest.js deleted file mode 100644 index c99b2c3..0000000 --- a/ocw-ui/frontend/test/unit/directives/OnBlurTest.js +++ /dev/null @@ -1,42 +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. -**/ - -'use strict'; - -describe('directives', function() { - beforeEach(module('ocw')); - - describe('onBlur directive', function() { - it('should call the supplied function on the blur event', function() { - inject(function($compile, $rootScope) { - // Set a rootScope variable to make sure that on-blur calls - // the function that we pass to it. - $rootScope.bogusFunction = function() { - $rootScope.test = "hi" - } - - var element = $compile('')($rootScope); - - expect($rootScope.test).toNotBe('hi'); - element.trigger('blur'); - expect($rootScope.test).toBe('hi'); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/directives/PreviewMapTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/directives/PreviewMapTest.js b/ocw-ui/frontend/test/unit/directives/PreviewMapTest.js deleted file mode 100644 index a7991e6..0000000 --- a/ocw-ui/frontend/test/unit/directives/PreviewMapTest.js +++ /dev/null @@ -1,46 +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. -**/ - -'use strict'; - -describe('directives', function() { - beforeEach(module('ocw')); - - describe('preview-map directive', function() { - it('should set the proper class', function() { - inject(function($compile, $rootScope) { - $rootScope.dataset = {latlonVals: {latMax: 90, lonMax: 90, latMin: -90, lonMin: -90}, name: "TRMM"}; - - var element = $compile('
')($rootScope); - - expect(element.hasClass("preview-map")).toBeTruthy(); - }); - }); - - it('should set the id of the template to the name of the dataset', function() { - inject(function($compile, $rootScope) { - $rootScope.dataset = {latlonVals: {latMax: 90, lonMax: 90, latMin: -90, lonMin: -90}, name: "TRMM"}; - - var element = $compile('
')($rootScope); - - expect(element.attr('id')).toEqual("{{dataset.name}}"); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/filters/ISODateToMiddleEndianTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/filters/ISODateToMiddleEndianTest.js b/ocw-ui/frontend/test/unit/filters/ISODateToMiddleEndianTest.js deleted file mode 100644 index 9228765..0000000 --- a/ocw-ui/frontend/test/unit/filters/ISODateToMiddleEndianTest.js +++ /dev/null @@ -1,67 +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. -**/ -'use strict'; - -describe('OCW Filters', function() { - beforeEach(module('ocw.filters')); - - describe('ISODateToMiddleEndian', function() { - it('should replace the ISO Date/Time stamp', function() { - inject(function($filter) { - var filter = $filter('ISODateToMiddleEndian'); - expect(filter('2012-01-02T00:00:00')).toEqual('01/02/2012'); - }); - }); - - it('should replace the modified ISO Date/Time stamp', function() { - inject(function($filter) { - var filter = $filter('ISODateToMiddleEndian'); - expect(filter('2012-01-02 00:00:00')).toEqual('01/02/2012'); - }); - }); - - it('should replace the ISO Date stamp', function() { - inject(function($filter) { - var filter = $filter('ISODateToMiddleEndian'); - expect(filter('2012-01-02')).toEqual('01/02/2012'); - }); - }); - - it('should replace leading and trailing whitespace', function() { - inject(function($filter) { - var filter = $filter('ISODateToMiddleEndian'); - expect(filter(' 2012-01-02T00:00:00 ')).toEqual('01/02/2012'); - }); - }); - - it('should do nothing when the date format has the incorrect number of hyphens', function() { - inject(function($filter) { - var filter = $filter('ISODateToMiddleEndian'); - expect(filter('2012-234T234')).toEqual('2012-234T234') - }); - }); - - it('should do nothing when the date format has no hyphens', function() { - inject(function($filter) { - var filter = $filter('ISODateToMiddleEndian'); - expect(filter('2012234T234')).toEqual('2012234T234') - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/services/EvaluationSettingsTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/services/EvaluationSettingsTest.js b/ocw-ui/frontend/test/unit/services/EvaluationSettingsTest.js deleted file mode 100644 index b8d021a..0000000 --- a/ocw-ui/frontend/test/unit/services/EvaluationSettingsTest.js +++ /dev/null @@ -1,40 +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. -**/ - -'use strict'; - -describe('OCW Services', function() { - - beforeEach(module('ocw.services')); - - describe('EvaluationSettings', function() { - - it('should initialize the evaluationSettings service', function() { - inject(function(evaluationSettings) { - expect(evaluationSettings).not.toEqual(null); - }); - }); - - it('should provide a getSettings function', function() { - inject(function(evaluationSettings) { - expect(evaluationSettings.getSettings()).not.toEqual(null); - }) - }) - }); -}); http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/services/RegionSelectParamsTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/services/RegionSelectParamsTest.js b/ocw-ui/frontend/test/unit/services/RegionSelectParamsTest.js deleted file mode 100644 index 2b90ec3..0000000 --- a/ocw-ui/frontend/test/unit/services/RegionSelectParamsTest.js +++ /dev/null @@ -1,41 +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. -**/ - -'use strict'; - -describe('OCW Services', function() { - - beforeEach(module('ocw.services')); - - describe('RegionSelectParams', function() { - - it('should initialize the regionSelectParams service', function() { - inject(function(regionSelectParams) { - expect(regionSelectParams).not.toEqual(null); - }); - }); - - it('should provide the getParameters function', function() { - inject(function(regionSelectParams) { - expect(regionSelectParams.getParameters()).not.toEqual(null); - }); - }); - }); -}); - http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-ui/frontend/test/unit/services/SelectedDatasetInfomationTest.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/test/unit/services/SelectedDatasetInfomationTest.js b/ocw-ui/frontend/test/unit/services/SelectedDatasetInfomationTest.js deleted file mode 100644 index aeada3d..0000000 --- a/ocw-ui/frontend/test/unit/services/SelectedDatasetInfomationTest.js +++ /dev/null @@ -1,90 +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. -**/ - -'use strict'; - -describe('OCW Services', function() { - - beforeEach(module('ocw.services')); - - describe('SelectedDatasetInformation', function() { - - it('should initialize the selectedDatasetInformation service', function() { - inject(function(selectedDatasetInformation) { - expect(selectedDatasetInformation).not.toEqual(null); - }); - }); - - it('should provide the getDatasets function', function() { - inject(function(selectedDatasetInformation) { - expect(selectedDatasetInformation.getDatasets()).not.toEqual(null); - }); - }); - - it('should provide the getDatasetCount function', function() { - inject(function(selectedDatasetInformation) { - expect(selectedDatasetInformation.getDatasetCount()).toEqual(0); - }); - }); - - it('should provide the addDataset function', function() { - inject(function(selectedDatasetInformation) { - selectedDatasetInformation.addDataset({}); - expect(selectedDatasetInformation.getDatasetCount()).toEqual(1); - }); - }); - - it('should set the shouldDisplay attribute when adding a dataset', function() { - inject(function(selectedDatasetInformation) { - selectedDatasetInformation.addDataset({}); - expect(selectedDatasetInformation.getDatasets()[0].shouldDisplay).toBe(false); - }); - }); - - it('should set the regrid attribute when adding a dataset', function() { - inject(function(selectedDatasetInformation) { - selectedDatasetInformation.addDataset({}); - expect(selectedDatasetInformation.getDatasets()[0].regrid).toBe(false); - }); - }); - - it('should provide the removeDataset function', function() { - inject(function(selectedDatasetInformation) { - selectedDatasetInformation.addDataset(1); - selectedDatasetInformation.addDataset(2); - - expect(selectedDatasetInformation.getDatasets()[0]).toEqual(1); - selectedDatasetInformation.removeDataset(0); - expect(selectedDatasetInformation.getDatasets()[0]).toEqual(2); - }); - }); - - it('should provide the clearDatasets function', function() { - inject(function(selectedDatasetInformation) { - selectedDatasetInformation.addDataset({}); - expect(selectedDatasetInformation.getDatasetCount()).toEqual(1); - - selectedDatasetInformation.clearDatasets(); - expect(selectedDatasetInformation.getDatasetCount()).toEqual(0); - }); - }); - }); -}); - - http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-vm/Vagrantfile ---------------------------------------------------------------------- diff --git a/ocw-vm/Vagrantfile b/ocw-vm/Vagrantfile deleted file mode 100644 index 90f41a6..0000000 --- a/ocw-vm/Vagrantfile +++ /dev/null @@ -1,17 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! -VAGRANTFILE_API_VERSION = "2" - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.box = "hashicorp/precise64" - - #Boot the VM into GUI mode. - config.vm.provider "virtualbox" do |vb| - # Don't boot with headless mode - vb.gui = true - # Use VBoxManage to customize the VM. For example to change memory: - vb.customize ["modifyvm", :id, "--memory", "1024"] - end -end http://git-wip-us.apache.org/repos/asf/climate/blob/a53e3af5/ocw-vm/init-ocw-vm.sh ---------------------------------------------------------------------- diff --git a/ocw-vm/init-ocw-vm.sh b/ocw-vm/init-ocw-vm.sh deleted file mode 100755 index 658a494..0000000 --- a/ocw-vm/init-ocw-vm.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash -# -# 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. - -# Install some useful/necessary dependencies to make future installs easier -sudo apt-get update -sudo apt-get install -y make -sudo apt-get install -y libblas-dev -sudo apt-get install -y liblapack-dev -sudo apt-get install -y gfortran -sudo apt-get install -y g++ -sudo apt-get install -y build-essential -sudo apt-get install -y python-dev -sudo apt-get install -y ia32-libs --fix-missing -sudo apt-get install -y git -sudo apt-get install -y vim - -# GUI related installs -sudo apt-get install -y lightdm - -# XFCE -#sudo apt-get install -y xfce4 -#sudo apt-get install -y xdg-utils -#sudo apt-get install -y eog - -# Ubuntu Unity -sudo apt-get install -y ubuntu-desktop - -# Use the Easy-OCW Ubuntu install script to get everything -# else installed! -git clone http://git-wip-us.apache.org/repos/asf/climate.git - -# Copy the Easy-OCW install script for Ubuntu -cp climate/easy-ocw/install-ubuntu-12_04.sh . -# Copy the requirements files for conda and pip used by Easy-OCW -cp climate/easy-ocw/*.txt . - -bash install-ubuntu-12_04.sh -q - -# Set symlink for the UI frontend code -cd climate/ocw-ui/backend -ln -s ../frontend/app app - -# Cleanup Anaconda and Basemap downloads from the install script -cd -sudo rm -f Anaconda-1.9.2-Linux-x86_64.sh -sudo rm -f basemap-1.0.7.tar.gz -sudo rm -rf basemap-1.0.7 - -mkdir /home/vagrant/Desktop - -# These links will only work if we're using the Unity desktop. -# If you want to use the XFCE desktop you will need to change -# the references to 'nautilus' to whatever file browser you -# will be using. -cat >/home/vagrant/Desktop/climate.desktop </home/vagrant/Desktop/ui.desktop </home/vagrant/Desktop/.ui.sh <