merrimanr commented on a change in pull request #1456: METRON-2175 Introduce 
HBase Connection Abstractions for HBase 2.0.2
URL: https://github.com/apache/metron/pull/1456#discussion_r303131505
 
 

 ##########
 File path: 
metron-platform/metron-hbase/metron-hbase-common/src/test/java/org/apache/metron/hbase/client/FakeHBaseClient.java
 ##########
 @@ -0,0 +1,335 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.metron.hbase.client;
+
+import org.apache.hadoop.hbase.client.Durability;
+import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.metron.hbase.ColumnList;
+import org.apache.metron.hbase.HBaseProjectionCriteria;
+import org.mockito.AdditionalMatchers;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.lang.invoke.MethodHandles;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.NavigableMap;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.stream.Collectors;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+/**
+ * An {@link HBaseClient} useful for testing.
+ *
+ * <p>Maintains a static, in-memory set of records to mimic the behavior of
+ * an {@link HBaseClient} that interacts with HBase.
+ */
+public class FakeHBaseClient implements HBaseClient, Serializable {
 
 Review comment:
   Is my understanding correct that `FakeHBaseClient` and 
`FakeHBaseClientFactory` are not directly used in this PR?  I agree that 
`FakeHBaseClient` looks fairly complex for a testing class.  Is this used in 
PRs that follow or am I just missing where it's included?
   
   My experience with `MockHTable` has been that it's very complex and 
difficult to maintain.  I would prefer to move away from depending on something 
like this for unit testing (integration tests use an in-memory server 
correct?).  
   
   I trust that you created this for a reason but it's hard for me to wrap my 
head around it without some context.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to