Search in sources :

Example 1 with JaxbI18NText

use of org.jbpm.services.task.impl.model.xml.JaxbI18NText in project jbpm by kiegroup.

the class AbstractTaskSerializationTest method jaxbI18NTextTest.

@Test
public void jaxbI18NTextTest() throws Exception {
    Assume.assumeFalse(getType().equals(TestType.YAML));
    I18NTextImpl textImpl = new I18NTextImpl();
    textImpl.setId(1605l);
    textImpl.setLanguage("es-ES");
    textImpl.setText("Quixote");
    JaxbI18NText jaxbText = new JaxbI18NText(textImpl);
    assertEquals("id", textImpl.getId(), jaxbText.getId());
    assertEquals("language", textImpl.getLanguage(), jaxbText.getLanguage());
    assertEquals("text", textImpl.getText(), jaxbText.getText());
    JaxbI18NText copyJaxbText = testRoundTrip(jaxbText);
    Assertions.assertThat(jaxbText).isEqualToComparingFieldByFieldRecursively(copyJaxbText);
    List<I18NText> intList = new ArrayList<I18NText>();
    intList.add(textImpl);
    List<JaxbI18NText> jaxbList = JaxbI18NText.convertListFromInterfaceToJaxbImpl(intList, I18NText.class, JaxbI18NText.class);
    jaxbText = jaxbList.get(0);
    assertEquals("id", textImpl.getId(), jaxbText.getId());
    assertEquals("language", textImpl.getLanguage(), jaxbText.getLanguage());
    assertEquals("text", textImpl.getText(), jaxbText.getText());
    intList = JaxbI18NText.convertListFromJaxbImplToInterface(jaxbList);
    I18NText text = intList.get(0);
    assertEquals("id", text.getId(), jaxbText.getId());
    assertEquals("language", text.getLanguage(), jaxbText.getLanguage());
    assertEquals("text", text.getText(), jaxbText.getText());
}
Also used : I18NText(org.kie.api.task.model.I18NText) JaxbI18NText(org.jbpm.services.task.impl.model.xml.JaxbI18NText) InternalI18NText(org.kie.internal.task.api.model.InternalI18NText) JaxbI18NText(org.jbpm.services.task.impl.model.xml.JaxbI18NText) I18NTextImpl(org.jbpm.services.task.impl.model.I18NTextImpl) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 I18NTextImpl (org.jbpm.services.task.impl.model.I18NTextImpl)1 JaxbI18NText (org.jbpm.services.task.impl.model.xml.JaxbI18NText)1 Test (org.junit.Test)1 I18NText (org.kie.api.task.model.I18NText)1 InternalI18NText (org.kie.internal.task.api.model.InternalI18NText)1