http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-ruler-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-ruler-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-ruler-test.js new file mode 100644 index 0000000..b1d0439 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-ruler-test.js @@ -0,0 +1,70 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +import wait from 'ember-test-helpers/wait'; + +import Processor from 'tez-ui/utils/processor'; + +moduleForComponent('em-swimlane-ruler', 'Integration | Component | em swimlane ruler', { + integration: true +}); + +test('Basic creation test', function(assert) { + + this.render(hbs`{{em-swimlane-ruler}}`); + assert.equal(this.$().text().trim(), 'Milliseconds'); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-swimlane-ruler}} + template block text + {{/em-swimlane-ruler}} + `); + assert.equal(this.$().text().trim(), 'Milliseconds'); +}); + +test('Mark test', function(assert) { + this.set("processor", Processor.create({ + startTime: 0, + endTime: 1000 * 20, + })); + + this.render(hbs`{{em-swimlane-ruler processor=processor zoom=100}}`); + + return wait().then(() => { + assert.equal(this.$(".unit-text").text().trim(), 'Seconds'); + assert.equal(this.$(".ruler-mark").length, 11); + }); +}); + +test('Mark zoom test', function(assert) { + this.set("processor", Processor.create({ + startTime: 0, + endTime: 1000 * 20, + })); + + this.render(hbs`{{em-swimlane-ruler processor=processor zoom=500}}`); + + return wait().then(() => { + assert.equal(this.$(".unit-text").text().trim(), 'Milliseconds'); + assert.equal(this.$(".ruler-mark").length, 55); + }); +});
http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-test.js new file mode 100644 index 0000000..e0ab7c7 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-test.js @@ -0,0 +1,93 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +import Process from 'tez-ui/utils/process'; + +moduleForComponent('em-swimlane', 'Integration | Component | em swimlane', { + integration: true +}); + +test('Basic creation test', function(assert) { + var testName1 = "TestName1", + testName2 = "TestName2"; + + this.set("processes", [Process.create({ + name: testName1 + }), Process.create({ + name: testName2 + })]); + + this.render(hbs`{{em-swimlane processes=processes}}`); + + assert.equal(this.$().text().trim().indexOf(testName1), 0); + assert.notEqual(this.$().text().trim().indexOf(testName2), -1); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-swimlane processes=processes}} + template block text + {{/em-swimlane}} + `); + + assert.equal(this.$().text().trim().indexOf(testName1), 0); + assert.notEqual(this.$().text().trim().indexOf(testName2), -1); +}); + +test('Normalization (Blocker based sorting) test - On a graph', function(assert) { + var p1 = Process.create({ + name: "P1" + }), + p2 = Process.create({ + name: "P2" + }), + p3 = Process.create({ + name: "P3", + blockers: [p1, p2] + }), + p4 = Process.create({ + name: "P4", + blockers: [p1] + }), + p5 = Process.create({ + name: "P5", + blockers: [p3, p4] + }); + + this.set("processes", [p5, p4, p3, p2, p1]); + + this.render(hbs`{{em-swimlane processes=processes}}`); + + let names = this.$(".em-swimlane-process-name"); + + assert.equal(names.length, 5); + assert.equal(names.eq(0).text().trim(), p1.name); + assert.equal(names.eq(1).text().trim(), p4.name); + assert.equal(names.eq(2).text().trim(), p2.name); + assert.equal(names.eq(3).text().trim(), p3.name); + assert.equal(names.eq(4).text().trim(), p5.name); +}); + +test('Zoom test', function(assert) { + this.set("processes", [Process.create()]); + + this.render(hbs`{{em-swimlane processes=processes zoom=500}}`); + assert.equal(this.$(".zoom-panel").attr("style").trim(), "width: 500%;"); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-vertex-name-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-vertex-name-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-vertex-name-test.js new file mode 100644 index 0000000..f085be3 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-vertex-name-test.js @@ -0,0 +1,80 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +import wait from 'ember-test-helpers/wait'; + +import Process from 'tez-ui/utils/process'; + +moduleForComponent('em-swimlane-vertex-name', 'Integration | Component | em swimlane vertex name', { + integration: true +}); + +test('Basic creation test', function(assert) { + + this.render(hbs`{{em-swimlane-vertex-name}}`); + assert.equal(this.$().text().trim(), 'Not Available!'); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-swimlane-vertex-name}} + template block text + {{/em-swimlane-vertex-name}} + `); + assert.equal(this.$().text().trim(), 'Not Available!'); +}); + +test('Name test', function(assert) { + this.set("process", Process.create({ + name: "TestName" + })); + + this.render(hbs`{{em-swimlane-vertex-name process=process}}`); + return wait().then(() => { + assert.equal(this.$(".name-text").text().trim(), 'TestName'); + }); +}); + +test('Progress test', function(assert) { + this.set("process", Process.create({ + vertex: { + finalStatus: "RUNNING", + progress: 0.5 + } + })); + + this.render(hbs`{{em-swimlane-vertex-name process=process}}`); + return wait().then(() => { + assert.equal(this.$().text().trim().substr(0, 3), '50%'); + }); +}); + +test('finalStatus test', function(assert) { + this.set("process", Process.create({ + vertex: { + finalStatus: "STAT" + } + })); + + this.render(hbs`{{em-swimlane-vertex-name process=process}}`); + return wait().then(() => { + assert.equal(this.$().text().trim(), 'STAT'); + }); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-table-status-cell-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-table-status-cell-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-table-status-cell-test.js new file mode 100644 index 0000000..fd4d612 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-table-status-cell-test.js @@ -0,0 +1,44 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('em-table-status-cell', 'Integration | Component | em table status cell', { + integration: true +}); + +test('Basic render test', function(assert) { + + this.render(hbs`{{em-table-status-cell}}`); + assert.equal(this.$().text().trim(), 'Not Available!'); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-table-status-cell}} + template block text + {{/em-table-status-cell}} + `); + assert.equal(this.$().text().trim(), 'Not Available!'); +}); + +test('Basic test', function(assert) { + this.render(hbs`{{em-table-status-cell content="inited"}}`); + assert.equal(this.$().text().trim(), 'inited'); + assert.equal(this.$("span")[0].className, 'status status-inited'); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-tooltip-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-tooltip-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-tooltip-test.js new file mode 100644 index 0000000..73a957b --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-tooltip-test.js @@ -0,0 +1,80 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('em-tooltip', 'Integration | Component | em tooltip', { + integration: true +}); + +test('Basic creation test', function(assert) { + + this.render(hbs`{{em-tooltip}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-tooltip}} + template block text + {{/em-tooltip}} + `); + + assert.equal(this.$().text().trim(), ''); +}); + +test('Title test', function(assert) { + this.set("title", "TestTitle"); + this.render(hbs`{{em-tooltip title=title}}`); + + assert.equal(this.$().text().trim(), 'TestTitle'); +}); + +test('Description test', function(assert) { + this.set("desc", "TestDesc"); + this.render(hbs`{{em-tooltip description=desc}}`); + + assert.equal(this.$().text().trim(), 'TestDesc'); +}); + +test('Properties test', function(assert) { + this.set("properties", [{ + name: "p1", value: "v1" + }, { + name: "p2", value: "v2" + }]); + this.render(hbs`{{em-tooltip properties=properties}}`); + + assert.equal(this.$("tr").length, 2); +}); + +test('Contents test', function(assert) { + this.set("contents", [{ + title: "p1", + properties: [{}, {}] + }, { + title: "p2", + properties: [{}, {}, {}] + }]); + + this.render(hbs`{{em-tooltip contents=contents}}`); + + assert.equal(this.$(".bubble").length, 2); + assert.equal(this.$("tr").length, 2 + 3); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/error-bar-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/error-bar-test.js b/tez-ui/src/main/webapp/tests/integration/components/error-bar-test.js new file mode 100644 index 0000000..10c6c7d --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/error-bar-test.js @@ -0,0 +1,43 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('error-bar', 'Integration | Component | error bar', { + integration: true +}); + +test('Basic creation test', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... });" + EOL + EOL + + + this.render(hbs`{{error-bar}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage:" + EOL + + this.render(hbs` + {{#error-bar}} + template block text + {{/error-bar}} + `); + + assert.equal(this.$().text().trim(), ''); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/stats-link-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/stats-link-test.js b/tez-ui/src/main/webapp/tests/integration/components/stats-link-test.js new file mode 100644 index 0000000..ad2dc7b --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/stats-link-test.js @@ -0,0 +1,38 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('stats-link', 'Integration | Component | stats link', { + integration: true +}); + +test('Basic creation test', function(assert) { + + this.render(hbs`{{stats-link}}`); + assert.equal(this.$().text().trim(), 'Not Available!'); + + // Template block usage:" + EOL + + this.render(hbs` + {{#stats-link}} + template block text + {{/stats-link}} + `); + assert.equal(this.$().text().trim(), 'Not Available!'); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/tab-n-refresh-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/tab-n-refresh-test.js b/tez-ui/src/main/webapp/tests/integration/components/tab-n-refresh-test.js new file mode 100644 index 0000000..e45b461 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/tab-n-refresh-test.js @@ -0,0 +1,50 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('tab-n-refresh', 'Integration | Component | tab n refresh', { + integration: true +}); + +test('Basic creation test', function(assert) { + var testTabs = [{ + text: "Tab 1", + routeName: "route_1", + },{ + text: "Tab 2", + routeName: "route_2", + }]; + + this.set("tabs", testTabs); + + this.render(hbs`{{tab-n-refresh tabs=tabs}}`); + + assert.equal(this.$("button").text().trim(), 'Refresh'); + assert.equal($(this.$("li")[0]).text().trim(), testTabs[0].text); + assert.equal($(this.$("li")[1]).text().trim(), testTabs[1].text); + + this.render(hbs` + {{#tab-n-refresh tabs=tabs}} + template block text + {{/tab-n-refresh}} + `); + + assert.equal(this.$("button").text().trim(), 'Refresh'); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/table-controls-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/table-controls-test.js b/tez-ui/src/main/webapp/tests/integration/components/table-controls-test.js new file mode 100644 index 0000000..79170ee --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/table-controls-test.js @@ -0,0 +1,43 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('table-controls', 'Integration | Component | table controls', { + integration: true +}); + +test('Basic creation test', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... });" + EOL + EOL + + + this.render(hbs`{{table-controls}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage:" + EOL + + this.render(hbs` + {{#table-controls}} + template block text + {{/table-controls}} + `); + + assert.equal(this.$().text().trim(), ''); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/zip-download-modal-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/zip-download-modal-test.js b/tez-ui/src/main/webapp/tests/integration/components/zip-download-modal-test.js new file mode 100644 index 0000000..cd9a61a --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/zip-download-modal-test.js @@ -0,0 +1,46 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('zip-download-modal', 'Integration | Component | zip download modal', { + integration: true +}); + +test('Basic creation test', function(assert) { + var testID = "dag_a", + expectedMessage = "Downloading data for dag: " + testID; + + this.set("content", { + dag: { + entityID: testID + } + }); + + this.render(hbs`{{zip-download-modal content=content}}`); + assert.equal(this.$(".message").text().trim(), expectedMessage); + + // Template block usage:" + EOL + + this.render(hbs` + {{#zip-download-modal content=content}} + template block text + {{/zip-download-modal}} + `); + assert.equal(this.$(".message").text().trim(), expectedMessage); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/test-helper.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/test-helper.js b/tez-ui/src/main/webapp/tests/test-helper.js new file mode 100644 index 0000000..96975ee --- /dev/null +++ b/tez-ui/src/main/webapp/tests/test-helper.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. + */ + +import resolver from './helpers/resolver'; +import { + setResolver +} from 'ember-qunit'; + +setResolver(resolver); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/abstract-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/abstract-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/abstract-test.js new file mode 100644 index 0000000..5ff39e7 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/abstract-test.js @@ -0,0 +1,110 @@ +/** + * 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('adapter:abstract', 'Unit | Adapter | abstract', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); + assert.equal(adapter.serverName, null); + + assert.ok(adapter.host); + assert.ok(adapter.namespace); + assert.ok(adapter.pathTypeHash); + + assert.ok(adapter.ajaxOptions); + assert.ok(adapter.pathForType); +}); + +test('host, namespace & pathTypeHash test', function(assert) { + let adapter = this.subject(), + testServerName = "sn", + testHosts = { + sn: "foo.bar", + }, + testENV = { + app: { + namespaces: { + webService: { + sn: "ws" + } + }, + paths: { + sn: "path" + } + } + }; + + adapter.hosts = testHosts; + adapter.env = testENV; + adapter.set("serverName", testServerName); + + assert.equal(adapter.get("host"), testHosts.sn); + assert.equal(adapter.get("namespace"), testENV.app.namespaces.webService.sn); + assert.equal(adapter.get("pathTypeHash"), testENV.app.paths.sn); +}); + +test('ajaxOptions test', function(assert) { + let adapter = this.subject(), + testUrl = "foo.bar", + testMethod = "tm", + testOptions = { + a: 1 + }, + testServer = "ts", + + result; + + // Without options + adapter.serverName = testServer; + result = adapter.ajaxOptions(testUrl, testMethod); + assert.ok(result); + assert.ok(result.crossDomain); + assert.ok(result.xhrFields.withCredentials); + assert.equal(result.targetServer, testServer); + + // Without options + adapter.serverName = testServer; + result = adapter.ajaxOptions(testUrl, testMethod, testOptions); + assert.ok(result); + assert.ok(result.crossDomain); + assert.ok(result.xhrFields.withCredentials); + assert.equal(result.targetServer, testServer); + assert.equal(result.a, testOptions.a); +}); + +test('pathForType test', function(assert) { + let adapter = this.subject(), + testHash = { + typ: "type" + }; + + assert.expect(2); + + adapter.pathTypeHash = testHash; + assert.equal(adapter.pathForType("typ"), testHash.typ); + assert.throws(function () { + adapter.pathForType("noType"); + }); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/ahs-app-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/ahs-app-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/ahs-app-test.js new file mode 100644 index 0000000..e1aac04 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/ahs-app-test.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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('adapter:ahs-app', 'Unit | Adapter | ahs app', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); + assert.ok(adapter.namespace); + assert.ok(adapter.pathForType); + + assert.equal(adapter.pathForType(), "apps"); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/am-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/am-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/am-test.js new file mode 100644 index 0000000..676656b --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/am-test.js @@ -0,0 +1,50 @@ +/** + * 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('adapter:am', 'Unit | Adapter | am', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); + assert.equal(adapter.serverName, "am"); + + assert.ok(adapter.queryRecord); +}); + +test('queryRecord test', function(assert) { + let testStore = {}, + testType = {}, + testQuery = {}, + + adapter = this.subject({ + query: function (store, type, query) { + assert.equal(store, testStore); + assert.equal(type, testType); + assert.equal(query, testQuery); + } + }); + + assert.expect(3); + adapter.queryRecord(testStore, testType, testQuery); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/app-rm-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/app-rm-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/app-rm-test.js new file mode 100644 index 0000000..942b2db --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/app-rm-test.js @@ -0,0 +1,29 @@ +/** + * 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('adapter:app-rm', 'Unit | Adapter | app rm', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/app-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/app-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/app-test.js new file mode 100644 index 0000000..08d2c44 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/app-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('adapter:app', 'Unit | Adapter | app', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/attempt-am-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/attempt-am-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/attempt-am-test.js new file mode 100644 index 0000000..43c8e4a --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/attempt-am-test.js @@ -0,0 +1,29 @@ +/** + * 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('adapter:attempt-am', 'Unit | Adapter | attempt am', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/attempt-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/attempt-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/attempt-test.js new file mode 100644 index 0000000..584c46e --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/attempt-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('adapter:attempt', 'Unit | Adapter | attempt', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/dag-am-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/dag-am-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/dag-am-test.js new file mode 100644 index 0000000..b0d3fa9 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/dag-am-test.js @@ -0,0 +1,29 @@ +/** + * 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('adapter:dag-am', 'Unit | Adapter | dag am', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/dag-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/dag-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/dag-test.js new file mode 100644 index 0000000..33532b2 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/dag-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('adapter:dag', 'Unit | Adapter | dag', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/loader-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/loader-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/loader-test.js new file mode 100644 index 0000000..7b4a2df --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/loader-test.js @@ -0,0 +1,137 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('adapter:loader', 'Unit | Adapter | loader', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); + assert.ok(adapter._isLoader); + assert.ok(adapter.buildURL); + assert.ok(adapter._loaderAjax); + assert.ok(adapter.queryRecord); + assert.ok(adapter.query); +}); + +test('buildURL test', function(assert) { + let adapter = this.subject(); + + assert.equal(adapter.buildURL("dag"), "/dags"); + assert.equal(adapter.buildURL("dag", "dag1"), "/dags/dag1"); + assert.equal(adapter.buildURL("{x}dag", "dag1", null, null, null, {x: "x_x"}), "/x_xdags/dag1", "Test for substitution"); +}); + +test('_loaderAjax test', function(assert) { + let adapter = this.subject(), + testURL = "/dags", + testQueryParams = { x:1 }, + testRecord = {}, + testNameSpace = "ns"; + + assert.expect(2 + 1 + 2); + + adapter.ajax = function (url, method/*, options*/) { + + assert.equal(url, testURL); + assert.equal(method, "GET"); + + return Ember.RSVP.resolve(testRecord); + }; + + adapter.sortQueryParams = function (queryParams) { + assert.ok(queryParams, "sortQueryParams was called with query params"); + }; + + adapter._loaderAjax(testURL, testQueryParams, testNameSpace).then(function (data) { + assert.equal(data.nameSpace, testNameSpace, "Namespace returned"); + assert.equal(data.data, testRecord, "Test record returned"); + }); +}); + +test('queryRecord test', function(assert) { + let adapter = this.subject(), + testURL = "/dags", + testModel = { modelName: "testModel" }, + testStore = {}, + testQuery = { + id: "test1", + params: {}, + urlParams: {}, + nameSpace: "ns" + }; + + assert.expect(4 + 3); + + adapter.buildURL = function (modelName, id, snapshot, requestType, query, params) { + assert.equal(modelName, testModel.modelName); + assert.equal(id, testQuery.id); + assert.equal(query, testQuery.params); + assert.equal(params, testQuery.urlParams); + + return testURL; + }; + + adapter._loaderAjax = function (url, queryParams, nameSpace) { + assert.equal(url, testURL); + assert.equal(queryParams, testQuery.params); + assert.equal(nameSpace, testQuery.nameSpace); + }; + + adapter.queryRecord(testStore, testModel, testQuery); +}); + +test('query test', function(assert) { + let adapter = this.subject(), + testURL = "/dags", + testModel = { modelName: "testModel" }, + testStore = {}, + testQuery = { + id: "test1", + params: {}, + urlParams: {}, + nameSpace: "ns" + }; + + assert.expect(5 + 3); + + adapter.buildURL = function (modelName, id, snapshot, requestType, query, params) { + assert.equal(modelName, testModel.modelName); + assert.equal(id, null); + assert.equal(requestType, "query"); + assert.equal(query, testQuery.params); + assert.equal(params, testQuery.urlParams); + + return testURL; + }; + + adapter._loaderAjax = function (url, queryParams, nameSpace) { + assert.equal(url, testURL); + assert.equal(queryParams, testQuery.params); + assert.equal(nameSpace, testQuery.nameSpace); + }; + + adapter.query(testStore, testModel, testQuery); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/rm-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/rm-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/rm-test.js new file mode 100644 index 0000000..0b0445e --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/rm-test.js @@ -0,0 +1,31 @@ +/** + * 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('adapter:rm', 'Unit | Adapter | rm', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); + assert.equal(adapter.serverName, "rm"); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/task-am-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/task-am-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/task-am-test.js new file mode 100644 index 0000000..a3eb98b --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/task-am-test.js @@ -0,0 +1,29 @@ +/** + * 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('adapter:task-am', 'Unit | Adapter | task am', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/task-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/task-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/task-test.js new file mode 100644 index 0000000..ca39e56 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/task-test.js @@ -0,0 +1,29 @@ +/** + * 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('adapter:task', 'Unit | Adapter | task', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/timeline-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/timeline-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/timeline-test.js new file mode 100644 index 0000000..7b0e978 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/timeline-test.js @@ -0,0 +1,84 @@ +/** + * 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('adapter:timeline', 'Unit | Adapter | timeline', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); + assert.ok(adapter.filters); + assert.ok(adapter.stringifyFilters); + assert.ok(adapter.normalizeQuery); + assert.ok(adapter.query); + + assert.equal(adapter.serverName, "timeline"); +}); + +test('stringifyFilters test', function(assert) { + let adapter = this.subject(); + + assert.equal(adapter.stringifyFilters({a: 1, b: 2}), "a:1,b:2"); + assert.throws(function () { + adapter.stringifyFilters(); + }); +}); + +test('normalizeQuery test', function(assert) { + let adapter = this.subject(), + normalQuery; + + adapter.set("filters", { + a: "A_ID", + b: "B_ID", + }); + + normalQuery = adapter.normalizeQuery({a: 1, b: 2, c: 3, d: 4}); + + assert.deepEqual(normalQuery.primaryFilter, "A_ID:1"); + assert.deepEqual(normalQuery.secondaryFilter, "B_ID:2"); + assert.deepEqual(normalQuery.c, 3); + assert.deepEqual(normalQuery.d, 4); +}); + +test('query test', function(assert) { + let adapter = this.subject(), + normalQuery = {}, + testStore = {}, + testType = "ts", + testQuery = {}; + + assert.expect(1 + 1); + + adapter.normalizeQuery = function (params) { + assert.equal(params, testQuery); + return normalQuery; + }; + adapter._loaderAjax = function (url, queryParams) { + assert.equal(queryParams, normalQuery); + }; + + adapter.query(testStore, testType, { + params: testQuery + }); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/vertex-am-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/vertex-am-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/vertex-am-test.js new file mode 100644 index 0000000..6e29aef --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/vertex-am-test.js @@ -0,0 +1,29 @@ +/** + * 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('adapter:vertex-am', 'Unit | Adapter | vertex am', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/adapters/vertex-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/vertex-test.js b/tez-ui/src/main/webapp/tests/unit/adapters/vertex-test.js new file mode 100644 index 0000000..191f781 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/adapters/vertex-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('adapter:vertex', 'Unit | Adapter | vertex', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/abstract-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/abstract-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/abstract-test.js new file mode 100644 index 0000000..9603b50 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/abstract-test.js @@ -0,0 +1,76 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:abstract', 'Unit | Controller | abstract', { + // Specify the other units that are required for this test. + // needs: ['route:abstract'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller.name); + assert.ok(controller.crumbObserver); + assert.ok(controller.setBreadcrumbs); + assert.ok(controller.loaded); +}); + +test('init test', function(assert) { + assert.expect(1); + + this.subject({ + send: function (name) { + assert.equal(name, "setBreadcrumbs"); + } + }); +}); + +test('crumbObserver test', function(assert) { + assert.expect(1 + 1); // Init and fired + + let controller = this.subject({ + send: function (name) { + assert.equal(name, "setBreadcrumbs"); + } + }); + + controller.set("breadcrumbs", []); +}); + +test('setBreadcrumbs test', function(assert) { + let testName = "Abc", // Because all controllers are pointing to the leaf rout + testBreadCrumbs = []; + + assert.expect(3); + this.subject({ + name: testName, + breadcrumbs: testBreadCrumbs, + send: function (name, crumbs) { + assert.equal(name, "setBreadcrumbs"); + assert.ok(crumbs.hasOwnProperty(testName)); + assert.equal(crumbs[testName], testBreadCrumbs); + } + }); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/app-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/app-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/app-test.js new file mode 100644 index 0000000..2fc7276 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/app-test.js @@ -0,0 +1,37 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag', 'Unit | Controller | dag', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); + assert.ok(controller.tabs); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/app/configs-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/app/configs-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/app/configs-test.js new file mode 100644 index 0000000..4661e8c --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/app/configs-test.js @@ -0,0 +1,40 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:app/configs', 'Unit | Controller | app/configs', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); + assert.ok(controller.columns); + assert.ok(controller.configs); + + assert.ok(controller.get("searchText"), "tez"); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/app/dags-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/app/dags-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/app/dags-test.js new file mode 100644 index 0000000..53cf7f2 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/app/dags-test.js @@ -0,0 +1,40 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:app/dags', 'Unit | Controller | app/dags', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + beforeSort: {bind: Ember.K}, + initVisibleColumns: Ember.K, + getCounterColumns: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); + assert.ok(controller.columns); + assert.ok(controller.getCounterColumns); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/app/index-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/app/index-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/app/index-test.js new file mode 100644 index 0000000..676b1d4 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/app/index-test.js @@ -0,0 +1,36 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:app/index', 'Unit | Controller | app/index', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.trackingURL); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/application-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/application-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/application-test.js new file mode 100644 index 0000000..6fe69df --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/application-test.js @@ -0,0 +1,45 @@ +/** + * 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('controller:application', 'Unit | Controller | application', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject(); + + assert.ok(controller.prefixedBreadcrumbs); +}); + +test('prefixedBreadcrumbs test', function(assert) { + let controller = this.subject(), + prefixedBreadcrumbs, + testText = "foo"; + + controller.breadcrumbs = [{ + text: testText + }]; + prefixedBreadcrumbs = controller.get("prefixedBreadcrumbs"); + + assert.equal(prefixedBreadcrumbs.length, 2); + assert.equal(prefixedBreadcrumbs[0].text, "All DAGs"); + assert.equal(prefixedBreadcrumbs[1].text, testText); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/attempt-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/attempt-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/attempt-test.js new file mode 100644 index 0000000..da451f7 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/attempt-test.js @@ -0,0 +1,37 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:attempt', 'Unit | Controller | attempt', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); + assert.ok(controller.tabs); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/attempt/counters-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/attempt/counters-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/attempt/counters-test.js new file mode 100644 index 0000000..8226f36 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/attempt/counters-test.js @@ -0,0 +1,36 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:attempt/counters', 'Unit | Controller | attempt/counters', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/attempt/index-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/attempt/index-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/attempt/index-test.js new file mode 100644 index 0000000..3733692 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/attempt/index-test.js @@ -0,0 +1,35 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:attempt/index', 'Unit | Controller | attempt/index', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/counters-table-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/counters-table-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/counters-table-test.js new file mode 100644 index 0000000..e0e7b02 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/counters-table-test.js @@ -0,0 +1,91 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:counters-table', 'Unit | Controller | counters table', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.columns); + assert.ok(controller.counters); + assert.ok(controller._countersObserver); + +}); + +test('counters & _countersObserver test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K, + model: { + counterGroupsHash: { + "foo": { + "Foo Name 1": "Value 1", + "Foo Name 2": "Value 2", + "Foo Name 3": "Value 3" + }, + "bar": { + "Bar Name 1": "Value 1", + "Bar Name 2": "Value 2", + "Bar Name 3": "Value 3" + } + } + } + }); + + assert.equal(controller.countersCount, 0); + + controller._countersObserver(); + + assert.equal(controller.get("counters.0.groupName"), "foo"); + assert.equal(controller.get("counters.0.counterName"), "Foo Name 1"); + assert.equal(controller.get("counters.0.counterValue"), "Value 1"); + + assert.equal(controller.get("counters.1.groupName"), "foo"); + assert.equal(controller.get("counters.1.counterName"), "Foo Name 2"); + assert.equal(controller.get("counters.1.counterValue"), "Value 2"); + + assert.equal(controller.get("counters.2.groupName"), "foo"); + assert.equal(controller.get("counters.2.counterName"), "Foo Name 3"); + assert.equal(controller.get("counters.2.counterValue"), "Value 3"); + + + assert.equal(controller.get("counters.3.groupName"), "bar"); + assert.equal(controller.get("counters.3.counterName"), "Bar Name 1"); + assert.equal(controller.get("counters.3.counterValue"), "Value 1"); + + assert.equal(controller.get("counters.4.groupName"), "bar"); + assert.equal(controller.get("counters.4.counterName"), "Bar Name 2"); + assert.equal(controller.get("counters.4.counterValue"), "Value 2"); + + assert.equal(controller.get("counters.5.groupName"), "bar"); + assert.equal(controller.get("counters.5.counterName"), "Bar Name 3"); + assert.equal(controller.get("counters.5.counterValue"), "Value 3"); + + assert.equal(controller.countersCount, 6); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/dag-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/dag-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/dag-test.js new file mode 100644 index 0000000..2fc7276 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/dag-test.js @@ -0,0 +1,37 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag', 'Unit | Controller | dag', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); + assert.ok(controller.tabs); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/dag/attempts-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/dag/attempts-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/dag/attempts-test.js new file mode 100644 index 0000000..f1d3d01 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/dag/attempts-test.js @@ -0,0 +1,41 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag/attempts', 'Unit | Controller | dag/attempts', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + beforeSort: {bind: Ember.K}, + initVisibleColumns: Ember.K, + getCounterColumns: function () { + return []; + } + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); + assert.ok(controller.columns); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/dag/counters-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/dag/counters-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/dag/counters-test.js new file mode 100644 index 0000000..7e72b95 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/dag/counters-test.js @@ -0,0 +1,36 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag/counters', 'Unit | Controller | dag/counters', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/dag/graphical-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/dag/graphical-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/dag/graphical-test.js new file mode 100644 index 0000000..6b7ecb6 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/dag/graphical-test.js @@ -0,0 +1,47 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag/graphical', 'Unit | Controller | dag/graphical', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + beforeSort: {bind: Ember.K}, + initVisibleColumns: Ember.K, + getCounterColumns: function () { + return []; + } + }); + + assert.ok(controller); + + assert.ok(controller.columnSelectorTitle); + assert.ok(controller.breadcrumbs); + assert.ok(controller.columns); + + assert.ok(controller.redirect); + assert.ok(controller.actions.entityClicked); + assert.ok(controller.viewData); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/unit/controllers/dag/index-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/dag/index-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/dag/index-test.js new file mode 100644 index 0000000..176b9e7 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/unit/controllers/dag/index-test.js @@ -0,0 +1,35 @@ +/** + * 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 Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag/index', 'Unit | Controller | dag/index', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K, + initVisibleColumns: Ember.K + }); + + assert.ok(controller); +});
