felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r832088 - /felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
Date Mon, 02 Nov 2009 20:25:24 GMT
Author: fmeschbe
Date: Mon Nov  2 20:25:23 2009
New Revision: 832088

URL: http://svn.apache.org/viewvc?rev=832088&view=rev
Log:
FELIX-1826 Fix integration test still using the component instance
as the value of the map (instead of the AbstractComponentManager)

Modified:
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java?rev=832088&r1=832087&r2=832088&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
Mon Nov  2 20:25:23 2009
@@ -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 ) );
     }
 
 



Mime
View raw message