felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1566550 - in /felix/sandbox/marrs/dependencymanager-prototype/dm/test/test: SerialExecutorTest.java ServiceRaceTest.java TestBase.java
Date Mon, 10 Feb 2014 09:50:30 GMT
Author: pderop
Date: Mon Feb 10 09:50:30 2014
New Revision: 1566550

URL: http://svn.apache.org/r1566550
Log:
code cleanup

Modified:
    felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/SerialExecutorTest.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ServiceRaceTest.java
    felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/TestBase.java

Modified: felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/SerialExecutorTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/SerialExecutorTest.java?rev=1566550&r1=1566549&r2=1566550&view=diff
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/SerialExecutorTest.java (original)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/SerialExecutorTest.java Mon
Feb 10 09:50:30 2014
@@ -16,21 +16,13 @@ import dm.impl.SerialExecutor;
 /**
  * Validates SerialExecutor used by DM implementation.
  */
-public class SerialExecutorTest {
+public class SerialExecutorTest extends TestBase {
     final Random m_rnd = new Random();
-    public enum LogLevel { WARN, INFO, DEBUG, };
-    final static LogLevel m_level = LogLevel.DEBUG;
     final int TESTS = 10000;
-
-    void debug(String msg) {
-        if (m_level.ordinal() >= LogLevel.DEBUG.ordinal()) {
-            System.out.println("[" + Thread.currentThread().getName() + "] " + msg);
-        }
-    }
     
     @Test
     public void testSerialExecutor() {
-        System.out.println("Testing serial executor");
+        info("Testing serial executor");
         int cores = Math.max(10, Runtime.getRuntime().availableProcessors());
         ExecutorService threadPool = null;
 

Modified: felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ServiceRaceTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ServiceRaceTest.java?rev=1566550&r1=1566549&r2=1566550&view=diff
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ServiceRaceTest.java (original)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/ServiceRaceTest.java Mon
Feb 10 09:50:30 2014
@@ -77,7 +77,7 @@ public class ServiceRaceTest extends Tes
             public void changed(State state) {
                 Assert.assertTrue(state.isAvailable());
                 clientStarted.step(1); // Our component must be started at most one time.
-                info("Client started");
+                debug("Client started");
             }
         };
         client.add(clientListener);
@@ -110,7 +110,7 @@ public class ServiceRaceTest extends Tes
             public void changed(State state) {
                 Assert.assertFalse(state.isAvailable());
                 clientStopped.step(1); // Our component must be started at most one time.
-                info("Client stopped");
+                debug("Client stopped");
             }
         };
         client.add(clientListener);
@@ -127,7 +127,7 @@ public class ServiceRaceTest extends Tes
         // Ensure that client has been stopped at most one time.
         clientStopped.waitForStep(1, 10000);        
         
-        info("finished one test loop");
+        debug("finished one test loop");
         if ((loop + 1) % 100 == 0) {
             long duration = System.currentTimeMillis() - m_timeStamp;
             warn("Performed 100 tests (total=%d) in %d ms.", loop, duration);

Modified: felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/TestBase.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/TestBase.java?rev=1566550&r1=1566549&r2=1566550&view=diff
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/TestBase.java (original)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/test/test/TestBase.java Mon Feb 10
09:50:30 2014
@@ -15,7 +15,7 @@ public class TestBase {
     final int DEBUG = 3;
     
     // Set the enabled log level.
-    final int m_level = WARN;
+    final int m_level = INFO;
     
     void debug(String format, Object ... params) {
         if (m_level >= DEBUG) {



Mime
View raw message