creditprocessservicetest.java
来自「CAS Client Demo学习SSO 的最佳例子」· Java 代码 · 共 49 行
JAVA
49 行
package com.loanapp.service;
import java.io.IOException;
import junit.framework.TestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class CreditProcessServiceTest extends TestCase {
private static Log log = LogFactory.getLog(CreditProcessServiceTest.class);
private CreditProcessService service = null;
private ApplicationContext appContext;
public void setUp() throws IOException {
appContext = new ClassPathXmlApplicationContext(new String[] {
"loanapp-jms-spring.xml"});
log.debug("Got Spring Application Context:" + appContext);
}
protected void tearDown() throws Exception {
super.tearDown();
log.debug("Closing Application Context");
appContext = null;
}
public void testProcessCreditRequest() {
try {
service = (CreditProcessService) appContext.getBean("creditProcessService");
// Receive the 4 messages sent to the message queue by
// LoanApplicationServiceTest test class
for (int i=0; i<4; i++) {
service.processCreditRequest();
}
} catch(Exception de) {
TestCase.fail();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?