SingleFeatureTest now fails if diag CLI command would have failed 01/48901/33
authorMichael Vorburger <vorburger@redhat.com>
Thu, 1 Dec 2016 16:35:37 +0000 (17:35 +0100)
committerStephen Kitt <skitt@redhat.com>
Mon, 16 Jan 2017 08:32:58 +0000 (08:32 +0000)
commit837d291d987bc1d7884a424b899cddc2b4e28dc2
tree294aa85b9cb9ee22fecb207bda3df31a6bd31dba
parenta2ef47c962bc1fefe5f3f0ae53ba0b65241ac329
SingleFeatureTest now fails if diag CLI command would have failed

This will help us detect a whole range of issues, notably any
blueprint related problems, much earlier in our development cycle than
we currently are.

The log contains details re. OSGi missing and available services.

NB: This change includes a (surprisingly long!) "black list" of features
known to be broken right now.  These ideally should all be fixed, and
the black list removed.

IMPL: The new bundles-test was introduced here because I ran into Pax
Exam related ClassNotFoundException, which I could not to resolve any
other way.  Basically, the problem is that the "probe" bundle which Pax
Exam creates on the fly includes the SingleFeatureTest class, and not
classes it references.  In other tests like IT this works, possibly
because Pax Exam somehow finds them in src/test/java; but not from
features-test.  (The currently existing utility classes next to
SingleFeatureTest in features-test probably only work because those run
outside the probe?)

This also did not help, because it's never called, because the
ClassNotFoundException happened earlier, on loading of the class
already:

import org.osgi.framework.Constants;

@ProbeBuilder
public TestProbeBuilder probeConfiguration(TestProbeBuilder probe) {
    LOG.info("probeConfiguration()");
    probe.setHeader(Constants.DYNAMICIMPORT_PACKAGE, "*");
    probe.setHeader(Constants.EXPORT_PACKAGE,
"org.opendaylight.odlparent.featuretest");
    probe.setHeader(IMPORT_PACKAGE,
"org.opendaylight.odlparent.featuretest");
    return probe;
}

Change-Id: I328e503703770aab539fdf1f0a7804ba676596ac
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
15 files changed:
bundles-test/pom.xml [new file with mode: 0644]
bundles-test/src/main/java/org/opendaylight/odlparent/bundlestest/BundleDiagInfos.java [new file with mode: 0644]
bundles-test/src/main/java/org/opendaylight/odlparent/bundlestest/BundleServiceSummaryMatcher.java [new file with mode: 0644]
bundles-test/src/main/java/org/opendaylight/odlparent/bundlestest/ServiceReferenceUtil.java [new file with mode: 0644]
bundles-test/src/main/java/org/opendaylight/odlparent/bundlestest/SystemState.java [new file with mode: 0644]
bundles-test/src/main/java/org/opendaylight/odlparent/bundlestest/TestBundleDiag.java [new file with mode: 0644]
bundles-test/src/main/java/org/opendaylight/odlparent/bundlestest/package-info.java [new file with mode: 0644]
bundles-test/src/test/java/org/opendaylight/odlparent/bundlestest/ServiceReferenceUtilTest.java [new file with mode: 0644]
feature-repo-parent/pom.xml
features-parent/pom.xml
features-test/pom.xml
features-test/src/main/java/org/opendaylight/odlparent/featuretest/PerFeatureRunner.java
features-test/src/main/java/org/opendaylight/odlparent/featuretest/SingleFeatureTest.java
odlparent/pom.xml
pom.xml