Package org.springbyexample.person.schema.beans

Examples of org.springbyexample.person.schema.beans.PersonResponse


    @Test
    @DirtiesContext
    public void testPersonServiceClient() {
        assertNotNull("Client is null.", client);
       
        PersonResponse response = client.getPersons(new GetPersonsRequest());
       
        logger.debug("Received response from server.");
       
        assertNotNull("Response is null.", response);
       
        int expectedSize = 2;
        assertEquals("Expected person list to be a size of '" + expectedSize + "'.", expectedSize, response.getPerson().size());
     
        Person person = response.getPerson().get(0);
     
        assertNotNull("Person is null.", person);
     
        assertEquals("Expected id of '" + ID + "'.", ID.intValue(), person.getId());
        assertEquals("Expected first name of '" + FIRST_NAME + "'.", FIRST_NAME, person.getFirstName());
        assertEquals("Expected last name of '" + LAST_NAME + "'.", LAST_NAME, person.getLastName());
   
        Person person2 = response.getPerson().get(1);
     
        assertNotNull("Person is null.", person2);
     
        assertEquals("Expected id of '" + SECOND_ID + "'.", SECOND_ID.intValue(), person2.getId());
        assertEquals("Expected first name of '" + SECOND_FIRST_NAME + "'.", SECOND_FIRST_NAME, person2.getFirstName());
View Full Code Here


    @Test
    @DirtiesContext
    public void testPersonServiceClient() {
        assertNotNull("Client is null.", client);
       
        PersonResponse response = client.getPersons(new GetPersonsRequest());
       
        logger.debug("Received response from server.");
       
        assertNotNull("Response is null.", response);
       
        int expectedSize = 2;
        assertEquals("Expected person list to be a size of '" + expectedSize + "'.", expectedSize, response.getPerson().size());
     
        Person person = response.getPerson().get(0);
     
        assertNotNull("Person is null.", person);
     
        assertEquals("Expected id of '" + ID + "'.", ID.intValue(), person.getId());
        assertEquals("Expected first name of '" + FIRST_NAME + "'.", FIRST_NAME, person.getFirstName());
        assertEquals("Expected last name of '" + LAST_NAME + "'.", LAST_NAME, person.getLastName());
   
        Person person2 = response.getPerson().get(1);
     
        assertNotNull("Person is null.", person2);
     
        assertEquals("Expected id of '" + SECOND_ID + "'.", SECOND_ID.intValue(), person2.getId());
        assertEquals("Expected first name of '" + SECOND_FIRST_NAME + "'.", SECOND_FIRST_NAME, person2.getFirstName());
View Full Code Here

     */
    @Test
    public void testMarshaller() {
        assertNotNull("Marshaller is null.", marshaller);

        PersonResponse personList = new PersonResponse().withPerson(
                new Person().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME),
                new Person().withId(SECOND_ID).withFirstName(SECOND_FIRST_NAME).withLastName(SECOND_LAST_NAME));
               
        ByteArrayOutputStream out = new ByteArrayOutputStream();
       
View Full Code Here

        Object value = unmarshaller.unmarshal(new StreamSource(in));
       
        assertNotNull("Unmarshalled instance is null.", value);
        assertTrue("Not an instance of Persons.", (value instanceof PersonResponse));
       
        PersonResponse personResponse = (PersonResponse)value;
       
        int expectedSize = 2;
        assertEquals("Expected person list to be a size of '" + expectedSize + "'.", expectedSize, personResponse.getPerson().size());
       
        Person person = personResponse.getPerson().get(0);
       
        assertNotNull("Person is null.", person);
       
        assertEquals("Expected id of '" + ID + "'.", ID.intValue(), person.getId());
        assertEquals("Expected first name of '" + FIRST_NAME + "'.", FIRST_NAME, person.getFirstName());
        assertEquals("Expected last name of '" + LAST_NAME + "'.", LAST_NAME, person.getLastName());

        Person person2 = personResponse.getPerson().get(1);
       
        assertNotNull("Person is null.", person2);
       
        assertEquals("Expected id of '" + SECOND_ID + "'.", SECOND_ID.intValue(), person2.getId());
        assertEquals("Expected first name of '" + SECOND_FIRST_NAME + "'.", SECOND_FIRST_NAME, person2.getFirstName());
View Full Code Here

 
    /**
     * Gets person list.
     */
    public PersonResponse getPersons(GetPersonsRequest request) {
        PersonResponse response =
            (PersonResponse) wsTemplate.marshalSendAndReceive(request);

        return response;
       
    }
View Full Code Here

    /**
     * Gets person list.
     */
    @PayloadRoot(localPart=GET_PERSONS_REQUEST, namespace=NAMESPACE)
    public PersonResponse getPersons(GetPersonsRequest request) {
        return new PersonResponse().withPerson(
                   person,
                   new Person().withId(2).withFirstName("John").withLastName("Jackson"));       
    }
View Full Code Here

    /**
     * Gets person list.
     */
    @PayloadRoot(localPart=GET_PERSONS_REQUEST, namespace=NAMESPACE)
    public PersonResponse getPersons(GetPersonsRequest request) {
        return new PersonResponse().withPerson(
                   new Person().withId(1).withFirstName("Joe").withLastName("Smith"),
                   new Person().withId(2).withFirstName("John").withLastName("Jackson"));       
    }
View Full Code Here

TOP

Related Classes of org.springbyexample.person.schema.beans.PersonResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.