public abstract class TestModelBase<T> extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
AS_JSON |
protected String |
AS_PB |
protected String |
AS_XML |
protected Class<?> |
clazz |
protected JAXBContext |
context |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
Modifier | Constructor and Description |
---|---|
protected |
TestModelBase(Class<?> clazz) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
buildTestModel() |
protected abstract void |
checkModel(T model) |
T |
fromJSON(String json) |
protected T |
fromPB(String pb) |
T |
fromXML(String xml) |
void |
testBuildModel() |
void |
testFromJSON() |
void |
testFromPB() |
void |
testFromXML() |
void |
testToJSON() |
void |
testToXML() |
protected String |
toJSON(T model) |
protected byte[] |
toPB(org.apache.hadoop.hbase.rest.ProtobufMessageHandler model) |
protected String |
toXML(T model) |
protected JAXBContext context
protected com.fasterxml.jackson.databind.ObjectMapper mapper
protected TestModelBase(Class<?> clazz) throws Exception
Exception
protected abstract T buildTestModel()
protected String toXML(T model) throws JAXBException
JAXBException
protected String toJSON(T model) throws JAXBException, IOException
JAXBException
IOException
public T fromJSON(String json) throws JAXBException, IOException
JAXBException
IOException
public T fromXML(String xml) throws JAXBException
JAXBException
protected byte[] toPB(org.apache.hadoop.hbase.rest.ProtobufMessageHandler model)
protected abstract void checkModel(T model)
public void testBuildModel() throws Exception
Exception
public void testFromPB() throws Exception
Exception
public void testFromXML() throws Exception
Exception
public void testToJSON() throws Exception
Exception
public void testFromJSON() throws Exception
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.