diff options
-rw-r--r-- | sca-java-1.x/trunk/itest/osgi-implementation/pom.xml | 14 | ||||
-rw-r--r-- | sca-java-1.x/trunk/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/sca-java-1.x/trunk/itest/osgi-implementation/pom.xml b/sca-java-1.x/trunk/itest/osgi-implementation/pom.xml index 4a6bd55263..651827b210 100644 --- a/sca-java-1.x/trunk/itest/osgi-implementation/pom.xml +++ b/sca-java-1.x/trunk/itest/osgi-implementation/pom.xml @@ -145,6 +145,12 @@ </dependency> <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.4</version> + </dependency> + + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.5</version> @@ -198,6 +204,14 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <forkMode>pertest</forkMode> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.1</version> diff --git a/sca-java-1.x/trunk/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java b/sca-java-1.x/trunk/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java index 7b95c12038..4639d7a692 100644 --- a/sca-java-1.x/trunk/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java +++ b/sca-java-1.x/trunk/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java @@ -18,6 +18,9 @@ */ package util; +import java.io.File; +import org.apache.commons.io.FileUtils; + import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime; @@ -37,6 +40,12 @@ public class OSGiTestUtil { String felixConfigFileName = "file:target/test-classes/osgi/felix/felix.config.properties"; System.setProperty("felix.config.properties", felixConfigFileName); + + // delete any cached OSGI bundles left over from previous test executions + File felixCache = new File("target/.felix"); + if (felixCache.exists()) { + FileUtils.cleanDirectory(felixCache); + } try { |