diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/test')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/ClassLoaderReleaseTestCase.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/ClassLoaderReleaseTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/ClassLoaderReleaseTestCase.java index 50f212ebf3..4488458f5a 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/ClassLoaderReleaseTestCase.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/ClassLoaderReleaseTestCase.java @@ -39,10 +39,13 @@ public class ClassLoaderReleaseTestCase { public void testInstallDeployable() throws IOException, ActivationException{
File f = copyFile("src/test/resources/sample-helloworld.jar");
Node node = TuscanyRuntime.runComposite(null, f.toURI().toURL().toString());
- Assert.assertFalse(f.delete());
- Map<String, List<String>> scuris = node.getStartedCompositeURIs();
- node.stopCompositeAndUninstallUnused(scuris.keySet().iterator().next(), scuris.get(scuris.keySet().iterator().next()).get(0));
- Assert.assertTrue(f.delete());
+ // this delete should fail on Windows as the jar is locked, but the doesn't seem to happen in 'nix
+ boolean b = f.delete();
+ if (!b) {
+ Map<String, List<String>> scuris = node.getStartedCompositeURIs();
+ node.stopCompositeAndUninstallUnused(scuris.keySet().iterator().next(), scuris.get(scuris.keySet().iterator().next()).get(0));
+ Assert.assertTrue(f.delete());
+ }
}
private File copyFile(String fileName) throws IOException {
|