Skip to content

Commit

Permalink
- adding simple jaxb roundtrip test
Browse files Browse the repository at this point in the history
  • Loading branch information
krisv committed May 16, 2013
1 parent 5ac300c commit cb9e56b
Showing 1 changed file with 25 additions and 0 deletions.
@@ -0,0 +1,25 @@
package org.kie.services.client.api.command;

import javax.xml.bind.JAXBException;

import org.jbpm.services.task.commands.StartTaskCommand;
import org.junit.Test;
import org.kie.api.command.Command;
import org.kie.services.client.api.command.serialization.jaxb.impl.JaxbCommandMessage;
import org.kie.services.client.api.command.serialization.jaxb.impl.JaxbSerializationProvider;

public class JaxbCommandMessageTest {

@Test
public void testCommandSerialization() throws JAXBException {
testRoundtrip(new StartTaskCommand(1, "krisv"));
}

public <T> void testRoundtrip(Command<T> command) throws JAXBException {
String commandXml = JaxbSerializationProvider.convertJaxbObjectToString(
new JaxbCommandMessage<T>("test", 1, command));
System.out.println(commandXml);
JaxbSerializationProvider.convertStringToJaxbObject(commandXml);
}

}

0 comments on commit cb9e56b

Please sign in to comment.