1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.ipc;
20
21 import static org.junit.Assert.assertEquals;
22
23 import com.google.protobuf.Descriptors;
24 import org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos;
25 import org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos;
26 import org.apache.hadoop.hbase.testclassification.SmallTests;
27 import org.junit.Test;
28 import org.junit.experimental.categories.Category;
29
30 @Category(SmallTests.class)
31 public class TestCoprocessorRpcUtils {
32 @Test
33 public void testServiceName() throws Exception {
34
35 Descriptors.ServiceDescriptor authService =
36 AuthenticationProtos.AuthenticationService.getDescriptor();
37 assertEquals(authService.getName(), CoprocessorRpcUtils.getServiceName(authService));
38
39
40 Descriptors.ServiceDescriptor dummyService =
41 DummyRegionServerEndpointProtos.DummyService.getDescriptor();
42 assertEquals(dummyService.getFullName(), CoprocessorRpcUtils.getServiceName(dummyService));
43 }
44 }