Java tutorial
/* * Copyright 2013 Alibaba.com All right reserved. This software is the confidential and proprietary information of * Alibaba.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only * in accordance with the terms of the license agreement you entered into with Alibaba.com. */ package com.ivanzhangwb.core.service; import java.util.List; import junit.framework.TestCase; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.ivanzhangwb.model.Member; /** * TestMain.java?? * * @author zhangwenbo Jan 9, 2013 12:03:28 AM */ public class TestMain extends TestCase { private AbstractApplicationContext applicationContext; public void setUp() throws Exception { applicationContext = new ClassPathXmlApplicationContext("test-applicationContext.xml"); } protected void tearDown() throws Exception { } public void test_query() { MemberServer memberServer = (MemberServer) applicationContext.getBean("testMember"); List<Member> lists = memberServer.queryMember("12313"); assertEquals(3, lists.size()); lists = memberServer.queryMember("22222"); } }