You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2013/04/08 11:34:42 UTC

svn commit: r1465580 - in /sling/trunk/testing/junit/core: pom.xml src/main/java/org/apache/sling/junit/impl/servlet/JacocoServlet.java

Author: bdelacretaz
Date: Mon Apr  8 09:34:41 2013
New Revision: 1465580

URL: http://svn.apache.org/r1465580
Log:
SLING-2810 - Mark Adamcin's tweaks, thanks\!

Modified:
    sling/trunk/testing/junit/core/pom.xml
    sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/JacocoServlet.java

Modified: sling/trunk/testing/junit/core/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/core/pom.xml?rev=1465580&r1=1465579&r2=1465580&view=diff
==============================================================================
--- sling/trunk/testing/junit/core/pom.xml (original)
+++ sling/trunk/testing/junit/core/pom.xml Mon Apr  8 09:34:41 2013
@@ -36,6 +36,7 @@
     
     <properties>
         <junit.version>4.8.2</junit.version>
+        <jacoco.version>0.6.2.201302030002</jacoco.version>
     </properties>
 
     <scm>
@@ -70,13 +71,45 @@
                             org.junit.runners.*;version=${junit.version}
                         </_exportcontents>
                         <Private-Package>org.apache.sling.junit.impl.*</Private-Package>
-                        <Embed-Dependency>org.jacoco.agent;inline=org/jacoco/agent/rt/IAgent.class,*;artifactId=junit</Embed-Dependency>
+                        <Embed-Dependency>org.jacoco.agent;classifier=runtime;inline=org/jacoco/agent/rt/IAgent.class,*;artifactId=junit</Embed-Dependency>
                     </instructions>
                 </configuration>
             </plugin>
         </plugins>
     </build>
 
+    <profiles>
+        <profile>
+            <id>extractJacocoAgent</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>unpack</goal>
+                                </goals>
+                                <configuration>
+                                    <artifactItems>
+                                        <artifactItem>
+                                            <groupId>org.jacoco</groupId>
+                                            <artifactId>org.jacoco.agent</artifactId>
+                                            <version>${jacoco.version}</version>
+                                            <includes>jacocoagent.jar</includes>
+                                            <outputDirectory>${project.build.directory}</outputDirectory>
+                                        </artifactItem>
+                                    </artifactItems>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
@@ -116,7 +149,7 @@
             <groupId>org.jacoco</groupId>
             <artifactId>org.jacoco.agent</artifactId>
             <classifier>runtime</classifier>
-            <version>0.6.2.201302030002</version>
+            <version>${jacoco.version}</version>
             <scope>provided</scope>
         </dependency>
 

Modified: sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/JacocoServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/JacocoServlet.java?rev=1465580&r1=1465579&r2=1465580&view=diff
==============================================================================
--- sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/JacocoServlet.java (original)
+++ sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/JacocoServlet.java Mon Apr  8 09:34:41 2013
@@ -59,12 +59,12 @@ public class JacocoServlet extends HttpS
             + "JaCoCo's tcpserver and tcpclient modes and its JMX interface open ports that do "
             + "not require any authentication. See the JaCoCo documentation for details.\n\n"
             + "To activate JaCoCo on a Sling instance, start its JVM with the following option:\n\n"
-            + "-javaagent:/path/to/jacoco-agent.jar,dumponexit=false,jmx=true\n\n"
-            + "The JaCoCo jar is a Maven dependency of this module, so you can get it using "
-            + "mvn dependency:copy-dependencies if you have this module's source code.\n\n"
+            + "-javaagent:/path/to/jacocoagent.jar,dumponexit=false,jmx=true\n\n"
+            + "The jacocoagent.jar file can be extracted from the appropriate maven artifact into the target directory "
+            + "using 'mvn process-sources -P extractJacocoAgent' if you have this module's source code.\n\n"
             + "With this servlet installed, you can generate a JaCoCo coverage report "
             + "as follows (for example), from a folder that contains a pom.xml:\n\n"
-            + "  curl http://localhost:8080/system/sling/jacoco/exec > target/jacoco.exec\n"
+            + "  curl -o target/jacoco.exec http://localhost:8080/system/sling/jacoco/exec\n"
             + "  mvn org.jacoco:jacoco-maven-plugin:report\n"
             + "  open target/site/jacoco/index.html\n\n"
             ;