Changeset 3184


Ignore:
Timestamp:
07/24/13 08:45:42 (11 years ago)
Author:
peterwithers
Message:

Added temporary creation of JAXBElement in the unit test to make it clear where the jaxb root node issues stem from. This should be removed and replaced by the same as returned by the ObjectFactory? when cause of it not being auto generated is resolved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/NotebooksTest.java

    r3168 r3184  
    3333import java.util.UUID;
    3434import javax.ws.rs.core.MediaType;
     35import javax.xml.bind.JAXBElement;
     36import javax.xml.namespace.QName;
    3537import org.jmock.Expectations;
    3638import static org.jmock.Expectations.returnValue;
     
    169171     */
    170172    @Test
    171     @Ignore
    172173    public void testModifyNotebook_String() {
    173174        System.out.println("testModifyNotebook_String");
    174175        final Notebook notebook = new Notebook();
     176        // this JAXBElement should be returned by the generated ObjectFactory, however it is not. This could be due to name space polution in the schema?
     177        // todo: this JAXBElement should be removed and replaced by the same as returned by the ObjectFactory when cause of it not being auto generated is resolved, in the mean time this line below makes it clear where the issue starts from.
     178        final JAXBElement<Notebook> jaxbElement = new JAXBElement<Notebook>(new QName("http://www.dasish.eu/ns/addit", "notebook"), Notebook.class, null, notebook);
    175179        notebook.setTitle("a title");
    176         ClientResponse response = resource().path("notebooks/_nid_").type(MediaType.APPLICATION_XML).accept(MediaType.APPLICATION_XML).put(ClientResponse.class, notebook);
    177         assertEquals(200, response.getStatus());
    178         assertEquals("modifyNotebook _nid_", response.getEntity(String.class));
     180        ClientResponse response = resource().path("notebooks/_nid_").type(MediaType.APPLICATION_XML).accept(MediaType.APPLICATION_XML).put(ClientResponse.class, jaxbElement);
     181        assertEquals(200, response.getStatus());
     182        assertEquals("modifyNotebook _nid_a title", response.getEntity(String.class));
    179183    }
    180184
Note: See TracChangeset for help on using the changeset viewer.