⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 creditprocessservicetest.java

📁 CAS Client Demo学习SSO 的最佳例子
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -