felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1712643 - in /felix/sandbox/pderop/dependencymanager.ds: org.apache.felix.dependencymanager.ds.itest/resource/ org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/ org.apache.felix.dependencymanager.ds.itest/sr...
Date Wed, 04 Nov 2015 20:53:01 GMT
Author: pderop
Date: Wed Nov  4 20:53:00 2015
New Revision: 1712643

URL: http://svn.apache.org/viewvc?rev=1712643&view=rev
Log:
Keep the code up-to-date with the felix-trunk version.

Added:
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/MutatingServiceConsumer.java
Modified:
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/resource/integration_test_circular.xml
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/ComponentConcurrencyTest.java
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/Felix4984Test.java
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/concurrency/AFactory.java
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/concurrency/CFactory.java
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrCommand.java

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/resource/integration_test_circular.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/resource/integration_test_circular.xml?rev=1712643&r1=1712642&r2=1712643&view=diff
==============================================================================
Binary files - no diff available.

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java?rev=1712643&r1=1712642&r2=1712643&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java
Wed Nov  4 20:53:00 2015
@@ -279,6 +279,34 @@ public class CircularReferenceTest exten
         assertEquals( 1, b.getAs().size() );
     }
     
+    /**
+     * A > 1.1 > B > 0..n > A Both should start (B first) and both should have
references
+     * @throws InvalidSyntaxException
+     */
+    @Test
+    public void test_A11_immediate_B0n_delayed_B_first() throws InvalidSyntaxException
+    {
+    	String componentNameB = "8.B.0.n.dynamic";
+        final ComponentConfigurationDTO componentB = findComponentConfigurationByName( componentNameB,
ComponentConfigurationDTO.ACTIVE );
+        ServiceReference[] serviceReferencesB = bundleContext.getServiceReferences( B.class.getName(),
"(service.pid=" + componentNameB + ")" );
+        TestCase.assertEquals( 1, serviceReferencesB.length );
+        ServiceReference<B> serviceReferenceB = serviceReferencesB[0];
+        B b = bundleContext.getService( serviceReferenceB );
+
+        String componentNameA = "8.A.1.1.static";
+        ComponentConfigurationDTO componentA = findComponentConfigurationByName( componentNameA,
ComponentConfigurationDTO.SATISFIED );
+        ServiceReference[] serviceReferencesA = bundleContext.getServiceReferences( A.class.getName(),
"(service.pid=" + componentNameA + ")" );
+        TestCase.assertEquals( 1, serviceReferencesA.length );
+        ServiceReference<A> serviceReferenceA = serviceReferencesA[0];
+        A a = bundleContext.getService( serviceReferenceA );
+        assertNotNull( a );
+        assertEquals( 1, a.getBs().size());
+  //test currently does not show desired result.              
+//        assertEquals( 1, b.getAs().size() );
+//        assertNotNull( b.getAs().get(0) );
+
+    }
+    
     private void assertABoundToOneB(A a) {
         if (a.getBs().size() != 1) {
             getLog().log(LogService.LOG_WARNING, "detected problem ...");

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/ComponentConcurrencyTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/ComponentConcurrencyTest.java?rev=1712643&r1=1712642&r2=1712643&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/ComponentConcurrencyTest.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/ComponentConcurrencyTest.java
Wed Nov  4 20:53:00 2015
@@ -49,7 +49,7 @@ public class ComponentConcurrencyTest ex
         // Currently, this test fails with all sort of exceptions.
         // for now, let's make this test fail. and post on the mailing list to see if someone
could take a look.
         
-        if (true) {
+        if (true) { // FIXME
             log.log(LogService.LOG_WARNING, "ComponentConcurrencyTest is currently failing
and is disabled (ask to mailing list about it).");
             return;
         }

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/Felix4984Test.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/Felix4984Test.java?rev=1712643&r1=1712642&r2=1712643&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/Felix4984Test.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/Felix4984Test.java
Wed Nov  4 20:53:00 2015
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.felix.scr.integration;
 
 import org.apache.felix.scr.integration.components.felix4984.A;

Added: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/MutatingServiceConsumer.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/MutatingServiceConsumer.java?rev=1712643&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/MutatingServiceConsumer.java
(added)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/MutatingServiceConsumer.java
Wed Nov  4 20:53:00 2015
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scr.integration.components;
+
+import java.util.Map;
+
+public class MutatingServiceConsumer
+{
+
+    private Boolean updatedInSet;
+    private Boolean updatedInUpdated;
+    private Boolean updatedInUnset;
+
+    void setMutatingService(MutatingService ms, Map<String, Object> props) 
+    {
+        updatedInSet = props.containsKey("theValue");
+    }
+    
+    void updatedMutatingService(MutatingService ms, Map<String, Object> props)
+    {
+        updatedInUpdated = props.containsKey("theValue");        
+    }
+    
+    void unsetMutatingService(MutatingService ms, Map<String, Object> props)
+    {
+        updatedInUnset = props.containsKey("theValue");
+    }
+    
+    public Boolean isUpdatedInSet()
+    {
+        return updatedInSet;
+    }
+    
+    public Boolean isUpdatedInUpdated()
+    {
+        return updatedInUpdated;
+    }
+    
+    public Boolean isUpdatedInUnset()
+    {
+        return updatedInUnset;
+    }
+    
+    
+}

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/concurrency/AFactory.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/concurrency/AFactory.java?rev=1712643&r1=1712642&r2=1712643&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/concurrency/AFactory.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/concurrency/AFactory.java
Wed Nov  4 20:53:00 2015
@@ -18,7 +18,7 @@ import org.osgi.service.component.Compon
 
 public class AFactory implements Runnable {
     private ComponentFactory _aFactory;
-    private Thread[] _threads = new Thread[1];
+    private Thread[] _threads = new Thread[2];
     private final CountDownLatch STOPLATCH = new CountDownLatch(1); // must match number
of threads (1 for now).
     private volatile boolean _running;
     

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/concurrency/CFactory.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/concurrency/CFactory.java?rev=1712643&r1=1712642&r2=1712643&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/concurrency/CFactory.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/components/concurrency/CFactory.java
Wed Nov  4 20:53:00 2015
@@ -18,7 +18,7 @@ import org.osgi.service.component.Compon
 
 public class CFactory implements Runnable {
     private ComponentFactory _cFactory;
-    private Thread[] _threads = new Thread[1];
+    private Thread[] _threads = new Thread[2];
     private final CountDownLatch STOPLATCH = new CountDownLatch(1); // must match number
of threads (1 for now).
     private volatile boolean _running;
 

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrCommand.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrCommand.java?rev=1712643&r1=1712642&r2=1712643&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrCommand.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrCommand.java
Wed Nov  4 20:53:00 2015
@@ -313,6 +313,8 @@ public class ScrCommand implements ScrIn
             out.println( "Component Description:");
             out.print( "  Name: " );
             out.println( component.name );
+            out.print( "  Implementation Class: " );
+            out.println( component.implementationClass );
             out.print( "  Default State: " );
             out.println( component.defaultEnabled ? "enabled" : "disabled" );
             out.print( "  Activation: " );



Mime
View raw message