Application Development and Automation 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: 
Read only

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

schmelto
Active Participant
0 Likes
2,675

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
Read only

joltdx
Active Contributor
2,190

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
Read only

joltdx
Active Contributor
2,191

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. 🙂

Read only

schmelto
Active Participant
0 Likes
2,190

Exactly what I looked for thanks for sharing 🙂

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

Read only

FredericGirod
Active Contributor
2,190

Hi made some videos for playing about Abap Unit.

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

Read only

schmelto
Active Participant
0 Likes
2,190

Hey frdric.girod thanks for sharing the videos.