Search in sources :

Example 46 with Marshaller

use of org.kie.server.api.marshalling.Marshaller in project droolsjbpm-integration by kiegroup.

the class StringContentJSONTest method testStringContentCaseFile.

@Test
public void testStringContentCaseFile() {
    Set<Class<?>> extraClasses = new HashSet<Class<?>>();
    Marshaller marshaller = MarshallerFactory.getMarshaller(extraClasses, MarshallingFormat.JSON, this.getClass().getClassLoader());
    String jsonMap = "{\n" + "  \"case-data\" : {\n" + "    \"yearsOfService\" : 1\n" + "  },\n" + "  \"case-user-assignments\" : {\n" + "  },\n" + "  \"case-group-assignments\" : {\n" + " }\n" + "}";
    StringContentCaseFile map = new StringContentCaseFile(jsonMap);
    // content must be of exact value as given in constructor
    String marshall = marshaller.marshall(map);
    assertEquals(jsonMap, marshall);
}
Also used : Marshaller(org.kie.server.api.marshalling.Marshaller) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 47 with Marshaller

use of org.kie.server.api.marshalling.Marshaller in project droolsjbpm-integration by kiegroup.

the class MarshallingRoundTripNestedClassesWithAnnotationsTest method testXStream.

@Test
public void testXStream() {
    Marshaller marshaller = MarshallerFactory.getMarshaller(getCustomClasses(), MarshallingFormat.XSTREAM, getClass().getClassLoader());
    verifyMarshallingRoundTrip(marshaller, createTestObject());
}
Also used : Marshaller(org.kie.server.api.marshalling.Marshaller) Test(org.junit.Test)

Example 48 with Marshaller

use of org.kie.server.api.marshalling.Marshaller in project droolsjbpm-integration by kiegroup.

the class MarshallingRoundTripTest method testXStream.

@Test
public void testXStream() {
    Marshaller marshaller = MarshallerFactory.getMarshaller(MarshallingFormat.XSTREAM, getClass().getClassLoader());
    verifyMarshallingRoundTrip(marshaller, testObject);
}
Also used : Marshaller(org.kie.server.api.marshalling.Marshaller) Test(org.junit.Test)

Example 49 with Marshaller

use of org.kie.server.api.marshalling.Marshaller in project droolsjbpm-integration by kiegroup.

the class MarshallingRoundTripTest method testJaxb.

@Test
public void testJaxb() {
    Marshaller marshaller = MarshallerFactory.getMarshaller(MarshallingFormat.JAXB, getClass().getClassLoader());
    verifyMarshallingRoundTrip(marshaller, testObject);
}
Also used : Marshaller(org.kie.server.api.marshalling.Marshaller) Test(org.junit.Test)

Example 50 with Marshaller

use of org.kie.server.api.marshalling.Marshaller in project droolsjbpm-integration by kiegroup.

the class MarshallingRoundTripTest method testJSON.

@Test
public void testJSON() {
    Marshaller marshaller = MarshallerFactory.getMarshaller(MarshallingFormat.JSON, getClass().getClassLoader());
    verifyMarshallingRoundTrip(marshaller, testObject);
}
Also used : Marshaller(org.kie.server.api.marshalling.Marshaller) Test(org.junit.Test)

Aggregations

Marshaller (org.kie.server.api.marshalling.Marshaller)65 Test (org.junit.Test)48 HashMap (java.util.HashMap)12 WebTarget (javax.ws.rs.client.WebTarget)11 BeforeClass (org.junit.BeforeClass)10 ArrayList (java.util.ArrayList)9 MarshallingFormat (org.kie.server.api.marshalling.MarshallingFormat)9 Response (javax.ws.rs.core.Response)8 BatchExecutionCommand (org.kie.api.command.BatchExecutionCommand)8 Command (org.kie.api.command.Command)8 ExecutionResults (org.kie.api.runtime.ExecutionResults)8 HashSet (java.util.HashSet)7 JaxbLong (org.kie.server.api.model.type.JaxbLong)6 KieContainerInstance (org.kie.server.services.api.KieContainerInstance)4 CallContainerCommand (org.kie.server.api.commands.CallContainerCommand)3 KieContainerResource (org.kie.server.api.model.KieContainerResource)3 KieServerCommand (org.kie.server.api.model.KieServerCommand)3 ServiceResponse (org.kie.server.api.model.ServiceResponse)3 Date (java.util.Date)2 BatchExecutionCommandImpl (org.drools.core.command.runtime.BatchExecutionCommandImpl)2