FELIX-1826 Fix integration test still using the component instance
as the value of the map (instead of the AbstractComponentManager)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@832088 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java b/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
index 450e5a4..3eae933 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
@@ -87,13 +87,15 @@
final Map<?, ?> instanceMap = ( Map<?, ?> ) getFieldValue( component, "m_componentInstances" );
TestCase.assertNotNull( instanceMap );
TestCase.assertEquals( 1, instanceMap.size() );
- TestCase.assertTrue( instanceMap.containsValue( instance ) );
+
+ final Object instanceManager = getFieldValue( instance, "m_componentManager" );
+ TestCase.assertTrue( instanceMap.containsValue( instanceManager ) );
instance.dispose();
TestCase.assertNull( SimpleComponent.INSTANCE );
TestCase.assertEquals( 0, instanceMap.size() );
- TestCase.assertFalse( instanceMap.containsValue( instance ) );
+ TestCase.assertFalse( instanceMap.containsValue( instanceManager ) );
}
@@ -138,7 +140,9 @@
final Map<?, ?> instanceMap = ( Map<?, ?> ) getFieldValue( component, "m_componentInstances" );
TestCase.assertNotNull( instanceMap );
TestCase.assertEquals( 1, instanceMap.size() );
- TestCase.assertTrue( instanceMap.containsValue( instance ) );
+
+ final Object instanceManager = getFieldValue( instance, "m_componentManager" );
+ TestCase.assertTrue( instanceMap.containsValue( instanceManager ) );
// disable the factory
component.disable();
@@ -148,13 +152,13 @@
TestCase.assertEquals( Component.STATE_DISABLED, component.getState() );
TestCase.assertNotNull( SimpleComponent.INSTANCE );
TestCase.assertEquals( 1, instanceMap.size() );
- TestCase.assertTrue( instanceMap.containsValue( instance ) );
+ TestCase.assertTrue( instanceMap.containsValue( instanceManager ) );
instance.dispose();
TestCase.assertNull( SimpleComponent.INSTANCE );
TestCase.assertEquals( 0, instanceMap.size() );
- TestCase.assertFalse( instanceMap.containsValue( instance ) );
+ TestCase.assertFalse( instanceMap.containsValue( instanceManager ) );
}