Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331944

Summary: tmpdir path assembly incorrect
Product: [Modeling] EMF Reporter: Axel Uhl <eclipse>
Component: Query2Assignee: Project Inbox <emf.query2-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ashw.kumar, saurav.sarkar1
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Extended patch fixing more occurrences wayne.beaton: iplog+

Description Axel Uhl CLA 2010-12-06 14:57:27 EST
Build Identifier: CVS Head of 2010-12-06

In TestIndexNotSufficient and NavigationTest there are cases of incorrect path assembly. They accidentally work on Windows but don't on Linux. Below please find a patch which solves it for us.

diff --git a/prototypes/index/org.eclipse.emf.query.index.test/src/org/eclipse/emf/query/index/test/TestIndexNotSufficient.java b/prototypes/index/org.eclipse.emf.query.index.test/src/org/eclipse/emf/query/index/test/TestIndexNotSufficient.java
index 30e41e5..0a9142c 100644
--- a/prototypes/index/org.eclipse.emf.query.index.test/src/org/eclipse/emf/query/index/test/TestIndexNotSufficient.java
+++ b/prototypes/index/org.eclipse.emf.query.index.test/src/org/eclipse/emf/query/index/test/TestIndexNotSufficient.java
@@ -313,7 +313,7 @@ public class TestIndexNotSufficient extends Assert {
 	}
 
 	private static String getTempDir() {
-		return System.getProperty("java.io.tmpdir") + File.pathSeparator + "index";
+		return System.getProperty("java.io.tmpdir") + File.separator + "index";
 	}
 
 	@Test
diff --git a/prototypes/index/org.eclipse.emf.query.index.test/src/org/eclipse/emf/query/index/test/navigation/NavigationTest.java b/prototypes/index/org.eclipse.emf.query.index.test/src/org/eclipse/emf/query/index/test/navigation/NavigationTest.java
index c5760fa..27a9b6a 100644
--- a/prototypes/index/org.eclipse.emf.query.index.test/src/org/eclipse/emf/query/index/test/navigation/NavigationTest.java
+++ b/prototypes/index/org.eclipse.emf.query.index.test/src/org/eclipse/emf/query/index/test/navigation/NavigationTest.java
@@ -52,7 +52,7 @@ public class NavigationTest extends Assert {
 	private Resource cont;
 
 	public Options getOptions() {
-		return new Options("C:/tmp/", Options.DISABLED, Options.DISABLED);
+		return new Options(System.getProperty("java.io.tmpdir"), Options.DISABLED, Options.DISABLED);
 	}
 
 	@Test
@@ -100,7 +100,7 @@ public class NavigationTest extends Assert {
 
 	private Resource getEcoreCopy() throws Exception {
 		ResourceSet rs = new ResourceSetImpl();
-		Resource copy = rs.createResource(URI.createFileURI("C:/tmp/ecoreCopy.xmi"));
+		Resource copy = rs.createResource(URI.createFileURI(System.getProperty("java.io.tmpdir") + File.separator + "ecoreCopy.xmi"));
 		Resource ecoreResource = EcorePackage.eINSTANCE.eResource();
 		copy.getContents().add(EcorePackage.eINSTANCE);
 		copy.save(null);


Reproducible: Always
Comment 1 Axel Uhl CLA 2010-12-06 15:12:27 EST
Created attachment 184654 [details]
Extended patch fixing more occurrences

This patch fixes more occurrences
Comment 2 Ashwani Kr Sharma CLA 2010-12-09 10:30:32 EST
The fix is submitted.
The tests runs now on https://hudson.eclipse.org/hudson/job/tycho-query2-nightly/

The query2 project is also restructured.
use to sync all the projects: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/org.eclipse.emf.query2/releng/Query2_New.psf
Comment 3 saurav sarkar CLA 2010-12-12 08:41:38 EST
As Ashwani mentioned the fix has been submitted.