diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-09-07 15:20:44 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-09-07 15:20:44 +0000 |
commit | 9a82a3194c89a9d1ed90b72587d2ad1b964c5390 (patch) | |
tree | ff617c5bab9bec6d55a8c56e587ea8e1ee959cf9 | |
parent | 2a9d4e8bb9ff53133dcc096bc6733a1246a30415 (diff) |
Fix testcase so that if the initial file delete does work (which happens on non-windows systems) then the testcase doesn't fail
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1166222 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-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 {
|