Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban Dugueperoux2016-01-25 09:37:22 +0000
committerEsteban DUGUEPEROUX2016-01-27 16:50:26 +0000
commit69f8e50b6e9089a141883882c5e14312c0a40a81 (patch)
treeec45db935a326d0cd9531641bcf778cd83e3c88b
parentac6986e571e76e8fbb37bfc69d14a1f8213ff379 (diff)
downloadorg.eclipse.sirius-69f8e50b6e9089a141883882c5e14312c0a40a81.tar.gz
org.eclipse.sirius-69f8e50b6e9089a141883882c5e14312c0a40a81.tar.xz
org.eclipse.sirius-69f8e50b6e9089a141883882c5e14312c0a40a81.zip
[481846] Use InMemoryResource's URI instead of URI without scheme
- Use InMemoryResource's URI instead of URI without scheme to avoid test.{ecore, aird} resource creation at root of org.eclipse.sirius.tests.junit plugin which make ToolFilterDescriptionListenerTests fail with https://git.eclipse.org/r/#/c/64846/ because test.aird is created with a DAnalysis having version too recent. Bug: 481846 Change-Id: Iea6948965eab1915d3ff35662bcae3af6f667dd6 Signed-off-by: Esteban Dugueperoux <esteban.dugueperoux@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/tools/ToolFilterDescriptionListenerTests.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/tools/ToolFilterDescriptionListenerTests.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/tools/ToolFilterDescriptionListenerTests.java
index a5751c4743..100141b5d4 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/tools/ToolFilterDescriptionListenerTests.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/tools/ToolFilterDescriptionListenerTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@ package org.eclipse.sirius.tests.unit.api.tools;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
-import junit.framework.TestCase;
import org.eclipse.core.commands.operations.DefaultOperationHistory;
import org.eclipse.core.commands.operations.IOperationHistory;
@@ -27,6 +26,7 @@ import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
+import org.eclipse.sirius.business.api.query.URIQuery;
import org.eclipse.sirius.business.api.session.DefaultLocalSessionCreationOperation;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.api.session.SessionCreationOperation;
@@ -40,8 +40,16 @@ import org.eclipse.sirius.viewpoint.description.tool.ToolFilterDescription;
import com.google.common.collect.Maps;
+import junit.framework.TestCase;
+
public class ToolFilterDescriptionListenerTests extends TestCase {
+ private static final String TEMPORARY_PROJECT_NAME = "DesignerTestProject";
+
+ private static final String SESSION_MODEL_FILENAME = "test.aird";
+
+ private static final String SEMANTIC_MODEL_FILENAME = "test.ecore";
+
private TransactionalEditingDomain editingDomain;
private Session session;
@@ -59,11 +67,13 @@ public class ToolFilterDescriptionListenerTests extends TestCase {
/* create an editing domain */
editingDomain = createEditingDomain(rset);
- final Resource resource = editingDomain.getResourceSet().createResource(URI.createFileURI("test.ecore"));
+ URI semanticResourceURI = URI.createURI(URIQuery.INMEMORY_URI_SCHEME + ":/" + TEMPORARY_PROJECT_NAME + "/" + SEMANTIC_MODEL_FILENAME);
+ final Resource resource = editingDomain.getResourceSet().createResource(semanticResourceURI);
ePackage = createEPackage(resource);
resource.save(Maps.newHashMap());
- final Resource airdResource = editingDomain.getResourceSet().createResource(URI.createFileURI("test.aird"));
+ URI sessionResourceURI = URI.createURI(URIQuery.INMEMORY_URI_SCHEME + ":/" + TEMPORARY_PROJECT_NAME + "/" + SESSION_MODEL_FILENAME);
+ final Resource airdResource = editingDomain.getResourceSet().createResource(sessionResourceURI);
SessionCreationOperation sessionCreationOperation = new DefaultLocalSessionCreationOperation(airdResource.getURI(), new NullProgressMonitor());
sessionCreationOperation.execute();

Back to the top