Add support for karaf.debug 11/27311/1
authorFlavio Fernandes <ffernand@redhat.com>
Tue, 22 Sep 2015 19:37:44 +0000 (15:37 -0400)
committerFlavio Fernandes <ffernand@redhat.com>
Tue, 22 Sep 2015 19:48:01 +0000 (15:48 -0400)
This is the basic version, a better approach would be to use either
AbstractMdsalTestBase or AbstractConfigTestBase (but the impact is
greater).

Original gerrit [1] caused a regression in that the
keepRuntimeFolder() was done conditionally. That broke things and
had to be reverted.

[1]: https://git.opendaylight.org/gerrit/#/c/26983/

Change-Id: I9fcbdb12fed154d3e2c16908b58bb99418fdc098
Also-By: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java

index dd4ac606398a03633b9f38f31651780830e78581..f568fe0c57b7320e161f8c83e9e102ea16e0adde 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.neutron.e2etest;
 
 import static org.ops4j.pax.exam.CoreOptions.maven;
 import static org.ops4j.pax.exam.CoreOptions.vmOption;
+import static org.ops4j.pax.exam.CoreOptions.when;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
@@ -34,12 +35,16 @@ import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.junit.PaxExam;
 
+import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.cm.ConfigurationAdmin;
 
 @RunWith(PaxExam.class)
 public class ITNeutronE2E {
 
+    private static final String KARAF_DEBUG_PORT = "5005";
+    private static final String KARAF_DEBUG_PROP = "karaf.debug";
+
     @Inject
     private BundleContext bundleContext;
 
@@ -52,6 +57,8 @@ public class ITNeutronE2E {
             // Provision and launch a container based on a distribution of Karaf (Apache ServiceMix).
             // FIXME: need to *NOT* hardcode the version here - it breaks on
             // version bumps
+            when(Boolean.getBoolean(KARAF_DEBUG_PROP))
+                    .useOptions(KarafDistributionOption.debugConfiguration(KARAF_DEBUG_PORT, true)),
             karafDistributionConfiguration()
                 .frameworkUrl(
                     maven()