1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.client;
19
20 import java.util.Arrays;
21 import java.util.Collection;
22 import org.apache.hadoop.conf.Configuration;
23 import org.apache.hadoop.hbase.HBaseTestingUtility;
24 import org.apache.hadoop.hbase.HConstants;
25 import org.apache.hadoop.hbase.testclassification.LargeTests;
26 import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
27 import org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint;
28 import org.apache.hadoop.hbase.regionserver.NoOpScanPolicyObserver;
29 import org.junit.BeforeClass;
30 import org.junit.experimental.categories.Category;
31 import org.junit.runners.Parameterized;
32
33
34
35
36
37 @Category(LargeTests.class)
38 public class TestFromClientSideWithCoprocessor extends TestFromClientSide {
39
40 @Parameterized.Parameters
41 public static Collection parameters() {
42 return Arrays.asList(new Object[][] {
43 { ZKConnectionRegistry.class }
44 });
45 }
46
47 public TestFromClientSideWithCoprocessor(Class registry) throws Exception {
48 initialize(registry);
49 }
50
51 public static void initialize(Class<? extends ConnectionRegistry> registry) throws Exception {
52 if (isSameParameterizedCluster(registry)) {
53 return;
54 }
55 if (TEST_UTIL != null) {
56
57 TEST_UTIL.shutdownMiniCluster();
58 }
59 TEST_UTIL = new HBaseTestingUtility();
60 Configuration conf = TEST_UTIL.getConfiguration();
61 conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
62 MultiRowMutationEndpoint.class.getName(), NoOpScanPolicyObserver.class.getName());
63 conf.setBoolean("hbase.table.sanity.checks", true);
64 conf.setClass(HConstants.REGISTRY_IMPL_CONF_KEY, registry, ConnectionRegistry.class);
65
66 TEST_UTIL.startMiniCluster(SLAVES);
67 }
68 }