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

Bug 344272

Summary: epsilon.storeModel throws exception when saving
Product: [Modeling] Epsilon Reporter: Antonio Garcia-Dominguez <agarcdomi>
Component: CoreAssignee: Antonio Garcia-Dominguez <agarcdomi>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dkolovos
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: interim

Description Antonio Garcia-Dominguez CLA 2011-04-29 09:35:09 EDT
I have tried to use the <epsilon.storeModel> task to take a snapshot of a model before loading it for ATL, but I get this exception:

java.io.IOException: The path '/local/d0p6/antonio/repositories/org.eclipse.gmt.epsilon/tests/org.eclipse.epsilon.workflow.test/resources/eunit/null1429701540' is unmapped
at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createOutputStream(PlatformResourceURIHandlerImpl.java:428)
at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createOutputStream(ExtensibleURIConverterImpl.java:290)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:990)
at org.eclipse.epsilon.emc.emf.AbstractEmfModel.store(AbstractEmfModel.java:343)
at org.eclipse.epsilon.emc.emf.AbstractEmfModel.store(AbstractEmfModel.java:332)
at org.eclipse.epsilon.workflow.tasks.StoreModelTask.executeImpl(StoreModelTask.java:33)
at org.eclipse.epsilon.workflow.tasks.EpsilonTask.execute(EpsilonTask.java:40)

Looking more closely, StoreModelTask seems to be passing the absolute path to the specified file to the store() method:

IModel eolModel = getProjectRepository().getModelByName(model);
if (target!=null) {
  eolModel.store(target.getAbsolutePath());
}
else {
  eolModel.store();
}

However, there is a test in EmfModelStoreTests checking that store does *not* work if store() is called with a raw path, without a scheme (such as "file://"), called storeFailsForAbsolutePathsWithoutASchema. I guess there was some internal change and we just forgot to update the Ant task.
Comment 1 Antonio Garcia-Dominguez CLA 2011-04-29 09:38:06 EDT
I have added a test and a fix in r1371.
Comment 2 Antonio Garcia-Dominguez CLA 2011-04-29 10:08:06 EDT
More testing seems to indicate that this works fine now.
Comment 3 Dimitris Kolovos CLA 2011-07-25 08:17:40 EDT
Fixed in 0.9.1