Return-Path: X-Original-To: apmail-tez-commits-archive@minotaur.apache.org Delivered-To: apmail-tez-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 6ABC018888 for ; Wed, 24 Feb 2016 22:34:52 +0000 (UTC) Received: (qmail 41662 invoked by uid 500); 24 Feb 2016 22:34:39 -0000 Delivered-To: apmail-tez-commits-archive@tez.apache.org Received: (qmail 41512 invoked by uid 500); 24 Feb 2016 22:34:39 -0000 Mailing-List: contact commits-help@tez.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tez.apache.org Delivered-To: mailing list commits@tez.apache.org Received: (qmail 41077 invoked by uid 99); 24 Feb 2016 22:34:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2016 22:34:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 42BB4E8ED6; Wed, 24 Feb 2016 22:34:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sree@apache.org To: commits@tez.apache.org Date: Wed, 24 Feb 2016 22:34:53 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [16/45] tez git commit: TEZ-2986. Tez UI 2: Implement All DAGs page (sree) http://git-wip-us.apache.org/repos/asf/tez/blob/d34cbe07/tez-ui2/src/main/webapp/tests/unit/serializers/dag-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/serializers/dag-test.js b/tez-ui2/src/main/webapp/tests/unit/serializers/dag-test.js new file mode 100644 index 0000000..7dd635c --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/serializers/dag-test.js @@ -0,0 +1,109 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('serializer:dag', 'Unit | Serializer | dag', { + // Specify the other units that are required for this test. + // needs: ['serializer:dag'] +}); + +test('Basic creation test', function(assert) { + let serializer = this.subject(); + + assert.ok(serializer); + assert.ok(serializer.maps.atsStatus); + assert.ok(serializer.maps.startTime); + assert.ok(serializer.maps.endTime); + assert.ok(serializer.maps.containerLogs); +}); + +test('atsStatus test', function(assert) { + let serializer = this.subject(), + mapper = serializer.maps.atsStatus; + + assert.equal(mapper({ + events: [{eventtype: "SOME_EVENT"}] + }), undefined); + + assert.equal(mapper({ + events: [{eventtype: "DAG_STARTED"}] + }), "RUNNING"); + + assert.equal(mapper({ + otherinfo: {status: "STATUS1"}, + primaryfilters: {status: ["STATUS2"]}, + events: [{eventtype: "DAG_STARTED"}] + }), "STATUS1"); + + assert.equal(mapper({ + primaryfilters: {status: ["STATUS2"]}, + events: [{eventtype: "DAG_STARTED"}] + }), "STATUS2"); +}); + +test('startTime test', function(assert) { + let serializer = this.subject(), + mapper = serializer.maps.startTime, + testTimestamp = Date.now(); + + assert.equal(mapper({ + events: [{eventtype: "SOME_EVENT"}] + }), undefined); + + assert.equal(mapper({ + events: [{eventtype: "DAG_STARTED", timestamp: testTimestamp}] + }), testTimestamp); + + assert.equal(mapper({ + otherinfo: {startTime: testTimestamp}, + events: [{eventtype: "DAG_STARTED"}] + }), testTimestamp); +}); + +test('endTime test', function(assert) { + let serializer = this.subject(), + mapper = serializer.maps.endTime, + testTimestamp = Date.now(); + + assert.equal(mapper({ + events: [{eventtype: "SOME_EVENT"}] + }), undefined); + + assert.equal(mapper({ + events: [{eventtype: "DAG_FINISHED", timestamp: testTimestamp}] + }), testTimestamp); + + assert.equal(mapper({ + otherinfo: {endTime: testTimestamp}, + events: [{eventtype: "DAG_FINISHED"}] + }), testTimestamp); +}); + +test('containerLogs test', function(assert) { + let serializer = this.subject(), + mapper = serializer.maps.containerLogs; + + assert.deepEqual(mapper({ + otherinfo: {}, + }), [], "No logs"); + + assert.deepEqual(mapper({ + otherinfo: {inProgressLogsURL_1: "foo", inProgressLogsURL_2: "bar"}, + }), [{text: "1", href: "http://foo"}, {text: "2", href: "http://bar"}], "2 logs"); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/d34cbe07/tez-ui2/src/main/webapp/tests/unit/transforms/object-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/transforms/object-test.js b/tez-ui2/src/main/webapp/tests/unit/transforms/object-test.js new file mode 100644 index 0000000..79b1bde --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/transforms/object-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('transform:object', 'Unit | Transform | object', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let transform = this.subject(); + assert.ok(transform); +});