|
Lines 56-62
Link Here
|
| 56 |
/** |
56 |
/** |
| 57 |
* @author Marcelo Paternostro |
57 |
* @author Marcelo Paternostro |
| 58 |
* @author Paul E. Slauenwhite |
58 |
* @author Paul E. Slauenwhite |
| 59 |
* @version January 24, 2008 |
59 |
* @version February 11, 2008 |
| 60 |
* @since January 25, 2005 |
60 |
* @since January 25, 2005 |
| 61 |
*/ |
61 |
*/ |
| 62 |
public class ExecutionUtil |
62 |
public class ExecutionUtil |
|
Lines 329-334
Link Here
|
| 329 |
{ |
329 |
{ |
| 330 |
if((tests != null) && (!tests.isEmpty())) |
330 |
if((tests != null) && (!tests.isEmpty())) |
| 331 |
{ |
331 |
{ |
|
|
332 |
ResourceSet resourceSet = null; |
| 332 |
Set resourcePrefixes = new HashSet(tests.size()+1); |
333 |
Set resourcePrefixes = new HashSet(tests.size()+1); |
| 333 |
for (Iterator i = tests.iterator(); i.hasNext();) |
334 |
for (Iterator i = tests.iterator(); i.hasNext();) |
| 334 |
{ |
335 |
{ |
|
Lines 338-343
Link Here
|
| 338 |
TPFTest test = (TPFTest)object; |
339 |
TPFTest test = (TPFTest)object; |
| 339 |
if(test.eResource() != null) |
340 |
if(test.eResource() != null) |
| 340 |
{ |
341 |
{ |
|
|
342 |
if(resourceSet == null) |
| 343 |
resourceSet = test.eResource().getResourceSet(); |
| 344 |
|
| 341 |
URI uri = test.eResource().getURI().trimFileExtension(); |
345 |
URI uri = test.eResource().getURI().trimFileExtension(); |
| 342 |
resourcePrefixes.add(uri.lastSegment().toString()); |
346 |
resourcePrefixes.add(uri.lastSegment().toString()); |
| 343 |
} |
347 |
} |
|
Lines 346-351
Link Here
|
| 346 |
|
350 |
|
| 347 |
if(!resourcePrefixes.isEmpty()) |
351 |
if(!resourcePrefixes.isEmpty()) |
| 348 |
{ |
352 |
{ |
|
|
353 |
final ResourceSet finalResourceSet = resourceSet; |
| 349 |
final String[] prefixes = (String[])resourcePrefixes.toArray(new String[resourcePrefixes.size()]); |
354 |
final String[] prefixes = (String[])resourcePrefixes.toArray(new String[resourcePrefixes.size()]); |
| 350 |
final Map ret = new HashMap(resourcePrefixes.size()+1,1); |
355 |
final Map ret = new HashMap(resourcePrefixes.size()+1,1); |
| 351 |
ResourceUtil.IGetFilesVisitor visitor = new ResourceUtil.IGetFilesVisitor() |
356 |
ResourceUtil.IGetFilesVisitor visitor = new ResourceUtil.IGetFilesVisitor() |
|
Lines 356-362
Link Here
|
| 356 |
{ |
361 |
{ |
| 357 |
if(file.getName().startsWith(prefixes[i])) |
362 |
if(file.getName().startsWith(prefixes[i])) |
| 358 |
{ |
363 |
{ |
| 359 |
EObject[] eObjects = ResourceUtil.load(new ResourceSetImpl(), file); |
364 |
EObject[] eObjects = ResourceUtil.load(finalResourceSet, file); |
| 360 |
if((eObjects.length == 1) && (eObjects[0] instanceof TPFExecutionResult)) |
365 |
if((eObjects.length == 1) && (eObjects[0] instanceof TPFExecutionResult)) |
| 361 |
{ |
366 |
{ |
| 362 |
TPFExecutionResult executionResult = (TPFExecutionResult)eObjects[0]; |
367 |
TPFExecutionResult executionResult = (TPFExecutionResult)eObjects[0]; |