summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-07-01 11:25:25 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-07-01 11:25:25 +0000
commitd39d03fe1645cff533aeb82b0e901c98cc8c135c (patch)
treeffdff1f922c42745eb2775120a0c96490544a5c9
parentab803c465357998d6f77d60f0ede77f417b3b9bf (diff)
Delete OSGI bundle cache before running a new test (TUSCANY-3615)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@959617 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-1.x/trunk/itest/osgi-implementation/pom.xml14
-rw-r--r--sca-java-1.x/trunk/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java9
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 {