INT-1028, polishing, README.txt, pom.xml etc...
This commit is contained in:
21
spring-integration-samples/loan-broker/README.txt
Normal file
21
spring-integration-samples/loan-broker/README.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
Loan Broker sample is distributed as valid Eclipse/Maven project, so you can run it in two ways.
|
||||
|
||||
Maven (command line):
|
||||
1. Execute 'mvn install'
|
||||
You should see the output that looks similar to this:
|
||||
. . . . .
|
||||
INFO : org.springframework.integration.loanbroker.demo.LoanBrokerDemo -
|
||||
********* Best Quote:
|
||||
====== Loan Quote =====
|
||||
Lender: StubBank-11
|
||||
Loan amount: $270,279
|
||||
Quotation Date: Fri Mar 12 02:19:35 EST 2010
|
||||
Expiration Date: Tue Mar 16 02:19:35 EDT 2010
|
||||
Term: 17 years
|
||||
Rate: 5.9092593%
|
||||
=======================
|
||||
. . . . .
|
||||
|
||||
Eclipse/STS (with m2eclipse plug-in)
|
||||
1. Import project into Eclipse/STS. If m2eclipse plugin is installed the dependency will be downloaded automatically
|
||||
2. Run 'org.springframework.integration.loanbroker.demo.LoanBrokerDemo' class located in 'src/test/java'
|
||||
@@ -56,9 +56,18 @@
|
||||
<target>1.5</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Demo.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.integration.loanbroker.demo;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.loanbroker.LoanBrokerGateway;
|
||||
@@ -27,30 +28,39 @@ import org.springframework.integration.loanbroker.domain.LoanRequest;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class LoanBrokerDemo {
|
||||
private static Logger logger = Logger.getLogger(LoanBrokerDemo.class);
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
new LoanBrokerDemo().runDemo();
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void runDemo() {
|
||||
|
||||
ConfigurableApplicationContext ac =
|
||||
new ClassPathXmlApplicationContext("bootstrap-config/stubed-loan-broker.xml");
|
||||
|
||||
LoanBrokerGateway broker = ac.getBean("loanBrokerGateway", LoanBrokerGateway.class);
|
||||
LoanRequest loanRequest = new LoanRequest();
|
||||
loanRequest.setCustomer(new Customer());
|
||||
|
||||
loanRequest.setCustomer(new Customer());
|
||||
|
||||
LoanQuote loan = broker.getLoanQuote(loanRequest);
|
||||
logger.info("\n********* Best Quote: " + loan);
|
||||
|
||||
|
||||
List<LoanQuote> loanQuotes = broker.getAllLoanQuotes(loanRequest);
|
||||
logger.info("\n********* All Quotes: ");
|
||||
for (LoanQuote loanQuote : loanQuotes) {
|
||||
logger.info(loanQuote);
|
||||
}
|
||||
|
||||
|
||||
ac.close();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user