ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r823516 - /incubator/ace/trunk/test/src/org/apache/ace/test/osgi/dm/TestActivatorBase.java
Date Fri, 09 Oct 2009 11:45:36 GMT
Author: marrs
Date: Fri Oct  9 11:45:36 2009
New Revision: 823516

URL: http://svn.apache.org/viewvc?rev=823516&view=rev
Log:
More debugging.

Modified:
    incubator/ace/trunk/test/src/org/apache/ace/test/osgi/dm/TestActivatorBase.java

Modified: incubator/ace/trunk/test/src/org/apache/ace/test/osgi/dm/TestActivatorBase.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/osgi/dm/TestActivatorBase.java?rev=823516&r1=823515&r2=823516&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/test/osgi/dm/TestActivatorBase.java (original)
+++ incubator/ace/trunk/test/src/org/apache/ace/test/osgi/dm/TestActivatorBase.java Fri Oct
 9 11:45:36 2009
@@ -94,6 +94,7 @@
 
         // wait for the service to be started
         try {
+            System.out.println("Waiting for " + (1 - m_semaphore.availablePermits()) + "
to become available.");
             if (m_semaphore.tryAcquire(30, TimeUnit.SECONDS)) {
                 // perform tests
                 testng.setTestClasses(m_testClasses);
@@ -164,4 +165,14 @@
 
     public void stopping(Service svc) {
     }
+
+    public static void main(String[] args) throws Exception {
+        Semaphore s = new Semaphore(-1);
+        System.out.println("#: " + (1 - s.availablePermits()));
+        s.release();
+        System.out.println("#: " + (1 - s.availablePermits()));
+        System.out.println("Trying...");
+        System.out.println(s.tryAcquire(3, TimeUnit.SECONDS));
+        System.out.println("#: " + (1 - s.availablePermits()));
+    }
 }



Mime
View raw message