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
Exceptionprotected abstract T buildTestModel()
protected String toXML(T model) throws JAXBException
JAXBExceptionprotected String toJSON(T model) throws JAXBException, IOException
JAXBExceptionIOExceptionpublic T fromJSON(String json) throws JAXBException, IOException
JAXBExceptionIOExceptionpublic T fromXML(String xml) throws JAXBException
JAXBExceptionprotected byte[] toPB(org.apache.hadoop.hbase.rest.ProtobufMessageHandler model)
protected abstract void checkModel(T model)
public void testBuildModel() throws Exception
Exceptionpublic void testFromPB() throws Exception
Exceptionpublic void testFromXML() throws Exception
Exceptionpublic void testToJSON() throws Exception
Exceptionpublic void testFromJSON() throws Exception
ExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.