3

我正在为 Oracle (10g) 存储过程编写测试工具。我打算使用@Transactional测试来运行存储过程,以便在测试结束时回滚事务。所以我的测试看起来像:

@ContextConfiguration(locations = "classpath:spring/ITestAssembly.xml")
@RunWith(SpringJUnit4ClassRunner.class)
public class ContentGenerationRunnerTest {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Test
    @Transactional
    public void contentIncShouldRun() throws Exception {
        new ContentGenerationRunner().runVclBec(jdbcTemplate);
    }
}

我可以断言已经进行了正确的更新,因为测试会话的本地更改将在测试方法中可见。

然而,为了做出更严格的断言,能够检查会话中已调用但尚未提交的 DML 语句的完整列表会很方便。有没有办法让我看到这个?

4

1 回答 1

0

相关问题:

https://dba.stackexchange.com/questions/2994/oracle-any-way-to-view-uncommited-changes-to-a-particular-table

于 2011-07-07T11:21:30.117 回答