import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;
import java.util.List;
import static junit.framework.Assert.assertNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext-test.xml")
@TestExecutionListeners({
DependencyInjectionTestExecutionListener.class,
DirtiesContextTestExecutionListener.class,
TransactionDbUnitTestExecutionListener.class})
public class FloorDaoTest {
@Autowired
private FloorDao floorDao;
@Test
[java]
@DatabaseSetup("FloorDao-findbByBuidlingName-dataset.xml") @DatabaseSetup("FloorDao-findbByBuidlingName-dataset.xml") public void testFindByBuildingName(){ List
至此,一个完整的数据层测试用例已经呈现,并且可以运行。可是实际的过程却并没有这么顺利,接下来的文章就要总结一下遇到的问题。