use of org.kie.server.api.marshalling.Marshaller in project droolsjbpm-integration by kiegroup.
the class DroolsCommandNestedPojoMarshallingTest method testJaxb.
@Test
public void testJaxb() {
Marshaller marshaller = marshallerBuilder.build(getCustomClasses(), MarshallingFormat.JAXB, getClass().getClassLoader());
verifyMarshallingRoundTrip(marshaller, createTestCommand(), jaxbExpectedPayload);
}
use of org.kie.server.api.marshalling.Marshaller in project droolsjbpm-integration by kiegroup.
the class DroolsCommandWithListMarshallingTest method testJSON.
@Test
public void testJSON() {
Marshaller marshaller = marshallerBuilder.build(getCustomClasses(), MarshallingFormat.JSON, getClass().getClassLoader());
verifyMarshallingRoundTrip(marshaller, createTestCommand(), jsonExpectedPayload);
}
use of org.kie.server.api.marshalling.Marshaller in project droolsjbpm-integration by kiegroup.
the class DroolsCommandWithListMarshallingTest method testXStream.
@Test
public void testXStream() {
Marshaller marshaller = marshallerBuilder.build(getCustomClasses(), MarshallingFormat.XSTREAM, getClass().getClassLoader());
verifyMarshallingRoundTrip(marshaller, createTestCommand(), xstreamExpectedPayload);
}
use of org.kie.server.api.marshalling.Marshaller in project droolsjbpm-integration by kiegroup.
the class DroolsCommandWithListMarshallingTest method testJaxb.
@Test
public void testJaxb() {
Marshaller marshaller = marshallerBuilder.build(getCustomClasses(), MarshallingFormat.JAXB, getClass().getClassLoader());
verifyMarshallingRoundTrip(marshaller, createTestCommand(), jaxbExpectedPayload);
}
use of org.kie.server.api.marshalling.Marshaller in project droolsjbpm-integration by kiegroup.
the class JSONMarshallerExtensionTest method testCustomExtensionMarshaller.
@Test
public void testCustomExtensionMarshaller() {
Set<Class<?>> extraClasses = new HashSet<Class<?>>();
Marshaller marshaller = MarshallerFactory.getMarshaller(extraClasses, MarshallingFormat.JSON, this.getClass().getClassLoader());
Calendar calendar = GregorianCalendar.getInstance();
String marshall = marshaller.marshall(calendar);
assertEquals(marshall, "\"" + FORMATTER.format(calendar.getTime()) + "\"");
GregorianCalendar unmarshall = marshaller.unmarshall(marshall, GregorianCalendar.class);
assertEquals(unmarshall, calendar);
PMMLRequestData request = new PMMLRequestData("123", "SimpleScorecard");
request.addRequestParam("param1", 10.0);
request.addRequestParam("param2", 15.0);
String mshl = marshaller.marshall(request);
PMMLRequestData rd = marshaller.unmarshall(mshl, PMMLRequestData.class);
assertEquals(rd, request);
logger.info(rd.toString());
}
Aggregations