Toad World® Forums

Run Test by coding


#1

Hello,

I would run this code :

DECLARE

BEGIN

qu_test.run_test_for (owner_in => ‘HORIZON’,

NAME_IN => ‘UDQ##TEST_PASSERELLE_PR’,

);

END;

l_result qu_config.maxvarchar2; result_out => l_result***DBMS_OUTPUT.put_line*** ('Overall result of test: ’ || l_result);

And I have this error :

ORA-20000: Error Code = -6550
Error Message = Unable to execute dynamic block of code for test initialization.

DYNAMIC_BLOCK = BEGIN “HORIZON”.“Q##UDQ##TEST_PASSERELLE_PR”.Q##skip_tc_execution.DELETE;

Do you have an idea?

Thanks,
Christophe


#2

Can you please verify that the “HORIZON”.“Q##UDQ##TEST_PASSERELLE_PR” exists and contains in its package specification the Q##skip_tc_execution collection?

SF


#3

CREATE OR REPLACE PACKAGE HORIZON.“Q##UDQ##TEST_PASSERELLE_PR” AUTHID DEFINER

/*

| Automated Test Package for UDQ##TEST_PASSERELLE_PR

|

| Generated by Quest Code Tester for Oracle.

| Visit the user community at http://unittest.inside.quest.com/index.jspa

| Generated on 2010-06-30T11:57:52

*/

IS

/* Global array for skipping test cases. */

TYPE skip_tc_aat IS TABLE OF BOOLEAN INDEX BY VARCHAR2(32767);

Q##skip_tc_execution skip_tc_aat;

/* Global variable for quick test setting. */

PROCEDURE qcto#assert_null (outcome_guid_in IN VARCHAR2, is_null_in

PROCEDURE qcto#assert_null (outcome_guid_in IN VARCHAR2, is_null_in

PROCEDURE qcto#assert_this (outcome_guid_in IN VARCHAR2, msg_in

PROCEDURE qcto#report_result (result_guid_in IN VARCHAR2, status_in

PROCEDURE Q##setup;

FUNCTION qcto#error_info RETURN VARCHAR2;

PROCEDURE Q##teardown;

PROCEDURE Q##UDQ##TEST_PASSERELLE_PR;

Hello,

Yes this package exist and the spec is :

______Q##quick_test_only BOOLEAN DEFAULT FALSE;IN BOOLEAN, check_type_in IN VARCHAR2, raise_exc_in IN BOOLEAN := FALSE, add_to_message_in IN VARCHAR2 DEFAULT NULL );IN BOOLEAN, check_type_in IN VARCHAR2, raise_exc_in IN BOOLEAN, add_to_message_in IN BOOLEAN);IN VARCHAR2, check_this_in IN BOOLEAN, null_ok_in IN BOOLEAN := FALSE, raise_exc_in IN BOOLEAN := FALSE);IN VARCHAR2, description_in IN VARCHAR2);


#4

Christophe,

I just noticed that the error message you showed me had this code in it:

DYNAMIC_BLOCK = BEGIN “HORIZON”.“Q##UDQ##TEST_PASSERELLE_PR”.Q##skip_tc_execution.DELETE;

It is, in other words, missing an END;.

Can you please confirm that this is not a problem of a partial copy/paste into this thread? Do you really not see an “END;” as part of the message reporting on that dynamic block? That would certainly cause problems.

Also, what happens when you run this block in Toad or whatever you use:

BEGIN
“HORIZON”.“Q##UDQ##TEST_PASSERELLE_PR”.q##skip_tc_execution.delete;
END;

Do you see errors here as well?

SF


#5

Ok, thanks to you I found the problem…

I run test from QCTO but the user QCTO didn’t have the right to execute Q##UDQ##TEST_PASSERELLE_PR on HORIZON.

Thank you,
Christophe


#6

Ah, so that was it…well, I am glad it got sorted, but I would like to understand better how this happened. If you don’t mind,I have a few questions:

  1. Were you connected to HORIZON when you created the test, or were you connected to a schema with execute authority on the program you were testing?

  2. Did you specify a different schema to own the test package?

Thanks, SF


#7

Hello,

In fact, I’m connected to HORIZON when I run my tests.
But, I tryed to run test by code on QCTO.

I wanted to create test reports automatically. From QCTO, launch every reports from every schema of tests.

So, I can run all my schemas tests from QCTO, or run 1 report by schema.

Thanks,
Christophe


#8

If you want to run all tests from QCTO, you need to make it a sort of “super schema” - after all, to run your code from that schema, it must have execute authority on your code.

You will need to execute grant statements for all code or grant execute any procedure (I think that is the privilege) so that Code Tester can do what you want it to do.

Does this make sense?


#9

If you want to run all tests from QCTO, you need to make it a sort of “super schema” - after all, to run your code from that schema, it must have execute authority on your code.

You will need to execute grant statements for all code or grant execute any procedure (I think that is the privilege) so that Code Tester can do what you want it to do.

Does this make sense?

SF