Version: 0.0.01.0.0-alpha.11.0.0-alpha.21.0.0-alpha.41.0.0-alpha.51.0.0-alpha.81.0.0-alpha.91.0.0-alpha.101.0.0-alpha.111.0.0-alpha.121.0.0-alpha.131.0.0-alpha.141.0.0-alpha.151.0.0-alpha.161.0.0-alpha.171.0.0-alpha.181.0.0-alpha.191.0.0-alpha.201.0.0-alpha.211.0.0-alpha.221.0.0-alpha.231.0.0-alpha.241.0.0-alpha.251.0.0-alpha.261.0.0-alpha.271.0.0-alpha.281.0.0-alpha.291.0.0-alpha.301.0.0-alpha.311.0.0-alpha.321.0.0-alpha.331.0.0-alpha.341.0.0-alpha.351.0.0-alpha.361.0.0-alpha.371.0.0-alpha.381.0.0-alpha.391.0.0-alpha.401.0.0-alpha.411.0.0-alpha.421.0.0-alpha.431.0.0-alpha.441.0.0-alpha.451.0.0-alpha.461.0.0-alpha.471.0.0-alpha.481.0.0-alpha.491.0.0-alpha.501.0.0-alpha.511.0.0-alpha.521.0.0-alpha.531.0.0-alpha.541.0.0-alpha.551.0.0-alpha.561.0.0-beta.11.0.0-beta.21.0.0-beta.31.0.0-beta.41.0.0-beta.51.0.0-beta.61.0.0-beta.71.0.0-beta.81.0.0-beta.91.0.0-beta.101.0.0-beta.111.0.0-beta.121.0.0-beta.131.0.0-beta.141.0.0-beta.151.0.0-beta.161.0.0-beta.171.0.0-beta.181.0.0-beta.191.0.01.0.1-alpha.11.0.1-beta.11.0.11.0.2-alpha.11.0.2-beta.11.0.21.0.3-alpha.11.0.3-beta.11.0.31.0.4-alpha.11.0.4-alpha.21.0.4-beta.11.0.4-beta.21.0.41.0.5-alpha.11.0.5-alpha.21.0.5-beta.11.0.51.0.6-alpha.11.0.6-alpha.21.0.6-alpha.31.0.6-beta.11.0.6-beta.21.0.6-beta.31.0.61.0.7-alpha.11.0.7-alpha.21.0.7-beta.11.0.7-beta.21.0.8-alpha.11.0.9-alpha.11.0.9-alpha.31.0.9-alpha.61.0.9-alpha.71.0.9-beta.11.0.9-beta.21.0.9-beta.31.0.91.0.10-alpha.11.0.10-beta.11.0.101.1.0-alpha.11.1.0-beta.11.1.01.1.1-alpha.11.1.1-beta.11.1.11.1.2-alpha.11.1.2-beta.11.1.21.1.3-alpha.11.1.3-alpha.21.1.3-alpha.31.1.3-alpha.41.1.3-alpha.51.1.3-alpha.61.1.3-alpha.71.1.3-alpha.81.1.3-alpha.91.1.3-alpha.101.1.3-alpha.111.1.3-beta.11.1.31.1.4-alpha.11.1.4-beta.11.1.41.1.5-alpha.11.1.5-beta.11.1.51.2.0-alpha.11.2.0-alpha.21.2.0-alpha.31.2.0-alpha.41.2.0-alpha.51.2.0-alpha.61.2.0-alpha.71.2.0-alpha.81.2.0-alpha.91.2.0-alpha.101.2.0-alpha.111.2.0-alpha.121.2.0-alpha.131.2.0-alpha.141.2.0-alpha.151.2.0-alpha.161.2.0-alpha.171.2.0-alpha.181.2.0-alpha.191.2.0-alpha.201.2.0-beta.11.2.0-beta.21.2.01.3.0-alpha.11.3.0-alpha.21.3.0-alpha.31.3.0-alpha.41.3.0-beta.21.3.01.3.1-alpha.11.3.1-alpha.21.3.1-alpha.31.3.1-beta.11.3.11.3.2-alpha.11.3.2-alpha.21.3.2-beta.11.3.21.4.0-alpha.11.4.0-beta.11.4.01.4.1-alpha.11.4.1-alpha.21.4.1-beta.11.4.1
'use strict';
/*
* External Libraries
*/
// var Async = require('async');
// var Request = require('supertest');
//
// var app = require('../src/app');
// var TestUtils = require('./TestUtils');
// var NodeTypes = ['recorders', 'streamers'];
// describe('REST Interface - Nodes', () => {
// before(function (done) {
// this.timeout(0);
// Async.series([
// (callback) => {
// NodeTypes.forEach((nodeType, index, array) => {
// if (index === array.length - 1) {
// TestUtils.DropCollection(nodeType, callback);
// } else {
// TestUtils.DropCollection(nodeType, null);
// }
// });
// },
// if (app.init({
// logLevel : app.LOG_LEVEL.INFO,
// mongoUrl : process.env.CLIO_MONGO_URL,
// serverPort: process.env.CLIO_DATA_API_PORT
// })) {
// app.launch(callback);
// ], done);
// for (let i = 0; i < NodeTypes.length; i++) {
// let nodeId;
// describe('POST /' + NodeTypes[i], () => {
// it('should respond 400 if port not specified', (done) => {
// Request(app).post('/' + NodeTypes[i]).send({
// publicIp: '123.123.123.123'
// }).expect(400, done);
// it('should respond 400 if public IP not specified', (done) => {
// port: 15925
// it('should respond 400 if public IP malformed', (done) => {
// publicIp: '123.123'
// it('should respond 400 if public IP is actually private', (done) => {
// publicIp: '192.168.1.101'
// it('should respond 200 if request data sufficient', (done) => {
// port : 15925,
// }).expect(201, done);
// it('should respond ID if request data sufficient', (done) => {
// publicIp: '123.123.123.124'
// }).expect((res) => {
// nodeId = res.body;
// if (!nodeId) throw new Error('ID Not Responded');
// if (!TestUtils.ObjectIdRegExp.test(nodeId)) throw new Error('Malformed Node ID');
// }).end(done);
// describe('PUT /' + NodeTypes[i] + '/:nodeId', () => {
// it('should respond 400 if malformed node ID', (done) => {
// Request(app).put('/' + NodeTypes[i] + '/1').send({
// streamIds: []
// it('should respond 400 if no stream IDs field', (done) => {
// Request(app).put('/' + NodeTypes[i] + '/' + nodeId).send({
// stupidIds: []
// }).expect(200, done);
// it('should respond 200 if specified several stream IDs', (done) => {
// streamIds: [
// '12345678223456783234567842345678/0',
// '12345678223456783234567842345679/1'
// ]
// after(() => app.shutdown());