1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.master;
20
21 import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
22 import org.apache.hadoop.hbase.master.MetricsMasterSource;
23 import org.apache.hadoop.hbase.master.MetricsMasterSourceFactory;
24 import org.apache.hadoop.hbase.master.MetricsMasterSourceImpl;
25 import org.junit.Test;
26
27 import static org.junit.Assert.assertSame;
28 import static org.junit.Assert.assertTrue;
29
30
31
32
33 public class TestMetricsMasterSourceImpl {
34
35 @Test
36 public void testGetInstance() throws Exception {
37 MetricsMasterSourceFactory metricsMasterSourceFactory = CompatibilitySingletonFactory
38 .getInstance(MetricsMasterSourceFactory.class);
39 MetricsMasterSource masterSource = metricsMasterSourceFactory.create(null);
40 assertTrue(masterSource instanceof MetricsMasterSourceImpl);
41 assertSame(metricsMasterSourceFactory, CompatibilitySingletonFactory.getInstance(MetricsMasterSourceFactory.class));
42 }
43
44 }