()
| 97 | } |
| 98 | |
| 99 | @Test |
| 100 | public void ctorWithConfigOverrides() throws Exception { |
| 101 | ClientSocketChannelFactory socket_factory = |
| 102 | mock(ClientSocketChannelFactory.class); |
| 103 | |
| 104 | // TODO - more defaults |
| 105 | Config config = new Config(); |
| 106 | config.overrideConfig("hbase.rpc.timeout", "1024"); |
| 107 | config.overrideConfig("hbase.rpcs.buffered_flush_interval", "16"); |
| 108 | config.overrideConfig("hbase.increments.buffer_size", "128"); |
| 109 | config.overrideConfig("hbase.nsre.low_watermark", "5"); |
| 110 | config.overrideConfig("hbase.nsre.high_watermark", "10"); |
| 111 | config.overrideConfig("hbase.increments.durable", "true"); |
| 112 | config.overrideConfig("hbase.meta.scan", "true"); |
| 113 | config.overrideConfig("hbase.meta.split", "true"); |
| 114 | |
| 115 | HBaseClient client = new HBaseClient(config, socket_factory); |
| 116 | assertSame(socket_factory, Whitebox.getInternalState(client, "channel_factory")); |
| 117 | assertSame(config, client.getConfig()); |
| 118 | assertEquals(1024, (int) (Integer) Whitebox.getInternalState(client, "rpc_timeout")); |
| 119 | assertEquals(16, (short) (Short) Whitebox.getInternalState(client, "flush_interval")); |
| 120 | assertEquals(128, (int) (Integer) Whitebox.getInternalState(client, "increment_buffer_size")); |
| 121 | assertEquals(5, (int) (Integer) Whitebox.getInternalState(client, "nsre_low_watermark")); |
| 122 | assertEquals(10, (int) (Integer) Whitebox.getInternalState(client, "nsre_high_watermark")); |
| 123 | assertTrue((boolean) (Boolean) Whitebox.getInternalState(client, "increment_buffer_durable")); |
| 124 | assertTrue((boolean) (Boolean) Whitebox.getInternalState(client, "scan_meta")); |
| 125 | assertTrue(client.split_meta); |
| 126 | } |
| 127 | |
| 128 | @Test |
| 129 | public void getRegionNotCached() throws Exception { |
nothing calls this directly
no test coverage detected