从一个模式到另一个模式执行 UTPLSQL 测试时遇到错误
Encountered Error while executing UTPLSQL test from one schema to another
我连接到 'user1' 并执行以下操作,utplsql 安装在 'utp' 中。我从 http://utplsql.sourceforge.net/.
安装了 utplsql 框架
BEGIN
utp.utAssert.eq('test',1,1);
END;
/
错误输出
ORA-02291: integrity constraint (UTP.UTR_ERROR_OUTCOME_FK) violated - parent key not found
ORA-06512: at "UTP.UTRERROR", line 149
ORA-06512: at "UTP.UTRERROR", line 324
ORA-06512: at "UTP.UTROUTCOME", line 146
ORA-01400: cannot insert NULL into ("UTP"."UTR_OUTCOME"."RUN_ID")
ORA-06512: at "UTP.UTRESULT2", line 72
ORA-06512: at "UTP.UTASSERT2", line 137
ORA-06512: at "UTP.UTASSERT2", line 541
ORA-06512: at "UTP.UTASSERT", line 118
ORA-06512: at line 2
但是
不是直接 运行ning utAssert.eq
,而是将其放入测试包中,然后 运行 that utPLSQL.test
或 utPLSQL.run
。 (我建议完成 Getting Started section of the utPLSQL documentation)。
定义测试包
CREATE OR REPLACE PACKAGE ut_simple IS
PROCEDURE ut_setup;
PROCEDURE ut_teardown;
PROCEDURE ut_simple_test;
END;
CREATE OR REPLACE PACKAGE BODY ut_simple IS
PROCEDURE ut_setup IS
BEGIN
NULL;
END;
PROCEDURE ut_teardown IS
BEGIN
NULL;
END;
PROCEDURE ut_simple_test IS
BEGIN
utp.utAssert.eq('test',1,1);
END;
END;
运行 测试
exec utp.utplsql.run ('ut_simple');
我连接到 'user1' 并执行以下操作,utplsql 安装在 'utp' 中。我从 http://utplsql.sourceforge.net/.
安装了 utplsql 框架BEGIN
utp.utAssert.eq('test',1,1);
END;
/
错误输出
ORA-02291: integrity constraint (UTP.UTR_ERROR_OUTCOME_FK) violated - parent key not found
ORA-06512: at "UTP.UTRERROR", line 149
ORA-06512: at "UTP.UTRERROR", line 324
ORA-06512: at "UTP.UTROUTCOME", line 146
ORA-01400: cannot insert NULL into ("UTP"."UTR_OUTCOME"."RUN_ID")
ORA-06512: at "UTP.UTRESULT2", line 72
ORA-06512: at "UTP.UTASSERT2", line 137
ORA-06512: at "UTP.UTASSERT2", line 541
ORA-06512: at "UTP.UTASSERT", line 118
ORA-06512: at line 2
但是
不是直接 运行ning utAssert.eq
,而是将其放入测试包中,然后 运行 that utPLSQL.test
或 utPLSQL.run
。 (我建议完成 Getting Started section of the utPLSQL documentation)。
定义测试包
CREATE OR REPLACE PACKAGE ut_simple IS
PROCEDURE ut_setup;
PROCEDURE ut_teardown;
PROCEDURE ut_simple_test;
END;
CREATE OR REPLACE PACKAGE BODY ut_simple IS
PROCEDURE ut_setup IS
BEGIN
NULL;
END;
PROCEDURE ut_teardown IS
BEGIN
NULL;
END;
PROCEDURE ut_simple_test IS
BEGIN
utp.utAssert.eq('test',1,1);
END;
END;
运行 测试
exec utp.utplsql.run ('ut_simple');