Package org.springframework.integration.service

Examples of org.springframework.integration.service.CustomerService


  public void testExtractCustomerNames() {
    final ApplicationContext context
      = new ClassPathXmlApplicationContext("/META-INF/spring/integration/spring-integration-context.xml",
                        CustomerServiceTest.class);

    final CustomerService service = context.getBean(CustomerService.class);

    final String sourceXml = "<customers><customer id=\"1\"><name>Foo Industries</name>"
        + "<industry>Chemical</industry><city>Glowing City</city></customer></customers>";
    final String expectedResult  = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
      + "<customers>\n"
      + "   <name>Foo Industries</name>\n"
      + "</customers>\n";

    final String extractedCustomerNames = service.getCustomerNames(sourceXml);

    System.out.println(">>" + expectedResult + "<<");
    System.out.println(">>" + extractedCustomerNames + "<<");

    Assert.assertEquals("The expected list of customer names did not match.",
View Full Code Here


    context.load("classpath:META-INF/spring/integration/*-context.xml");
    context.registerShutdownHook();
    context.refresh();

    final CustomerService service = context.getBean(CustomerService.class);

    final Resource resource = context.getResource("classpath:data/customers.xml");
    final InputStream is = resource.getInputStream();
    final String customers = new String(FileCopyUtils.copyToByteArray(is));

    System.out.println("\n\nExtracting Customer Names from:\n"
                     + HORIZONTAL_LINE
                     + customers + "\n"
                     + HORIZONTAL_LINE
                     + "\n");
    final String customernames = service.getCustomerNames(customers);
    System.out.println("Extracted Customer Names: \n"
                     + HORIZONTAL_LINE
                     + customernames + "\n"
                     + HORIZONTAL_LINE
                     + "\n");
View Full Code Here

TOP

Related Classes of org.springframework.integration.service.CustomerService

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.