FELIX-1488 Since the reassignement of configuration is desired but not
actually trigger (according to BJ Hargrave) the test cases are modified
to cope with or without configuration reassignment. Currently the tests
run with expecting reassignment disabled.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@806078 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/configadmin/src/test/java/org/apache/felix/cm/integration/MultiServicePIDTest.java b/configadmin/src/test/java/org/apache/felix/cm/integration/MultiServicePIDTest.java
index f0c5058..9ff808a 100644
--- a/configadmin/src/test/java/org/apache/felix/cm/integration/MultiServicePIDTest.java
+++ b/configadmin/src/test/java/org/apache/felix/cm/integration/MultiServicePIDTest.java
@@ -166,8 +166,23 @@
delay();
- // expect configuration reassigned
- TestCase.assertEquals( bundle2.getLocation(), config.getBundleLocation() );
+ /*
+ * According to BJ Hargrave configuration is not re-dispatched
+ * due to setting the bundle location.
+ * <p>
+ * Therefore, we have two sets one with re-dispatch expectation and
+ * one without re-dispatch expectation.
+ */
+ if ( REDISPATCH_CONFIGURATION_ON_SET_BUNDLE_LOCATION )
+ {
+ // expect configuration reassigned
+ TestCase.assertEquals( bundle2.getLocation(), config.getBundleLocation() );
+ }
+ else
+ {
+ // expected configuration unbound
+ TestCase.assertNull( config.getBundleLocation() );
+ }
// remove the configuration for good
deleteConfig( pid );
@@ -232,8 +247,23 @@
delay();
- // config has to be reassigned
- TestCase.assertEquals( bundle2.getLocation(), config.getBundleLocation() );
+ /*
+ * According to BJ Hargrave configuration is not re-dispatched
+ * due to setting the bundle location.
+ * <p>
+ * Therefore, we have two sets one with re-dispatch expectation and
+ * one without re-dispatch expectation.
+ */
+ if ( REDISPATCH_CONFIGURATION_ON_SET_BUNDLE_LOCATION )
+ {
+ // expect configuration reassigned
+ TestCase.assertEquals( bundle2.getLocation(), config.getBundleLocation() );
+ }
+ else
+ {
+ // expected configuration unbound
+ TestCase.assertNull( config.getBundleLocation() );
+ }
}
else if ( bundle2.getLocation().equals( config.getBundleLocation() ) )
{
@@ -250,8 +280,23 @@
delay();
- // config has to be reassigned
- TestCase.assertEquals( bundle.getLocation(), config.getBundleLocation() );
+ /*
+ * According to BJ Hargrave configuration is not re-dispatched
+ * due to setting the bundle location.
+ * <p>
+ * Therefore, we have two sets one with re-dispatch expectation and
+ * one without re-dispatch expectation.
+ */
+ if ( REDISPATCH_CONFIGURATION_ON_SET_BUNDLE_LOCATION )
+ {
+ // expect configuration reassigned
+ TestCase.assertEquals( bundle.getLocation(), config.getBundleLocation() );
+ }
+ else
+ {
+ // expected configuration unbound
+ TestCase.assertNull( config.getBundleLocation() );
+ }
}
else
{