Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E419D177B9 for ; Tue, 30 Sep 2014 20:48:07 +0000 (UTC) Received: (qmail 21065 invoked by uid 500); 30 Sep 2014 20:48:07 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 20980 invoked by uid 500); 30 Sep 2014 20:48:07 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 20815 invoked by uid 99); 30 Sep 2014 20:48:07 -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, 30 Sep 2014 20:48:07 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4FA77A0C39B; Tue, 30 Sep 2014 20:48:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jonathanhurley@apache.org To: commits@ambari.apache.org Date: Tue, 30 Sep 2014 20:48:16 -0000 Message-Id: <4b28c0d1e0e74df2ba640ef66ce3c5d0@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [10/35] Revert "AMBARI-7536. Create skeleton for UI unit tests. (onechiporenko)" http://git-wip-us.apache.org/repos/asf/ambari/blob/7faca858/contrib/views/slider/src/main/resources/ui/config.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/config.js b/contrib/views/slider/src/main/resources/ui/config.js index 6b8a243..4c6a023 100755 --- a/contrib/views/slider/src/main/resources/ui/config.js +++ b/contrib/views/slider/src/main/resources/ui/config.js @@ -24,8 +24,7 @@ exports.config = { javascripts: { joinTo: { 'javascripts/app.js': /^(app|envs\/development)/, - 'javascripts/vendor.js': /^(vendor\/scripts\/(common|development)|vendor\\scripts\\(common|development))/, - 'javascripts/test.js': /^test(\/|\\)(?!vendor)/ + 'javascripts/vendor.js': /^(vendor\/scripts\/(common|development)|vendor\\scripts\\(common|development))/ }, order: { before: [ http://git-wip-us.apache.org/repos/asf/ambari/blob/7faca858/contrib/views/slider/src/main/resources/ui/test/demo/demo_integration_test.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/test/demo/demo_integration_test.js b/contrib/views/slider/src/main/resources/ui/test/demo/demo_integration_test.js new file mode 100755 index 0000000..08e3693 --- /dev/null +++ b/contrib/views/slider/src/main/resources/ui/test/demo/demo_integration_test.js @@ -0,0 +1,24 @@ +/** + * 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("/", function() { + visit("/").then(function() { + equal(find("h2").text(), "Welcome to Ember.js", "Application header is rendered"); + equal(find("li").length, 3, "There are three items in the list"); + }); +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/7faca858/contrib/views/slider/src/main/resources/ui/test/demo/demo_unit_test.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/test/demo/demo_unit_test.js b/contrib/views/slider/src/main/resources/ui/test/demo/demo_unit_test.js new file mode 100755 index 0000000..84d2758 --- /dev/null +++ b/contrib/views/slider/src/main/resources/ui/test/demo/demo_unit_test.js @@ -0,0 +1,21 @@ +/** + * 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('this is always true', function() { + equal(1, 1, '1 is not 1... ooooh!'); +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/7faca858/contrib/views/slider/src/main/resources/ui/test/helpers.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/test/helpers.js b/contrib/views/slider/src/main/resources/ui/test/helpers.js new file mode 100755 index 0000000..54c9edb --- /dev/null +++ b/contrib/views/slider/src/main/resources/ui/test/helpers.js @@ -0,0 +1,34 @@ +/** + * 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. + */ + +require('initialize'); + +document.write('
'); +App.rootElement = '#ember-testing'; +App.setupForTesting(); +App.injectTestHelpers(); + +module('Integration tests', { + setup: function() { + Ember.run(App, App.advanceReadiness); + }, + + teardown: function() { + App.reset(); + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/7faca858/contrib/views/slider/src/main/resources/ui/test/models/slider_app_test.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/test/models/slider_app_test.js b/contrib/views/slider/src/main/resources/ui/test/models/slider_app_test.js deleted file mode 100644 index e56bcc9..0000000 --- a/contrib/views/slider/src/main/resources/ui/test/models/slider_app_test.js +++ /dev/null @@ -1,68 +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. - */ - -moduleForModel('sliderApp', 'App.SliderApp', { - - needs: [ - 'model:sliderAppType', - 'model:sliderAppComponent', - 'model:quickLink', - 'model:sliderAppAlert', - 'model:typedProperty' - ], - - setup: function() { - App.set('gangliaHost', null); - }, - - teardown: function() { - App.set('gangliaHost', null); - } - -}); - -test('doNotShowComponentsAndAlerts', function () { - - var sliderApp = this.subject({name: 'p1', status: 'FROZEN'}); - - equal(sliderApp.get('doNotShowComponentsAndAlerts'), true, 'Should be true if status is FROZEN'); - - Em.run(function () { - sliderApp.set('status', 'FAILED'); - }); - equal(sliderApp.get('doNotShowComponentsAndAlerts'), true, 'Should be true if status is FAILED'); - -}); - - -test('showMetrics', function () { - - var sliderApp = this.subject({name: 'p1', configs: {}}); - - Em.run(function() { - App.set('gangliaHost', 'some_host'); - }); - equal(sliderApp.get('showMetrics'), true, 'should be true if App.gangliaHost is provided'); - - Em.run(function() { - App.set('gangliaHost', null); - sliderApp.set('status', App.SliderApp.Status.running); - }); - equal(sliderApp.get('showMetrics'), true, 'should be true if status is RUNNING'); - -}); \ No newline at end of file