Toad World® Forums

Exporting Part of a Test

Hi,

Is there any way to export a subset of some of the test cases instead of the whole testF

For large tests the resulting XML files can get very large and I have had problems recently trying to import the resulting file back in.

Thanks

Tony

Hi Tony,

Unfortunately, no, there’s no way to export a subset…

But there’s a workaround. You can split a test definition into multiple test definitions. If it is suitable for you, we can explain how to do this.

Also you may exclude program source code snapshot and test results to make resulting file smaller.

By the way, could you please give us more detail about the problems you have when importing the resulting file back? May be it is possible to fix this.

Thanks,

Roman

Hi Roman,

Thanks for that. Yes I would like to know how to split a test definition.

The error I was getting was an export that was made before a new parameter was added to a procedure, the error text is as follows:

ORA-20099: Unexpected error occurred.

ORA-20000: QCTO00000000000000000261-ORA-00000

ORA-06512: at “QUESTCODETESTER.QU_RUNTIME”, line 1501

ORA-06512: at “QUESTCODETESTER.QU_RUNTIME”, line 2062

ORA-06512: at “QUESTCODETESTER.QU_RUNTIME”, line 2110

ORA-06512: at “QUESTCODETESTER.QU_RUNTIME”, line 2206

ORA-06512: at “QUESTCODETESTER.QU_CODE_COVERAGE_HDR_CP”, line 2780

ORA-06512: at “QUESTCODETESTER.QU_CODE_COVERAGE_HDR_CP”, line 2829

ORA-06512: at “QUESTCODETESTER.QU_CODE_COVERAGE_HDR_XP”, line 24

ORA-06512: at line 1

ORA-06512: at “QUESTCODETESTER.QU_XMLDOM_IMPORT”, line 1106

ORA-06512: at “QUESTCODETESTER.QU_XMLDOM_IMPORT”, line 1972

ORA-06512: at “QUESTCODETESTER.QU_XMLDOM_IMPORT”, line 1083

ORA-06512: at “QUESTCODETESTER.QU_XMLDOM_IMPORT”, line 2030

ORA-06512: at “QUESTCODETESTER.QU_XMLDOM_IMPORT”, line 1083

ORA-06512: at “QUESTCODETESTER.QU_XMLDOM_IMPORT”, line 2030

ORA-06512: at “QUESTCODETESTER.QU_XMLDOM_IMPORT”, line 1083

ORA-06512: at “QUESTCODETESTER.QU_XMLDOM_IMPORT”, line 2030

ORA-06512: at "QUESTCOD

Thanks

Tony

Hi Tony,

It looks like a known issue. Do you use Code Tester 2.5.1? This should be fixed in CT 2.6.

I suggest you either update Code Tester or execute the attached package body (see the link below) in your repository schema (this will fix this issue in CT 2.5.1).

Please note: this fix the issue in export routines, so you will have to re-export your test definition to get the correct resulting XML file.

[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/63/qu_5F00_test_5F00_case_5F00_xp.zip:550:0]

Please let me know, if this helps.

Split test definition function is not documented. I’ll ask Leonid to give you more details if you still need it.

Thanks,

Roman

Hi Roman,

We are currenty using 2.5.1 and are attempting to get hold of 2.6 (have some issues with our account to sort out) - we have only just purchased the product having used the 2.5.1 trial for the last couple of weeks.

Would still like to know how to split a test as that would be very useful.

Thanks

Tony

Hi Tony,

Could you connect Toad to you repository, where you want to split big test defintion, run the following script and send me DBMS_OUTPUT results?

DECLARE

PROCEDURE get_stat (harness_guid_in IN qu_harness_tp.universal_id_t)

IS

 l_harness        qu_harness_tp.qu_harness_rt;

 l_unit_tests     qu_unit_test_tp.qu_unit_test_tc;

 l_test_cases     qu_test_case_tp.qu_test_case_tc;

 l_outcomes       qu_outcome_tp.qu_outcome_tc;

 l_tc_cnt         PLS_INTEGER := 0;

 l_oc_cnt         PLS_INTEGER;

 l_oc_cnt_total   PLS_INTEGER := 0;

 l_tc_av          NUMBER;

 l_oc_av          NUMBER;

BEGIN

 l_harness := qu_harness_qp.onerow (universal_id_in => harness_guid_in);

 IF l_harness.universal_id IS NOT NULL

 THEN

    DBMS_OUTPUT.put_line ('Test definition: ' || l_harness.test_name || '-' || l_harness.universal_id);

    DBMS_OUTPUT.put_line (

       'For: ' || l_harness.program_owner || '.' || l_harness.program_name || ' (' || l_harness.program_type || ')');

    DBMS_OUTPUT.put_line ('Generated test package: ' || l_harness.harness_owner || '.' || l_harness.name);

    l_unit_tests := qu_unit_test_qp.ar_fk_qu_utest_hrn (harness_guid_in => harness_guid_in);

    DBMS_OUTPUT.put_line (l_unit_tests.COUNT || ' unit tests.');

    IF l_unit_tests.COUNT > 0

    THEN

       FOR i IN l_unit_tests.FIRST .. l_unit_tests.LAST

       LOOP

          l_test_cases := qu_test_case_qp.ar_fk_qu_test_guid (unit_test_guid_in => l_unit_tests (i).universal_id);

          l_tc_cnt := l_tc_cnt + l_test_cases.COUNT;

          l_oc_cnt := 0;

          FOR j IN l_test_cases.FIRST .. l_test_cases.LAST

          LOOP

             l_outcomes := qu_outcome_qp.ar_fk_outcome_case (test_case_guid_in => l_test_cases (j).universal_id);

             l_oc_cnt := l_oc_cnt + l_outcomes.COUNT;

          END LOOP;

          DBMS_OUTPUT.put_line (i || ') ' || l_test_cases.COUNT || ' test cases / ' || l_oc_cnt || ' outcomes');

          l_oc_cnt_total := l_oc_cnt_total + l_oc_cnt;

       END LOOP;

       DBMS_OUTPUT.put_line ('Total: ' || l_tc_cnt || ' test cases.');

       l_tc_av := l_tc_cnt;

       l_tc_av := l_tc_av / l_unit_tests.COUNT;

       DBMS_OUTPUT.put_line ('Average: ' || TO_CHAR (l_tc_av, '999.9') || ' test cases/unit test.');

       l_oc_av := l_oc_cnt_total;

       l_oc_av := l_oc_av / l_tc_cnt;

       DBMS_OUTPUT.put_line ('Average: ' || TO_CHAR (l_oc_av, '999.9') || ' outcomes/test case.');

    END IF;

 ELSE

    DBMS_OUTPUT.put_line ('Harness ' || harness_guid_in || ' not found/');

 END IF;

END get_stat;

BEGIN

FOR l_rec IN (SELECT *

             FROM qu_harness h

            WHERE h.program_name <> '*IMPLICIT*')

LOOP

 get_stat (l_rec.universal_id);

END LOOP;

END;

/

I need this statistics in order to come up with my recommendation about splitting.

Thanks,

Leonid

Hi Leonid,

I don’t think I will need to break down my
test, it is not as big as I thought, just the resulting XML. All I need to do
is to remove the code coverage information to be able to export the test or get
the 2.6 upgrade.

Thanks

Tony

Regards,

Tony Roberts

Oracle DBA

Crowder Consulting

Email:
tony.roberts@crowderconsult.co.uk

Tel:

Office: 0151 647 7772 (Main)

Crowder & Co Ltd,
Registered Office: Post Office House, 99-105 Argyle Street, Birkenhead, Merseyside, CH41
6AD.

Telephone: 0151 647 7772

Registered No. 3003604.

This e-mail is
confidential and intended solely for the use of the individual to whom it is
addressed. Any views or opinions presented are solely those of the author and
do not necessarily represent those of Crowder & Co Ltd. If you are not the
intended recipient of this e-mail you may not copy, use, forward or disclose its
contents to any other person ; please delete the message and attachments from
your system.

For more information
visit our web site at http://www.crowderconsult.com/


From:
LeoK [mailto:bounce-LeoK@toadworld.com]

Sent: 21 June 2013 16:50

To: codetester@toadworld.com

Subject: RE: [Code Tester for
Oracle - Discussion Forum] Exporting Part of a Test

RE:
Exporting Part of a Test

Reply by LeoK

Hi Tony,

Could you connect Toad to you repository, where you want to
split big test defintion, run the following script and send me DBMS_OUTPUT
results?

DECLARE

PROCEDURE get_stat (harness_guid_in IN
qu_harness_tp.universal_id_t)

IS

 l_harness      

qu_harness_tp.qu_harness_rt;

 l_unit_tests     qu_unit_test_tp.qu_unit_test_tc;

 l_test_cases    

qu_test_case_tp.qu_test_case_tc;

 l_outcomes      

qu_outcome_tp.qu_outcome_tc;

 l_tc_cnt        

PLS_INTEGER := 0;

 l_oc_cnt        

PLS_INTEGER;

 l_oc_cnt_total   PLS_INTEGER := 0;

 l_tc_av        

NUMBER;

 l_oc_av        

NUMBER;

BEGIN

 l_harness := qu_harness_qp.onerow

(universal_id_in => harness_guid_in);

 IF l_harness.universal_id IS NOT NULL

 THEN

    DBMS_OUTPUT.put_line ('Test

definition: ’ || l_harness.test_name || ‘-’ || l_harness.universal_id);

    DBMS_OUTPUT.put_line (

       'For: ' ||

l_harness.program_owner || ‘.’ || l_harness.program_name || ’ (’ ||
l_harness.program_type || ‘)’);

    DBMS_OUTPUT.put_line ('Generated

test package: ’ || l_harness.harness_owner || ‘.’ || l_harness.name);

    l_unit_tests :=

qu_unit_test_qp.ar_fk_qu_utest_hrn (harness_guid_in => harness_guid_in);

    DBMS_OUTPUT.put_line

(l_unit_tests.COUNT || ’ unit tests.’);

    IF l_unit_tests.COUNT > 0

    THEN

       FOR i IN

l_unit_tests.FIRST … l_unit_tests.LAST

       LOOP

          l_test_cases :=

qu_test_case_qp.ar_fk_qu_test_guid (unit_test_guid_in => l_unit_tests
(i).universal_id);

          l_tc_cnt :=

l_tc_cnt + l_test_cases.COUNT;

          l_oc_cnt := 0;

          FOR j IN

l_test_cases.FIRST … l_test_cases.LAST

          LOOP

l_outcomes := qu_outcome_qp.ar_fk_outcome_case (test_case_guid_in =>
l_test_cases (j).universal_id);

l_oc_cnt := l_oc_cnt + l_outcomes.COUNT;

          END LOOP;

DBMS_OUTPUT.put_line (i || ‘) ’ || l_test_cases.COUNT || ’ test cases / ’ ||
l_oc_cnt || ’ outcomes’);

          l_oc_cnt_total

:= l_oc_cnt_total + l_oc_cnt;

       END LOOP;

       DBMS_OUTPUT.put_line

(‘Total: ’ || l_tc_cnt || ’ test cases.’);

       l_tc_av := l_tc_cnt;

       l_tc_av := l_tc_av /

l_unit_tests.COUNT;

       DBMS_OUTPUT.put_line

(‘Average: ’ || TO_CHAR (l_tc_av, ‘999.9’) || ’ test cases/unit test.’);

       l_oc_av :=

l_oc_cnt_total;

       l_oc_av := l_oc_av /

l_tc_cnt;

       DBMS_OUTPUT.put_line

(‘Average: ’ || TO_CHAR (l_oc_av, ‘999.9’) || ’ outcomes/test case.’);

    END IF;

 ELSE

    DBMS_OUTPUT.put_line ('Harness ' ||

harness_guid_in || ’ not found/’);

 END IF;

END get_stat;

BEGIN

FOR l_rec IN (SELECT *

FROM qu_harness h

            WHERE

h.program_name <> ‘IMPLICIT’)

LOOP

 get_stat (l_rec.universal_id);

END LOOP;

END;

/

I need this statistics in order to come up with
my recommendation about splitting.

Thanks,

Leonid

To reply, please
reply-all to this email.

Stop
receiving emails on this subject.

Or Unsubscribe
from General notifications altogether.

Code Tester for Oracle - Discussion Forum

Flag
this post as spam/abuse.

Crowder & Co Ltd, Registered Office: Post Office House, 99-105 Argyle Street, Birkenhead, Merseyside, CH41 6AD.

Telephone: 0151 647 7772

Registered in England and Wales, No. 3003604. VAT No. GB618952020

This e-mail is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Crowder & Co Ltd. If you are not the intended recipient of this e-mail you may not copy, use, forward or disclose its contents to any other person ; please delete the message and attachments from your system.

For more information visit our web site at http://www.crowderconsult.co.uk