[INFRAUTILS-12] New integration test utilities Created: 15/May/17  Updated: 05/Oct/21  Resolved: 05/Oct/21

Status: Resolved
Project: infrautils
Component/s: General
Affects Version/s: Nitrogen
Fix Version/s: None

Type: Improvement Priority: Medium
Reporter: Michael Vorburger Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Relates
relates to ODLPARENT-262 SingleFeatureTest needs to be safe to... In Progress

 Description   

As-is currently, it takes too much copy/paste-ing, of both POM XML as well as Java code, to correctly create Pax Exam Integration Tests which in Karaf in ODL.

Caveat emptor: ITs should ONLY be written if what you need test coverage for cannot be done with a "Component Test", see https://wiki-archive.opendaylight.org/view/BestPractices/Component_Tests; but sometimes they are useful...

The org.opendaylight.controller.config.it.base.AbstractConfigTestBase is a previous attempt at something similar (and there may be others that I'm not aware of?), but it has limitations (incl. its use of CSS, and only 1 feature; also no base POM), so I'll propose a new one in infrautils.

It will attempt to enforce a much cleaner classpath than most of our current ITs have; it's just wrong to have an entire Karaf and the features themselves on the test's CP; all that is loaded dynamically, that's the whole point of Pax Exam; only the IT itself, a small API surface of what you want to test, but not impls, and some Pax utils should be on the CP...

If I can, I may even make the new one able to automatically support running the same IT under both Karaf 3 as well as Karaf 4, that would be cool.

It may have other built-in goodies in the future; e.g. something to deal with PITA of referencing utility classes from tests, such as something like say the infrautils LogRule or Google Truth, etc. (Due to the Pax Exam classloading, that's a real PITA.)

I'm also missing a utility to be able to easily test Karaf CLI commands; I'll probably eventually add that as part of this as well.



 Comments   
Comment by Michael Vorburger [ 15/May/17 ]

https://git.opendaylight.org/gerrit/#/c/56898/ has first iteration (more later)

Comment by Robert Varga [ 05/Oct/21 ]

I do not believe we should be going the Guice route this way. We have ODLPARENT-262, which should allow us to easily package up a feature.xml and test that. A test can be written as a normal OSGi DS application and launched either in a dynamic or static container.

Generated at Wed Feb 07 20:02:02 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.