oracle PL/SQL 的单元测试
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/152441/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unit testing for PL/SQL
提问by Matthew Watson
Anyone have any experience or tools for unit testing PL/SQL. The best looking tool I've seen for this seems to be Quests Code Tester, but i'm not sure how well that would integration with continuous integration tools or command line testing?
任何人都有任何用于单元测试 PL/SQL 的经验或工具。我见过的最好看的工具似乎是 Quests Code Tester,但我不确定它与持续集成工具或命令行测试的集成效果如何?
采纳答案by darreljnz
I use utPLSQL as the framework and OUnit as the client. utPLSQL isn't really meant to be used by itself, a good graphical client is required. OUnit is the predecessor to Qute. Qute is also a good tool but more complex than my requirements - it allows you to construct tests using a GUI and does good stuff like test code generation.
我使用 utPLSQL 作为框架,使用 OUnit 作为客户端。utPLSQL 并不是真的要单独使用,需要一个好的图形客户端。OUnit 是 Qute 的前身。Qute 也是一个很好的工具,但比我的要求更复杂 - 它允许您使用 GUI 构建测试并执行诸如测试代码生成之类的好东西。
Edit: My understanding is that utPLSQL stores all results in database tables, including all historical results which would make a good data source for gathering statistics for continuous integration. You can also define test groups so a single call to utPLSQL can call multiple test packages.
编辑:我的理解是 utPLSQL 将所有结果存储在数据库表中,包括所有历史结果,这将成为收集持续集成统计数据的良好数据源。您还可以定义测试组,以便对 utPLSQL 的单个调用可以调用多个测试包。
回答by Mac
Check utPLSQLout. I found it somewhat difficult to start with, but i think it does the job reasonably well.
检查utPLSQL。我发现开始有点困难,但我认为它可以很好地完成这项工作。
As for continuous integration tools, I used to create usual tests (NUnit, C#) that just called the stored procedures created with utPLSQL and checked their result out.
至于持续集成工具,我曾经创建通常的测试(NUnit、C#),这些测试只是调用使用 utPLSQL 创建的存储过程并检查它们的结果。
回答by Raimonds Simanovskis
I have created and using PL/SQL unit testing framework using Ruby library ruby-plsql.
我已经使用 Ruby 库 ruby-plsql创建并使用了PL/SQL 单元测试框架。
It provides much shorter and more readable tests than utPLSQL and gives more flexibility compared to GUI tools (like Quest Code Tester or SQLDeveloper 2.1).
与 utPLSQL 相比,它提供了更短、更易读的测试,并且与 GUI 工具(如 Quest Code Tester 或 SQLDeveloper 2.1)相比具有更大的灵活性。
回答by FerranB
The last version of SQL Developerincludes an Unit Test suite very interesting.
SQL Developer的最后一个版本包括一个非常有趣的单元测试套件。
回答by borjab
There are a few listed on the wikipedia : http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#PL.2FSQL
维基百科上列出了一些:http: //en.wikipedia.org/wiki/List_of_unit_testing_frameworks#PL.2FSQL
回答by Romain Linsolas
I found this interesting postabout the continuous integration for PL/SQL projects.
It meanly deals with the unit testing of PL/SQL code, using the previously listed utPLSQL framework...
它使用前面列出的 utPLSQL 框架来处理 PL/SQL 代码的单元测试......
回答by GregW
I'm using python py.test
with cx_oracle
to build test scripts for pl/sql packages. Works nice so far.
我使用pythonpy.test
与cx_oracle
构建测试脚本的PL / SQL包。到目前为止效果很好。
回答by user272735
I've recently used successfully unit testing framework of PL/SQL Commonstoolkit (see also author's slides). The toolkit is not yet publicly available (at the time of the writing) but if you drop an email to the authors you'll get a working package (or at least I got).
我最近成功使用了PL/SQL Commons工具包的单元测试框架(另请参阅作者的幻灯片)。该工具包尚未公开(在撰写本文时),但如果您向作者发送电子邮件,您将获得一个工作包(或者至少我得到了)。