felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1632191 [4/4] - in /felix/sandbox/pderop/dependencymanager-prototype: org.apache.felix.dependencymanager.annotation/src/org/apache/felix/dm/annotation/plugin/bnd/ org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ org....
Date Wed, 15 Oct 2014 22:09:13 GMT
Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ServiceRaceTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ServiceRaceTest.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ServiceRaceTest.java
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ServiceRaceTest.java
Wed Oct 15 22:09:11 2014
@@ -27,8 +27,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.ComponentState;
 import org.apache.felix.dm.ComponentStateListener;
-import org.apache.felix.dm.Dependency;
-import org.apache.felix.dm.context.AbstractDependency;
 import org.apache.felix.dm.context.Event;
 import org.apache.felix.dm.impl.ComponentImpl;
 import org.apache.felix.dm.impl.ConfigurationDependencyImpl;
@@ -40,6 +38,7 @@ import org.osgi.service.cm.Configuration
 /**
  * This test class simulates a client having many dependencies being registered/unregistered
concurrently.
  */
+@SuppressWarnings({"unchecked", "rawtypes"})
 public class ServiceRaceTest extends TestBase {
     final static int STEP_WAIT = 5000;
     final static int DEPENDENCIES = 10;
@@ -95,7 +94,7 @@ public class ServiceRaceTest extends Tes
         client.setImplementation(theClient);
 
         // Create client service dependencies
-        final AbstractDependency[] dependencies = new AbstractDependency[DEPENDENCIES];
+        final SimpleServiceDependency[] dependencies = new SimpleServiceDependency[DEPENDENCIES];
         for (int i = 0; i < DEPENDENCIES; i++) {
             dependencies[i] = new SimpleServiceDependency();
             dependencies[i].setRequired(true);
@@ -103,6 +102,7 @@ public class ServiceRaceTest extends Tes
             client.add(dependencies[i]);
         }
         final ConfigurationDependencyImpl confDependency = new ConfigurationDependencyImpl();
+        confDependency.setPid("mypid");
         client.add(confDependency);
 
         // Create Configuration (concurrently).
@@ -140,7 +140,7 @@ public class ServiceRaceTest extends Tes
                 // We *must* do this after having started the component (in a reality, the
dependencies can be 
                 // injected only one the tracker has been opened ...
                 for (int i = 0; i < DEPENDENCIES; i++) {
-                    final AbstractDependency dep = dependencies[i];
+                    final SimpleServiceDependency dep = dependencies[i];
                     final Event added = new EventImpl(i);
                     m_threadpool.execute(new Runnable() {
                         public void run() {
@@ -161,7 +161,7 @@ public class ServiceRaceTest extends Tes
 
         // Stop the client and all dependencies concurrently.
         for (int i = 0; i < DEPENDENCIES; i++) {
-            final AbstractDependency dep = dependencies[i];
+            final SimpleServiceDependency dep = dependencies[i];
             final Event removed = new EventImpl(i);
             m_threadpool.execute(new Runnable() {
                 public void run() {

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/TestBase.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/TestBase.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/TestBase.java
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/TestBase.java
Wed Oct 15 22:09:11 2014
@@ -35,6 +35,7 @@ public class TestBase {
     // Set the enabled log level.
     final int m_level = WARN;
     
+    @SuppressWarnings("unused")
     void debug(String format, Object ... params) {
         if (m_level >= DEBUG) {
             out.println(Thread.currentThread().getName() + " - " + String.format(format,
params));
@@ -45,6 +46,7 @@ public class TestBase {
         warn(format, null, params);
     }
     
+    @SuppressWarnings("unused")
     void info(String format, Object ... params) {
         if (m_level >= INFO) {
             out.println(Thread.currentThread().getName() + " - " + String.format(format,
params));



Mime
View raw message