A valid class instance or static class name is required for

Posted by bstaunton on 19-Mar-2018 12:20

I get the error mentioned in the title whenever I run an ABL Test Class, using ABL Unit, which I made to test another class. The test passes perfectly in another project but I've now imported it into my work project and I get that error, though the test and the class being tested both compile fine.

Googling leads me to this article https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvoop/dynamically-invoking-a-method-at-run-time.html but I haven't used the DYNAMIC-INVOKE statement anywhere in either the test or the tested class. Anyone have any ideas what's causing this?

Thanks.

Posted by Fabian Schueler on 24-Jul-2018 03:22

A coworker of mine had this error recently. The problem was, that the testclass didn't have the package-path in the CLASS-definition. Since you said you imported it, this might be your problem as well.

Wrong: CLASS <classname> :

Correct: CLASS <package>.[...].<classname> :

Maybe yours isn't missing, but incorrect?

All Replies

Posted by Peter Judge on 19-Mar-2018 12:27

At a first guess, is there a PROPATH issue? Is the r-code where you expect it to be?

you can inspect/compare the .propath files between projects.

you can also "export" run configurations by choosing "shared file" in the run config's Common tab. If you copy that file into another project it should* work

* should being dependent on how you've constructed various file paths. i would recommend using the PDSOE variables like @{ROOT} etc to make the configs portable.

Posted by Laura Stern on 19-Mar-2018 12:29

It clearly sounds like you are getting the wrong error message, so that is probably a bug.

But the question is: why are you getting an error? Is the class in a package?  When you moved the class into your work project, did you maintain the same directory structure?  Are you running from r-code?

Posted by bstaunton on 20-Mar-2018 04:54

Hi, thanks for the answers. On my personal project the r-code was stored in the same folder as the CLS files, however in the work project there is a separate r-code folder, outside of the project, it seems. Within this folder, there seems to be the same file structure (com/tests). I highly doubt I'll be allowed to alter the r-code destination or the PROPATH for the whole project anyway. I'm still getting the error this morning as well.

EDIT: I've created a new project in the same workspace as the work project. In this one the r-code is in the same folder as the .cls files. I still get the same error when running the tests. So I don't think that's what causing the problem.

Posted by bstaunton on 22-Mar-2018 04:25

Hi, I still need help with this pretty badly, does anyone have any ideas?

Posted by Brian K. Maher on 22-Mar-2018 04:44

I think you should open a case with tech support.
 

Posted by bstaunton on 22-Mar-2018 04:51

OK, I will Brian. Thanks.

Posted by Fabian Schueler on 24-Jul-2018 03:22

A coworker of mine had this error recently. The problem was, that the testclass didn't have the package-path in the CLASS-definition. Since you said you imported it, this might be your problem as well.

Wrong: CLASS <classname> :

Correct: CLASS <package>.[...].<classname> :

Maybe yours isn't missing, but incorrect?

Posted by Jeffrey Fierens on 03-Jul-2019 14:19

I think your 'another class' is causing a runtime error (because of different startup parameters in your new project perhaps?).

Try running your test class as a Progress OpenEdge Application instead, this should provide you with a dialog box with the runtime error info.

Posted by Lennart Tranborg on 03-Oct-2019 11:00

I had the same problem and this solved it for me. When I fixed the my test class from CLASS TestBePortfolio: to CLASS UnitTest.UncommittedTest.TestBePortfolio: it worked fine.

This thread is closed