felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1616385 - in /felix/trunk/scr/src: main/java/org/apache/felix/scr/impl/ main/java/org/apache/felix/scr/impl/config/ main/java/org/apache/felix/scr/impl/manager/ main/java/org/apache/felix/scr/impl/runtime/ test/java/org/apache/felix/scr/in...
Date Thu, 07 Aug 2014 02:11:27 GMT
Author: djencks
Date: Thu Aug  7 02:11:27 2014
New Revision: 1616385

URL: http://svn.apache.org/r1616385
Log:
FElIX-4403 update to use modified rfc190 dto classes

Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ReferenceManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/CircularReferenceTest.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentActivationTest.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentConfigurationPidTest.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentConfigurationTest.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/PersistentComponentFactoryTest.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindGreedyTest.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindTest.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceChangedTest.java

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java Thu Aug  7 02:11:27
2014
@@ -40,10 +40,11 @@ import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.framework.dto.ServiceReferenceDTO;
 import org.osgi.service.component.runtime.ServiceComponentRuntime;
-import org.osgi.service.component.runtime.dto.BoundReferenceDTO;
 import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO;
 import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO;
 import org.osgi.service.component.runtime.dto.ReferenceDTO;
+import org.osgi.service.component.runtime.dto.SatisfiedReferenceDTO;
+import org.osgi.service.component.runtime.dto.UnsatisfiedReferenceDTO;
 
 /**
  * The <code>ScrCommand</code> class provides the implementations for the
@@ -407,13 +408,13 @@ public class ScrCommand implements ScrIn
         out.println( cc.id );
         out.print("    State: ");
         out.println( toStateString(cc.state));
-        for ( BoundReferenceDTO ref: cc.boundReferences) 
+        for ( SatisfiedReferenceDTO ref: cc.satisfiedReferences) 
         {
-            out.print( "    BoundReference: ");
+            out.print( "    SatisfiedReference: ");
             out.println( ref.name );
             out.print( "      Target: " );
             out.println( ref.target );
-          ServiceReferenceDTO[] serviceRefs = ref.serviceReferences;
+          ServiceReferenceDTO[] serviceRefs = ref.boundServices;
           if ( serviceRefs != null )
           {
               out.print( "      Bound to:" );
@@ -429,6 +430,28 @@ public class ScrCommand implements ScrIn
           }
 
         }
+        for ( UnsatisfiedReferenceDTO ref: cc.unsatisfiedReferences) 
+        {
+            out.print( "    UnsatisfiedReference: ");
+            out.println( ref.name );
+            out.print( "      Target: " );
+            out.println( ref.target );
+          ServiceReferenceDTO[] serviceRefs = ref.targetServices;
+          if ( serviceRefs != null )
+          {
+              out.print( "      Target services:" );
+              for ( ServiceReferenceDTO sr: serviceRefs )
+              {
+                  out.print( "        " );
+                  out.println( sr.id );
+              }
+          }
+          else
+          {
+              out.println( "      (unbound)" );
+          }
+
+        }
         propertyInfo( cc.properties, out, "    ");
     }
 
@@ -501,8 +524,8 @@ public class ScrCommand implements ScrIn
     {
         switch (state) {
 
-        case (ComponentConfigurationDTO.UNSATISFIED):
-            return "unsatisfied ";
+        case (ComponentConfigurationDTO.UNSATISFIED_REFERENCE):
+            return "unsatisfied reference";
         case (ComponentConfigurationDTO.ACTIVE):
             return "active      ";
         case (ComponentConfigurationDTO.SATISFIED):

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentManager.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentManager.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentManager.java Thu
Aug  7 02:11:27 2014
@@ -26,8 +26,9 @@ import org.osgi.service.component.runtim
 
 public interface ComponentManager<S> {
 	
-	int STATE_SATISFIED = ComponentConfigurationDTO.SATISFIED;
-	int STATE_UNSATISFIED = ComponentConfigurationDTO.UNSATISFIED;
+    int STATE_UNSATISFIED_CONFIGURATION = ComponentConfigurationDTO.UNSATISFIED_CONFIGURATION;
+    int STATE_UNSATISFIED_REFERENCE = ComponentConfigurationDTO.UNSATISFIED_REFERENCE;
+    int STATE_SATISFIED = ComponentConfigurationDTO.SATISFIED;
 	int STATE_ACTIVE = ComponentConfigurationDTO.ACTIVE;
 	int STATE_DISPOSED = 32;
 	int STATE_DISABLED = 64; //TODO????

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ReferenceManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ReferenceManager.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ReferenceManager.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ReferenceManager.java Thu
Aug  7 02:11:27 2014
@@ -45,4 +45,6 @@ public interface ReferenceManager<S, T> 
 	 */
 	String getTarget();
 
+    boolean isSatisfied();
+
 }
\ No newline at end of file

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
Thu Aug  7 02:11:27 2014
@@ -614,6 +614,11 @@ public abstract class AbstractComponentM
     {
         return false;
     }
+    
+    protected boolean isSatisfied()
+    {
+        return m_satisfied;
+    }
 
 
     //-------------- atomic transition methods -------------------------------
@@ -1351,7 +1356,7 @@ public abstract class AbstractComponentM
         }
         if ( !m_satisfied )
         {
-            return STATE_UNSATISFIED;
+            return STATE_UNSATISFIED_REFERENCE;
         }
         if ( hasInstance() )
         {

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java
Thu Aug  7 02:11:27 2014
@@ -565,8 +565,7 @@ public class SingleComponentManager<S> e
             obtainActivationWriteLock( "reconfigure" );
             try
             {
-                if ( getState() == STATE_UNSATISFIED
-                        && !getComponentMetadata().isConfigurationIgnored() )
+                if ( !isSatisfied() && !getComponentMetadata().isConfigurationIgnored()
)
                 {
                     log( LogService.LOG_DEBUG, "Attempting to activate unsatisfied component",
null );
                     updateTargets( getProperties() );

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java
Thu Aug  7 02:11:27 2014
@@ -36,10 +36,11 @@ import org.osgi.framework.ServiceReferen
 import org.osgi.framework.dto.BundleDTO;
 import org.osgi.framework.dto.ServiceReferenceDTO;
 import org.osgi.service.component.runtime.ServiceComponentRuntime;
-import org.osgi.service.component.runtime.dto.BoundReferenceDTO;
 import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO;
 import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO;
 import org.osgi.service.component.runtime.dto.ReferenceDTO;
+import org.osgi.service.component.runtime.dto.SatisfiedReferenceDTO;
+import org.osgi.service.component.runtime.dto.UnsatisfiedReferenceDTO;
 import org.osgi.util.promise.Promise;
 
 public class ServiceComponentRuntimeImpl implements ServiceComponentRuntime {
@@ -124,7 +125,8 @@ public class ServiceComponentRuntimeImpl
 	private ComponentConfigurationDTO managerToConfiguration(
 			ComponentManager<?> manager, ComponentDescriptionDTO description) {
 		ComponentConfigurationDTO dto = new ComponentConfigurationDTO();
-		dto.boundReferences = refManagersToDTO(manager.getReferenceManagers());
+        dto.satisfiedReferences = satisfiedRefManagersToDTO(manager.getReferenceManagers());
+        dto.unsatisfiedReferences = unsatisfiedRefManagersToDTO(manager.getReferenceManagers());
 		dto.description = description;
 		dto.id = manager.getId();
 		dto.properties = new HashMap<String, Object>(manager.getProperties());//TODO deep
copy?
@@ -132,26 +134,51 @@ public class ServiceComponentRuntimeImpl
 		return dto;
 	}
 
-	private BoundReferenceDTO[] refManagersToDTO(List<? extends ReferenceManager<?, ?>>
referenceManagers) {
-		BoundReferenceDTO[] dtos = new BoundReferenceDTO[referenceManagers.size()];
-		int i = 0;
-		for (ReferenceManager<?, ?> ref: referenceManagers)
-		{
-			BoundReferenceDTO dto = new BoundReferenceDTO();
-			dto.name = ref.getName();
-			dto.target = ref.getTarget();
-			List<ServiceReference<?>> serviceRefs = ref.getServiceReferences();
-			ServiceReferenceDTO[] srDTOs = new ServiceReferenceDTO[serviceRefs.size()];
-			int j = 0;
-			for (ServiceReference<?> serviceRef: serviceRefs)
-			{
-				srDTOs[j++] = serviceReferenceToDTO(serviceRef);
-			}
-			dto.serviceReferences = srDTOs;
-			dtos[i++] = dto;
-		}
-		return dtos;
-	}
+    private SatisfiedReferenceDTO[] satisfiedRefManagersToDTO(List<? extends ReferenceManager<?,
?>> referenceManagers) {
+        List<SatisfiedReferenceDTO> dtos = new ArrayList<SatisfiedReferenceDTO>();
+        for (ReferenceManager<?, ?> ref: referenceManagers)
+        {
+            if (ref.isSatisfied())
+            {
+                SatisfiedReferenceDTO dto = new SatisfiedReferenceDTO();
+                dto.name = ref.getName();
+                dto.target = ref.getTarget();
+                List<ServiceReference<?>> serviceRefs = ref.getServiceReferences();
+                ServiceReferenceDTO[] srDTOs = new ServiceReferenceDTO[serviceRefs.size()];
+                int j = 0;
+                for (ServiceReference<?> serviceRef : serviceRefs)
+                {
+                    srDTOs[j++] = serviceReferenceToDTO(serviceRef);
+                }
+                dto.boundServices = srDTOs;
+                dtos.add(dto);
+            }
+        }
+        return dtos.toArray( new SatisfiedReferenceDTO[dtos.size()] );
+    }
+
+    private UnsatisfiedReferenceDTO[] unsatisfiedRefManagersToDTO(List<? extends ReferenceManager<?,
?>> referenceManagers) {
+        List<UnsatisfiedReferenceDTO> dtos = new ArrayList<UnsatisfiedReferenceDTO>();
+        for (ReferenceManager<?, ?> ref: referenceManagers)
+        {
+            if (!ref.isSatisfied())
+            {
+                UnsatisfiedReferenceDTO dto = new UnsatisfiedReferenceDTO();
+                dto.name = ref.getName();
+                dto.target = ref.getTarget();
+                List<ServiceReference<?>> serviceRefs = ref.getServiceReferences();
+                ServiceReferenceDTO[] srDTOs = new ServiceReferenceDTO[serviceRefs.size()];
+                int j = 0;
+                for (ServiceReference<?> serviceRef : serviceRefs)
+                {
+                    srDTOs[j++] = serviceReferenceToDTO(serviceRef);
+                }
+                dto.targetServices = srDTOs;
+                dtos.add(dto);
+            }
+        }
+        return dtos.toArray( new UnsatisfiedReferenceDTO[dtos.size()] );
+    }
 
 	private ServiceReferenceDTO serviceReferenceToDTO(
 			ServiceReference<?> serviceRef) {

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/CircularReferenceTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/CircularReferenceTest.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/CircularReferenceTest.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/CircularReferenceTest.java
Thu Aug  7 02:11:27 2014
@@ -57,10 +57,10 @@ public class CircularReferenceTest exten
     public void test_A11_B11()
     {
         String componentNameA = "1.A.1.1.dynamic";
-        final ComponentConfigurationDTO componentA = findComponentConfigurationByName( componentNameA,
ComponentConfigurationDTO.UNSATISFIED );
+        final ComponentConfigurationDTO componentA = findComponentConfigurationByName( componentNameA,
ComponentConfigurationDTO.UNSATISFIED_REFERENCE );
 
         String componentNameB = "1.B.1.1.dynamic";
-        final ComponentConfigurationDTO componentB = findComponentConfigurationByName( componentNameB,
ComponentConfigurationDTO.UNSATISFIED );
+        final ComponentConfigurationDTO componentB = findComponentConfigurationByName( componentNameB,
ComponentConfigurationDTO.UNSATISFIED_REFERENCE );
     }
 
     /**

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentActivationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentActivationTest.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentActivationTest.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentActivationTest.java
Thu Aug  7 02:11:27 2014
@@ -199,7 +199,7 @@ public class ComponentActivationTest ext
 
     private void testRequiredDependency(final String componentname) throws Exception
     {
-        ComponentConfigurationDTO cc = getDisabledConfigurationAndEnable(componentname, ComponentConfigurationDTO.UNSATISFIED);
+        ComponentConfigurationDTO cc = getDisabledConfigurationAndEnable(componentname, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
         SimpleServiceImpl ss = SimpleServiceImpl.create( bundleContext, "foo" );
         
@@ -208,7 +208,7 @@ public class ComponentActivationTest ext
         ServiceReference<ActivatorComponent> ref = bundleContext.getServiceReference(
ActivatorComponent.class );
         
         ss.drop();
-        findComponentConfigurationByName(componentname, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(componentname, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
         
         TestCase.assertNull(bundleContext.getServiceReference( ActivatorComponent.class ));

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentConfigurationPidTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentConfigurationPidTest.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentConfigurationPidTest.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentConfigurationPidTest.java
Thu Aug  7 02:11:27 2014
@@ -48,7 +48,7 @@ public class ComponentConfigurationPidTe
         delay();
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
-        getConfigurationsDisabledThenEnable(name, 0, ComponentConfigurationDTO.UNSATISFIED);
+        getConfigurationsDisabledThenEnable(name, 0, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
@@ -77,7 +77,7 @@ public class ComponentConfigurationPidTe
         deleteConfig( pid );
         delay();
 
-        getConfigurationsDisabledThenEnable(name, 0, ComponentConfigurationDTO.UNSATISFIED);
+        getConfigurationsDisabledThenEnable(name, 0, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
         configure( pid );

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentConfigurationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentConfigurationTest.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentConfigurationTest.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentConfigurationTest.java
Thu Aug  7 02:11:27 2014
@@ -125,7 +125,7 @@ public class ComponentConfigurationTest 
         
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
-        getConfigurationsDisabledThenEnable(pid, 0, ComponentConfigurationDTO.UNSATISFIED);
+        getConfigurationsDisabledThenEnable(pid, 0, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
         configure( pid );
@@ -269,14 +269,14 @@ public class ComponentConfigurationTest 
             delay();
 
             // mandatory ref missing --> component unsatisfied
-            ComponentConfigurationDTO cc = getDisabledConfigurationAndEnable(pid, ComponentConfigurationDTO.UNSATISFIED);
+            ComponentConfigurationDTO cc = getDisabledConfigurationAndEnable(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
             // dynamically configure without the correct target
             configure( pid );
             delay();
 
             // mandatory ref missing --> component unsatisfied
-            findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED);
+            findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
             // dynamically configure with correct target
             theConfig.put( targetProp, "(filterprop=" + filterProp + ")" );
@@ -306,13 +306,13 @@ public class ComponentConfigurationTest 
             delay();
 
             // mandatory ref missing --> component unsatisfied
-            findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED);
+            findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
             deleteConfig( pid );
             delay();
 
             // mandatory ref missing --> component unsatisfied
-            findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED);
+            findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
             disableAndCheck(cc);
             TestCase.assertNull( SimpleComponent.INSTANCE );
@@ -346,14 +346,14 @@ public class ComponentConfigurationTest 
             delay();
 
             // mandatory ref missing --> component unsatisfied
-            ComponentConfigurationDTO cc = getDisabledConfigurationAndEnable(pid, ComponentConfigurationDTO.UNSATISFIED);
+            ComponentConfigurationDTO cc = getDisabledConfigurationAndEnable(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
             // dynamically configure without the correct target
             configure( pid );
             delay();
 
             // mandatory ref missing --> component unsatisfied
-            findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED);
+            findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
             // dynamically configure with correct target
             theConfig.put( targetProp, "(|(filterprop=" + filterProp1 + ")(filterprop=" +
filterProp2 + "))" );
@@ -398,7 +398,7 @@ public class ComponentConfigurationTest 
             delay();
 
             // mandatory ref missing --> component unsatisfied
-            findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED);
+            findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
             disableAndCheck(cc);
             TestCase.assertNull( SimpleComponent.INSTANCE );

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=1616385&r1=1616384&r2=1616385&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
Thu Aug  7 02:11:27 2014
@@ -325,7 +325,7 @@ public class ComponentFactoryTest extend
     {
         //set up the component that refers to the service the factory will create.
         final String referringComponentName = "ComponentReferringToFactoryObject";
-        getConfigurationsDisabledThenEnable(referringComponentName, 1, ComponentConfigurationDTO.UNSATISFIED);
+        getConfigurationsDisabledThenEnable(referringComponentName, 1, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
         final String componentname = "factory.component.referred";
         final String componentfactory = "factory.component.factory.referred";
@@ -349,7 +349,7 @@ public class ComponentFactoryTest extend
         TestCase.assertNull( instance.getInstance() ); // SCR 112.12.6.2
 
         //make sure it's unsatisfied (service is no longer available)
-        checkConfigurationCount(referringComponentName, 1, ComponentConfigurationDTO.UNSATISFIED);
+        checkConfigurationCount(referringComponentName, 1, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
     }
 
     @Test

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
Thu Aug  7 02:11:27 2014
@@ -295,7 +295,7 @@ public abstract class ComponentTestBase
     static final Map<Integer, String> STATES = new HashMap<Integer, String>();
     
     static {
-    	STATES.put(ComponentConfigurationDTO.UNSATISFIED, "Unsatisfied (" + ComponentConfigurationDTO.UNSATISFIED
+ ")" );
+    	STATES.put(ComponentConfigurationDTO.UNSATISFIED_REFERENCE, "Unsatisfied (" + ComponentConfigurationDTO.UNSATISFIED_REFERENCE
+ ")" );
     	STATES.put(ComponentConfigurationDTO.SATISFIED, "Satisified (" + ComponentConfigurationDTO.SATISFIED
+ ")" );
     	STATES.put(ComponentConfigurationDTO.ACTIVE, "Active (" + ComponentConfigurationDTO.ACTIVE
+ ")" );
     }

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/PersistentComponentFactoryTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/PersistentComponentFactoryTest.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/PersistentComponentFactoryTest.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/PersistentComponentFactoryTest.java
Thu Aug  7 02:11:27 2014
@@ -266,7 +266,7 @@ public class PersistentComponentFactoryT
         propsNonMatch.put( "ref.target", "(filterprop=nomatch)" );
         ComponentFactory factory = getComponentFactory(componentfactory);
         final ComponentInstance instanceNonMatch = factory.newInstance( propsNonMatch );//works
even without required reference
-        checkConfigurationCount(componentname, 1, ComponentConfigurationDTO.UNSATISFIED);
+        checkConfigurationCount(componentname, 1, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
         final SimpleServiceImpl noMatch = SimpleServiceImpl.create( bundleContext, "nomatch"
).setFilterProperty(
             "nomatch" );
@@ -294,7 +294,7 @@ public class PersistentComponentFactoryT
         delay();
 
         // check registered components (ComponentFactory is still present)
-        checkConfigurationCount(componentname, 1, ComponentConfigurationDTO.UNSATISFIED);
+        checkConfigurationCount(componentname, 1, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
         // deactivated due to unsatisfied reference
         TestCase.assertNull( instanceNonMatch.getInstance() );
@@ -311,7 +311,7 @@ public class PersistentComponentFactoryT
     {
         //set up the component that refers to the service the factory will create.
         final String referringComponentName = "ComponentReferringToFactoryObject";
-        getConfigurationsDisabledThenEnable(referringComponentName, 1, ComponentConfigurationDTO.UNSATISFIED);
+        getConfigurationsDisabledThenEnable(referringComponentName, 1, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
         final String componentname = "factory.component.referred";
         final String componentfactory = "factory.component.factory.referred";
@@ -335,7 +335,7 @@ public class PersistentComponentFactoryT
         TestCase.assertNull( instance.getInstance() ); // SCR 112.12.6.2
 
         //make sure it's unsatisfied (service is no longer available)
-        checkConfigurationCount(referringComponentName, 1, ComponentConfigurationDTO.UNSATISFIED);
+        checkConfigurationCount(referringComponentName, 1, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
     }
 
     @Test

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindGreedyTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindGreedyTest.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindGreedyTest.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindGreedyTest.java
Thu Aug  7 02:11:27 2014
@@ -182,7 +182,7 @@ public class ServiceBindGreedyTest exten
         srv1.drop();
         // no delay, should be immediate
 
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         final SimpleComponent comp11 = SimpleComponent.INSTANCE;
         TestCase.assertNull( comp11 );
 
@@ -426,7 +426,7 @@ public class ServiceBindGreedyTest exten
         srv1.drop();
         // no delay, should be immediate
 
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         final SimpleComponent comp11 = SimpleComponent.INSTANCE;
         TestCase.assertNull( comp11 );
 
@@ -548,7 +548,7 @@ public class ServiceBindGreedyTest exten
     {
         String name ="test_required_multiple_dynamic_factory"; //also pid
         final String factoryPid = "factory_" + name;
-        getConfigurationsDisabledThenEnable(name, 0, ComponentConfigurationDTO.UNSATISFIED);
+        getConfigurationsDisabledThenEnable(name, 0, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 //        final String pid = "test_required_multiple_dynamic_factory";
 //
 //        final Component component = findComponentDescriptorByName( pid );
@@ -558,7 +558,7 @@ public class ServiceBindGreedyTest exten
 //        // async enabling (unsatisfied)
 //        enableAndCheck(cc.description);
 //        delay();
-//        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+//        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
         // register service, satisfying
         final SimpleServiceImpl srv1 = SimpleServiceImpl.create( bundleContext, "srv1" );
@@ -832,7 +832,7 @@ public class ServiceBindGreedyTest exten
         srv1.drop();
         delay(); // async reactivate
 
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         final SimpleComponent comp11 = SimpleComponent.INSTANCE;
         TestCase.assertNull( comp11 );
 
@@ -1104,7 +1104,7 @@ public class ServiceBindGreedyTest exten
         srv1.drop();
         delay(); // async reactivate
 
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         final SimpleComponent comp11 = SimpleComponent.INSTANCE;
         TestCase.assertNull( comp11 );
 

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindTest.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindTest.java (original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindTest.java Thu
Aug  7 02:11:27 2014
@@ -182,7 +182,7 @@ public class ServiceBindTest extends Com
         srv1.drop();
         // no delay, should be immediate
 
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         final SimpleComponent comp11 = SimpleComponent.INSTANCE;
         TestCase.assertNull( comp11 );
 
@@ -426,7 +426,7 @@ public class ServiceBindTest extends Com
         srv1.drop();
         // no delay, should be immediate
 
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         final SimpleComponent comp11 = SimpleComponent.INSTANCE;
         TestCase.assertNull( comp11 );
 
@@ -548,7 +548,7 @@ public class ServiceBindTest extends Com
     {
         String name ="test_required_multiple_dynamic_factory"; //also pid
         final String factoryPid = "factory_" + name;
-        getConfigurationsDisabledThenEnable(name, 0, ComponentConfigurationDTO.UNSATISFIED);
+        getConfigurationsDisabledThenEnable(name, 0, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 //        final String pid = "test_required_multiple_dynamic_factory";
 //
 //        final Component component = findComponentDescriptorByName( pid );
@@ -558,7 +558,7 @@ public class ServiceBindTest extends Com
 //        // async enabling (unsatisfied)
 //        enableAndCheck(cc.description);
 //        delay();
-//        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+//        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
 
         // register service, satisfying
         final SimpleServiceImpl srv1 = SimpleServiceImpl.create( bundleContext, "srv1" );
@@ -833,7 +833,7 @@ public class ServiceBindTest extends Com
         srv1.drop();
         delay(); // async reactivate
 
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         final SimpleComponent comp11 = SimpleComponent.INSTANCE;
         TestCase.assertNull( comp11 );
 
@@ -1105,7 +1105,7 @@ public class ServiceBindTest extends Com
         srv1.drop();
         delay(); // async reactivate
 
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         final SimpleComponent comp11 = SimpleComponent.INSTANCE;
         TestCase.assertNull( comp11 );
 

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceChangedTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceChangedTest.java?rev=1616385&r1=1616384&r2=1616385&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceChangedTest.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ServiceChangedTest.java
Thu Aug  7 02:11:27 2014
@@ -127,7 +127,7 @@ public class ServiceChangedTest extends 
 
         // set target to not match any more -> deactivate this component
         srv1.setFilterProperty( "don't match" );
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         TestCase.assertNull( SimpleComponent.INSTANCE );
         TestCase.assertNull( comp10.m_singleRef );
         TestCase.assertTrue( comp10.m_multiRef.isEmpty() );
@@ -249,7 +249,7 @@ public class ServiceChangedTest extends 
         // set target to not match any more
         srv1.setFilterProperty( "don't match" );
 
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         final SimpleComponent comp11 = SimpleComponent.INSTANCE;
         TestCase.assertNull( comp11 );
         TestCase.assertNull( comp10.m_singleRef );
@@ -382,7 +382,7 @@ public class ServiceChangedTest extends 
 
         // set target to not match any more -> deactivate this component
         srv1.setFilterProperty( "don't match" );
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         TestCase.assertNull( SimpleComponent.INSTANCE );
         TestCase.assertNull( comp10.m_singleRef );
         TestCase.assertTrue( comp10.m_multiRef.isEmpty() );
@@ -525,7 +525,7 @@ public class ServiceChangedTest extends 
         // set target to not match any more
         srv1.setFilterProperty( "don't match" );
 
-        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED);
+        findComponentConfigurationByName(name, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
         final SimpleComponent comp11 = SimpleComponent.INSTANCE;
         TestCase.assertNull( comp11 );
         TestCase.assertNull( comp10.m_singleRef );



Mime
View raw message