felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1161461 - in /felix/trunk/ipojo/junit4osgi: junit4osgi/pom.xml maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java
Date Thu, 25 Aug 2011 09:27:23 GMT
Author: clement
Date: Thu Aug 25 09:27:22 2011
New Revision: 1161461

URL: http://svn.apache.org/viewvc?rev=1161461&view=rev
Log:
junit4osgi now uses the bnd-ipojo-plugin.

Modified:
    felix/trunk/ipojo/junit4osgi/junit4osgi/pom.xml
    felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java

Modified: felix/trunk/ipojo/junit4osgi/junit4osgi/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/junit4osgi/junit4osgi/pom.xml?rev=1161461&r1=1161460&r2=1161461&view=diff
==============================================================================
--- felix/trunk/ipojo/junit4osgi/junit4osgi/pom.xml (original)
+++ felix/trunk/ipojo/junit4osgi/junit4osgi/pom.xml Thu Aug 25 09:27:22 2011
@@ -93,10 +93,18 @@
               META-INF/LICENSE.junit=LICENSE.junit,
               META-INF/NOTICE=NOTICE
             </Include-Resource>
+            <_plugin>org.apache.felix.ipojo.bnd.PojoizationPlugin;metadata=${basedir}/metadata.xml;use-local-schemas=true</_plugin>
           </instructions>
         </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>bnd-ipojo-plugin</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+          </dependency>
+        </dependencies>
       </plugin>
-      <plugin>
+      <!--<plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-ipojo-plugin</artifactId>
         <version>1.9.0-SNAPSHOT</version>
@@ -110,7 +118,7 @@
             </configuration>
           </execution>
         </executions>
-      </plugin>
+      </plugin>-->
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>rat-maven-plugin</artifactId>

Modified: felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java?rev=1161461&r1=1161460&r2=1161461&view=diff
==============================================================================
--- felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java
(original)
+++ felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java
Thu Aug 25 09:27:22 2011
@@ -51,6 +51,7 @@ import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -363,7 +364,7 @@ public class Junit4osgiPlugin extends Ab
             getLog().debug("Service List");
             for (int i = 0; i < refs.length; i++) {
                 String[] itfs = (String[]) refs[i].getProperty(Constants.OBJECTCLASS);
-                List list = Arrays.asList(itfs); 
+                List list = Arrays.asList(itfs);
                 if (list.contains("org.apache.felix.ipojo.architecture.Architecture")) {
                     getLog().debug(list.toString() + " - " + refs[i].getProperty("architecture.instance"));
                 } else {
@@ -468,6 +469,9 @@ public class Junit4osgiPlugin extends Ab
             return bc.getService(ref);
         }
         getLog().error("Junit Runner service unavailable");
+
+        dumpServices(bc);
+
         return null;
     }
 
@@ -630,6 +634,25 @@ public class Junit4osgiPlugin extends Ab
         }
     }
 
+    /**
+     * Prints the service list.
+     * @param bc the bundle context.
+     */
+    public void dumpServices(BundleContext bc) {
+        getLog().info("Services:");
+        ServiceReference[] refs = null;
+        try {
+            refs = bc.getAllServiceReferences(null, null);
+        } catch (InvalidSyntaxException e) {
+            e.printStackTrace();
+        }
+        for (int i = 0; i < refs.length; i++) {
+            String[] itfs = (String[]) refs[i].getProperty(Constants.OBJECTCLASS);
+            String bundle = refs[i].getBundle().getSymbolicName();
+            getLog().info(bundle + " : " + Arrays.toString(itfs));
+        }
+    }
+
     public LogServiceImpl getLogService() {
         return m_logService;
     }



Mime
View raw message