Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unit Class Test Method will not run

Former Member
0 Kudos

I created a Test Class in SE24, and created one method with the following code:


private section.

  methods CREATE_ISTREAM_XSTRING_TEST
  for testing .
  methods SETUP .
  methods TEARDOWN .


METHOD create_istream_xstring_test

   CALL METHOD CL_AUNIT_ASSERT=>FAIL
       EXPORTING
         MSG    = 'Deliberate fail'
         LEVEL  = 2
*        QUIT   = METHOD
*        DETAIL =
        .
ENDMETHOD.

For some reason it won't hit this code and the status window informs me that

Unit tests processed successfully; 1 programs, 0 classes, 0 methods

When I run a unit test.

Why won't the method get executed when testing?

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

Have you created your a Local test class inherited from this Global Test class?

Steps to consider:

1. Create a Global Test class

2. Create a Model Class which has all your main logic

3. Create a Local test class inherited from the Global Test Class (cerated in Step 1)

4. Now try to do the unit test in the Model Class

Regards,

Naimesh Patel

2 REPLIES 2

naimesh_patel
Active Contributor
0 Kudos

Have you created your a Local test class inherited from this Global Test class?

Steps to consider:

1. Create a Global Test class

2. Create a Model Class which has all your main logic

3. Create a Local test class inherited from the Global Test Class (cerated in Step 1)

4. Now try to do the unit test in the Model Class

Regards,

Naimesh Patel

0 Kudos

Hi,

I solved the problem by using the Wizard to crate an ABAP Unit test class.

BR,

Tony.

Edited by: Anthony Bateman on Aug 28, 2009 12:31 PM