1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.thrift;
20
21 import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
22 import org.apache.hadoop.hbase.thrift.MetricsThriftServerSourceFactory;
23 import org.apache.hadoop.hbase.thrift.MetricsThriftServerSourceFactoryImpl;
24 import org.junit.Test;
25
26 import static org.junit.Assert.assertNotNull;
27 import static org.junit.Assert.assertSame;
28 import static org.junit.Assert.assertTrue;
29
30
31
32
33 public class TestMetricsThriftServerSourceFactoryImpl {
34
35 @Test
36 public void testCompatabilityRegistered() throws Exception {
37 assertNotNull(CompatibilitySingletonFactory.getInstance(MetricsThriftServerSourceFactory.class));
38 assertTrue(CompatibilitySingletonFactory.getInstance(MetricsThriftServerSourceFactory.class) instanceof MetricsThriftServerSourceFactoryImpl);
39 }
40
41 @Test
42 public void testCreateThriftOneSource() throws Exception {
43
44 assertSame(new MetricsThriftServerSourceFactoryImpl().createThriftOneSource(),
45 new MetricsThriftServerSourceFactoryImpl().createThriftOneSource());
46
47 }
48
49 @Test
50 public void testCreateThriftTwoSource() throws Exception {
51
52 assertSame(new MetricsThriftServerSourceFactoryImpl().createThriftTwoSource(),
53 new MetricsThriftServerSourceFactoryImpl().createThriftTwoSource());
54 }
55 }