public abstract class TestModelBase<T>
extends TestCase
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 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(ProtobufMessageHandler model) |
protected String |
toXML(T model) |
protected String AS_XML
protected String AS_PB
protected String AS_JSON
protected JAXBContext context
protected Class<?> clazz
protected ObjectMapper mapper
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(ProtobufMessageHandler model)
protected abstract void checkModel(T model)