From 64f965d74374f3a15342bf6e807ac50513a69f68 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Wed, 25 Aug 2010 22:20:41 +0100 Subject: Add a test for query timerange --- jarmon/jarmon.test.js | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'jarmon/jarmon.test.js') diff --git a/jarmon/jarmon.test.js b/jarmon/jarmon.test.js index 4a5c273..86243b4 100644 --- a/jarmon/jarmon.test.js +++ b/jarmon/jarmon.test.js @@ -8,12 +8,6 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) { Y.Test.Runner.add(new Y.Test.Case({ name: "jarmon.downloadBinary", - setUp : function () { - }, - - tearDown : function () { - }, - test_urlNotFound: function () { /** * When url cannot be found, the deferred should errback with status @@ -46,10 +40,32 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) { }, this); this.wait(); - }, + } })); + + Y.Test.Runner.add(new Y.Test.Case({ + name: "jarmon.RrdQuery", + + test_getDataTimeRangeOverlapError: function () { + /** + * The starttime must be less than the endtime + **/ + var rq = new jarmon.RrdQuery({}, ''); + var error = null; + try { + rq.getData(1, 0); + } catch(e) { + error = e; + } + Y.Assert.isInstanceOf(jarmon.TimeRangeError, error); + } + + })); + + + //initialize the console var yconsole = new Y.Console({ newestOnTop: false, -- cgit v1.2.3