summaryrefslogtreecommitdiff
path: root/jarmon/jarmon.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'jarmon/jarmon.test.js')
-rw-r--r--jarmon/jarmon.test.js128
1 files changed, 64 insertions, 64 deletions
diff --git a/jarmon/jarmon.test.js b/jarmon/jarmon.test.js
index 5a56d5a..0bccf9c 100644
--- a/jarmon/jarmon.test.js
+++ b/jarmon/jarmon.test.js
@@ -8,11 +8,11 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
Y.Test.Runner.add(new Y.Test.Case({
name: "jarmon.downloadBinary",
+ /**
+ * When url cannot be found, the deferred should errback with status
+ * 404.
+ **/
test_urlNotFound: function () {
- /**
- * When url cannot be found, the deferred should errback with status
- * 404.
- **/
var self = this;
var d = new jarmon.downloadBinary('non-existent-file.html');
d.always(
@@ -26,11 +26,11 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
this.wait();
},
+ /**
+ * When url is found, the deferred should callback with an instance
+ * of javascriptrrd.BinaryFile
+ **/
test_urlFound: function () {
- /**
- * When url is found, the deferred should callback with an instance
- * of javascriptrrd.BinaryFile
- **/
var self = this;
var d = new jarmon.downloadBinary('testfile.bin');
d.always(
@@ -69,11 +69,11 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
});
},
+ /**
+ * The generated rrd file should have a lastupdate date of
+ * 1980-01-01 00:50:01
+ **/
test_getLastUpdate: function () {
- /**
- * The generated rrd file should have a lastupdate date of
- * 1980-01-01 00:50:01
- **/
var self = this;
this.d.done(
function(rrd) {
@@ -85,12 +85,12 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
this.wait();
},
+ /**
+ * The generated rrd file should have a single DS whose name is
+ * 'speed'. A RangeError is thrown if the requested index or dsName
+ * doesnt exist.
+ **/
test_getDSIndex: function () {
- /**
- * The generated rrd file should have a single DS whose name is
- * 'speed'. A RangeError is thrown if the requested index or dsName
- * doesnt exist.
- **/
var self = this;
this.d.done(
function(rrd) {
@@ -110,10 +110,10 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
this.wait();
},
+ /**
+ * The generated rrd file should have a single RRA
+ **/
test_getNrRRAs: function () {
- /**
- * The generated rrd file should have a single RRA
- **/
var self = this;
this.d.done(
function(rrd) {
@@ -124,13 +124,13 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
this.wait();
},
+ /**
+ * The generated rrd file should have a single RRA using AVERAGE
+ * consolidation, step=10, rows=6 and values 0-5
+ * rra.getEl throws a RangeError if asked for row which doesn't
+ * exist.
+ **/
test_getRRA: function () {
- /**
- * The generated rrd file should have a single RRA using AVERAGE
- * consolidation, step=10, rows=6 and values 0-5
- * rra.getEl throws a RangeError if asked for row which doesn't
- * exist.
- **/
var self = this;
this.d.done(
function(rrd) {
@@ -168,10 +168,10 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
});
},
+ /**
+ * The starttime must be less than the endtime
+ **/
test_getDataTimeRangeOverlapError: function () {
- /**
- * The starttime must be less than the endtime
- **/
var self = this;
this.d.done(
function(rrd) {
@@ -191,11 +191,11 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
},
+ /**
+ * Error is raised if the rrd file doesn't contain an RRA with the
+ * requested consolidation function (CF)
+ **/
test_getDataUnknownCfError: function () {
- /**
- * Error is raised if the rrd file doesn't contain an RRA with the
- * requested consolidation function (CF)
- **/
var self = this;
this.d.done(
function(rrd) {
@@ -214,13 +214,13 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
},
+ /**
+ * The generated rrd file should have values 0-9 at 300s intervals
+ * starting at 1980-01-01 00:00:00
+ * Result should include a data points with times > starttime and
+ * <= endTime
+ **/
test_getData: function () {
- /**
- * The generated rrd file should have values 0-9 at 300s intervals
- * starting at 1980-01-01 00:00:00
- * Result should include a data points with times > starttime and
- * <= endTime
- **/
var self = this;
this.d.done(
function(rrd) {
@@ -266,11 +266,11 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
this.wait();
},
+ /**
+ * If the requested time range is outside the range of the RRD file
+ * we should not get any values back
+ **/
test_getDataUnknownValues: function () {
- /**
- * If the requested time range is outside the range of the RRD file
- * we should not get any values back
- **/
var self = this;
this.d.done(
function(rrd) {
@@ -287,11 +287,11 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
return v * 10;
},
+ /**
+ * RrdQuery can be passed a transformer function which may
+ * manipulate the values from the RRDFile
+ **/
test_transformerFunction: function () {
- /**
- * RrdQuery can be passed a transformer function which may
- * manipulate the values from the RRDFile
- **/
var self = this;
this.d.done(
function(rrd) {
@@ -318,10 +318,10 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
this.rq = new jarmon.RrdQueryRemote('build/test.rrd', '');
},
+ /**
+ * The starttime must be less than the endtime
+ **/
test_getDataTimeRangeOverlapError: function () {
- /**
- * The starttime must be less than the endtime
- **/
var self = this;
this.rq.getData(1, 0).fail(
function(res) {
@@ -333,11 +333,11 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
},
+ /**
+ * Error is raised if the rrd file doesn't contain an RRA with the
+ * requested consolidation function (CF)
+ **/
test_getDataUnknownCfError: function () {
- /**
- * Error is raised if the rrd file doesn't contain an RRA with the
- * requested consolidation function (CF)
- **/
var self = this;
this.rq.getData(RRD_STARTTIME, RRD_ENDTIME, 0, 'FOO').always(
function(res) {
@@ -349,13 +349,13 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
},
+ /**
+ * The generated rrd file should have values 0-9 at 300s intervals
+ * starting at 1980-01-01 00:00:00
+ * Result should include a data points with times > starttime and
+ * <= endTime
+ **/
test_getData: function () {
- /**
- * The generated rrd file should have values 0-9 at 300s intervals
- * starting at 1980-01-01 00:00:00
- * Result should include a data points with times > starttime and
- * <= endTime
- **/
var self = this;
this.rq.getData(RRD_STARTTIME + (RRD_STEP+1) * 1000,
RRD_ENDTIME - (RRD_STEP-1) * 1000).always(
@@ -396,11 +396,11 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
this.wait();
},
+ /**
+ * If the requested time range is outside the range of the RRD file
+ * we should not get any values back
+ **/
test_getDataUnknownValues: function () {
- /**
- * If the requested time range is outside the range of the RRD file
- * we should not get any values back
- **/
var self = this;
this.rq.getData(RRD_ENDTIME, RRD_ENDTIME+1000).always(
function(data) {