Improve the SFT log for features.xml/feature.xml 81/51381/1
authorStephen Kitt <skitt@redhat.com>
Fri, 3 Feb 2017 09:21:28 +0000 (10:21 +0100)
committerStephen Kitt <skitt@redhat.com>
Fri, 3 Feb 2017 09:21:28 +0000 (10:21 +0100)
Instead of logging an error when features.xml or feature.xml aren't
found, check whether we find any test children and log an error if
there aren't any globally.

Change-Id: I21fe04911cbf350b33c28e2fcb79422f631c6ac4
Signed-off-by: Stephen Kitt <skitt@redhat.com>
features4-test/src/main/java/org/opendaylight/odlparent/featuretest/PerRepoTestRunner.java

index eea226a5fd2cc1c3a872a8ddc354421745968e7f..b44ef832484aa0e361af1048064c48791f4044c4 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.odlparent.featuretest;
 import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import javax.xml.bind.JAXBException;
 import org.apache.karaf.features.internal.model.Feature;
@@ -56,10 +57,11 @@ public class PerRepoTestRunner extends ParentRunner<PerFeatureRunner> {
                     final boolean recursive = Boolean.getBoolean(REPO_RECURSE);
                     LOG.info("Creating test runners for repoUrl {} recursive {}", repoUrl, recursive);
                     children.addAll(runnersFromRepoUrl(repoUrl, testClass, recursive));
-                } else {
-                    LOG.error("getClass().getClassLoader().getResource(\"{}\") returned null", filename);
                 }
             }
+            if (children.isEmpty()) {
+                LOG.error("No features found to test; looked for {}", Arrays.toString(FEATURES_FILENAMES));
+            }
         } catch (final IOException | JAXBException e) {
             throw new InitializationError(e);
         }