Skip to content
Newer
Older
100644 39 lines (36 sloc) 1.5 KB
c99395e @wdavidw Convert test to coffee-script; Run tests agains hbase 0.90.4-cdh3u2
authored Nov 23, 2011
1
6d74a86 @wdavidw Fix Issue #3: Node dies when HBase is offline
authored Dec 2, 2011
2 hbase = require '..'
c99395e @wdavidw Convert test to coffee-script; Run tests agains hbase 0.90.4-cdh3u2
authored Nov 23, 2011
3 utils = require './utils'
4 assert = require 'assert'
5
6 module.exports =
7 'Get version': (next) ->
8 utils.getClient (error, client) ->
9 client.getVersion (err, version) ->
10 assert.ifError err
11 keys = Object.keys version
12 assert.deepEqual(['Server','REST','OS','Jersey','JVM'],keys)
13 next()
14 'Get version cluster': (next) ->
15 utils.getClient (error, client) ->
16 client.getVersionCluster (err, versionCluster) ->
17 assert.ifError err
18 assert.ok(/^(Unknown)|(\d[\d\.]+)/.test(versionCluster))
19 next()
20 'Get status cluster': (next) ->
21 utils.getClient (error, client) ->
22 client.getStatusCluster (err,statusCluster) ->
23 assert.ifError err
24 keys = Object.keys statusCluster
25 assert.deepEqual(['requests','regions','averageLoad','DeadNodes','LiveNodes'],keys)
26 next()
27 'Get tables': (next) ->
28 utils.getClient (error, client) ->
29 client.getTables (err,tables) ->
30 assert.ifError err
31 assert.strictEqual 1, tables.filter( (table) -> table.name is 'node_table' ).length
32 next()
6d74a86 @wdavidw Fix Issue #3: Node dies when HBase is offline
authored Dec 2, 2011
33 'Test': (next) ->
34 # Hopefully, 456789 isnt used, might worth checking it with `nc`
35 hbase({host: 'localhost', port: 456789})
36 .getVersionCluster (err, versionCluster) ->
37 assert.ok err instanceof Error
38 next()
Something went wrong with that request. Please try again.