Examples of OutputReportIncident


Examples of org.apache.camel.example.reportincident.OutputReportIncident

* @version $Revision: 880731 $
*/
public class IncidentBean {

    public OutputReportIncident reportIncident(InputReportIncident in) {
        OutputReportIncident out = new OutputReportIncident();
        out.setCode(in.getIncidentId() + " = OK");
        return out;
    }
View Full Code Here

Examples of org.apache.camel.example.reportincident.OutputReportIncident

        // we use CXF to create a client for us as its easier than JAXWS and works
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(ReportIncidentEndpoint.class);
        factory.setAddress("http://localhost:9080/camel-itest-osgi/webservices/incident");
        ReportIncidentEndpoint client = factory.create(ReportIncidentEndpoint.class);
        OutputReportIncident out = client.reportIncident(input);

        // assert we got a OK back
        assertEquals("OK;456", out.getCode());
        LOG.warn("Finish the testing");
    }
View Full Code Here

Examples of org.apache.camel.example.reportincident.OutputReportIncident

        input.setEmail("davsclaus@apache.org");
        input.setPhone("12345678");

        // create the webservice client and send the request
        ReportIncidentEndpoint client = createCXFClient();
        OutputReportIncident out = client.reportIncident(input);

        // assert we got a OK back
        assertEquals("OK;123", out.getCode());
    }
View Full Code Here

Examples of org.apache.camel.example.reportincident.OutputReportIncident

        input.setEmail("davsclaus@apache.org");
        input.setPhone("12345678");

        // create the webservice client and send the request
        ReportIncidentEndpoint client = createCXFClient();
        OutputReportIncident out = client.reportIncident(input);

        // assert we got a OK back
        assertEquals("OK;123", out.getCode());
    }
View Full Code Here

Examples of org.apache.camel.example.reportincident.OutputReportIncident

        // store the data as a file
        String filename = parameters.getIncidentId() + ".txt";
        // send the data to the endpoint and the header contains what filename it should be stored as
        template.sendBodyAndHeader(data, "CamelFileName", filename);

        OutputReportIncident out = new OutputReportIncident();
        out.setCode("OK");
        return out;
    }
View Full Code Here

Examples of org.apache.camel.example.reportincident.OutputReportIncident

* @version $Revision$
*/
public class ReportIncidentEndpointService implements ReportIncidentEndpoint {

    public OutputReportIncident reportIncident(InputReportIncident in) {
        OutputReportIncident out = new OutputReportIncident();
        out.setCode("OK;" + in.getIncidentId());
        return out;
    }
View Full Code Here

Examples of org.apache.camel.example.reportincident.OutputReportIncident

        input.setEmail("davsclaus@apache.org");
        input.setPhone("12345678");

        // create the webservice client and send the request
        ReportIncidentEndpoint client = createCXFClient();
        OutputReportIncident out = client.reportIncident(input);

        // assert we got a OK back
        assertEquals("OK;456", out.getCode());
    }
View Full Code Here

Examples of org.apache.camel.example.reportincident.OutputReportIncident

        ReportIncidentService_PortType port = locator.getReportIncidentPort(url);

        // create input to send
        InputReportIncident input = createDummyIncident();
        // send the webservice and get the response
        OutputReportIncident output = port.reportIncident(input);
        assertEquals("OK", output.getCode());

        // should generate a file also
        File file = new File("target/" + input.getIncidentId() + ".txt");
        assertTrue("File should exists", file.exists());
    }
View Full Code Here

Examples of org.apache.camel.example.reportincident.OutputReportIncident

    public void testIncident() {
        ReportIncidentService service = (ReportIncidentService) applicationContext.getBean("incidentservice");

        InputReportIncident input = createDummyIncident();
        OutputReportIncident output = service.reportIncident(input);
        assertEquals("OK", output.getCode());

        // should generate a file also
        File file = new File("target/" + input.getIncidentId() + ".txt");
        assertTrue("File should exists", file.exists());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.