<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ABAP Unit Tests in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560950#M1431317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a class Z_XY and then I wrote an ABAP Unit Test class Z_XY_TEST with several test methods which test all methods of class Z_XY.&lt;/P&gt;&lt;P&gt;In principle everything works fine. All tests deliver the results I expect when I run the unit test on the test class. &lt;/P&gt;&lt;P&gt;The only thing that confuses me is the warning "The global test class &amp;lt;Z_XY_TEST&amp;gt; is not abstract." that appears in the dialog "ABAP Unit: Result Display". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please take a look at the documentation: &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_70/en/ABAPCLASS_FOR_TESTING.htm" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABAPCLASS_FOR_TESTING.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In particular:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As of Release 7.0, you can create global test classes for re-using complex test preparations. Global test classes should always be abstract and can only be used in local test classes. All instance methods of a global test class are currently automatic test methods. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To navigate to a local test class, open your ABAP Class &amp;gt; Goto &amp;gt; Local Test Classes (NW 7.0)&lt;/P&gt;&lt;P&gt;or Goto &amp;gt; Local Definitions/Implementations &amp;gt; Local Test Classes (NW 7.0.2+)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Hristo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jan 2010 15:37:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-22T15:37:48Z</dc:date>
    <item>
      <title>ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560948#M1431315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to ABAP. Since some days I'm evaluating ABAP Unit Tests (for ABAP Objects). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a class Z_XY and then I wrote an ABAP Unit Test class Z_XY_TEST with several test methods which test all methods of class Z_XY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In principle everything works fine. All tests deliver the results I expect when I run the unit test on the test class. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing that confuses me is the warning "The global test class &amp;lt;Z_XY_TEST&amp;gt; is not abstract." that appears in the dialog "ABAP Unit: Result Display". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This warning seems to prevent the test from getting a green "LED" on the highest level ("TASK..."). Additionally, the tests cannot be run if the "Limit of Risk Level" is set to another value as "Harmless" because: "No execution as acutal risk level is too high", so that I cannot use another risk level limit than "Harmless".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I switch the instantiation of the test class to "Abstract" absolute no tests are executed (not surprising...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in anticipation,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eike Menking&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Eike Menking on Jan 22, 2010 4:06 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2010 15:06:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560948#M1431315</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-22T15:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560949#M1431316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you use the Global Test class, ideally you should do is:&lt;/P&gt;&lt;P&gt;Create your Production Class (Z_XY)&lt;/P&gt;&lt;P&gt;Create your Global Text Class by selecting the Unit Test Class (Z_XY_TEST). This must not be FINAL.&lt;/P&gt;&lt;P&gt;You create the test methods, which we would like to execute. Make them as Protected.&lt;/P&gt;&lt;P&gt;Now, go to Production Class and create local test class. Use Utilities &amp;gt; Test Class Generation&lt;/P&gt;&lt;P&gt;In your generated local test class definition, inherit it from the Global Test Class Z_XY_TEST).&lt;/P&gt;&lt;P&gt;Implement new methods or redefine your existing methods.&lt;/P&gt;&lt;P&gt;Run the Unit Test .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally, the global test class should be Abstract as, you are not supposed to instantiate that class. ABAP Unit Framework would do it for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried all these steps (with Abstract and without abstract) but I didn't get the specified information message. Are you doing something else ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2010 15:29:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560949#M1431316</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2010-01-22T15:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560950#M1431317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a class Z_XY and then I wrote an ABAP Unit Test class Z_XY_TEST with several test methods which test all methods of class Z_XY.&lt;/P&gt;&lt;P&gt;In principle everything works fine. All tests deliver the results I expect when I run the unit test on the test class. &lt;/P&gt;&lt;P&gt;The only thing that confuses me is the warning "The global test class &amp;lt;Z_XY_TEST&amp;gt; is not abstract." that appears in the dialog "ABAP Unit: Result Display". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please take a look at the documentation: &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_70/en/ABAPCLASS_FOR_TESTING.htm" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABAPCLASS_FOR_TESTING.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In particular:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As of Release 7.0, you can create global test classes for re-using complex test preparations. Global test classes should always be abstract and can only be used in local test classes. All instance methods of a global test class are currently automatic test methods. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To navigate to a local test class, open your ABAP Class &amp;gt; Goto &amp;gt; Local Test Classes (NW 7.0)&lt;/P&gt;&lt;P&gt;or Goto &amp;gt; Local Definitions/Implementations &amp;gt; Local Test Classes (NW 7.0.2+)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Hristo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2010 15:37:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560950#M1431317</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-22T15:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560951#M1431318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your helpful answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My failure was: I created an ABAP Unit Test class on my own instead of using the "Utilities-&amp;gt;Test Class Generation" and implemented all tests on my own. Works as well except for this "Abstract Global Test Class"-Problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said it before: I'm new to the ABAP world...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eike Menking&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2010 16:25:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560951#M1431318</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-22T16:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560952#M1431319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Eike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the ABAP Unit philosophy is that local unit test classes reside within the program they test. Global Test Classes are intended solely for reuse purposes. An global test class that is not abstract is most likely checking something else. To prevent people to write test which don´t adhere to the unit test philosphy of ABAP Unit there is this little reminder :)=&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;  Klaus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Mar 2010 18:17:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-unit-tests/m-p/6560952#M1431319</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2010-03-06T18:17:22Z</dc:date>
    </item>
  </channel>
</rss>

