http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/models/yarn-node-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/models/yarn-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/models/yarn-node-test.js deleted file mode 100644 index 5877589..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/models/yarn-node-test.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleForModel, test } from 'ember-qunit'; - -moduleForModel('yarn-node', 'Unit | Model | Node', { - // Specify the other units that are required for this test. - needs: [] -}); - -test('Basic creation test', function(assert) { - let model = this.subject(); - - assert.ok(model); - assert.ok(model._notifyProperties); - assert.ok(model.didLoad); - assert.ok(model.totalVmemAllocatedContainersMB); - assert.ok(model.vmemCheckEnabled); - assert.ok(model.pmemCheckEnabled); - assert.ok(model.nodeHealthy); - assert.ok(model.lastNodeUpdateTime); - assert.ok(model.healthReport); - assert.ok(model.nmStartupTime); - assert.ok(model.nodeManagerBuildVersion); - assert.ok(model.hadoopBuildVersion); -}); - -test('test fields', function(assert) { - let model = this.subject(); - - assert.expect(4); - Ember.run(function () { - model.set("totalVmemAllocatedContainersMB", 4096); - model.set("totalPmemAllocatedContainersMB", 2048); - model.set("totalVCoresAllocatedContainers", 4); - model.set("hadoopBuildVersion", "3.0.0-SNAPSHOT"); - assert.equal(model.get("totalVmemAllocatedContainersMB"), 4096); - assert.equal(model.get("totalPmemAllocatedContainersMB"), 2048); - assert.equal(model.get("totalVCoresAllocatedContainers"), 4); - assert.equal(model.get("hadoopBuildVersion"), "3.0.0-SNAPSHOT"); - }); -}); -
http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/models/yarn-rm-node-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/models/yarn-rm-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/models/yarn-rm-node-test.js deleted file mode 100644 index 4fd2517..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/models/yarn-rm-node-test.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleForModel, test } from 'ember-qunit'; - -moduleForModel('yarn-rm-node', 'Unit | Model | RMNode', { - // Specify the other units that are required for this test. - needs: [] -}); - -test('Basic creation test', function(assert) { - let model = this.subject(); - - assert.ok(model); - assert.ok(model._notifyProperties); - assert.ok(model.didLoad); - assert.ok(model.rack); - assert.ok(model.state); - assert.ok(model.nodeHostName); - assert.ok(model.nodeHTTPAddress); - assert.ok(model.lastHealthUpdate); - assert.ok(model.healthReport); - assert.ok(model.numContainers); - assert.ok(model.usedMemoryMB); - assert.ok(model.availMemoryMB); - assert.ok(model.usedVirtualCores); - assert.ok(model.availableVirtualCores); - assert.ok(model.version); - assert.ok(model.nodeLabels); - assert.ok(model.nodeLabelsAsString); - assert.ok(model.nodeStateStyle); - assert.ok(model.isDummyNode); - assert.ok(model.getMemoryDataForDonutChart); - assert.ok(model.getVCoreDataForDonutChart); -}); - -test('test fields', function(assert) { - let model = this.subject(); - - Ember.run(function () { - model.set("rack", "/default-rack"); - model.set("state", "RUNNING"); - model.set("nodeHostName", "localhost"); - model.set("id", "localhost:64318"); - model.set("nodeHTTPAddress", "localhost:8042"); - model.set("usedMemoryMB", 1024); - model.set("availMemoryMB", 7168); - model.set("usedVirtualCores", 1); - model.set("availableVirtualCores", 7); - model.set("nodeLabels", ["x"]); - assert.equal(model.get("rack"), "/default-rack"); - assert.equal(model.get("state"), "RUNNING"); - assert.equal(model.get("nodeHostName"), "localhost"); - assert.equal(model.get("id"), "localhost:64318"); - assert.equal(model.get("nodeHTTPAddress"), "localhost:8042"); - assert.equal(model.get("usedMemoryMB"), 1024); - assert.equal(model.get("availMemoryMB"), 7168); - assert.equal(model.get("usedVirtualCores"), 1); - assert.equal(model.get("availableVirtualCores"), 7); - assert.equal(model.get("isDummyNode"), false); - assert.deepEqual(model.get("nodeLabels"), ["x"]); - assert.equal(model.get("nodeLabelsAsString"), "x"); - assert.deepEqual(model.get("nodeStateStyle"), "label label-success"); - assert.deepEqual(model.get("getMemoryDataForDonutChart"), - [{label: "Used", value: 1024}, {label: "Available", value: 7168}]); - assert.deepEqual(model.get("getVCoreDataForDonutChart"), - [{label: "Used", value: 1}, {label: "Available", value: 7}]); - model.set("state", "SHUTDOWN"); - assert.deepEqual(model.get("nodeStateStyle"), "label label-danger"); - model.set("state", "REBOOTED"); - assert.deepEqual(model.get("nodeStateStyle"), "label label-warning"); - model.set("state", "NEW"); - assert.deepEqual(model.get("nodeStateStyle"), "label label-default"); - model.set("nodeLabels", ["x","y"]); - assert.equal(model.get("nodeLabelsAsString"), "x"); - model.set("nodeLabels", undefined); - assert.equal(model.get("nodeLabelsAsString"), ""); - }); -}); - http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-apps-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-apps-test.js deleted file mode 100644 index a438b2e..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-apps-test.js +++ /dev/null @@ -1,11 +0,0 @@ -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('route:yarn-apps', 'Unit | Route | yarn apps', { - // Specify the other units that are required for this test. - // needs: ['controller:foo'] -}); - -test('it exists', function(assert) { - var route = this.subject(); - assert.ok(route); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-container-log-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-container-log-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-container-log-test.js deleted file mode 100644 index 4e68da0..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-container-log-test.js +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; -import Constants from 'yarn-ui/constants'; - -moduleFor('route:yarn-container-log', 'Unit | Route | ContainerLog', { -}); - -test('Basic creation test', function(assert) { - let route = this.subject(); - assert.ok(route); - assert.ok(route.model); -}); - -test('Test getting container log', function(assert) { - var response = { - logs: "This is syslog", - containerID: "container_e32_1456000363780_0002_01_000001", - logFileName: "syslog"}; - var store = { - findRecord: function(type) { - return new Ember.RSVP.Promise(function(resolve) { - resolve(response); - } - )} - }; - assert.expect(6); - var route = this.subject(); - route.set('store', store); - var model = route.model({node_id: "localhost:64318", - node_addr: "localhost:8042", - container_id: "container_e32_1456000363780_0002_01_000001", - filename: "syslog"}); - model.then(function(value) { - assert.ok(value); - assert.ok(value.containerLog); - assert.deepEqual(value.containerLog, response); - assert.ok(value.nodeInfo); - assert.equal(value.nodeInfo.addr, 'localhost:8042'); - assert.equal(value.nodeInfo.id, 'localhost:64318'); - }); -}); - -/** - * This can happen when an empty response is sent from server - */ -test('Test non HTTP error while getting container log', function(assert) { - var error = {}; - var response = { - logs: "", - containerID: "container_e32_1456000363780_0002_01_000001", - logFileName: "syslog"}; - var store = { - findRecord: function(type) { - return new Ember.RSVP.Promise(function(resolve, reject) { - reject(error); - } - )} - }; - assert.expect(6); - var route = this.subject(); - route.set('store', store); - var model = route.model({node_id: "localhost:64318", - node_addr: "localhost:8042", - container_id: "container_e32_1456000363780_0002_01_000001", - filename: "syslog"}); - model.then(function(value) { - assert.ok(value); - assert.ok(value.containerLog); - assert.deepEqual(value.containerLog, response); - assert.ok(value.nodeInfo); - assert.equal(value.nodeInfo.addr, 'localhost:8042'); - assert.equal(value.nodeInfo.id, 'localhost:64318'); - }); -}); - -test('Test HTTP error while getting container log', function(assert) { - var error = {errors: [{status: 404, responseText: 'Not Found'}]}; - var response = { - logs: "", - containerID: "container_e32_1456000363780_0002_01_000001", - logFileName: "syslog"}; - var store = { - findRecord: function(type) { - return new Ember.RSVP.Promise(function(resolve, reject) { - reject(error); - } - )} - }; - assert.expect(5); - var route = this.subject(); - route.set('store', store); - var model = route.model({node_id: "localhost:64318", - node_addr: "localhost:8042", - container_id: "container_e32_1456000363780_0002_01_000001", - filename: "syslog"}); - model.then(function(value) { - assert.ok(value); - assert.ok(value.errors); - assert.equal(value.errors.length, 1); - assert.equal(value.errors[0].status, 404); - assert.equal(value.errors[0].responseText, 'Not Found'); - }); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-app-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-app-test.js deleted file mode 100644 index 8e5acf9..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-app-test.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('route:yarn-node-app', 'Unit | Route | NodeApp', { -}); - -test('Basic creation test', function(assert) { - let route = this.subject(); - assert.ok(route); - assert.ok(route.model); -}); - -test('Test getting specific app on a node', function(assert) { - var response = - {id:"application_1456251210105_0001", state:"FINISHED", user:"root"}; - var store = { - queryRecord: function(type, query) { - return new Ember.RSVP.Promise(function(resolve) { - resolve(response); - }); - } - }; - assert.expect(6); - var route = this.subject(); - route.set('store', store); - var model = - route.model({node_id:"localhost:64318", node_addr:"localhost:8042", - app_id:"application_1456251210105_0001"}). - then( - function(value){ - assert.ok(value); - assert.ok(value.nodeApp); - assert.deepEqual(value.nodeApp, response); - assert.ok(value.nodeInfo); - assert.equal(value.nodeInfo.addr, 'localhost:8042'); - assert.equal(value.nodeInfo.id, 'localhost:64318'); - } - ); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-apps-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-apps-test.js deleted file mode 100644 index 44d9995..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-apps-test.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('route:yarn-node-apps', 'Unit | Route | NodeApps', { -}); - -test('Basic creation test', function(assert) { - let route = this.subject(); - assert.ok(route); - assert.ok(route.model); -}); - -test('Test getting apps on a node', function(assert) { - var response = [ - {id:"application_1456251210105_0001", state:"FINISHED", user:"root"}, - {id:"application_1456251210105_0002", state:"RUNNING",user:"root", - containerids:["container_e38_1456251210105_0002_01_000001", - "container_e38_1456251210105_0002_01_000002"]}]; - var store = { - query: function(type, query) { - return new Ember.RSVP.Promise(function(resolve) { - resolve(response.slice()); - }); - } - }; - assert.expect(8); - var route = this.subject(); - route.set('store', store); - var model = - route.model({node_id:"localhost:64318", node_addr:"localhost:8042"}). - then( - function(value){ - assert.ok(value); - assert.ok(value.apps); - assert.equal(value.apps.length, 2); - assert.deepEqual(response[0], value.apps[0]); - assert.deepEqual(response[1], value.apps[1]); - assert.ok(value.nodeInfo); - assert.equal(value.nodeInfo.addr, 'localhost:8042'); - assert.equal(value.nodeInfo.id, 'localhost:64318'); - } - ); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-container-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-container-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-container-test.js deleted file mode 100644 index f0b68fc..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-container-test.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('route:yarn-node-container', 'Unit | Route | NodeContainer', { -}); - -test('Basic creation test', function(assert) { - let route = this.subject(); - assert.ok(route); - assert.ok(route.model); -}); - -test('Test getting specific container on a node', function(assert) { - var response = - {id: "container_e32_1456000363780_0002_01_000001", state: "RUNNING", - exitCode:-1000,diagnostics:"",user:"root",totalMemoryNeededMB:2048, - totalVCoresNeeded:1,containerLogsLink: "http://localhost:8042/node/" + - "containerlogs/container_e32_1456000363780_0002_01_000001/root", - nodeId: "localhost:64318", containerLogFiles:["syslog","stderr", - "stdout"]}; - var store = { - queryRecord: function(type, query) { - return new Ember.RSVP.Promise(function(resolve) { - resolve(response); - }); - } - }; - assert.expect(6); - var route = this.subject(); - route.set('store', store); - var model = - route.model({node_id:"localhost:64318", node_addr:"localhost:8042", - container_id:"container_e32_1456000363780_0002_01_000001"}). - then( - function(value){ - assert.ok(value); - assert.ok(value.nodeContainer); - assert.deepEqual(value.nodeContainer, response); - assert.ok(value.nodeInfo); - assert.equal(value.nodeInfo.addr, 'localhost:8042'); - assert.equal(value.nodeInfo.id, 'localhost:64318'); - } - ); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-containers-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-containers-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-containers-test.js deleted file mode 100644 index 8359713..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-containers-test.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('route:yarn-node-containers', 'Unit | Route | NodeContainers', { -}); - -test('Basic creation test', function(assert) { - let route = this.subject(); - assert.ok(route); - assert.ok(route.model); -}); - -test('Test getting apps on a node', function(assert) { - var response = - [{id: "container_e32_1456000363780_0002_01_000001", state: "RUNNING", - exitCode:-1000,diagnostics:"",user:"root",totalMemoryNeededMB:2048, - totalVCoresNeeded:1,containerLogsLink: "http://localhost:8042/node/" + - "containerlogs/container_e32_1456000363780_0002_01_000001/root", - nodeId: "localhost:64318", containerLogFiles:["syslog","stderr", - "stdout"]}, - {id:"container_e32_1456000363780_0002_01_000003", state:"RUNNING", - exitCode:-1000, diagnostics:"", user:"root", totalMemoryNeededMB:1024, - totalVCoresNeeded:1,containerLogsLink:"http://localhost:8042/node" + - "/containerlogs/container_e32_1456000363780_0002_01_000003/root", - nodeId:"localhost:64318",containerLogFiles:["syslog","stderr", - "syslog.shuffle","stdout"]}]; - var store = { - query: function(type, query) { - return new Ember.RSVP.Promise(function(resolve) { - resolve(response.slice()); - }); - } - }; - assert.expect(8); - var route = this.subject(); - route.set('store', store); - var model = - route.model({node_id:"localhost:64318", node_addr:"localhost:8042"}). - then( - function(value){ - assert.ok(value); - assert.ok(value.containers); - assert.equal(value.containers.length, 2); - assert.deepEqual(value.containers[0], response[0]); - assert.deepEqual(value.containers[1], response[1]); - assert.ok(value.nodeInfo); - assert.equal(value.nodeInfo.addr, 'localhost:8042'); - assert.equal(value.nodeInfo.id, 'localhost:64318'); - } - ); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-test.js deleted file mode 100644 index 4e82f1b..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-node-test.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; -import Ember from 'ember'; - -moduleFor('route:yarn-node', 'Unit | Route | Node', { -}); - -test('Basic creation test', function(assert) { - let route = this.subject(); - assert.ok(route); - assert.ok(route.model); -}); - -test('Test getting a node', function(assert) { - var nodeResponse = - {healthReport: "Healthy", totalVmemAllocatedContainersMB: 344064, - totalPmemAllocatedContainersMB: 163840, - totalVCoresAllocatedContainers: 160, - vmemCheckEnabled: true, pmemCheckEnabled: true, - lastNodeUpdateTime: 1456250210310, nodeHealthy: true, - nodeManagerVersion: "3.0.0-SNAPSHOT", - nodeManagerBuildVersion: "3.0.0-SNAPSHOT", - nodeManagerVersionBuiltOn: "2000-01-01T00:00Z", - hadoopVersion: "3.0.0-SNAPSHOT", - hadoopBuildVersion: "3.0.0-SNAPSHOT", - hadoopVersionBuiltOn: "2000-01-01T00:00Z", - id: "localhost:64318", nodeHostName: "192.168.0.102", - nmStartupTime: 1456250208231}; - var rmNodeResponse = - {rack: "/default-rack", state: "RUNNING", id: "localhost:64318", - nodeHostName: "localhost", nodeHTTPAddress: "localhost:8042", - lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", - healthReport: "", numContainers: 0, usedMemoryMB: 0, - availMemoryMB: 163840, usedVirtualCores: 0, - availableVirtualCores: 160, - resourceUtilization: { - nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, - nodeCPUUsage: 0.14995001256465912, - aggregatedContainersPhysicalMemoryMB: 0, - aggregatedContainersVirtualMemoryMB: 0, - containersCPUUsage: 0 - }}; - - // Create store which returns appropriate responses. - var store = { - findRecord: function(type) { - if (type == 'yarnNode') { - return new Ember.RSVP.Promise(function(resolve) { - resolve(nodeResponse); - }); - } else if (type == 'yarnRmNode') { - return new Ember.RSVP.Promise(function(resolve) { - resolve(rmNodeResponse); - }); - } - } - }; - var route = this.subject(); - assert.expect(4); - route.set('store', store); - var model = route.model( - {node_addr:"localhost:8042", node_id:"localhost:64318"})._result; - assert.ok(model.node); - assert.deepEqual(model.node, nodeResponse); - assert.ok(model.rmNode); - assert.deepEqual(model.rmNode, rmNodeResponse); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-nodes-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-nodes-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-nodes-test.js deleted file mode 100644 index baa5bd6..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/routes/yarn-nodes-test.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; -import Ember from 'ember'; - -moduleFor('route:yarn-nodes', 'Unit | Route | Nodes', { -}); - -test('Basic creation test', function(assert) { - let route = this.subject(); - assert.ok(route); - assert.ok(route.model); -}); - -test('Test getting nodes', function(assert) { - var response = [{ - rack: "/default-rack", state: "RUNNING", id: "192.168.1.1:64318", - nodeHostName: "192.168.1.1", nodeHTTPAddress: "192.168.1.1:8042", - lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", - healthReport: "", numContainers: 0, usedMemoryMB: 0, - availMemoryMB: 163840, usedVirtualCores: 0, - availableVirtualCores: 160, - resourceUtilization: { - nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, - nodeCPUUsage: 0.14995001256465912, - aggregatedContainersPhysicalMemoryMB: 0, - aggregatedContainersVirtualMemoryMB: 0, - containersCPUUsage: 0 - }}, - {rack: "/default-rack", state: "RUNNING", id: "192.168.1.2:64318", - nodeHostName: "192.168.1.2", nodeHTTPAddress: "192.168.1.2:8042", - lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", - healthReport: "", numContainers: 0, usedMemoryMB: 0, - availMemoryMB: 163840, usedVirtualCores: 0, - availableVirtualCores: 160, - resourceUtilization: { - nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, - nodeCPUUsage: 0.14995001256465912, - aggregatedContainersPhysicalMemoryMB: 0, - aggregatedContainersVirtualMemoryMB: 0, - containersCPUUsage: 0 - }}]; - var store = { - findAll: function(type) { - return new Ember.RSVP.Promise(function(resolve) { - resolve(response); - }); - } - }; - var route = this.subject(); - route.set('store', store); - var model = route.model()._result; - assert.expect(4); - assert.ok(model); - assert.equal(model.length, 2); - assert.deepEqual(response[0], model[0]); - assert.deepEqual(response[1], model[1]); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-app-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-app-test.js deleted file mode 100644 index a169fd5..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-app-test.js +++ /dev/null @@ -1,15 +0,0 @@ -import { moduleForModel, test } from 'ember-qunit'; - -moduleForModel('yarn-app', 'Unit | Serializer | yarn app', { - // Specify the other units that are required for this test. - needs: ['serializer:yarn-app'] -}); - -// Replace this with your real tests. -test('it serializes records', function(assert) { - var record = this.subject(); - - var serializedRecord = record.serialize(); - - assert.ok(serializedRecord); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-container-log-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-container-log-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-container-log-test.js deleted file mode 100644 index 2349dc2..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-container-log-test.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('serializer:yarn-container-log', 'Unit | Serializer | ContainerLog', { -}); - -test('Basic creation test', function(assert) { - let serializer = this.subject(); - - assert.ok(serializer); - assert.ok(serializer.normalizeSingleResponse); -}); - -test('normalizeSingleResponse test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-container-log" - }, - payload = "This is syslog"; - var id = "localhost:64318!container_e32_1456000363780_0002_01_000001!syslog"; - assert.expect(6); - var response = - serializer.normalizeSingleResponse({}, modelClass, payload, id, null); - assert.ok(response.data); - assert.equal(response.data.id, id); - assert.equal(response.data.type, modelClass.modelName); - assert.equal(response.data.attributes.logs, payload); - assert.equal(response.data.attributes.containerID, - "container_e32_1456000363780_0002_01_000001"); - assert.equal(response.data.attributes.logFileName, "syslog"); -}); - http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-app-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-app-test.js deleted file mode 100644 index 21a715c..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-app-test.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('serializer:yarn-node-app', 'Unit | Serializer | NodeApp', { -}); - -test('Basic creation test', function(assert) { - let serializer = this.subject(); - - assert.ok(serializer); - assert.ok(serializer.normalizeSingleResponse); - assert.ok(serializer.normalizeArrayResponse); - assert.ok(serializer.internalNormalizeSingleResponse); -}); - -test('normalizeArrayResponse test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-node-app" - }, - payload = { - apps: { - app: [{ - id:"application_1456251210105_0001", state:"FINISHED", user:"root" - },{ - id:"application_1456251210105_0002", state:"RUNNING",user:"root", - containerids:["container_e38_1456251210105_0002_01_000001", - "container_e38_1456251210105_0002_01_000002"] - }] - } - }; - assert.expect(15); - var response = - serializer.normalizeArrayResponse({}, modelClass, payload, null, null); - assert.ok(response.data); - assert.equal(response.data.length, 2); - assert.equal(response.data[0].attributes.containers, undefined); - assert.equal(response.data[1].attributes.containers.length, 2); - assert.deepEqual(response.data[1].attributes.containers, - payload.apps.app[1].containerids); - for (var i = 0; i < 2; i++) { - assert.equal(response.data[i].type, modelClass.modelName); - assert.equal(response.data[i].id, payload.apps.app[i].id); - assert.equal(response.data[i].attributes.appId, payload.apps.app[i].id); - assert.equal(response.data[i].attributes.state, payload.apps.app[i].state); - assert.equal(response.data[i].attributes.user, payload.apps.app[i].user); - } -}); - -test('normalizeArrayResponse no apps test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-node-app" - }, - payload = { apps: null }; - assert.expect(5); - var response = - serializer.normalizeArrayResponse({}, modelClass, payload, null, null); - assert.ok(response.data); - assert.equal(response.data.length, 1); - assert.equal(response.data[0].type, modelClass.modelName); - assert.equal(response.data[0].id, "dummy"); - assert.equal(response.data[0].attributes.appId, undefined); -}); - -test('normalizeSingleResponse test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-node-app" - }, - payload = { - app: {id:"application_1456251210105_0001", state:"FINISHED", user:"root"} - }; - assert.expect(7); - var response = - serializer.normalizeSingleResponse({}, modelClass, payload, null, null); - assert.ok(response.data); - assert.equal(payload.app.id, response.data.id); - assert.equal(modelClass.modelName, response.data.type); - assert.equal(payload.app.id, response.data.attributes.appId); - assert.equal(payload.app.state, response.data.attributes.state); - assert.equal(payload.app.user, response.data.attributes.user); - assert.equal(response.data.attributes.containers, undefined); -}); - http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-container-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-container-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-container-test.js deleted file mode 100644 index 1f08467..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-container-test.js +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('serializer:yarn-node-container', 'Unit | Serializer | NodeContainer', { -}); - -test('Basic creation test', function(assert) { - let serializer = this.subject(); - - assert.ok(serializer); - assert.ok(serializer.normalizeSingleResponse); - assert.ok(serializer.normalizeArrayResponse); - assert.ok(serializer.internalNormalizeSingleResponse); -}); - -test('normalizeArrayResponse test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-node-container" - }, - payload = { - containers: { - container: [{ - id: "container_e32_1456000363780_0002_01_000001", state: "RUNNING", - exitCode:-1000,diagnostics:"",user:"root",totalMemoryNeededMB:2048, - totalVCoresNeeded:1,containerLogsLink: "http://localhost:8042/node/" + - "containerlogs/container_e32_1456000363780_0002_01_000001/root", - nodeId: "localhost:64318", containerLogFiles:["syslog","stderr", - "stdout"] - },{ - id:"container_e32_1456000363780_0002_01_000003", state:"RUNNING", - exitCode:-1000, diagnostics:"", user:"root", totalMemoryNeededMB:1024, - totalVCoresNeeded:1,containerLogsLink:"http://localhost:8042/node" + - "/containerlogs/container_e32_1456000363780_0002_01_000003/root", - nodeId:"localhost:64318",containerLogFiles:["syslog","stderr", - "syslog.shuffle","stdout"] - }] - } - }; - assert.expect(14); - var response = - serializer.normalizeArrayResponse({}, modelClass, payload, null, null); - assert.ok(response.data); - assert.equal(response.data.length, 2); - assert.equal(response.data[0].id, - "container_e32_1456000363780_0002_01_000001"); - assert.equal(response.data[1].id, - "container_e32_1456000363780_0002_01_000003"); - assert.equal(response.data[0].attributes.containerLogFiles.length, 3); - assert.equal(response.data[1].attributes.containerLogFiles.length, 4); - for (var i = 0; i < 2; i++) { - assert.equal(response.data[i].type, modelClass.modelName); - assert.deepEqual(response.data[i].attributes.containerLogFiles, - payload.containers.container[i].containerLogFiles); - assert.equal(response.data[i].attributes.state, - payload.containers.container[i].state); - assert.equal(response.data[i].attributes.user, - payload.containers.container[i].user); - } -}); - -test('normalizeArrayResponse no containers test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-node-container" - }, - payload = { containers: null }; - assert.expect(5); - var response = - serializer.normalizeArrayResponse({}, modelClass, payload, null, null); - assert.ok(response.data); - assert.equal(response.data.length, 1); - assert.equal(response.data[0].type, modelClass.modelName); - assert.equal(response.data[0].id, "dummy"); - assert.equal(response.data[0].attributes.containerId, undefined); -}); - -test('normalizeSingleResponse test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-node-container" - }, - payload = { - container: { - id: "container_e32_1456000363780_0002_01_000001", state: "RUNNING", - exitCode:-1000,diagnostics:"",user:"root",totalMemoryNeededMB:2048, - totalVCoresNeeded:1,containerLogsLink: "http://localhost:8042/node/" + - "containerlogs/container_e32_1456000363780_0002_01_000001/root", - nodeId: "localhost:64318", containerLogFiles:["syslog","stderr", - "stdout"] - } - }; - assert.expect(11); - var response = - serializer.normalizeSingleResponse({}, modelClass, payload, null, null); - assert.ok(response.data); - assert.equal(response.data.id, payload.container.id); - assert.equal(response.data.type, modelClass.modelName); - assert.equal(response.data.attributes.containerId, payload.container.id); - assert.equal(response.data.attributes.state, payload.container.state); - assert.equal(response.data.attributes.user, payload.container.user); - assert.equal(response.data.attributes.exitCode, payload.container.exitCode); - assert.equal(response.data.attributes.totalMemoryNeededMB, - payload.container.totalMemoryNeeded); - assert.equal(response.data.attributes.totalVCoresNeeded, - payload.container.totalVCoresNeeded); - assert.equal(response.data.attributes.containerLogFiles.length, 3); - assert.deepEqual(response.data.attributes.containerLogFiles, - payload.container.containerLogFiles); -}); - http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-test.js deleted file mode 100644 index 0e76ccb..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-node-test.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; -import Converter from 'yarn-ui/utils/converter'; - -moduleFor('serializer:yarn-node', 'Unit | Serializer | Node', { -}); - -test('Basic creation test', function(assert) { - let serializer = this.subject(); - - assert.ok(serializer); - assert.ok(serializer.normalizeSingleResponse); - assert.ok(serializer.internalNormalizeSingleResponse); -}); - -test('normalizeSingleResponse test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-node" - }, - payload = { - nodeInfo: { - healthReport: "Healthy", totalVmemAllocatedContainersMB: 344064, - totalPmemAllocatedContainersMB: 163840, - totalVCoresAllocatedContainers: 160, - vmemCheckEnabled: true, pmemCheckEnabled: true, - lastNodeUpdateTime: 1456250210310, nodeHealthy: true, - nodeManagerVersion: "3.0.0-SNAPSHOT", - nodeManagerBuildVersion: "3.0.0-SNAPSHOT", - nodeManagerVersionBuiltOn: "2000-01-01T00:00Z", - hadoopVersion: "3.0.0-SNAPSHOT", - hadoopBuildVersion: "3.0.0-SNAPSHOT", - hadoopVersionBuiltOn: "2000-01-01T00:00Z", - id: "localhost:64318", nodeHostName: "192.168.0.102", - nmStartupTime: 1456250208231 - } - }; - assert.expect(6); - var id = "localhost:64318"; - var response = serializer.normalizeSingleResponse({}, modelClass, payload, id, null); - assert.equal(response.data.id, id); - assert.equal(response.data.type, modelClass.modelName); - assert.equal(response.data.attributes.totalVmemAllocatedContainersMB, - payload.nodeInfo.totalVmemAllocatedContainersMB); - assert.equal(response.data.attributes.totalPmemAllocatedContainersMB, - payload.nodeInfo.totalPmemAllocatedContainersMB); - assert.equal(response.data.attributes.totalVCoresAllocatedContainers, - payload.nodeInfo.totalVCoresAllocatedContainers); - assert.equal(response.data.attributes.nmStartupTime, - Converter.timeStampToDate(payload.nodeInfo.nmStartupTime)); -}); - http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-rm-node-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-rm-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-rm-node-test.js deleted file mode 100644 index bc6397d..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/serializers/yarn-rm-node-test.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('serializer:yarn-rm-node', 'Unit | Serializer | RMNode', { -}); - -test('Basic creation test', function(assert) { - let serializer = this.subject(); - - assert.ok(serializer); - assert.ok(serializer.normalizeSingleResponse); - assert.ok(serializer.normalizeArrayResponse); - assert.ok(serializer.internalNormalizeSingleResponse); -}); - -test('normalizeArrayResponse test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-rm-node" - }, - payload = { - nodes: { - node: [{ - rack: "/default-rack", state: "RUNNING", id: "192.168.1.1:64318", - nodeHostName: "192.168.1.1", nodeHTTPAddress: "192.168.1.1:8042", - lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", - healthReport: "", numContainers: 0, usedMemoryMB: 2048, - availMemoryMB: 161792, usedVirtualCores: 2, - availableVirtualCores: 158, nodeLabels: ["x"], - resourceUtilization: { - nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, - nodeCPUUsage: 0.14995001256465912, - aggregatedContainersPhysicalMemoryMB: 0, - aggregatedContainersVirtualMemoryMB: 0, - containersCPUUsage: 0 - } - },{ - rack: "/default-rack", state: "RUNNING", id: "192.168.1.2:64318", - nodeHostName: "192.168.1.2", nodeHTTPAddress: "192.168.1.2:8042", - lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", - healthReport: "", numContainers: 0, usedMemoryMB: 0, - availMemoryMB: 163840, usedVirtualCores: 0, - availableVirtualCores: 160, nodeLabels: ["y"], - resourceUtilization: { - nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, - nodeCPUUsage: 0.14995001256465912, - aggregatedContainersPhysicalMemoryMB: 0, - aggregatedContainersVirtualMemoryMB: 0, - containersCPUUsage: 0 - } - }] - } - }; - assert.expect(12); - var response = - serializer.normalizeArrayResponse({}, modelClass, payload, null, null); - assert.ok(response.data); - assert.equal(response.data.length, 2); - assert.equal(response.data[0].id, "192.168.1.1:64318"); - assert.equal(response.data[1].id, "192.168.1.2:64318"); - for (var i = 0; i < 2; i++) { - assert.equal(response.data[i].type, modelClass.modelName); - assert.equal(response.data[i].attributes.nodeHostName, - payload.nodes.node[i].nodeHostName); - assert.equal(response.data[i].attributes.nodeHTTPAddress, - payload.nodes.node[i].nodeHTTPAddress); - assert.deepEqual(response.data[i].attributes.nodeLabels, - payload.nodes.node[i].nodeLabels); - } -}); - -test('normalizeArrayResponse no nodes test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-rm-node" - }, - payload = { nodes: null }; - assert.expect(5); - var response = - serializer.normalizeArrayResponse({}, modelClass, payload, null, null); - console.log(response); - assert.ok(response.data); - assert.equal(response.data.length, 1); - assert.equal(response.data[0].type, modelClass.modelName); - assert.equal(response.data[0].id, "dummy"); - assert.equal(response.data[0].attributes.nodeHostName, undefined); -}); - -test('normalizeSingleResponse test', function(assert) { - let serializer = this.subject(), - modelClass = { - modelName: "yarn-rm-node" - }, - payload = { - node: { - rack: "/default-rack", state: "RUNNING", id: "192.168.1.1:64318", - nodeHostName: "192.168.1.1", nodeHTTPAddress: "192.168.1.1:8042", - lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", - healthReport: "", numContainers: 0, usedMemoryMB: 2048, - availMemoryMB: 161792, usedVirtualCores: 2, - availableVirtualCores: 158, nodeLabels: ["x"], - resourceUtilization: { - nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, - nodeCPUUsage: 0.14995001256465912, - aggregatedContainersPhysicalMemoryMB: 0, - aggregatedContainersVirtualMemoryMB: 0, - containersCPUUsage: 0 - } - } - }; - assert.expect(13); - var id = "localhost:64318"; - var response = - serializer.normalizeSingleResponse({}, modelClass, payload, id, null); - assert.ok(response.data); - assert.equal(response.data.id, id); - assert.equal(response.data.type, modelClass.modelName); - assert.equal(response.data.attributes.rack, payload.node.rack); - assert.equal(response.data.attributes.state, payload.node.state); - assert.equal(response.data.attributes.nodeHostName, - payload.node.nodeHostName); - assert.equal(response.data.attributes.nodeHTTPAddress, - payload.node.nodeHTTPAddress); - assert.equal(response.data.attributes.version, payload.node.version); - assert.equal(response.data.attributes.availMemoryMB, - payload.node.availMemoryMB); - assert.equal(response.data.attributes.usedMemoryMB, - payload.node.usedMemoryMB); - assert.equal(response.data.attributes.availableVirtualCores, - payload.node.availableVirtualCores); - assert.equal(response.data.attributes.usedVirtualCores, - payload.node.usedVirtualCores); - assert.deepEqual(response.data.attributes.nodeLabels, - payload.node.nodeLabels); -}); - http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/utils/converter-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/utils/converter-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/utils/converter-test.js deleted file mode 100644 index 481537d..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/utils/converter-test.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import converter from '../../../utils/converter'; -import { module, test } from 'qunit'; - -module('Unit | Utility | Converter'); - -// Replace this with your real tests. -test('it works', function(assert) { - assert.ok(converter); - assert.ok(converter.splitForContainerLogs); -}); - -test('split for container logs', function(assert) { - var id = "localhost:64318!container_e32_1456000363780_0002_01_000001!" + - "syslog"; - var arr = converter.splitForContainerLogs(id); - assert.ok(arr); - assert.deepEqual(arr, ["localhost:64318", - "container_e32_1456000363780_0002_01_000001", "syslog"]); - id = "localhost:64318!container_e32_1456000363780_0002_01_000001!" + - "syslog!logs"; - arr = converter.splitForContainerLogs(id); - assert.ok(arr); - assert.deepEqual(arr, ["localhost:64318", - "container_e32_1456000363780_0002_01_000001", "syslog!logs"]); - id = "localhost:64318!container_e32_1456000363780_0002_01_000001"; - arr = converter.splitForContainerLogs(id); - assert.notOk(arr); - id = null; - arr = converter.splitForContainerLogs(id); - assert.notOk(arr); - id = undefined; - arr = converter.splitForContainerLogs(id); - assert.notOk(arr); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/utils/sorter-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/utils/sorter-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/utils/sorter-test.js deleted file mode 100644 index 8f17380..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/tests/unit/utils/sorter-test.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Sorter from 'yarn-ui/utils/sorter'; -import { module, test } from 'qunit'; - -module('Unit | Utility | Sorter'); - -test('Basic creation test', function(assert) { - assert.ok(Sorter); -}); http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/vendor/.gitkeep ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/vendor/.gitkeep b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/vendor/.gitkeep deleted file mode 100644 index e69de29..0000000 http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ea644f4/hadoop-yarn-project/hadoop-yarn/pom.xml ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/pom.xml b/hadoop-yarn-project/hadoop-yarn/pom.xml index 3353e33..8c1e042 100644 --- a/hadoop-yarn-project/hadoop-yarn/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/pom.xml @@ -230,6 +230,7 @@ </profiles> <modules> + <module>hadoop-yarn-ui</module> <module>hadoop-yarn-api</module> <module>hadoop-yarn-common</module> <module>hadoop-yarn-server</module> --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org