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: 

How to add Unit Test Class to global Class in Eclipse?

schmelto
Active Participant
0 Kudos

I want to add unit tests to a global class using eclipse.

CLASS zcl_fi_edi_payext_2441 DEFINITION
  PUBLIC
  CREATE PUBLIC .
" some coding
ENDCLASS.

CLASS zcl_fi_edi_payext_2441 IMPLEMENTATION.
" some coding
ENDCLASS.

CLASS test DEFINITION FOR TESTING RISK LEVEL HARMLESS.
ENDCLASS.

CLASS test IMPLEMENTATION.
ENDCLASS.

But it throws the error message: "The statement CLASS ... DEFINITION ... . is unexpected"

How can I solve this issue?

Thanks in advance!

1 ACCEPTED SOLUTION

joltdx
Active Contributor

Hi Tom!

In ADT in Eclipse, there are a couple of tabs at the BOTTOM of the editor...

Global Class, Class--relevant Local Types, Local Types, Test Classes and Macros.

So, that's where to go to enter your test classes. 🙂

4 REPLIES 4

joltdx
Active Contributor

Hi Tom!

In ADT in Eclipse, there are a couple of tabs at the BOTTOM of the editor...

Global Class, Class--relevant Local Types, Local Types, Test Classes and Macros.

So, that's where to go to enter your test classes. 🙂

schmelto
Active Participant
0 Kudos

Exactly what I looked for thanks for sharing 🙂

If you once see that tabs you can't unsee them.

FredericGirod
Active Contributor

Hi made some videos for playing about Abap Unit.

https://blogs.sap.com/2021/02/22/abap-unit-learning-session/

schmelto
Active Participant
0 Kudos

Hey frdric.girod thanks for sharing the videos.