Author: [email protected]
Date: Mon Jan 30 12:12:29 2012
New Revision: 2020

Log:
Initial version of code coverage demo projects.

Added:
   sandbox/marrs/amdatu-codecoverage/
   sandbox/marrs/amdatu-codecoverage/pom.xml
   sandbox/marrs/amdatu-codecoverage/projectA/
   sandbox/marrs/amdatu-codecoverage/projectA/.classpath
   sandbox/marrs/amdatu-codecoverage/projectA/.project
   sandbox/marrs/amdatu-codecoverage/projectA/.settings/
   
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.core.resources.prefs
   
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.jdt.core.prefs
   
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.m2e.core.prefs
   
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.pde.core.prefs
   sandbox/marrs/amdatu-codecoverage/projectA/pom.xml
   sandbox/marrs/amdatu-codecoverage/projectA/src/
   sandbox/marrs/amdatu-codecoverage/projectA/src/main/
   sandbox/marrs/amdatu-codecoverage/projectA/src/main/java/
   sandbox/marrs/amdatu-codecoverage/projectA/src/main/java/org/
   sandbox/marrs/amdatu-codecoverage/projectA/src/main/java/org/amdatu/
   sandbox/marrs/amdatu-codecoverage/projectA/src/main/java/org/amdatu/test/
   
sandbox/marrs/amdatu-codecoverage/projectA/src/main/java/org/amdatu/test/ActivatorA.java
   
sandbox/marrs/amdatu-codecoverage/projectA/src/main/java/org/amdatu/test/UnitTestedA.java
   sandbox/marrs/amdatu-codecoverage/projectA/src/test/
   sandbox/marrs/amdatu-codecoverage/projectA/src/test/java/
   sandbox/marrs/amdatu-codecoverage/projectA/src/test/java/org/
   sandbox/marrs/amdatu-codecoverage/projectA/src/test/java/org/amdatu/
   sandbox/marrs/amdatu-codecoverage/projectA/src/test/java/org/amdatu/test/
   
sandbox/marrs/amdatu-codecoverage/projectA/src/test/java/org/amdatu/test/UnitTest.java
   sandbox/marrs/amdatu-codecoverage/projectB/
   sandbox/marrs/amdatu-codecoverage/projectB/.classpath
   sandbox/marrs/amdatu-codecoverage/projectB/.project
   sandbox/marrs/amdatu-codecoverage/projectB/.settings/
   
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.core.resources.prefs
   
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.jdt.core.prefs
   
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.m2e.core.prefs
   
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.pde.core.prefs
   sandbox/marrs/amdatu-codecoverage/projectB/pom.xml
   sandbox/marrs/amdatu-codecoverage/projectB/src/
   sandbox/marrs/amdatu-codecoverage/projectB/src/main/
   sandbox/marrs/amdatu-codecoverage/projectB/src/main/java/
   sandbox/marrs/amdatu-codecoverage/projectB/src/main/java/org/
   sandbox/marrs/amdatu-codecoverage/projectB/src/main/java/org/amdatu/
   sandbox/marrs/amdatu-codecoverage/projectB/src/main/java/org/amdatu/test/
   
sandbox/marrs/amdatu-codecoverage/projectB/src/main/java/org/amdatu/test/ActivatorB.java
   
sandbox/marrs/amdatu-codecoverage/projectB/src/main/java/org/amdatu/test/UnitTestedB.java
   sandbox/marrs/amdatu-codecoverage/projectB/src/test/
   sandbox/marrs/amdatu-codecoverage/projectB/src/test/java/
   sandbox/marrs/amdatu-codecoverage/projectB/src/test/java/org/
   sandbox/marrs/amdatu-codecoverage/projectB/src/test/java/org/amdatu/
   sandbox/marrs/amdatu-codecoverage/projectB/src/test/java/org/amdatu/test/
   
sandbox/marrs/amdatu-codecoverage/projectB/src/test/java/org/amdatu/test/UnitTest.java
   sandbox/marrs/amdatu-codecoverage/projectC/
   sandbox/marrs/amdatu-codecoverage/projectC/.classpath
   sandbox/marrs/amdatu-codecoverage/projectC/.project
   sandbox/marrs/amdatu-codecoverage/projectC/.settings/
   
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.core.resources.prefs
   
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.jdt.core.prefs
   
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.m2e.core.prefs
   
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.pde.core.prefs
   sandbox/marrs/amdatu-codecoverage/projectC/pom.xml
   sandbox/marrs/amdatu-codecoverage/projectC/src/
   sandbox/marrs/amdatu-codecoverage/projectC/src/main/
   sandbox/marrs/amdatu-codecoverage/projectC/src/main/java/
   sandbox/marrs/amdatu-codecoverage/projectC/src/test/
   sandbox/marrs/amdatu-codecoverage/projectC/src/test/java/
   sandbox/marrs/amdatu-codecoverage/projectC/src/test/java/org/
   sandbox/marrs/amdatu-codecoverage/projectC/src/test/java/org/amdatu/
   sandbox/marrs/amdatu-codecoverage/projectC/src/test/java/org/amdatu/itest/
   
sandbox/marrs/amdatu-codecoverage/projectC/src/test/java/org/amdatu/itest/InvokeServiceTest.java

Added: sandbox/marrs/amdatu-codecoverage/pom.xml
==============================================================================
--- (empty file)
+++ sandbox/marrs/amdatu-codecoverage/pom.xml   Mon Jan 30 12:12:29 2012
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (c) 2010, 2011 The Amdatu Foundation Licensed under the Apache 
License, Version 2.0 (the "License"); you may 
+  not use this file except in compliance with the License. You may obtain a 
copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+  Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS 
+  IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
implied. See the License for the specific language 
+  governing permissions and limitations under the License.verning permissions 
and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.amdatu</groupId>
+  <artifactId>reactor</artifactId>
+  <version>1</version>
+  <packaging>pom</packaging>
+  <name>Amdatu Reactor</name>
+  <description>Amdatu Maven reactor</description>
+  <url>http://wwwm.amdatu.org/</url>
+  <inceptionYear>2010</inceptionYear>
+
+  <build>
+    <defaultGoal>install</defaultGoal>
+  </build>
+  <modules>
+    <module>projectA</module>
+    <module>projectB</module>
+    <module>projectC</module>
+  </modules>
+</project>

Added: sandbox/marrs/amdatu-codecoverage/projectA/.classpath
==============================================================================
--- (empty file)
+++ sandbox/marrs/amdatu-codecoverage/projectA/.classpath       Mon Jan 30 
12:12:29 2012
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" 
path="src/main/java"/>
+       <classpathentry kind="src" output="target/test-classes" 
path="src/test/java"/>
+       <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" 
path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: sandbox/marrs/amdatu-codecoverage/projectA/.project
==============================================================================
--- (empty file)
+++ sandbox/marrs/amdatu-codecoverage/projectA/.project Mon Jan 30 12:12:29 2012
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>projectA</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>

Added: 
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.core.resources.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.core.resources.prefs
       Mon Jan 30 12:12:29 2012
@@ -0,0 +1,5 @@
+#Mon Jan 30 09:36:38 CET 2012
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/test/java=UTF-8
+encoding/<project>=UTF-8

Added: 
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.jdt.core.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.jdt.core.prefs 
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,6 @@
+#Mon Jan 30 09:36:38 CET 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5

Added: 
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.m2e.core.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.m2e.core.prefs 
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,5 @@
+#Mon Jan 30 09:36:34 CET 2012
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1

Added: 
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.pde.core.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectA/.settings/org.eclipse.pde.core.prefs 
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,3 @@
+#Mon Jan 30 09:36:39 CET 2012
+BUNDLE_ROOT_PATH=target/classes
+eclipse.preferences.version=1

Added: sandbox/marrs/amdatu-codecoverage/projectA/pom.xml
==============================================================================
--- (empty file)
+++ sandbox/marrs/amdatu-codecoverage/projectA/pom.xml  Mon Jan 30 12:12:29 2012
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright (c) 2010, 2011 The Amdatu Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.verning permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.amdatu.core</groupId>
+    <artifactId>org.amdatu.core</artifactId>
+    <version>0.3.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.amdatu.core</groupId>
+  <artifactId>projectA</artifactId>
+  <packaging>bundle</packaging>
+  <name>Amdatu Code Coverage - Project A</name>
+  <description>Demo Project to show off code coverage.</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-container-native</artifactId>
+      <version>2.3.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-junit4</artifactId>
+      <version>2.3.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+      <version>1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-link-mvn</artifactId>
+      <version>2.3.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.url</groupId>
+      <artifactId>pax-url-aether</artifactId>
+      <version>1.3.5</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.url</groupId>
+      <artifactId>pax-url-wrap</artifactId>
+      <version>1.3.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.framework</artifactId>
+      <version>4.0.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.atlassian.maven.plugins</groupId>
+      <artifactId>maven-clover2-plugin</artifactId>
+      <version>3.1.3</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>com.atlassian.maven.plugins</groupId>
+        <artifactId>maven-clover2-plugin</artifactId>
+        <version>3.1.3</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <Bundle-Activator>org.amdatu.test.ActivatorA</Bundle-Activator>
+            <Bundle-SymbolicName>projectA</Bundle-SymbolicName>
+            <Private-Package>org.amdatu.test</Private-Package>
+            <Import-Package>com_*;resolution:=optional,*</Import-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>maven-paxexam-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>integration-test</phase>
+            <id>generate-depends-file</id>
+            <goals>
+              <goal>generate-depends-file</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>run-integration-test</id>
+            <phase>integration-test</phase>
+            <goals>
+              <goal>test</goal>
+            </goals>
+            <configuration>
+              <systemPropertyVariables>
+                  </systemPropertyVariables>
+              <skip>false</skip>
+            </configuration>
+          </execution>
+        </executions>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: 
sandbox/marrs/amdatu-codecoverage/projectA/src/main/java/org/amdatu/test/ActivatorA.java
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectA/src/main/java/org/amdatu/test/ActivatorA.java
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,26 @@
+package org.amdatu.test;
+
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+
+public class ActivatorA extends DependencyActivatorBase implements Runnable {
+
+       @Override
+       public void init(BundleContext context, DependencyManager manager) 
throws Exception {
+               manager.add(createComponent()
+                       .setInterface(Runnable.class.getName(), null)
+                       .setImplementation(this)
+               );
+       }
+
+       @Override
+       public void destroy(BundleContext context, DependencyManager manager) 
throws Exception {
+       }
+
+       public void run() {
+               UnitTestedA t = new UnitTestedA();
+               t.itested();
+               System.out.println("running");
+       }
+}

Added: 
sandbox/marrs/amdatu-codecoverage/projectA/src/main/java/org/amdatu/test/UnitTestedA.java
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectA/src/main/java/org/amdatu/test/UnitTestedA.java
   Mon Jan 30 12:12:29 2012
@@ -0,0 +1,13 @@
+package org.amdatu.test;
+
+public class UnitTestedA {
+       public void tested() {
+               System.out.println("in tested");
+       }
+       public void itested() {
+               System.out.println("in itested");
+       }
+       public void untested() {
+               System.out.println("in untested");
+       }
+}

Added: 
sandbox/marrs/amdatu-codecoverage/projectA/src/test/java/org/amdatu/test/UnitTest.java
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectA/src/test/java/org/amdatu/test/UnitTest.java
      Mon Jan 30 12:12:29 2012
@@ -0,0 +1,10 @@
+package org.amdatu.test;
+
+import org.junit.Test;
+
+public class UnitTest {
+       @Test public void testEverything() {
+               UnitTestedA t = new UnitTestedA();
+               t.tested();
+       }
+}
\ No newline at end of file

Added: sandbox/marrs/amdatu-codecoverage/projectB/.classpath
==============================================================================
--- (empty file)
+++ sandbox/marrs/amdatu-codecoverage/projectB/.classpath       Mon Jan 30 
12:12:29 2012
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" 
path="src/main/java"/>
+       <classpathentry kind="src" output="target/test-classes" 
path="src/test/java"/>
+       <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" 
path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: sandbox/marrs/amdatu-codecoverage/projectB/.project
==============================================================================
--- (empty file)
+++ sandbox/marrs/amdatu-codecoverage/projectB/.project Mon Jan 30 12:12:29 2012
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>projectB</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>

Added: 
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.core.resources.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.core.resources.prefs
       Mon Jan 30 12:12:29 2012
@@ -0,0 +1,5 @@
+#Mon Jan 30 09:36:35 CET 2012
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/test/java=UTF-8
+encoding/<project>=UTF-8

Added: 
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.jdt.core.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.jdt.core.prefs 
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,6 @@
+#Mon Jan 30 09:36:35 CET 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5

Added: 
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.m2e.core.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.m2e.core.prefs 
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,5 @@
+#Mon Jan 30 09:36:35 CET 2012
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1

Added: 
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.pde.core.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectB/.settings/org.eclipse.pde.core.prefs 
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,3 @@
+#Mon Jan 30 09:36:36 CET 2012
+BUNDLE_ROOT_PATH=target/classes
+eclipse.preferences.version=1

Added: sandbox/marrs/amdatu-codecoverage/projectB/pom.xml
==============================================================================
--- (empty file)
+++ sandbox/marrs/amdatu-codecoverage/projectB/pom.xml  Mon Jan 30 12:12:29 2012
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright (c) 2010, 2011 The Amdatu Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.verning permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.amdatu.core</groupId>
+    <artifactId>org.amdatu.core</artifactId>
+    <version>0.3.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.amdatu.core</groupId>
+  <artifactId>projectB</artifactId>
+  <packaging>bundle</packaging>
+  <name>Amdatu Code Coverage - Project B</name>
+  <description>Demo Project to show off code coverage.</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-container-native</artifactId>
+      <version>2.3.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-junit4</artifactId>
+      <version>2.3.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+      <version>1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-link-mvn</artifactId>
+      <version>2.3.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.url</groupId>
+      <artifactId>pax-url-aether</artifactId>
+      <version>1.3.5</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.url</groupId>
+      <artifactId>pax-url-wrap</artifactId>
+      <version>1.3.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.framework</artifactId>
+      <version>4.0.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.atlassian.maven.plugins</groupId>
+      <artifactId>maven-clover2-plugin</artifactId>
+      <version>3.1.3</version>
+      <scope>test</scope>
+    </dependency>
+    <!--
+    <dependency>
+      <groupId>org.amdatu.core</groupId>
+      <artifactId>org.amdatu.demo2</artifactId>
+      <version>0.3.0-SNAPSHOT</version>
+    </dependency>
+    -->
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>com.atlassian.maven.plugins</groupId>
+        <artifactId>maven-clover2-plugin</artifactId>
+        <version>3.1.3</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <Bundle-Activator>org.amdatu.test.ActivatorB</Bundle-Activator>
+            <Bundle-SymbolicName>projectB</Bundle-SymbolicName>
+            <Private-Package>org.amdatu.test</Private-Package>
+            <Import-Package>com_*;resolution:=optional,*</Import-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>maven-paxexam-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>integration-test</phase>
+            <id>generate-depends-file</id>
+            <goals>
+              <goal>generate-depends-file</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>run-integration-test</id>
+            <phase>integration-test</phase>
+            <goals>
+              <goal>test</goal>
+            </goals>
+            <configuration>
+              <systemPropertyVariables>
+                  </systemPropertyVariables>
+              <skip>false</skip>
+            </configuration>
+          </execution>
+        </executions>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: 
sandbox/marrs/amdatu-codecoverage/projectB/src/main/java/org/amdatu/test/ActivatorB.java
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectB/src/main/java/org/amdatu/test/ActivatorB.java
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,26 @@
+package org.amdatu.test;
+
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+
+public class ActivatorB extends DependencyActivatorBase implements Runnable {
+
+       @Override
+       public void init(BundleContext context, DependencyManager manager) 
throws Exception {
+               manager.add(createComponent()
+                       .setInterface(Runnable.class.getName(), null)
+                       .setImplementation(this)
+               );
+       }
+
+       @Override
+       public void destroy(BundleContext context, DependencyManager manager) 
throws Exception {
+       }
+
+       public void run() {
+               UnitTestedB t = new UnitTestedB();
+               t.itested();
+               System.out.println("running");
+       }
+}

Added: 
sandbox/marrs/amdatu-codecoverage/projectB/src/main/java/org/amdatu/test/UnitTestedB.java
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectB/src/main/java/org/amdatu/test/UnitTestedB.java
   Mon Jan 30 12:12:29 2012
@@ -0,0 +1,13 @@
+package org.amdatu.test;
+
+public class UnitTestedB {
+       public void tested() {
+               System.out.println("in tested");
+       }
+       public void itested() {
+               System.out.println("in itested");
+       }
+       public void untested() {
+               System.out.println("in untested");
+       }
+}

Added: 
sandbox/marrs/amdatu-codecoverage/projectB/src/test/java/org/amdatu/test/UnitTest.java
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectB/src/test/java/org/amdatu/test/UnitTest.java
      Mon Jan 30 12:12:29 2012
@@ -0,0 +1,10 @@
+package org.amdatu.test;
+
+import org.junit.Test;
+
+public class UnitTest {
+       @Test public void testEverything() {
+               UnitTestedB t = new UnitTestedB();
+               t.tested();
+       }
+}
\ No newline at end of file

Added: sandbox/marrs/amdatu-codecoverage/projectC/.classpath
==============================================================================
--- (empty file)
+++ sandbox/marrs/amdatu-codecoverage/projectC/.classpath       Mon Jan 30 
12:12:29 2012
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" 
path="src/main/java"/>
+       <classpathentry kind="src" output="target/test-classes" 
path="src/test/java"/>
+       <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" 
path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: sandbox/marrs/amdatu-codecoverage/projectC/.project
==============================================================================
--- (empty file)
+++ sandbox/marrs/amdatu-codecoverage/projectC/.project Mon Jan 30 12:12:29 2012
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>projectB</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>

Added: 
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.core.resources.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.core.resources.prefs
       Mon Jan 30 12:12:29 2012
@@ -0,0 +1,5 @@
+#Mon Jan 30 09:36:35 CET 2012
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/test/java=UTF-8
+encoding/<project>=UTF-8

Added: 
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.jdt.core.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.jdt.core.prefs 
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,6 @@
+#Mon Jan 30 09:36:35 CET 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5

Added: 
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.m2e.core.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.m2e.core.prefs 
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,5 @@
+#Mon Jan 30 09:36:35 CET 2012
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1

Added: 
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.pde.core.prefs
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectC/.settings/org.eclipse.pde.core.prefs 
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,3 @@
+#Mon Jan 30 09:36:36 CET 2012
+BUNDLE_ROOT_PATH=target/classes
+eclipse.preferences.version=1

Added: sandbox/marrs/amdatu-codecoverage/projectC/pom.xml
==============================================================================
--- (empty file)
+++ sandbox/marrs/amdatu-codecoverage/projectC/pom.xml  Mon Jan 30 12:12:29 2012
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright (c) 2010, 2011 The Amdatu Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.verning permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.amdatu.core</groupId>
+    <artifactId>org.amdatu.core</artifactId>
+    <version>0.3.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.amdatu.core</groupId>
+  <artifactId>projectC</artifactId>
+  <packaging>bundle</packaging>
+  <name>Amdatu Code Coverage - Project C</name>
+  <description>Integration tests for A and B.</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-container-native</artifactId>
+      <version>2.3.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-junit4</artifactId>
+      <version>2.3.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+      <version>1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-link-mvn</artifactId>
+      <version>2.3.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.url</groupId>
+      <artifactId>pax-url-aether</artifactId>
+      <version>1.3.5</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.url</groupId>
+      <artifactId>pax-url-wrap</artifactId>
+      <version>1.3.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.framework</artifactId>
+      <version>4.0.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.atlassian.maven.plugins</groupId>
+      <artifactId>maven-clover2-plugin</artifactId>
+      <version>3.1.3</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.amdatu.core</groupId>
+      <artifactId>projectA</artifactId>
+      <version>0.3.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.amdatu.core</groupId>
+      <artifactId>projectB</artifactId>
+      <version>0.3.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>com.atlassian.maven.plugins</groupId>
+        <artifactId>maven-clover2-plugin</artifactId>
+        <version>3.1.3</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <Bundle-Activator>org.amdatu.test.Activator</Bundle-Activator>
+            <Bundle-SymbolicName>projectC</Bundle-SymbolicName>
+            <Private-Package>dummy</Private-Package>
+            <Import-Package>com_*;resolution:=optional,*</Import-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>maven-paxexam-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>integration-test</phase>
+            <id>generate-depends-file</id>
+            <goals>
+              <goal>generate-depends-file</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>run-integration-test</id>
+            <phase>integration-test</phase>
+            <goals>
+              <goal>test</goal>
+            </goals>
+            <configuration>
+              <systemPropertyVariables>
+                  </systemPropertyVariables>
+              <skip>false</skip>
+            </configuration>
+          </execution>
+        </executions>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: 
sandbox/marrs/amdatu-codecoverage/projectC/src/test/java/org/amdatu/itest/InvokeServiceTest.java
==============================================================================
--- (empty file)
+++ 
sandbox/marrs/amdatu-codecoverage/projectC/src/test/java/org/amdatu/itest/InvokeServiceTest.java
    Mon Jan 30 12:12:29 2012
@@ -0,0 +1,70 @@
+package org.amdatu.itest;
+
+
+
+import static org.ops4j.pax.exam.CoreOptions.bootDelegationPackages;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
+
+import javax.inject.Inject;
+
+import org.apache.felix.dm.DependencyManager;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.ExamReactorStrategy;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+@RunWith(JUnit4TestRunner.class)
+@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
+public class InvokeServiceTest {
+       @Inject
+       BundleContext m_context;
+       Runnable m_runnable;
+//     
+       
+    @Configuration
+    public Option[] config() {
+        return options(
+               bootDelegationPackages("com_*"),
+            junitBundles(),
+            
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.shell").version("1.4.2"),
+            
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.shell.tui").version("1.4.1"),
+            
wrappedBundle(mavenBundle().groupId("com.cenqua.clover").artifactId("clover").version("3.1.3")),
+            
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager").version("3.1.0-SNAPSHOT"),
+            
mavenBundle().groupId("org.amdatu.core").artifactId("projectA").versionAsInProject().start(false),
+            
mavenBundle().groupId("org.amdatu.core").artifactId("projectB").versionAsInProject().start(false)
+        );
+    }
+       
+       @Test
+       public void testService() throws Exception {
+               Bundle[] bundles = m_context.getBundles();
+               Bundle demoBundle = null;
+               Bundle demoBundle2 = null;
+               for (Bundle b : bundles) {
+                       System.out.println(b.getSymbolicName() + " " + 
b.getVersion());
+                       if (b.getSymbolicName().equals("projectA")) {
+                               demoBundle = b;
+                       }
+                       if (b.getSymbolicName().equals("projectB")) {
+                               demoBundle2 = b;
+                       }
+               }
+               DependencyManager dm = new DependencyManager(m_context);
+               
dm.add(dm.createComponent().setImplementation(this).add(dm.createServiceDependency().setService(Runnable.class).setRequired(true)));
+               demoBundle.start();
+               demoBundle2.start();
+               m_runnable.run();
+               demoBundle.stop();
+               m_runnable.run();
+               demoBundle2.stop();
+       }
+}
+
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits

Reply via email to