<?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 Testing class methods using an ABAP Unit test class in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238042#M1525900</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ABAPers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a new Z-class (ex: ZCL_REP) and also created a Z-dialog (SAPMZREP) that will be using this object class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also created an ABAP Unit test class in order to test my class methods.  I am wondering where should this AU test class code reside... the options I see are:&lt;/P&gt;&lt;P&gt;a) inside my module pool SAPMZREP as an include&lt;/P&gt;&lt;P&gt;b) in a different Z-program  completely&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where is the best place to store this test code ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;José&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Sep 2010 12:57:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-09-10T12:57:23Z</dc:date>
    <item>
      <title>Testing class methods using an ABAP Unit test class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238042#M1525900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ABAPers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a new Z-class (ex: ZCL_REP) and also created a Z-dialog (SAPMZREP) that will be using this object class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also created an ABAP Unit test class in order to test my class methods.  I am wondering where should this AU test class code reside... the options I see are:&lt;/P&gt;&lt;P&gt;a) inside my module pool SAPMZREP as an include&lt;/P&gt;&lt;P&gt;b) in a different Z-program  completely&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where is the best place to store this test code ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;José&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 12:57:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238042#M1525900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-10T12:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Testing class methods using an ABAP Unit test class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238043#M1525901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends on how you want to compile it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you put the include in the module pool, if you change something in the module pool that causes a syntax error in the test class, you must fix the test class to finish compilation of the code. (You should update your test class anyway so it shouldn't be an issue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you put the include outside the module pool, you may have inconsistancies between the abap unit class and the tested code but you don't necessarily have to keep the test class updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At first I thought it didn't matter but after writing it out, I think it's best to keep it in the module pool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 13:08:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238043#M1525901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-10T13:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Testing class methods using an ABAP Unit test class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238044#M1525902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would say, inside your ZCL_REP class as local test class. You should have all the logic which you want to test using the Unit Test inside your class ZCL_REP.&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, 10 Sep 2010 13:17:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238044#M1525902</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2010-09-10T13:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Testing class methods using an ABAP Unit test class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238045#M1525903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naimesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your answer and I like the idea of keeping "Unit Testing code" close to my Object Class ZCL_REP since this is exactly what my test code is actually testing.  However, how can I attach my test code to the object class since an object class, as far as I know, is not a "program" where I can attach an include to it.  When I am in "Class Builder" or "Object navigator (SE80)", can you tell me how I can insert my test class code to the "ocject class" itself... ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;José&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 13:26:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238045#M1525903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-10T13:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Testing class methods using an ABAP Unit test class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238046#M1525904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are on ABAP Release 700 or higher, you can use the option Utilities &amp;gt; Test Class Generation in the SE24. This will give you popup to select the "production" ( - testable) method for which you want to create the Local Test Class. Once the test class is generated, you can navigate to test class using Go to &amp;gt; Local Test Classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are on ABAP Release 640, you don't have the Local Test Class include nor the Test class generation wizard. So, you need to use the "Local Types" to define your test class and "Implementation" to implement the test class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to get an access to Private attribute or methods, you need to use the FRIENDS. Check answer from Klaus in the thread &lt;SPAN __jive_macro_name="thread" id="1759810"&gt;&lt;/SPAN&gt;.&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, 10 Sep 2010 13:42:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238046#M1525904</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2010-09-10T13:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Testing class methods using an ABAP Unit test class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238047#M1525905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked and solved my problem... Thanks a lot !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 18:06:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/testing-class-methods-using-an-abap-unit-test-class/m-p/7238047#M1525905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-23T18:06:38Z</dc:date>
    </item>
  </channel>
</rss>

