[bugzilla 384447] Improve RepositoryAdapter's SaveContexts Lifecycle
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/generator/modelgeneration/StructuralFeatureGenerator.java b/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/generator/modelgeneration/StructuralFeatureGenerator.java
index ec0ea26..166d864 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/generator/modelgeneration/StructuralFeatureGenerator.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/generator/modelgeneration/StructuralFeatureGenerator.java
@@ -46,6 +46,8 @@
  */

 public final class StructuralFeatureGenerator {

 

+	private static final String COMPILATION_EXCEPTION_MESSAGE_FEATURE = "The feature ";

+

 	/**

 	 * StructuralFeatureGenerator constructor.

 	 */

@@ -75,7 +77,7 @@
 			if (feature == null || feature.getEType() == null) {

 				modelingUnitGenerator.getInformationHolder().registerCompilationExceptionAsCompilationStatus(

 						new CompilationException(affectation, CompilationErrorType.INVALID_REFERENCE_ERROR,

-								"The feature " + feature.getName() + " is derived and cannot be set."));

+								COMPILATION_EXCEPTION_MESSAGE_FEATURE + feature.getName() + " is derived and cannot be set."));

 				// TODO externalize message

 				feature.setEType(EcorePackage.eINSTANCE.getEString());

 			}

@@ -120,7 +122,7 @@
 

 			} else {

 				CompilationStatus status = CompilerFactory.eINSTANCE.createCompilationStatus();

-				status.setMessage("The feature " + affectation.getName() + " is undefined for type "

+				status.setMessage(COMPILATION_EXCEPTION_MESSAGE_FEATURE + affectation.getName() + " is undefined for type "

 						+ eClass.eClass());

 				status.setTarget(affectation);

 				status.setSeverity(CompilationStatusSeverity.ERROR);

@@ -215,12 +217,12 @@
 			if (value instanceof Collection) {

 				for (Object element : (Collection<?>)value) {

 					if (element instanceof EObject && !isInstanceOf((EObject)element, type)) {

-						throw new InvalidValueException(unitInstruction, "The feature " + feature.getName()

+						throw new InvalidValueException(unitInstruction, COMPILATION_EXCEPTION_MESSAGE_FEATURE + feature.getName()

 								+ " cannot handle type " + element.getClass().getSimpleName() + ". ");

 					}

 				}

 			} else if (value instanceof EObject && !isInstanceOf((EObject)value, type)) {

-				throw new InvalidValueException(unitInstruction, "The feature " + feature.getName()

+				throw new InvalidValueException(unitInstruction, COMPILATION_EXCEPTION_MESSAGE_FEATURE + feature.getName()

 						+ " cannot handle type " + value.getClass().getSimpleName() + ". ");

 			}

 		}

diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/launcher/CompilerCreator.java b/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/launcher/CompilerCreator.java
index 4d106fb..04b59c9 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/launcher/CompilerCreator.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/launcher/CompilerCreator.java
@@ -63,16 +63,23 @@
 		listenedTypes.add(IntentDocumentPackage.eINSTANCE.getIntentSection_ModelingUnits());

 

 		for (EObject obj : ModelingUnitPackage.eINSTANCE.eContents()) {

-			if (obj instanceof EClass) {

+			if (obj instanceof EClass && !(ModelingUnitPackage.eINSTANCE.getTypeReference().equals(obj))) {

 				listenedTypes.addAll(TypeNotificator.getStructuralFeaturesForEClass((EClass)obj));

 			}

 		}

 		listenedTypes.remove(IntentDocumentPackage.eINSTANCE.getIntentGenericElement_CompilationStatus());

 		listenedTypes.remove(GenericUnitPackage.eINSTANCE.getGenericUnit_Instructions());

 		listenedTypes.remove(GenericUnitPackage.eINSTANCE.getGenericUnit_UnitName());

+		listenedTypes

+				.remove(ModelingUnitPackage.eINSTANCE.getContributionInstruction_ContributionReference());

+		listenedTypes.remove(ModelingUnitPackage.eINSTANCE

+				.getModelingUnitInstructionReference_ReferencedInstruction());

+		listenedTypes.remove(ModelingUnitPackage.eINSTANCE.getResourceReference_Declaration());

+		listenedTypes.remove(ModelingUnitPackage.eINSTANCE.getInstanceLevelInstruction_MetaType());

 

 		// Step 2: create the adapter and the handler for these types

 		final RepositoryAdapter repositoryAdapter = repository.createRepositoryAdapter();

+		repositoryAdapter.openSaveContext();

 

 		RepositoryObjectHandler handler;

 		handler = new ReadWriteRepositoryObjectHandlerImpl(repositoryAdapter);

diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/repositoryconnection/CompilerRepositoryClient.java b/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/repositoryconnection/CompilerRepositoryClient.java
index 14525a3..0903a4c 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/repositoryconnection/CompilerRepositoryClient.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.compiler/src/org/eclipse/mylyn/docs/intent/client/compiler/repositoryconnection/CompilerRepositoryClient.java
@@ -13,7 +13,6 @@
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.mylyn.docs.intent.collab.common.logger.IIntentLogger.LogType;
 import org.eclipse.mylyn.docs.intent.collab.common.logger.IntentLogger;
-import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.ReadOnlyException;
 import org.eclipse.mylyn.docs.intent.collab.handlers.impl.AbstractRepositoryClient;
 import org.eclipse.mylyn.docs.intent.collab.handlers.notification.RepositoryChangeNotification;
 import org.eclipse.mylyn.docs.intent.collab.repository.Repository;
@@ -57,24 +56,16 @@
 	 */
 	@Override
 	protected Job createNotificationJob(RepositoryChangeNotification notification) {
-		try {
-			// Open a save context if needed
-			if (this.repositoryObjectHandler.getRepositoryAdapter().getContext() == null) {
-				this.repositoryObjectHandler.getRepositoryAdapter().openSaveContext();
-			}
-		} catch (ReadOnlyException e) {
-			IntentLogger.getInstance().logError(e);
-		}
 		return new CompilationJob(this.repository, this.repositoryObjectHandler);
 	}
 
 	/**
 	 * {@inheritDoc}
 	 * 
-	 * @see org.eclipse.mylyn.docs.intent.collab.handlers.RepositoryClient#dispose()
+	 * @see org.eclipse.mylyn.docs.intent.collab.handlers.impl.AbstractRepositoryClient#dispose()
 	 */
+	@Override
 	public void dispose() {
-		this.repositoryObjectHandler.getRepositoryAdapter().closeContext();
 		this.repository.unregister(this);
 		super.dispose();
 	}
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.indexer/src/org/eclipse/mylyn/docs/intent/client/indexer/IndexerRepositoryClient.java b/plugins/org.eclipse.mylyn.docs.intent.client.indexer/src/org/eclipse/mylyn/docs/intent/client/indexer/IndexerRepositoryClient.java
index b66d01b..7b35407 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.indexer/src/org/eclipse/mylyn/docs/intent/client/indexer/IndexerRepositoryClient.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.indexer/src/org/eclipse/mylyn/docs/intent/client/indexer/IndexerRepositoryClient.java
@@ -61,14 +61,14 @@
 			repositoryAdapter.execute(new IntentCommand() {
 
 				public void execute() {
-					final IntentIndex index = new IndexQuery(repositoryAdapter).getOrCreateIntentIndex();
-					final IntentDocument document = new IntentDocumentQuery(repositoryAdapter)
-							.getOrCreateIntentDocument();
-					IntentLogger.getInstance().log(LogType.LIFECYCLE,
-							"[Indexer] Indexing " + document.getChapters().size() + " chapters");
 
 					try {
-						repositoryAdapter.openSaveContext();
+						final IntentIndex index = new IndexQuery(repositoryAdapter).getOrCreateIntentIndex();
+						final IntentDocument document = new IntentDocumentQuery(repositoryAdapter)
+								.getOrCreateIntentDocument();
+						IntentLogger.getInstance().log(LogType.LIFECYCLE,
+								"[Indexer] Indexing " + document.getChapters().size() + " chapters");
+
 						indexComputor.computeIndex(index, document);
 
 						repositoryAdapter.setSendSessionWarningBeforeSaving(Lists
@@ -79,7 +79,6 @@
 					} catch (ReadOnlyException e) {
 						IntentLogger.getInstance().log(LogType.ERROR, "Indexer failed to save changes", e);
 					}
-					repositoryAdapter.closeContext();
 					IntentLogger.getInstance().log(LogType.LIFECYCLE, "[Indexer] Index saved");
 				}
 			});
@@ -105,5 +104,4 @@
 		job.setSystem(true);
 		return job;
 	}
-
 }
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.indexer/src/org/eclipse/mylyn/docs/intent/client/indexer/launcher/IndexerCreator.java b/plugins/org.eclipse.mylyn.docs.intent.client.indexer/src/org/eclipse/mylyn/docs/intent/client/indexer/launcher/IndexerCreator.java
index f654892..18469b8 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.indexer/src/org/eclipse/mylyn/docs/intent/client/indexer/launcher/IndexerCreator.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.indexer/src/org/eclipse/mylyn/docs/intent/client/indexer/launcher/IndexerCreator.java
@@ -55,6 +55,7 @@
 

 		// Step 1 : adapter creation

 		final RepositoryAdapter repositoryAdapter = repository.createRepositoryAdapter();

+		repositoryAdapter.openSaveContext();

 

 		// Step 2 : creating the handler

 		RepositoryObjectHandler handler = new ReadWriteRepositoryObjectHandlerImpl(repositoryAdapter);

diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/SynchronizeRepositoryJob.java b/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/SynchronizeRepositoryJob.java
index c55ad3a..5c89acf 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/SynchronizeRepositoryJob.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/SynchronizeRepositoryJob.java
@@ -68,22 +68,11 @@
 			repositoryAdapter.execute(new IntentCommand() {
 
 				public void execute() {
-					try {
-						repositoryAdapter.openSaveContext();
-						client.setTraceabilityIndex((TraceabilityIndex)repositoryAdapter.reload(client
-								.getTraceabilityIndex()));
+					client.setTraceabilityIndex((TraceabilityIndex)repositoryAdapter.reload(client
+							.getTraceabilityIndex()));
 
-						IntentLogger.getInstance().log(LogType.LIFECYCLE,
-								"[Synchronizer] Start synchronization");
-						synchronize(monitor, repositoryAdapter);
-						repositoryAdapter.closeContext();
-					} catch (ReadOnlyException e) {
-						IntentLogger
-								.getInstance()
-								.log(LogType.ERROR,
-										"Synchronizer has insufficient rights (read-only) to save the modifications on the repository");
-					}
-
+					IntentLogger.getInstance().log(LogType.LIFECYCLE, "[Synchronizer] Start synchronization");
+					synchronize(monitor, repositoryAdapter);
 				}
 
 			});
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/launcher/SynchronizerCreator.java b/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/launcher/SynchronizerCreator.java
index 0e10f94..dc12851 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/launcher/SynchronizerCreator.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/launcher/SynchronizerCreator.java
@@ -104,7 +104,6 @@
 				}

 			}

 		}

-		repositoryAdapter.closeContext();

 		return synchronizerClient;

 

 	}

diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/synchronizer/IntentSynchronizer.java b/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/synchronizer/IntentSynchronizer.java
index ad81b5a..a4838b2 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/synchronizer/IntentSynchronizer.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/synchronizer/IntentSynchronizer.java
@@ -34,7 +34,6 @@
 import org.eclipse.emf.ecore.EObject;

 import org.eclipse.emf.ecore.resource.Resource;

 import org.eclipse.emf.ecore.resource.ResourceSet;

-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;

 import org.eclipse.mylyn.docs.intent.client.synchronizer.SynchronizerRepositoryClient;

 import org.eclipse.mylyn.docs.intent.client.synchronizer.api.contribution.ISynchronizerExtension;

 import org.eclipse.mylyn.docs.intent.client.synchronizer.api.contribution.ISynchronizerExtensionRegistry;

@@ -244,7 +243,7 @@
 

 		stopIfCanceled(progressMonitor);

 		// Step 2 : getting the generated resource

-		Resource externalResource = getExternalResource(indexEntry);

+		Resource externalResource = getExternalResource(adapter, indexEntry);

 

 		stopIfCanceled(progressMonitor);

 		// Step 3 : if one of the resource is null,

@@ -458,13 +457,15 @@
 	 * Returns the resource containing the compiled model currently inspected (<b>external</b> resource of the

 	 * repository : can be in a workspace, on internet...).

 	 * 

+	 * @param adapter

+	 *            the current {@link RepositoryAdapter}

 	 * @param indexEntry

 	 *            the indexEntry indicating the location of the compiled resource

 	 * @return the resource containing the compiled model currently inspected (<b>external</b> resource of the

 	 *         repository) - can be null if the resource doesn't exist.

 	 */

-	private Resource getExternalResource(TraceabilityIndexEntry indexEntry) {

-		ResourceSet resourceSet = new ResourceSetImpl();

+	private Resource getExternalResource(RepositoryAdapter adapter, TraceabilityIndexEntry indexEntry) {

+		ResourceSet resourceSet = adapter.getResourceSet();

 		Resource resource = null;

 		if (indexEntry.getResourceDeclaration() != null) {

 			URI externalURI = getResourceDeclarationURI(indexEntry.getResourceDeclaration());

diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/launcher/IntentCDOManager.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/launcher/IntentCDOManager.java
index 1562a6e..770b412 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/launcher/IntentCDOManager.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/launcher/IntentCDOManager.java
@@ -19,7 +19,6 @@
 import org.eclipse.mylyn.docs.intent.client.compiler.launcher.CompilerCreator;

 import org.eclipse.mylyn.docs.intent.client.compiler.repositoryconnection.CompilerRepositoryClient;

 import org.eclipse.mylyn.docs.intent.client.indexer.IndexerRepositoryClient;

-import org.eclipse.mylyn.docs.intent.client.indexer.launcher.IndexerCreator;

 import org.eclipse.mylyn.docs.intent.client.linkresolver.repository.LinkResolverClient;

 import org.eclipse.mylyn.docs.intent.client.linkresolver.repository.LinkResolverCreator;

 import org.eclipse.mylyn.docs.intent.client.synchronizer.SynchronizerRepositoryClient;

@@ -141,14 +140,14 @@
 		}

 

 		// Indexer

-		if (indexerClient == null) {

-			indexerClient = IndexerCreator.createIndexer(repository);

-		}

+		// if (indexerClient == null) {

+		// indexerClient = IndexerCreator.createIndexer(repository);

+		// }

 

 		// notifies the clients

 

 		// launch the indexer in order to allow navigation within the document

-		indexerClient.handleChangeNotification(null);

+		// indexerClient.handleChangeNotification(null);

 

 		// launch the compiler to detect eventual existing issues

 		compilerClient.handleChangeNotification(null);

diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/repository/IntentCDOBasedRepositoryManagerContribution.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/repository/IntentCDOBasedRepositoryManagerContribution.java
index 6d813e7..591799d 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/repository/IntentCDOBasedRepositoryManagerContribution.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/repository/IntentCDOBasedRepositoryManagerContribution.java
@@ -68,7 +68,7 @@
 	 * @return the repository name
 	 */
 	private String getRepositoryName(String identifier) {
-		String repositoryName = identifier.replaceFirst("cdo:/", "");
+		String repositoryName = identifier.replaceFirst("cdo://", "").replaceFirst("cdo:/", "");
 		repositoryName = repositoryName.split("/")[0];
 		return repositoryName;
 	}
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/ProjectExplorerRefresher.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/ProjectExplorerRefresher.java
index aec3126..9500d4a 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/ProjectExplorerRefresher.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/ProjectExplorerRefresher.java
@@ -84,6 +84,7 @@
 		Repository repository = IntentRepositoryManager.INSTANCE.getRepository(project.getName());

 		final RepositoryAdapter repositoryAdapter = repository.createRepositoryAdapter();

 

+		repositoryAdapter.openSaveContext();

 		// Step 2 : Creating the RepositoryObjectHandler for this client

 		RepositoryObjectHandler handler = new ReadWriteRepositoryObjectHandlerImpl(repositoryAdapter);

 		// listening to the Intent Index

diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/ShowProblemInEditorHandler.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/ShowProblemInEditorHandler.java
index 5c3b4cc..e4988fc 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/ShowProblemInEditorHandler.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/ShowProblemInEditorHandler.java
@@ -82,6 +82,7 @@
 			location = location.substring(0, location.indexOf("/"));
 			Repository repository = IntentRepositoryManager.INSTANCE.getRepository(location);
 			RepositoryAdapter adapter = repository.createRepositoryAdapter();
+			adapter.openReadOnlyContext();
 			EObject elementToOpen = adapter.getResource(IntentLocations.INTENT_INDEX).getResourceSet()
 					.getEObject(URI.createURI(markerItem.getLocation()), true);
 			if (elementToOpen instanceof CompilationStatus) {
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/propertytester/IsAssociatedToIntentDocumentTester.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/propertytester/IsAssociatedToIntentDocumentTester.java
index 1b5e9d8..a3eef72 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/propertytester/IsAssociatedToIntentDocumentTester.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/propertytester/IsAssociatedToIntentDocumentTester.java
@@ -89,13 +89,14 @@
 	 * @return the intent document if the given element is an Intent Project, or directly the Intent Document;
 	 *         null otherwise.
 	 */
-	public static IntentDocument getIntentDocument(Object any) {
+	public static IntentDocument getIntentDocument(Object selection) {
 		IntentDocument document = null;
-		if (any instanceof Collection<?> && ((Collection<?>)any).iterator().hasNext()) {
-			any = ((Collection<?>)any).iterator().next();
+		Object any = selection;
+		if (selection instanceof Collection<?> && ((Collection<?>)selection).iterator().hasNext()) {
+			any = ((Collection<?>)selection).iterator().next();
 		}
-		if (any instanceof IStructuredSelection && !((IStructuredSelection)any).isEmpty()) {
-			any = ((IStructuredSelection)any).iterator().next();
+		if (selection instanceof IStructuredSelection && !((IStructuredSelection)selection).isEmpty()) {
+			any = ((IStructuredSelection)selection).iterator().next();
 		}
 		if (any instanceof IProject) {
 
@@ -107,7 +108,7 @@
 				Repository repository = IntentRepositoryManager.INSTANCE.getRepository(project.getName());
 				if (repository != null) {
 					repositoryAdapter = repository.createRepositoryAdapter();
-
+					repositoryAdapter.openReadOnlyContext();
 					EList<EObject> contents = repositoryAdapter.getResource(IntentLocations.INTENT_INDEX)
 							.getContents();
 					if (!contents.isEmpty() && contents.iterator().next() instanceof IntentDocument) {
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/editor/completion/ModelingUnitCompletionProcessor.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/editor/completion/ModelingUnitCompletionProcessor.java
index b54cf7c..7f920bb 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/editor/completion/ModelingUnitCompletionProcessor.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/editor/completion/ModelingUnitCompletionProcessor.java
@@ -36,6 +36,7 @@
 import org.eclipse.mylyn.docs.intent.core.compiler.TraceabilityIndex;
 import org.eclipse.mylyn.docs.intent.core.compiler.TraceabilityIndexEntry;
 import org.eclipse.mylyn.docs.intent.core.modelingunit.InstanciationInstruction;
+import org.eclipse.mylyn.docs.intent.parser.IntentKeyWords;
 
 /**
  * Computes the completion proposal for ModelingUnits.
@@ -106,9 +107,10 @@
 					proposals.addAll(getProposalsForEmptyModelingUnit(false, text));
 				} else if (NEW_ENTITY_KEYWORD.equals(lastRelevantKeyWord)) {
 					proposals.addAll(getProposalsForNewInstruction(text));
-				} else if ("{".equals(lastRelevantKeyWord)) {
+				} else if (IntentKeyWords.INTENT_KEYWORD_OPEN.equals(lastRelevantKeyWord)) {
 					proposals.addAll(getProposalsForStructuralFeatureAffectation(text));
-				} else if ("=".equals(lastRelevantKeyWord) || "+=".equals(lastRelevantKeyWord)) {
+				} else if (IntentKeyWords.MODELING_UNIT_AFFECTATION_SINGLE_VAL.equals(lastRelevantKeyWord)
+						|| IntentKeyWords.MODELING_UNIT_AFFECTATION_MULTI_VAL.equals(lastRelevantKeyWord)) {
 					proposals.addAll(getProposalsForStructuralFeatureValue(text));
 				}
 			}
@@ -154,7 +156,8 @@
 				if (instruction.getName() != null
 						&& (contributionBeginning.length() == 0 || instruction.getName().startsWith(
 								contributionBeginning))) {
-					String description = "Contribute to the " + instruction.getName() + " ";
+					String description = "Contribute to the " + instruction.getName()
+							+ IntentKeyWords.INTENT_WHITESPACE;
 					if (instruction.getMetaType() != null
 							&& instruction.getMetaType().getTypeName() != null) {
 						description += instruction.getMetaType().getTypeName();
@@ -185,17 +188,20 @@
 		String featureNameBeginning = "";
 		boolean isContribution = true;
 		boolean isResourceDeclaration = false;
-		if (text.lastIndexOf("{") != -1) {
-			contributionName = text.substring(0, text.lastIndexOf("{")).trim();
-			featureNameBeginning = text.substring(text.lastIndexOf("{")).replace("{", "").trim();
+		if (text.lastIndexOf(IntentKeyWords.INTENT_KEYWORD_OPEN) != -1) {
+			contributionName = text.substring(0, text.lastIndexOf(IntentKeyWords.INTENT_KEYWORD_OPEN)).trim();
+			featureNameBeginning = text.substring(text.lastIndexOf(IntentKeyWords.INTENT_KEYWORD_OPEN))
+					.replace(IntentKeyWords.INTENT_KEYWORD_OPEN, "").trim();
 
 			if (contributionName.contains(NEW_ENTITY_KEYWORD)) {
 				isContribution = false;
 				contributionName = contributionName.substring(
 						contributionName.lastIndexOf(NEW_ENTITY_KEYWORD)).trim();
-				contributionName = contributionName.substring(contributionName.indexOf(" ")).trim();
-				if (contributionName.contains(" ")) {
-					contributionName = contributionName.substring(0, contributionName.indexOf(" ")).trim();
+				contributionName = contributionName.substring(
+						contributionName.indexOf(IntentKeyWords.INTENT_WHITESPACE)).trim();
+				if (contributionName.contains(IntentKeyWords.INTENT_WHITESPACE)) {
+					contributionName = contributionName.substring(0,
+							contributionName.indexOf(IntentKeyWords.INTENT_WHITESPACE)).trim();
 				}
 			}
 			if (contributionName.contains(RESOURCE_DECLARATION_KEYWORD)) {
@@ -270,24 +276,31 @@
 		String classifierName = null;
 		String featureName = null;
 		String beginning = "";
-		if (text.lastIndexOf("{") != -1) {
-			classifierName = text.substring(0, text.lastIndexOf("{")).trim();
-			featureName = text.substring(text.lastIndexOf("{")).replace("{", "").trim();
-			if (featureName.contains("+=")) {
-				beginning = featureName.substring(featureName.indexOf("+=") + 2).trim();
-				featureName = featureName.substring(0, featureName.indexOf("+=")).trim();
-			} else if (featureName.contains("=")) {
-				beginning = featureName.substring(featureName.indexOf("=") + 1).trim();
-				featureName = featureName.substring(0, featureName.indexOf("=")).trim();
+		if (text.lastIndexOf(IntentKeyWords.INTENT_KEYWORD_OPEN) != -1) {
+			classifierName = text.substring(0, text.lastIndexOf(IntentKeyWords.INTENT_KEYWORD_OPEN)).trim();
+			featureName = text.substring(text.lastIndexOf(IntentKeyWords.INTENT_KEYWORD_OPEN))
+					.replace(IntentKeyWords.INTENT_KEYWORD_OPEN, "").trim();
+			if (featureName.contains(IntentKeyWords.MODELING_UNIT_AFFECTATION_MULTI_VAL)) {
+				beginning = featureName.substring(
+						featureName.indexOf(IntentKeyWords.MODELING_UNIT_AFFECTATION_MULTI_VAL) + 2).trim();
+				featureName = featureName.substring(0,
+						featureName.indexOf(IntentKeyWords.MODELING_UNIT_AFFECTATION_MULTI_VAL)).trim();
+			} else if (featureName.contains(IntentKeyWords.MODELING_UNIT_AFFECTATION_SINGLE_VAL)) {
+				beginning = featureName.substring(
+						featureName.indexOf(IntentKeyWords.MODELING_UNIT_AFFECTATION_SINGLE_VAL) + 1).trim();
+				featureName = featureName.substring(0,
+						featureName.indexOf(IntentKeyWords.MODELING_UNIT_AFFECTATION_SINGLE_VAL)).trim();
 			}
 
 			if (classifierName.contains(NEW_ENTITY_KEYWORD)) {
 				isContribution = false;
 				classifierName = classifierName.substring(classifierName.lastIndexOf(NEW_ENTITY_KEYWORD))
 						.trim();
-				classifierName = classifierName.substring(classifierName.indexOf(" ")).trim();
-				if (classifierName.contains(" ")) {
-					classifierName = classifierName.substring(0, classifierName.indexOf(" ")).trim();
+				classifierName = classifierName.substring(
+						classifierName.indexOf(IntentKeyWords.INTENT_WHITESPACE)).trim();
+				if (classifierName.contains(IntentKeyWords.INTENT_WHITESPACE)) {
+					classifierName = classifierName.substring(0,
+							classifierName.indexOf(IntentKeyWords.INTENT_WHITESPACE)).trim();
 				}
 			}
 			if (classifierName.contains(RESOURCE_DECLARATION_KEYWORD)) {
@@ -413,10 +426,10 @@
 	 * Returns the last relevant keyword of the given text. For example :
 	 * <ul>
 	 * <li>"new Somethin" will return "new"</li>
-	 * <li>"new Something {" will return "{"</li>
-	 * <li>"new Something { attrib" will return "{"</li>
-	 * <li>"new Something { attribute =" will return "="</li>
-	 * <li>"new Something { attribute = 'value'; will return "{"</li>
+	 * <li>"new Something {" will return IntentKeyWords.INTENT_KEYWORD_OPEN</li>
+	 * <li>"new Something { attrib" will return IntentKeyWords.INTENT_KEYWORD_OPEN</li>
+	 * <li>"new Something { attribute =" will return IntentKeyWords.MODELING_UNIT_AFFECTATION_SINGLE_VAL</li>
+	 * <li>"new Something { attribute = 'value'; will return IntentKeyWords.INTENT_KEYWORD_OPEN</li>
 	 * </ul>
 	 * 
 	 * @param text
@@ -426,9 +439,11 @@
 	private String getLastRelevantKeyWord(String text) {
 
 		int lastNew = getLastIndexOf(text, Pattern.compile(NEW_ENTITY_KEYWORD));
-		int lastOpeningBracket = text.lastIndexOf("{");
-		int lastStructuralFeatureAffectation = text.lastIndexOf("=");
-		int lastMultiValuedStructuralFeatureAffectation = text.lastIndexOf("+=");
+		int lastOpeningBracket = text.lastIndexOf(IntentKeyWords.INTENT_KEYWORD_OPEN);
+		int lastStructuralFeatureAffectation = text
+				.lastIndexOf(IntentKeyWords.MODELING_UNIT_AFFECTATION_SINGLE_VAL);
+		int lastMultiValuedStructuralFeatureAffectation = text
+				.lastIndexOf(IntentKeyWords.MODELING_UNIT_AFFECTATION_MULTI_VAL);
 		int lastKWIndex = Math.max(
 				Math.max(lastStructuralFeatureAffectation, lastStructuralFeatureAffectation),
 				Math.max(lastNew, lastOpeningBracket));
@@ -436,11 +451,11 @@
 			if (lastKWIndex == lastNew) {
 				return NEW_ENTITY_KEYWORD;
 			} else if (lastKWIndex == lastOpeningBracket) {
-				return "{";
+				return IntentKeyWords.INTENT_KEYWORD_OPEN;
 			} else if (lastKWIndex == lastStructuralFeatureAffectation) {
-				return "=";
+				return IntentKeyWords.MODELING_UNIT_AFFECTATION_SINGLE_VAL;
 			} else if (lastKWIndex == lastMultiValuedStructuralFeatureAffectation) {
-				return "+=";
+				return IntentKeyWords.MODELING_UNIT_AFFECTATION_MULTI_VAL;
 			}
 		}
 		int lastIndexOfSpaceCharacter = lastIndexOfSpaceCharacter(text);
@@ -456,7 +471,7 @@
 	}
 
 	private int lastIndexOfSpaceCharacter(String text) {
-		int lastIndexOfSpace = text.lastIndexOf(" ");
+		int lastIndexOfSpace = text.lastIndexOf(IntentKeyWords.INTENT_WHITESPACE);
 		int lastIndexOfTab = text.lastIndexOf("\t");
 		int lastIndexOfNewLine = text.lastIndexOf("\n");
 		return Math.max(Math.max(lastIndexOfSpace, lastIndexOfTab), lastIndexOfNewLine);
@@ -473,10 +488,11 @@
 	private String removeInstructionsInsideClosedBrackets(String text) {
 		Document tempDoc = new Document(text);
 		IntentPairMatcher pairMatcher = new IntentPairMatcher();
-		if (tempDoc.get().indexOf("{") != -1) {
-			IRegion match = pairMatcher.match(tempDoc, tempDoc.get().indexOf("{") + 1);
+		if (tempDoc.get().indexOf(IntentKeyWords.INTENT_KEYWORD_OPEN) != -1) {
+			IRegion match = pairMatcher.match(tempDoc,
+					tempDoc.get().indexOf(IntentKeyWords.INTENT_KEYWORD_OPEN) + 1);
 			try {
-				while (tempDoc.get().indexOf("{") != -1 && match != null) {
+				while (tempDoc.get().indexOf(IntentKeyWords.INTENT_KEYWORD_OPEN) != -1 && match != null) {
 
 					int beginLineToRemove = tempDoc.getLineOfOffset(match.getOffset());
 					int beginOffSettoRemove = tempDoc.getLineOffset(beginLineToRemove);
@@ -486,7 +502,8 @@
 					String newDocContent = tempDoc.get().substring(0, beginOffSettoRemove)
 							+ tempDoc.get().substring(endOffsetToRemove);
 					tempDoc.set(newDocContent);
-					match = pairMatcher.match(tempDoc, tempDoc.get().indexOf("{") + 1);
+					match = pairMatcher.match(tempDoc,
+							tempDoc.get().indexOf(IntentKeyWords.INTENT_KEYWORD_OPEN) + 1);
 				}
 			} catch (BadLocationException e) {
 				// Nothing to do : silent catch
@@ -522,7 +539,7 @@
 
 	private TemplateProposal createStructuralFeatureAffectationTemplateProposal(String contributionName,
 			EStructuralFeature feature) {
-		String affect = "=";
+		String affect = IntentKeyWords.MODELING_UNIT_AFFECTATION_SINGLE_VAL;
 		if (feature.isMany()) {
 			affect = "+" + affect;
 		}
@@ -545,7 +562,8 @@
 			}
 		}
 		String description = "Set the value " + contributionName + "." + feature.getName();
-		return createTemplateProposal(label, description, feature.getName() + " " + affect + " ",
+		return createTemplateProposal(label, description, feature.getName()
+				+ IntentKeyWords.INTENT_WHITESPACE + affect + IntentKeyWords.INTENT_WHITESPACE,
 				"icon/outline/modelingunit_affect.png");
 	}
 
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/internal/logger/EclipseBasedIntentLogger.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/internal/logger/EclipseBasedIntentLogger.java
index cb20470..560e078 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/internal/logger/EclipseBasedIntentLogger.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/internal/logger/EclipseBasedIntentLogger.java
@@ -87,6 +87,7 @@
 				severity = IStatus.ERROR;
 				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Intent - An error occured",
 						message);
+				break;
 			case ERROR:
 				severity = IStatus.ERROR;
 				break;
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/utils/IntentEditorOpener.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/utils/IntentEditorOpener.java
index b997aec..d72fac3 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/utils/IntentEditorOpener.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui/src/org/eclipse/mylyn/docs/intent/client/ui/utils/IntentEditorOpener.java
@@ -60,14 +60,13 @@
 	public static void openIntentEditor(final Repository repository, boolean readOnlyMode) {

 		try {

 			final RepositoryAdapter repositoryAdapter = repository.createRepositoryAdapter();

-			repositoryAdapter.openSaveContext();

+

+			openContext(repositoryAdapter, readOnlyMode);

 			IntentDocument elementToOpen = new IntentDocumentQuery(repositoryAdapter)

 					.getOrCreateIntentDocument();

 			openIntentEditor(repositoryAdapter, elementToOpen, false, elementToOpen, false);

 		} catch (PartInitException e) {

 			IntentUiLogger.logError(e);

-		} catch (ReadOnlyException e) {

-			IntentUiLogger.logError(e);

 		}

 	}

 

@@ -179,23 +178,24 @@
 	 *            indicates whether the context should be opened in read-only mode or node

 	 */

 	private static void openContext(RepositoryAdapter repositoryAdapter, boolean readOnlyMode) {

-		boolean isReadOnly = readOnlyMode;

-		if (!readOnlyMode) {

-			try {

-				repositoryAdapter.openSaveContext();

-			} catch (ReadOnlyException e) {

-				IntentLogger

-						.getInstance()

-						.log(LogType.WARNING,

-								"The Intent Editor has insufficient rights (read-only) to save modifications on the repository. A read-only context will be used instead.");

-				isReadOnly = true;

+		if (repositoryAdapter.getContext() == null) {

+			boolean isReadOnly = readOnlyMode;

+			if (!readOnlyMode) {

+				try {

+					repositoryAdapter.openSaveContext();

+				} catch (ReadOnlyException e) {

+					IntentLogger

+							.getInstance()

+							.log(LogType.WARNING,

+									"The Intent Editor has insufficient rights (read-only) to save modifications on the repository. A read-only context will be used instead.");

+					isReadOnly = true;

+				}

+			}

+

+			if (isReadOnly) {

+				repositoryAdapter.openReadOnlyContext();

 			}

 		}

-

-		if (isReadOnly) {

-			repositoryAdapter.openReadOnlyContext();

-		}

-

 	}

 

 	/**

diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/adapters/CDOAdapter.java b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/adapters/CDOAdapter.java
index f3ef748..6a11ba7 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/adapters/CDOAdapter.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/adapters/CDOAdapter.java
@@ -19,22 +19,28 @@
 import org.eclipse.emf.cdo.CDOObject;
 import org.eclipse.emf.cdo.common.CDOCommonSession.Options.PassiveUpdateMode;
 import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
 import org.eclipse.emf.cdo.session.CDOSession;
 import org.eclipse.emf.cdo.transaction.CDOTransaction;
 import org.eclipse.emf.cdo.util.CDOURIUtil;
 import org.eclipse.emf.cdo.util.CommitException;
 import org.eclipse.emf.cdo.util.ReadOnlyException;
 import org.eclipse.emf.cdo.view.CDOAdapterPolicy;
+import org.eclipse.emf.cdo.view.CDOInvalidationPolicy;
 import org.eclipse.emf.cdo.view.CDOView;
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.spi.cdo.InternalCDOObject;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.IntentCommand;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryStructurer;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.SaveException;
 import org.eclipse.mylyn.docs.intent.collab.handlers.notification.Notificator;
+import org.eclipse.mylyn.docs.intent.collab.repository.Repository;
 import org.eclipse.net4j.util.event.IListener;
 
 /**
@@ -44,6 +50,16 @@
  */
 public class CDOAdapter implements RepositoryAdapter {
 
+	private static final CDOInvalidationPolicy INTENT_CDO_INVALIDATION_POLICY = new CDOInvalidationPolicy() {
+		public void handleInvalidation(CDOObject object, CDORevisionKey key) {
+			((InternalCDOObject)object).cdoInternalSetRevision(null);
+		}
+
+		public void handleInvalidObject(CDOObject object) {
+			// We do no throw exception to catch these error silently
+		}
+	};
+
 	/**
 	 * The session used in this adapter.
 	 */
@@ -70,14 +86,22 @@
 	private boolean allowChangeSubscriptionPolicy;
 
 	/**
+	 * The {@link Repository} from witch this adapter has been created.
+	 */
+	private Repository repository;
+
+	/**
 	 * CDOAdapter Constructor.
 	 * 
+	 * @param repository
+	 *            the {@link Repository} from witch this adapter has been created
 	 * @param object
 	 *            the session to use.
 	 */
-	public CDOAdapter(Object object) {
+	public CDOAdapter(Repository repository, Object object) {
 		this.notificatorToListener = new HashMap<Notificator, Set<IListener>>();
 		this.allowChangeSubscriptionPolicy = false;
+		this.repository = repository;
 		setSession(object);
 	}
 
@@ -111,7 +135,8 @@
 	 */
 	public Object openSaveContext() {
 		if (this.currentContext == null) {
-			this.currentContext = session.openTransaction();
+			this.currentContext = session.openTransaction(new ResourceSetImpl());
+			currentContext.options().setInvalidationPolicy(INTENT_CDO_INVALIDATION_POLICY);
 			setChangeSubscriptionPolicy();
 			this.isReadOnlyContext = false;
 		}
@@ -145,18 +170,6 @@
 	}
 
 	/**
-	 * Use this method if a save context has already been launched and you want this Adapter to use it.
-	 * 
-	 * @param saveContext
-	 *            the save context to use
-	 */
-	public void setSaveContext(Object saveContext) {
-		this.currentContext = (CDOTransaction)saveContext;
-		this.isReadOnlyContext = false;
-		setChangeSubscriptionPolicy();
-	}
-
-	/**
 	 * {@inheritDoc}
 	 * 
 	 * @see org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter#save()
@@ -367,4 +380,25 @@
 	public void execute(IntentCommand command) {
 		command.execute();
 	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter#getRepository()
+	 */
+	public Repository getRepository() {
+		return this.repository;
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter#getResourceSet()
+	 */
+	public ResourceSet getResourceSet() {
+		if (this.currentContext != null) {
+			return this.currentContext.getResourceSet();
+		}
+		return null;
+	}
 }
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/adapters/CDOTypeListener.java b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/adapters/CDOTypeListener.java
index 61dfa16..61ac533 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/adapters/CDOTypeListener.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/adapters/CDOTypeListener.java
@@ -92,8 +92,9 @@
 			if (changesDetected) {
 				RepositoryChangeNotification newNotification = RepositoryChangeNotificationFactoryHolder
 						.getChangeNotificationFactory().createRepositoryChangeNotification(invalidationEvent);
-
-				this.listeningTypeNotificator.notifyHandlers(newNotification);
+				if (newNotification != null) {
+					this.listeningTypeNotificator.notifyHandlers(newNotification);
+				}
 			}
 
 		}
@@ -113,14 +114,11 @@
 				&& !isListennedType;) {
 			ENamedElement listennedtype = iterator.next();
 			if (listennedtype instanceof EStructuralFeature) {
-
 				isListennedType = listennedtype.equals(feature);
 			}
 			if (listennedtype instanceof EClass) {
-
 				isListennedType = ((EClass)listennedtype).getEAllStructuralFeatures().contains(feature);
 			}
-
 		}
 
 		return isListennedType;
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/notification/CDORepositoryChangeNotificationFactory.java b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/notification/CDORepositoryChangeNotificationFactory.java
index 76f9359..8002433 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/notification/CDORepositoryChangeNotificationFactory.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/notification/CDORepositoryChangeNotificationFactory.java
@@ -10,6 +10,9 @@
  *******************************************************************************/
 package org.eclipse.mylyn.docs.intent.collab.cdo.notification;
 
+import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
+import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta;
+import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
 import org.eclipse.emf.cdo.session.CDOSessionInvalidationEvent;
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.ecore.EObject;
@@ -79,22 +82,24 @@
 			CDOSessionInvalidationEvent event) {
 		RepositoryChangeNotification newNotification = new RepositoryChangeNotificationImpl();
 
-		// for (CDORevisionKey key : event.getChangedObjects()) {
-		// CDORevisionDelta revisionDelta = (CDORevisionDelta)key;
-		//
-		// for (CDOFeatureDelta delta : revisionDelta.getFeatureDeltas()) {
-		// switch (delta.getType()) {
-		// case SET:
-		// // CDOSetFeatureDelta completeDelta = (CDOSetFeatureDelta)delta;
-		// newNotification.getRightRoots().add(view.getObject(key.getID()));
-		// break;
-		// default:
-		//
-		// break;
-		// }
-		// }
-		//
-		// }
+		for (CDORevisionKey key : event.getChangedObjects()) {
+			CDORevisionDelta revisionDelta = (CDORevisionDelta)key;
+
+			for (CDOFeatureDelta delta : revisionDelta.getFeatureDeltas()) {
+				switch (delta.getType()) {
+					case SET:
+						if (event.getLocalTransaction() != null) {
+							newNotification.getRightRoots().add(
+									event.getLocalTransaction().getObject(key.getID()));
+							break;
+						}
+					default:
+
+						break;
+				}
+			}
+
+		}
 		return newNotification;
 	}
 
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/repository/CDORepository.java b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/repository/CDORepository.java
index 7f6e4eb..a064bfc 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/repository/CDORepository.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/repository/CDORepository.java
@@ -16,6 +16,7 @@
 import org.eclipse.emf.cdo.net4j.CDONet4jSession;
 import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration;
 import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
+import org.eclipse.emf.cdo.util.CDOUtil;
 import org.eclipse.emf.ecore.EPackage.Registry;
 import org.eclipse.mylyn.docs.intent.collab.cdo.adapters.CDOAdapter;
 import org.eclipse.mylyn.docs.intent.collab.handlers.RepositoryClient;
@@ -115,6 +116,7 @@
 
 		// If no configuration has been created yet
 		if (cdoSessionConfiguration == null) {
+			CDOUtil.setLegacyModeDefault(true);
 			// We create this configuration
 			container = ContainerUtil.createContainer();
 
@@ -205,10 +207,8 @@
 	 */
 	public RepositoryAdapter createRepositoryAdapter() {
 		try {
-			return new CDOAdapter((CDONet4jSession)getOrCreateSession());
+			return new CDOAdapter(this, (CDONet4jSession)getOrCreateSession());
 		} catch (RepositoryConnectionException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
 			return null;
 		}
 	}
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/utils/CDORepositoryCreator.java b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/utils/CDORepositoryCreator.java
index c74f78e..0c20d28 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/utils/CDORepositoryCreator.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/utils/CDORepositoryCreator.java
@@ -45,7 +45,7 @@
 			throw new RepositoryConnectionException("The given configuration informations are invalid.");
 		}
 
-		if (RepositoryChangeNotificationFactoryHolder.getChangeNotificationFactory() == null) {
+		if (!(RepositoryChangeNotificationFactoryHolder.getChangeNotificationFactory() instanceof CDORepositoryChangeNotificationFactory)) {
 			RepositoryChangeNotificationFactoryHolder
 					.setChangeNotificationFactory(new CDORepositoryChangeNotificationFactory());
 		}
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/utils/IntentStaleReferencePolicy.java b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/utils/IntentStaleReferencePolicy.java
new file mode 100644
index 0000000..3a35cf1
--- /dev/null
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/utils/IntentStaleReferencePolicy.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.docs.intent.collab.cdo.utils;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.view.CDOStaleObject;
+import org.eclipse.emf.cdo.view.CDOStaleReferencePolicy;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+
+/**
+ * The {@link CDOStaleReferencePolicy} used by Intent to handle invalid cdo objects.
+ * <p>
+ * A stale object is represented as an EMF proxy : we just return true to eIsProxy.
+ * </p>
+ * 
+ * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
+ */
+public class IntentStaleReferencePolicy implements CDOStaleReferencePolicy {
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.emf.cdo.view.CDOStaleReferencePolicy#processStaleReference(org.eclipse.emf.ecore.EObject,
+	 *      org.eclipse.emf.ecore.EStructuralFeature, int, org.eclipse.emf.cdo.common.id.CDOID)
+	 */
+	public Object processStaleReference(EObject source, EStructuralFeature feature, int index, CDOID target) {
+		if (feature == null) {
+			return null;
+		}
+		final EClassifier type = feature.getEType();
+
+		Class<?> instanceClass = type.getInstanceClass();
+		Class<?>[] interfaces = null;
+
+		// Be sure to have only interface
+		if (instanceClass.isInterface()) {
+			interfaces = new Class<?>[] {instanceClass, InternalEObject.class, CDOStaleObject.class,
+			};
+		} else {
+			interfaces = new Class<?>[] {InternalEObject.class, CDOStaleObject.class,
+			};
+		}
+
+		Object proxy = null;
+		try {
+			proxy = Proxy.newProxyInstance(instanceClass.getClassLoader(), interfaces,
+					new IntentCDOInvocationHandler());
+		} catch (IllegalArgumentException exception) {
+			// If we cannot instanciate the Proxy, we log a warning
+			// and return null
+			interfaces = new Class<?>[] {instanceClass, InternalEObject.class,
+			};
+			proxy = Proxy.newProxyInstance(instanceClass.getClassLoader(), interfaces,
+					new IntentCDOInvocationHandler());
+		}
+
+		return proxy;
+	}
+
+	/**
+	 * An invocation handler in charge of "making believe" that the stale object is a proxy.
+	 * 
+	 * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
+	 */
+	private static class IntentCDOInvocationHandler implements InvocationHandler {
+
+		/**
+		 * {@inheritDoc}
+		 * 
+		 * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method,
+		 *      java.lang.Object[])
+		 */
+		public Object invoke(Object proxy, Method method, Object[] args) {
+			final String methodName = method.getName();
+			Object result = null;
+
+			if ("eIsProxy".equals(methodName)) { //$NON-NLS-1$
+				result = true;
+			}
+			return result;
+		}
+	}
+}
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/CompilationStatusQuery.java b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/CompilationStatusQuery.java
index 5ce219d..66465cb 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/CompilationStatusQuery.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/CompilationStatusQuery.java
@@ -12,6 +12,7 @@
 
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.mylyn.docs.intent.collab.common.location.IntentLocations;
+import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.IntentCommand;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.ReadOnlyException;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter;
 import org.eclipse.mylyn.docs.intent.core.compiler.CompilationStatusManager;
@@ -44,13 +45,18 @@
 	 */
 	public CompilationStatusManager getOrCreateCompilationStatusManager() {
 		if (statusManager == null) {
-			Resource resource;
 			try {
-				resource = repositoryAdapter
+				final Resource resource = repositoryAdapter
 						.getOrCreateResource(IntentLocations.COMPILATION_STATUS_INDEX_PATH);
 
 				if (resource.getContents().isEmpty()) {
-					resource.getContents().add(CompilerFactory.eINSTANCE.createCompilationStatusManager());
+					repositoryAdapter.execute(new IntentCommand() {
+
+						public void execute() {
+							resource.getContents().add(
+									CompilerFactory.eINSTANCE.createCompilationStatusManager());
+						}
+					});
 				}
 				statusManager = (CompilationStatusManager)resource.getContents().get(0);
 			} catch (ReadOnlyException e) {
@@ -59,5 +65,4 @@
 		}
 		return statusManager;
 	}
-
 }
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/IndexQuery.java b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/IndexQuery.java
index 2aa1efc..cce1984 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/IndexQuery.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/IndexQuery.java
@@ -13,6 +13,7 @@
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.mylyn.docs.intent.collab.common.location.IntentLocations;
+import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.IntentCommand;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter;
 import org.eclipse.mylyn.docs.intent.core.indexer.IntentIndex;
 import org.eclipse.mylyn.docs.intent.core.indexer.IntentIndexEntry;
@@ -46,7 +47,12 @@
 		if (intentIndex == null) {
 			final Resource indexResource = repositoryAdapter.getResource(IntentLocations.GENERAL_INDEX_PATH);
 			if (indexResource.getContents().isEmpty()) {
-				indexResource.getContents().add(IntentIndexerFactory.eINSTANCE.createIntentIndex());
+				repositoryAdapter.execute(new IntentCommand() {
+
+					public void execute() {
+						indexResource.getContents().add(IntentIndexerFactory.eINSTANCE.createIntentIndex());
+					}
+				});
 			}
 			intentIndex = (IntentIndex)indexResource.getContents().get(0);
 		}
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/IntentDocumentQuery.java b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/IntentDocumentQuery.java
index eed4534..4bba29d 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/IntentDocumentQuery.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/IntentDocumentQuery.java
@@ -19,6 +19,7 @@
 
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.mylyn.docs.intent.collab.common.location.IntentLocations;
+import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.IntentCommand;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter;
 import org.eclipse.mylyn.docs.intent.core.descriptionunit.DescriptionUnit;
 import org.eclipse.mylyn.docs.intent.core.document.IntentChapter;
@@ -59,9 +60,14 @@
 	 */
 	public IntentDocument getOrCreateIntentDocument() {
 		if (intentDocument == null) {
-			Resource resource = repositoryAdapter.getResource(IntentLocations.INTENT_INDEX);
+			final Resource resource = repositoryAdapter.getResource(IntentLocations.INTENT_INDEX);
 			if (resource.getContents().isEmpty()) {
-				resource.getContents().add(IntentDocumentFactory.eINSTANCE.createIntentDocument());
+				repositoryAdapter.execute(new IntentCommand() {
+
+					public void execute() {
+						resource.getContents().add(IntentDocumentFactory.eINSTANCE.createIntentDocument());
+					}
+				});
 			}
 			intentDocument = (IntentDocument)resource.getContents().get(0);
 		}
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/TraceabilityInformationsQuery.java b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/TraceabilityInformationsQuery.java
index 1d068cd..4cecb1d 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/TraceabilityInformationsQuery.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/query/TraceabilityInformationsQuery.java
@@ -25,6 +25,7 @@
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.mylyn.docs.intent.collab.common.location.IntentLocations;
+import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.IntentCommand;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.ReadOnlyException;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter;
 import org.eclipse.mylyn.docs.intent.core.compiler.CompilerFactory;
@@ -64,14 +65,18 @@
 	 */
 	public TraceabilityIndex getOrCreateTraceabilityIndex() {
 		if (traceabilityIndex == null) {
-			Resource traceabilityResource;
 			try {
-				traceabilityResource = repositoryAdapter
+				final Resource traceabilityResource = repositoryAdapter
 						.getOrCreateResource(IntentLocations.TRACEABILITY_INFOS_INDEX_PATH);
 
 				if (traceabilityResource.getContents().isEmpty()) {
-					traceabilityResource.getContents().add(
-							CompilerFactory.eINSTANCE.createTraceabilityIndex());
+					repositoryAdapter.execute(new IntentCommand() {
+
+						public void execute() {
+							traceabilityResource.getContents().add(
+									CompilerFactory.eINSTANCE.createTraceabilityIndex());
+						}
+					});
 				}
 				traceabilityIndex = (TraceabilityIndex)traceabilityResource.getContents().get(0);
 			} catch (ReadOnlyException e) {
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/adapters/WorkspaceAdapter.java b/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/adapters/WorkspaceAdapter.java
index a0f9b2e..0309ed4 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/adapters/WorkspaceAdapter.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/adapters/WorkspaceAdapter.java
@@ -33,6 +33,7 @@
 import org.eclipse.emf.ecore.EObject;

 import org.eclipse.emf.ecore.EStructuralFeature;

 import org.eclipse.emf.ecore.resource.Resource;

+import org.eclipse.emf.ecore.resource.ResourceSet;

 import org.eclipse.emf.ecore.resource.URIConverter;

 import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;

 import org.eclipse.emf.ecore.util.EcoreUtil;

@@ -49,6 +50,7 @@
 import org.eclipse.mylyn.docs.intent.collab.ide.notification.WorkspaceTypeListener;

 import org.eclipse.mylyn.docs.intent.collab.ide.repository.WorkspaceRepository;

 import org.eclipse.mylyn.docs.intent.collab.ide.repository.WorkspaceSession;

+import org.eclipse.mylyn.docs.intent.collab.repository.Repository;

 import org.eclipse.mylyn.docs.intent.collab.repository.RepositoryConnectionException;

 

 /**

@@ -217,11 +219,7 @@
 							// We make sure the session isn't still reacting to previous saves

 							while (((WorkspaceSession)this.repository.getOrCreateSession())

 									.isProcessingDelta()) {

-								try {

-									Thread.sleep(TIME_TO_WAIT_BEFORE_CHECKING_SESSIONDELTA);

-								} catch (InterruptedException e) {

-									throw new SaveException(e.getMessage());

-								}

+								Thread.sleep(TIME_TO_WAIT_BEFORE_CHECKING_SESSIONDELTA);

 							}

 

 							// Step 2: we send a warning to the WorkspaceSession if necessary

@@ -245,6 +243,8 @@
 					saveException = new SaveException(e.getMessage());

 				} catch (IOException e) {

 					saveException = new SaveException(e.getMessage());

+				} catch (InterruptedException e) {

+					throw new SaveException(e.getMessage());

 				}

 

 			}

@@ -689,4 +689,22 @@
 		}

 		return false;

 	}

+

+	/**

+	 * {@inheritDoc}

+	 * 

+	 * @see org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter#getRepository()

+	 */

+	public Repository getRepository() {

+		return this.repository;

+	}

+

+	/**

+	 * {@inheritDoc}

+	 * 

+	 * @see org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter#getResourceSet()

+	 */

+	public ResourceSet getResourceSet() {

+		return this.repository.getResourceSet();

+	}

 }

diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/notification/WorkspaceTypeListener.java b/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/notification/WorkspaceTypeListener.java
index ff9cf4f..3001717 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/notification/WorkspaceTypeListener.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/notification/WorkspaceTypeListener.java
@@ -82,8 +82,9 @@
 		if (changesDetected) {
 			RepositoryChangeNotification newNotification = RepositoryChangeNotificationFactoryHolder
 					.getChangeNotificationFactory().createRepositoryChangeNotification(resource);
-
-			this.typeNotificator.notifyHandlers(newNotification);
+			if (newNotification != null) {
+				this.typeNotificator.notifyHandlers(newNotification);
+			}
 		}
 	}
 
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/adapters/RepositoryAdapter.java b/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/adapters/RepositoryAdapter.java
index 40a79b3..f0f1b6f 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/adapters/RepositoryAdapter.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/adapters/RepositoryAdapter.java
@@ -17,7 +17,9 @@
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.mylyn.docs.intent.collab.handlers.notification.Notificator;
+import org.eclipse.mylyn.docs.intent.collab.repository.Repository;
 
 /**
  * Allows the RepositoryObjectHandler to work with any type of repository.
@@ -204,4 +206,18 @@
 	 *            the command to execute
 	 */
 	void execute(IntentCommand command);
+
+	/**
+	 * Returns the {@link Repository} from which this adapter has been created.
+	 * 
+	 * @return the {@link Repository} from which this adapter has been created
+	 */
+	Repository getRepository();
+
+	/**
+	 * Returns the {@link ResourceSet} associated to this {@link RepositoryAdapter}.
+	 * 
+	 * @return the {@link ResourceSet} associated to this {@link RepositoryAdapter}
+	 */
+	ResourceSet getResourceSet();
 }
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/impl/AbstractRepositoryClient.java b/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/impl/AbstractRepositoryClient.java
index d9b1d1a..b656068 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/impl/AbstractRepositoryClient.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/impl/AbstractRepositoryClient.java
@@ -54,6 +54,7 @@
 	 */

 	public void removeRepositoryObjectHandler(RepositoryObjectHandler handler) {

 		handler.removeClient(this);

+		this.repositoryObjectHandler.getRepositoryAdapter().closeContext();

 		repositoryObjectHandler.stop();

 		this.repositoryObjectHandler = null;

 	}

diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/impl/ReadWriteRepositoryObjectHandlerImpl.java b/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/impl/ReadWriteRepositoryObjectHandlerImpl.java
index a6ebf60..1d36d37 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/impl/ReadWriteRepositoryObjectHandlerImpl.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/handlers/impl/ReadWriteRepositoryObjectHandlerImpl.java
@@ -36,7 +36,6 @@
 	public ReadWriteRepositoryObjectHandlerImpl(RepositoryAdapter repositoryAdapter) throws ReadOnlyException {
 		super();
 		this.setRepositoryAdapter(repositoryAdapter);
-		this.getRepositoryAdapter().openSaveContext();
 	}
 
 	/**
@@ -65,7 +64,6 @@
 	 */
 	@Override
 	public void stop() {
-		this.getRepositoryAdapter().closeContext();
 		super.stop();
 	}
 
@@ -75,7 +73,6 @@
 	 * @see org.eclipse.mylyn.docs.intent.collab.handlers.ReadWriteRepositoryObjectHandler#setConflictHander(org.eclipse.mylyn.docs.intent.collab.handlers.ConfictResolver)
 	 */
 	public void setConflictHander(ConfictResolver conflictHandler) {
-		// TODO Auto-generated method stub
 
 	}
 
diff --git a/plugins/org.eclipse.mylyn.docs.intent.parser/src/org/eclipse/mylyn/docs/intent/parser/IntentKeyWords.java b/plugins/org.eclipse.mylyn.docs.intent.parser/src/org/eclipse/mylyn/docs/intent/parser/IntentKeyWords.java
index 0bb46d2..3296257 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.parser/src/org/eclipse/mylyn/docs/intent/parser/IntentKeyWords.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.parser/src/org/eclipse/mylyn/docs/intent/parser/IntentKeyWords.java
@@ -82,4 +82,8 @@
 	String MODELING_UNIT_BEGIN = ModelingUnitParser.MODELING_UNIT_PREFIX;
 
 	String MODELING_UNIT_END = ModelingUnitParser.MODELING_UNIT_SUFFIX;
+
+	String MODELING_UNIT_AFFECTATION_MULTI_VAL = "+=";
+
+	String MODELING_UNIT_AFFECTATION_SINGLE_VAL = "=";
 }
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/META-INF/MANIFEST.MF b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/META-INF/MANIFEST.MF
index 55c1b5f..266fd11 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/META-INF/MANIFEST.MF
@@ -23,4 +23,5 @@
  org.eclipse.emf.compare.match;bundle-version="[1.2.0,2.0.0)",
  org.eclipse.mylyn.docs.intent.retro;bundle-version="0.7.0",
  org.eclipse.mylyn.docs.intent.compare;bundle-version="0.7.0",
- org.eclipse.mylyn.docs.intent.modelingunit.update;bundle-version="0.7.0"
+ org.eclipse.mylyn.docs.intent.modelingunit.update;bundle-version="0.7.0",
+ org.eclipse.mylyn.docs.intent.test.server
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/suite/UITestSuite.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/suite/UITestSuite.java
index d523407..1a4c6ab 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/suite/UITestSuite.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/suite/UITestSuite.java
@@ -15,6 +15,7 @@
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
+import org.eclipse.mylyn.docs.intent.client.ui.test.unit.cdo.CDOIntegrationTest;
 import org.eclipse.mylyn.docs.intent.client.ui.test.unit.compare.ChangeEditorUpdateTest;
 import org.eclipse.mylyn.docs.intent.client.ui.test.unit.compare.IntentMatchEngineTests;
 import org.eclipse.mylyn.docs.intent.client.ui.test.unit.compare.SimpleOrderTests;
@@ -109,6 +110,14 @@
 		updatesSuite.addTestSuite(DragAndDropTest.class);
 		uiTestSuite.addTest(updatesSuite);
 
+		/*
+		 * CDO related test Suite
+		 */
+		final TestSuite cdoSuite = new TestSuite("CDO integration tests");
+		suite.addTest(cdoSuite);
+
+		cdoSuite.addTestSuite(CDOIntegrationTest.class);
+
 		return suite;
 	}
 
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/CDOIntegrationTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/CDOIntegrationTest.java
new file mode 100644
index 0000000..284979a
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/CDOIntegrationTest.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.docs.intent.client.ui.test.unit.cdo;
+
+import org.eclipse.mylyn.docs.intent.client.ui.test.unit.cdo.util.AbstractIntentCDOTest;
+import org.eclipse.mylyn.docs.intent.collab.common.location.IntentLocations;
+import org.eclipse.mylyn.docs.intent.collab.common.repository.IntentRepositoryManager;
+import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.IntentCommand;
+import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.ReadOnlyException;
+import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryAdapter;
+import org.eclipse.mylyn.docs.intent.core.document.IntentDocument;
+import org.eclipse.mylyn.docs.intent.core.document.IntentDocumentFactory;
+
+/**
+ * Basic tests ensuring that Intent works correctly when the document is stored on a CDO Repository.
+ * 
+ * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
+ */
+public class CDOIntegrationTest extends AbstractIntentCDOTest {
+
+	private static final String INTENT_ABSTRACT_RESOURCE_DOCUMENT_PATH = "data/unit/documents/scenario/abstract_resources.intent";
+
+	/**
+	 * A test that ensure that a local user can :
+	 * <ul>
+	 * <li>Create/get an intent document located on a cdo repository</li>
+	 * <li>Receive changes made by remote users.</li>
+	 * </ul>
+	 * 
+	 * @throws Exception
+	 */
+	public void testBasicRelationshipBetweenLocalAndRemoteUser() throws Exception {
+		// Local user creates and get the intent project
+		setUpIntentProject("myIntentProject", INTENT_ABSTRACT_RESOURCE_DOCUMENT_PATH, false);
+		final IntentDocument cdoIntentDocument = getIntentDocument();
+		repositoryAdapter.save();
+		final int initialChapterNumber = cdoIntentDocument.getChapters().size();
+		assertNotNull("Intent document has not been correctly created on the repository", cdoIntentDocument);
+
+		// Some remote user modifies the intent document by adding a chapter
+		final RepositoryAdapter remoteUser = IntentRepositoryManager.INSTANCE.getRepository(
+				"cdo:/myIntentProject").createRepositoryAdapter();
+		remoteUser.openSaveContext();
+		remoteUser.execute(new IntentCommand() {
+
+			public void execute() {
+				IntentDocument remoteIntentDocument;
+				try {
+					remoteIntentDocument = (IntentDocument)remoteUser
+							.getOrCreateResource(IntentLocations.INTENT_INDEX).getContents().iterator()
+							.next();
+					assertFalse("Remote and Local user should not share the same instance",
+							remoteIntentDocument == cdoIntentDocument);
+					remoteIntentDocument.getChapters().add(
+							IntentDocumentFactory.eINSTANCE.createIntentChapter());
+				} catch (ReadOnlyException e) {
+					fail(e.getMessage());
+				}
+			}
+		});
+		assertEquals("Remote modification should not have been received by the local user",
+				initialChapterNumber, cdoIntentDocument.getChapters().size());
+		remoteUser.save();
+		remoteUser.closeContext();
+
+		assertEquals("Remote modification should have been received by the local user",
+				initialChapterNumber + 1, cdoIntentDocument.getChapters().size());
+	}
+
+	/**
+	 * Ensures that when remote users make modifications and commit.
+	 * 
+	 * @throws Exception
+	 */
+	// public void testRemoteChangesIntegrationInsideEditor() throws Exception {
+	// Local user opens an editor on an Intent document
+	// setUpIntentProject("myIntentProject", INTENT_ABSTRACT_RESOURCE_DOCUMENT_PATH, false);
+	// waitForAllOperationsInUIThread();
+	// IntentEditor editor = openIntentEditor(getIntentDocument());
+	// waitForAllOperationsInUIThread();
+	// String initialContent = ((IntentEditorDocument)editor.getDocumentProvider().getDocument(
+	// editor.getEditorInput())).get();
+
+	// Remote user adds an untitle chapter
+	// final RepositoryAdapter remoteUser = IntentRepositoryManager.INSTANCE.getRepository(
+	// "cdo:/myIntentProject").createRepositoryAdapter();
+	// remoteUser.openSaveContext();
+	// remoteUser.execute(new IntentCommand() {
+	//
+	// public void execute() {
+	// IntentDocument remoteIntentDocument;
+	// try {
+	// remoteIntentDocument = (IntentDocument)remoteUser
+	// .getOrCreateResource(IntentLocations.INTENT_INDEX).getContents().iterator()
+	// .next();
+	// remoteIntentDocument.getChapters().add(
+	// IntentDocumentFactory.eINSTANCE.createIntentChapter());
+	// } catch (ReadOnlyException e) {
+	// fail(e.getMessage());
+	// }
+	// }
+	// });
+	// remoteUser.save();
+	// remoteUser.closeContext();
+	// waitForAllOperationsInUIThread();
+
+	// Local user should see the new chapter
+	// assertNotSame(initialContent,
+	// ((IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput()))
+	// .get());
+	//
+	// editor.close(false);
+	// }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/util/AbstractIntentCDOTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/util/AbstractIntentCDOTest.java
new file mode 100644
index 0000000..1a8deee
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/util/AbstractIntentCDOTest.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.docs.intent.client.ui.test.unit.cdo.util;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest;
+import org.eclipse.mylyn.docs.intent.collab.common.repository.IntentRepositoryInitializer;
+import org.eclipse.mylyn.docs.intent.collab.common.repository.IntentRepositoryManager;
+import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.ReadOnlyException;
+import org.eclipse.mylyn.docs.intent.collab.repository.RepositoryConnectionException;
+import org.eclipse.mylyn.docs.intent.test.server.IntentCDORepository;
+
+/**
+ * An abstract test class providing API for managing an Intent document stored in a CDO Repository.
+ * 
+ * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
+ */
+public class AbstractIntentCDOTest extends AbstractIntentUITest {
+
+	private static final String INTENT_REPOSITORY_NAME = "intent-server";
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest#setUp()
+	 */
+	@Override
+	protected void setUp() throws Exception {
+		// First step is to launch a CDOServer
+		IntentCDORepository.start(true, INTENT_REPOSITORY_NAME);
+
+		// Otherwise, everything is the same as local
+		super.setUp();
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest#tearDown()
+	 */
+	@Override
+	protected void tearDown() throws Exception {
+		super.tearDown();
+
+		// Stopping the CDOServer
+		IntentCDORepository.stop();
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest#setUpIntentProject(java.lang.String,
+	 *      java.lang.String, boolean)
+	 */
+	@Override
+	protected void setUpIntentProject(String projectName, String intentDocumentPath,
+			boolean listenForRepository) {
+		super.setUpIntentProject("cdo:/" + INTENT_REPOSITORY_NAME + "/" + projectName, intentDocumentPath,
+				listenForRepository);
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest#doCreateIntentProject(java.lang.String,
+	 *      java.lang.String)
+	 */
+	@Override
+	protected void doCreateIntentProject(String projectName, String intentDocumentContent)
+			throws CoreException {
+		// Step 1: create the repository
+		try {
+			repository = IntentRepositoryManager.INSTANCE.getRepository(projectName);
+
+			repositoryAdapter = repository.createRepositoryAdapter();
+			repositoryAdapter.openSaveContext();
+			assertNotNull(repository);
+			assertNotNull(repositoryAdapter);
+
+			// Step 2: initialise content
+			IntentRepositoryInitializer.initializeContent(projectName, intentDocumentContent);
+		} catch (RepositoryConnectionException e) {
+			fail("Failed to create CDO Repository '" + projectName + "': " + e.getMessage());
+		} catch (ReadOnlyException e) {
+			fail("Failed to open a Transaction on the CDO Repository '" + projectName + "': "
+					+ e.getMessage());
+		}
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest#additionalSetUpOperations()
+	 */
+	@Override
+	protected void additionalSetUpOperations() {
+
+	}
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/IntentMatchEngineTests.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/IntentMatchEngineTests.java
index ed32f42..e09121d 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/IntentMatchEngineTests.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/IntentMatchEngineTests.java
@@ -32,10 +32,17 @@
 import org.eclipse.mylyn.docs.intent.parser.IntentParser;
 import org.eclipse.mylyn.docs.intent.parser.modelingunit.ParseException;
 
+/**
+ * Test ensuring that the Intent match engine works as expected.
+ * 
+ * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
+ */
 public class IntentMatchEngineTests extends AbstractIntentUITest {
 
 	private static final String INTENT_DOCUMENT_FOLDER = "data/unit/documents/editorupdates/";
 
+	private static final String LINEBREAK = "\n";
+
 	private Collection<AssertionFailedError> errors = Sets.newLinkedHashSet();
 
 	private int compareCasesNumber;
@@ -121,7 +128,7 @@
 				String message = "One new chapter should be detected at position " + position;
 				try {
 					DiffElement diff = assertDiffElementIsAsExpected(message, differences, 2);
-					assertEquals(message + "\n" + getDiffAsString(differences), DifferenceKind.ADDITION,
+					assertEquals(message + LINEBREAK + getDiffAsString(differences), DifferenceKind.ADDITION,
 							diff.getKind());
 					assertEquals(message + getDiffAsString(differences), newChapter,
 							((ModelElementChangeLeftTarget)diff).getLeftElement());
@@ -153,11 +160,11 @@
 			try {
 				List<DiffElement> differences = IntentASTMerger.getDifferences(copy, getIntentDocument());
 				DiffElement diff = assertDiffElementIsAsExpected(message, differences, 2);
-				assertEquals(message + "\n" + getDiffAsString(differences), DifferenceKind.DELETION,
+				assertEquals(message + LINEBREAK + getDiffAsString(differences), DifferenceKind.DELETION,
 						diff.getKind());
-				assertEquals(message + "\n" + getDiffAsString(differences), chapterToRemoveInOriginal,
+				assertEquals(message + LINEBREAK + getDiffAsString(differences), chapterToRemoveInOriginal,
 						((ModelElementChangeRightTarget)diff).getRightElement());
-				assertEquals(message + "\n" + getDiffAsString(differences), copy,
+				assertEquals(message + LINEBREAK + getDiffAsString(differences), copy,
 						((ModelElementChangeRightTarget)diff).getLeftParent());
 			} catch (AssertionFailedError e) {
 				errors.add(e);
@@ -199,11 +206,11 @@
 						+ sectionID;
 				try {
 					DiffElement diff = assertDiffElementIsAsExpected(message, differences, containerLevel);
-					assertEquals(message + "\n" + getDiffAsString(differences), DifferenceKind.ADDITION,
+					assertEquals(message + LINEBREAK + getDiffAsString(differences), DifferenceKind.ADDITION,
 							diff.getKind());
-					assertEquals(message + "\n" + getDiffAsString(differences), newSection,
+					assertEquals(message + LINEBREAK + getDiffAsString(differences), newSection,
 							((ModelElementChangeLeftTarget)diff).getLeftElement());
-					assertEquals(message + "\n" + getDiffAsString(differences), container,
+					assertEquals(message + LINEBREAK + getDiffAsString(differences), container,
 							((ModelElementChangeLeftTarget)diff).getRightParent());
 				} catch (AssertionFailedError e) {
 					errors.add(e);
@@ -255,12 +262,11 @@
 
 			try {
 				DiffElement diff = assertDiffElementIsAsExpected(message, differences, containerLevel);
-				assertEquals(message + "\n" + getDiffAsString(differences), DifferenceKind.DELETION,
+				assertEquals(message + LINEBREAK + getDiffAsString(differences), DifferenceKind.DELETION,
 						diff.getKind());
-				assertEquals(message + "\n" + getDiffAsString(differences),
-						container.getIntentContent().get(trueIndex),
-						((ModelElementChangeRightTarget)diff).getRightElement());
-				assertEquals(message + "\n" + getDiffAsString(differences), containerCopy,
+				assertEquals(message + LINEBREAK + getDiffAsString(differences), container.getIntentContent()
+						.get(trueIndex), ((ModelElementChangeRightTarget)diff).getRightElement());
+				assertEquals(message + LINEBREAK + getDiffAsString(differences), containerCopy,
 						((ModelElementChangeRightTarget)diff).getLeftParent());
 			} catch (AssertionFailedError e) {
 				errors.add(e);
@@ -291,27 +297,28 @@
 	protected DiffElement assertDiffElementIsAsExpected(String message, Collection<DiffElement> differences,
 			int expectedLevel) {
 		compareCasesNumber++;
-		assertEquals(message + "\n" + getDiffAsString(differences), 1, differences.size());
+		assertEquals(message + LINEBREAK + getDiffAsString(differences), 1, differences.size());
 
 		// We want to have exactly one difference at the expected level
 		DiffElement childDiff = differences.iterator().next();
 		int currentLevel = 0;
 		while (childDiff != null && currentLevel < expectedLevel) {
-			assertEquals(message + "\n" + getDiffAsString(differences), 1, childDiff.getSubDiffElements()
-					.size());
+			assertEquals(message + LINEBREAK + getDiffAsString(differences), 1, childDiff
+					.getSubDiffElements().size());
 			currentLevel++;
 			childDiff = childDiff.getSubDiffElements().iterator().next();
 		}
 
 		// This difference should not have any sub difference elements
-		assertEquals(message + "\n" + getDiffAsString(differences), 0, childDiff.getSubDiffElements().size());
+		assertEquals(message + LINEBREAK + getDiffAsString(differences), 0, childDiff.getSubDiffElements()
+				.size());
 		return childDiff;
 	}
 
 	protected String getDiffAsString(Collection<DiffElement> differences) {
 		String diff = "";
 		for (DiffElement element : differences) {
-			diff += element.toString() + "\n";
+			diff += element.toString() + LINEBREAK;
 			diff += getDiffAsString(element.getSubDiffElements());
 		}
 		return diff;
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/repository/IntentRepositoryStructurerTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/repository/IntentRepositoryStructurerTest.java
index 17e5114..90e8421 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/repository/IntentRepositoryStructurerTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/repository/IntentRepositoryStructurerTest.java
@@ -39,6 +39,20 @@
  */
 public class IntentRepositoryStructurerTest extends AbstractIntentUITest {
 
+	private static final String CHAPTER_KEYWORD = "Chapter";
+	private static final String SUBSECTION_2_1_1 = "2.1.1";
+	private static final String SUBSECTION_4_1_2 = "4.1.2";
+	private static final String SUBSECTION_4_1_1 = "4.1.1";
+	private static final String SECTION_4_1 = "4.1";
+	private static final String CHAPTER_4 = "4";
+	private static final String CHAPTER_3 = "3";
+	private static final String CHAPTER_2 = "2";
+	private static final String CHAPTER_1 = "1";
+	private static final String SECTION_3_2 = "3.2";
+	private static final String SECTION_3_1 = "3.1";
+	private static final String SECTION_2_2 = "2.2";
+	private static final String SECTION_2_1 = "2.1";
+	private static final String SECTION1_1 = "1.1";
 	private static final String NEW_CHAPTER = "\tChapter {\n\t\tSection {\n\t\t}\n\t}\n}";
 
 	/**
@@ -52,8 +66,8 @@
 		IntentEditor editor = openIntentEditor();
 
 		// Step 2: we check the initial structure of the project
-		checkRepositoryStructure(Lists.newArrayList("1", "2", "3"),
-				Lists.newArrayList("1.1", "2.1", "2.2", "3.1", "3.1.1", "3.1.2"),
+		checkRepositoryStructure(Lists.newArrayList(CHAPTER_1, CHAPTER_2, CHAPTER_3),
+				Lists.newArrayList(SECTION1_1, SECTION_2_1, SECTION_2_2, SECTION_3_1, "3.1.1", "3.1.2"),
 				Lists.newArrayList("1.1.1", "3.1.1"));
 
 		// Step 3: adding a new chapter a the begging
@@ -66,9 +80,9 @@
 
 		editor.doSave(new NullProgressMonitor());
 		waitForAllOperationsInUIThread();
-		checkRepositoryStructure(Lists.newArrayList("1", "2", "3", "4"),
-				Lists.newArrayList("1.1", "2.1", "3.1", "3.2", "4.1", "4.1.1", "4.1.2"),
-				Lists.newArrayList("2.1.1", "4.1.1"));
+		checkRepositoryStructure(Lists.newArrayList(CHAPTER_1, CHAPTER_2, CHAPTER_3, CHAPTER_4),
+				Lists.newArrayList(SECTION1_1, SECTION_2_1, SECTION_3_1, SECTION_3_2, SECTION_4_1, SUBSECTION_4_1_1, SUBSECTION_4_1_2),
+				Lists.newArrayList(SUBSECTION_2_1_1, SUBSECTION_4_1_1));
 
 		// Step 4: adding a new chapter at the end
 		String documentWithChapterAtTheEnd = document.get().substring(0, document.get().lastIndexOf("}"))
@@ -77,34 +91,34 @@
 		document.set(documentWithChapterAtTheEnd);
 		editor.doSave(new NullProgressMonitor());
 		waitForAllOperationsInUIThread();
-		checkRepositoryStructure(Lists.newArrayList("1", "2", "3", "4", "5"),
-				Lists.newArrayList("1.1", "2.1", "3.1", "3.2", "4.1", "4.1.1", "4.1.2", "5.1"),
-				Lists.newArrayList("2.1.1", "4.1.1"));
+		checkRepositoryStructure(Lists.newArrayList(CHAPTER_1, CHAPTER_2, CHAPTER_3, CHAPTER_4, "5"),
+				Lists.newArrayList(SECTION1_1, SECTION_2_1, SECTION_3_1, SECTION_3_2, SECTION_4_1, SUBSECTION_4_1_1, SUBSECTION_4_1_2, "5.1"),
+				Lists.newArrayList(SUBSECTION_2_1_1, SUBSECTION_4_1_1));
 
 		// Step 5 : adding a new chapter in the middle
 		String chapterToAdd = "";
 		int index = document.get().indexOf("The 2.2 Section");
 		chapterToAdd = document.get().substring(index);
-		chapterToAdd = chapterToAdd.substring(chapterToAdd.indexOf("Chapter"),
-				chapterToAdd.lastIndexOf("Chapter"));
+		chapterToAdd = chapterToAdd.substring(chapterToAdd.indexOf(CHAPTER_KEYWORD),
+				chapterToAdd.lastIndexOf(CHAPTER_KEYWORD));
 		document.set(document.get().replace(chapterToAdd, chapterToAdd + NEW_CHAPTER));
 		editor.doSave(new NullProgressMonitor());
 		waitForAllOperationsInUIThread();
-		checkRepositoryStructure(Lists.newArrayList("1", "2", "3", "4", "5"),
-				Lists.newArrayList("1.1", "2.1", "3.1", "3.2", "4.1", "4.1.1", "4.1.2", "5.1"),
-				Lists.newArrayList("2.1.1", "4.1.1"));
+		checkRepositoryStructure(Lists.newArrayList(CHAPTER_1, CHAPTER_2, CHAPTER_3, CHAPTER_4, "5"),
+				Lists.newArrayList(SECTION1_1, SECTION_2_1, SECTION_3_1, SECTION_3_2, SECTION_4_1, SUBSECTION_4_1_1, SUBSECTION_4_1_2, "5.1"),
+				Lists.newArrayList(SUBSECTION_2_1_1, SUBSECTION_4_1_1));
 
 		// Step 6 : deleting a chapter in the middle
 		String chapterToDelete = "";
 		index = document.get().indexOf("The 2.2 Section");
 		chapterToDelete = document.get().substring(index);
-		chapterToDelete = chapterToDelete.substring(chapterToDelete.indexOf("Chapter"),
-				chapterToDelete.lastIndexOf("Chapter"));
+		chapterToDelete = chapterToDelete.substring(chapterToDelete.indexOf(CHAPTER_KEYWORD),
+				chapterToDelete.lastIndexOf(CHAPTER_KEYWORD));
 		document.set(document.get().replace(chapterToDelete, ""));
 		editor.doSave(new NullProgressMonitor());
 		waitForAllOperationsInUIThread();
-		checkRepositoryStructure(Lists.newArrayList("1", "2", "3", "4"),
-				Lists.newArrayList("1.1", "2.1", "3.1", "3.2", "4.1"), Lists.newArrayList("2.1.1"));
+		checkRepositoryStructure(Lists.newArrayList(CHAPTER_1, CHAPTER_2, CHAPTER_3, CHAPTER_4),
+				Lists.newArrayList(SECTION1_1, SECTION_2_1, SECTION_3_1, SECTION_3_2, SECTION_4_1), Lists.newArrayList(SUBSECTION_2_1_1));
 	}
 
 	/**
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/CompilerNotificationsTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/CompilerNotificationsTest.java
index 75ab90b..5e0d4ab 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/CompilerNotificationsTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/CompilerNotificationsTest.java
@@ -19,6 +19,7 @@
 import org.eclipse.mylyn.docs.intent.client.ui.editor.annotation.IntentAnnotationMessageType;
 import org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest;
 import org.eclipse.mylyn.docs.intent.client.ui.test.util.AnnotationUtils;
+import org.eclipse.mylyn.docs.intent.parser.IntentKeyWords;
 import org.eclipse.mylyn.docs.intent.parser.test.utils.FileToStringConverter;
 
 /**
@@ -28,6 +29,10 @@
  */
 public class CompilerNotificationsTest extends AbstractIntentUITest {
 
+	private static final String COMPILER_SHOULD_NOT_DETECT_ISSUE_FAILURE_MESSAGE = "The compiler should not detect any issue";
+
+	private static final String ECLASS_NAME = "c1";
+
 	private static final String INTENT_DATA_FOLDER = "data/unit/documents/scenario/compilerNotifications/";
 
 	private IntentEditor editor;
@@ -55,21 +60,21 @@
 	public void testCompilerIsNotifiedWhenModifyingMU() {
 		// Update Modeling Unit : make it pass
 		repositoryListener.clearPreviousEntries();
-		document.set(document.get().replace("c1", "new EClass c1 {}"));
+		document.set(document.get().replace(ECLASS_NAME, "new EClass c1 {}"));
 		editor.doSave(new NullProgressMonitor());
 		waitForCompiler(true);
-		assertFalse("The compiler should not detect any issue", AnnotationUtils.hasIntentAnnotation(editor,
-				IntentAnnotationMessageType.COMPILER_ERROR, "", false));
+		assertFalse(COMPILER_SHOULD_NOT_DETECT_ISSUE_FAILURE_MESSAGE, AnnotationUtils.hasIntentAnnotation(
+				editor, IntentAnnotationMessageType.COMPILER_ERROR, "", false));
 		// FIXME add this condition
 		// waitForCompiler(false);
 
 		// Update Modeling Unit : Add an error
 		repositoryListener.clearPreviousEntries();
-		document.set(document.get().replace("new EClass c1 {}", "c1"));
+		document.set(document.get().replace("new EClass c1 {}", ECLASS_NAME));
 		editor.doSave(new NullProgressMonitor());
 		waitForCompiler(true);
-		assertTrue("The compiler should not detect any issue", AnnotationUtils.hasIntentAnnotation(editor,
-				IntentAnnotationMessageType.COMPILER_ERROR, "The Entity c1 cannot be resolved", true));
+		assertTrue(COMPILER_SHOULD_NOT_DETECT_ISSUE_FAILURE_MESSAGE, AnnotationUtils.hasIntentAnnotation(
+				editor, IntentAnnotationMessageType.COMPILER_ERROR, "The Entity c1 cannot be resolved", true));
 		// FIXME add this condition
 		// waitForCompiler(false);
 	}
@@ -88,7 +93,7 @@
 
 		// Renaming the section and change the issue
 		repositoryListener.clearPreviousEntries();
-		document.set(document.get().replace("c1", "cRenamed"));
+		document.set(document.get().replace(ECLASS_NAME, "cRenamed"));
 
 		editor.doSave(new NullProgressMonitor());
 		waitForCompiler(true);
@@ -104,7 +109,8 @@
 		repositoryListener.clearPreviousEntries();
 		String newSection = FileToStringConverter.getFileAsString(new File(INTENT_DATA_FOLDER
 				+ "newSection01.intent"));
-		document.set(document.get().replace("M@", "M@\n" + newSection));
+		document.set(document.get().replace(IntentKeyWords.MODELING_UNIT_END,
+				IntentKeyWords.MODELING_UNIT_END + "\n" + newSection));
 
 		editor.doSave(new NullProgressMonitor());
 		waitForCompiler(true);
@@ -115,8 +121,8 @@
 
 		// Create another new Modeling Unit : Add an error
 		repositoryListener.clearPreviousEntries();
-		int beginIndex = document.get().lastIndexOf("@M");
-		int endIndex = document.get().lastIndexOf("M@");
+		int beginIndex = document.get().lastIndexOf(IntentKeyWords.MODELING_UNIT_END);
+		int endIndex = document.get().lastIndexOf(IntentKeyWords.MODELING_UNIT_END);
 		document.set(document.get().substring(0, beginIndex) + document.get().substring(endIndex + 2));
 
 		editor.doSave(new NullProgressMonitor());
@@ -137,8 +143,8 @@
 
 		editor.doSave(new NullProgressMonitor());
 		waitForCompiler(true);
-		assertFalse("The compiler should not detect any issue", AnnotationUtils.hasIntentAnnotation(editor,
-				IntentAnnotationMessageType.COMPILER_ERROR, "", false));
+		assertFalse(COMPILER_SHOULD_NOT_DETECT_ISSUE_FAILURE_MESSAGE, AnnotationUtils.hasIntentAnnotation(
+				editor, IntentAnnotationMessageType.COMPILER_ERROR, "", false));
 		// FIXME add this condition
 		// waitForCompiler(false);
 
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/AbstractIntentUITest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/AbstractIntentUITest.java
index 2fbc81b..add2340 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/AbstractIntentUITest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/AbstractIntentUITest.java
@@ -56,7 +56,7 @@
 import org.eclipse.ui.PlatformUI;

 

 /**

- * An abstract test class providing API for manage an Intent IDE projects and editors.

+ * An abstract test class providing API for managing an Intent IDE projects and editors.

  * 

  * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>

  */

@@ -110,9 +110,6 @@
 		waitForAllOperationsInUIThread();

 		IntentEditorActivator.getDefault().getLog().addLogListener(this);

 

-		System.out.println("-- SETTED UP.;");

-		traceHeapSize();

-

 		openedEditors = new ArrayList<IntentEditor>();

 	}

 

@@ -169,17 +166,13 @@
 		setAllFieldsToNull();

 

 		super.tearDown();

-		long totalHeapSize = Runtime.getRuntime().totalMemory();

-		long usedHeap = totalHeapSize - Runtime.getRuntime().freeMemory();

-		System.out.println("-- TEARED DOWN.");

-		traceHeapSize();

 	}

 

 	/**

 	 * Creates and register an new {@link org.eclipse.mylyn.docs.intent.collab.handlers.RepositoryClient } in

 	 * charge of detecting that events happened on the repository.

 	 */

-	protected void registerRepositoryListener() {

+	protected final void registerRepositoryListener() {

 		this.repositoryListener = new RepositoryListenerForTests();

 		Platform.addLogListener(repositoryListener);

 	}

@@ -190,7 +183,7 @@
 	 * @param projectName

 	 *            the intent project name

 	 */

-	protected void setUpIntentProject(final String projectName) {

+	protected final void setUpIntentProject(final String projectName) {

 		setUpIntentProject(projectName, INTENT_EMPTY_DOC_PATH, false);

 	}

 

@@ -203,7 +196,7 @@
 	 *            the path of the intent document to use (relative to the

 	 *            org.eclipse.mylyn.docs.intent.client.ui.test project).

 	 */

-	protected void setUpIntentProject(final String projectName, String intentDocumentPath) {

+	protected final void setUpIntentProject(final String projectName, String intentDocumentPath) {

 		setUpIntentProject(projectName, intentDocumentPath, false);

 	}

 

@@ -223,38 +216,23 @@
 	protected void setUpIntentProject(final String projectName, String intentDocumentPath,

 			boolean listenForRepository) {

 		try {

-			// Step 1 : getting the content of the intent document located at the given path.

+			// Step 1: getting the content of the intent document located at the given path.

 			File file = new File(intentDocumentPath);

 			final String intentDocumentContent = FileToStringConverter.getFileAsString(file);

 

-			// Step 2 : creating the intent project

-			IWorkspaceRunnable create = new IWorkspaceRunnable() {

-				public void run(IProgressMonitor monitor) throws CoreException {

-					IProject project = WorkspaceUtils.createProject(projectName, monitor);

-					ToggleNatureAction.toggleNature(project);

+			// Step 2: creating the intent project

+			doCreateIntentProject(projectName, intentDocumentContent);

 

-					IntentRepositoryInitializer.initializeContent(projectName, intentDocumentContent);

-

-					// Step 3 : initializing all useful informations

-					intentProject = project;

-					setUpRepository(project);

-				}

-			};

-			ResourcesPlugin.getWorkspace().run(create, null);

-

-			while (repositoryAdapter == null

-			// && (repository == null || ((WorkspaceRepository)repository).getEditingDomain()

-			// .getCommandStack() == null)

-			) {

+			while (repositoryAdapter == null) {

 				Thread.sleep(10);

 			}

 

-			// Step 3 : registering the repository listener

+			// Step 3: registering the repository listener

 			registerRepositoryListener();

-

-			// Step 4: waiting for synchronizer to pass

 			repositoryListener.clearPreviousEntries();

-			waitForSynchronizer();

+

+			// Step 4: additional setup operations

+			additionalSetUpOperations();

 

 		} catch (CoreException e) {

 			AssertionFailedError error = new AssertionFailedError("Failed to create Intent project");

@@ -273,12 +251,39 @@
 	}

 

 	/**

+	 * Creates the intent project with the given name, with the given content.

+	 * 

+	 * @param projectName

+	 *            the name of the project to create

+	 * @param intentDocumentContent

+	 *            the content to associate to the created intent document

+	 * @throws CoreException

+	 *             if the project cannot be created properly

+	 */

+	protected void doCreateIntentProject(final String projectName, final String intentDocumentContent)

+			throws CoreException {

+		IWorkspaceRunnable create = new IWorkspaceRunnable() {

+			public void run(IProgressMonitor monitor) throws CoreException {

+				IProject project = WorkspaceUtils.createProject(projectName, monitor);

+				ToggleNatureAction.toggleNature(project);

+

+				IntentRepositoryInitializer.initializeContent(projectName, intentDocumentContent);

+

+				// Step 3 : initializing all useful informations

+				intentProject = project;

+				setUpRepository(project);

+			}

+		};

+		ResourcesPlugin.getWorkspace().run(create, null);

+	}

+

+	/**

 	 * Set up the repository for the given project.

 	 * 

 	 * @param project

 	 *            the project

 	 */

-	protected void setUpRepository(IProject project) {

+	protected final void setUpRepository(IProject project) {

 		assertNotNull(project);

 		try {

 			repository = IntentRepositoryManager.INSTANCE.getRepository(project.getName());

@@ -354,7 +359,7 @@
 	 * 

 	 * @return the intentDocument associated to the current Intent project

 	 */

-	protected IntentDocument getIntentDocument() {

+	protected final IntentDocument getIntentDocument() {

 		if (intentDocument == null) {

 			intentDocument = new IntentDocumentQuery(repositoryAdapter).getOrCreateIntentDocument();

 		}

@@ -368,7 +373,7 @@
 	 *            the number of the chapter

 	 * @return the chapter

 	 */

-	protected IntentChapter getIntentChapter(int number) {

+	protected final IntentChapter getIntentChapter(int number) {

 		return getIntentDocument().getChapters().get(number - 1);

 	}

 

@@ -379,7 +384,7 @@
 	 *            the number of the section

 	 * @return the section

 	 */

-	protected IntentSection getIntentSection(int... number) {

+	protected final IntentSection getIntentSection(int... number) {

 		IntentSection section = getIntentChapter(number[0]).getSubSections().get(number[1] - 1);

 		if (number.length > 2) {

 			for (int i = 2; i < number.length; i++) {

@@ -394,7 +399,7 @@
 	 * 

 	 * @return the opened editor

 	 */

-	protected IntentEditor openIntentEditor() {

+	protected final IntentEditor openIntentEditor() {

 		return openIntentEditor(getIntentDocument());

 	}

 

@@ -405,7 +410,7 @@
 	 *            the {@link IntentStructuredElement} to open an editor on

 	 * @return the opened editor

 	 */

-	protected IntentEditor openIntentEditor(IntentStructuredElement element) {

+	protected final IntentEditor openIntentEditor(IntentStructuredElement element) {

 		IntentEditorOpener.openIntentEditor(repository, element, true, null, true);

 		waitForAllOperationsInUIThread();

 		IntentEditor editor = IntentEditorOpener.getAlreadyOpenedEditor(element);

@@ -441,28 +446,28 @@
 	/**

 	 * Wait for synchronizer to complete work.

 	 */

-	protected void waitForSynchronizer() {

+	protected final void waitForSynchronizer() {

 		waitForSynchronizer(true);

 	}

 

 	/**

 	 * Wait for repository to complete work.

 	 */

-	protected void waitForIndexer() {

+	protected final void waitForIndexer() {

 		waitForIndexer(true);

 	}

 

 	/**

 	 * Wait for compiler to complete work.

 	 */

-	protected void waitForCompiler() {

+	protected final void waitForCompiler() {

 		waitForCompiler(true);

 	}

 

 	/**

 	 * Wait for the project explorer refresher to complete work.

 	 */

-	protected void waitForProjectExplorerRefresher() {

+	protected final void waitForProjectExplorerRefresher() {

 		waitForProjectExplorerRefresher(true);

 	}

 

@@ -472,7 +477,7 @@
 	 * @param synchronizerShouldBeNotified

 	 *            indicates whether the synchronizer should be notified or not

 	 */

-	protected void waitForSynchronizer(boolean synchronizerShouldBeNotified) {

+	protected final void waitForSynchronizer(boolean synchronizerShouldBeNotified) {

 		waitForAllOperationsInUIThread();

 		assertNotNull(

 				"Cannot wait for synchronizer : you need to initialize a repository listener by calling the registerRepositoryListener() method",

@@ -498,7 +503,7 @@
 	 * @param indexerShouldBeNotified

 	 *            indicates whether the indexer should be notified or not

 	 */

-	protected void waitForIndexer(boolean indexerShouldBeNotified) {

+	protected final void waitForIndexer(boolean indexerShouldBeNotified) {

 		waitForAllOperationsInUIThread();

 		assertNotNull(

 				"Cannot wait for Indexer : you need to initialize a repository listener by calling the registerRepositoryListener() method",

@@ -519,7 +524,7 @@
 	 * @param refresherShouldBeNotified

 	 *            indicates whether the indexer should be notified or not

 	 */

-	protected void waitForProjectExplorerRefresher(boolean refresherShouldBeNotified) {

+	protected final void waitForProjectExplorerRefresher(boolean refresherShouldBeNotified) {

 		waitForAllOperationsInUIThread();

 		assertNotNull(

 				"Cannot wait for Project Explorer Refresher : you need to initialize a repository listener by calling the registerRepositoryListener() method",

@@ -540,7 +545,7 @@
 	 * @param compilerShouldBeNotified

 	 *            indicates whether the compiler should be notified or not

 	 */

-	protected void waitForCompiler(boolean compilerShouldBeNotified) {

+	protected final void waitForCompiler(boolean compilerShouldBeNotified) {

 		waitForAllOperationsInUIThread();

 		assertNotNull(

 				"Cannot wait for compiler : you need to initialize a repository listener by calling the registerRepositoryListener() method",

@@ -561,6 +566,14 @@
 	}

 

 	/**

+	 * Additional operations performed at the end of set-up.

+	 */

+	protected void additionalSetUpOperations() {

+		// waiting for synchronizer to pass

+		waitForSynchronizer();

+	}

+

+	/**

 	 * Sets all fields of the current test case to null (to avoid memory leaks).

 	 */

 	private void setAllFieldsToNull() {

diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/TestParserErrors.java b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/TestParserErrors.java
index c707a2b..f426ee4 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/TestParserErrors.java
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/TestParserErrors.java
@@ -22,19 +22,28 @@
 
 	@Test
 	public void testMissingBracket() {
+		final int expectedErrorposition = 10;
+		final int expectedErrorLength = 22;
 		testErrorsOnFile("dataTests/intentDocuments/errors/missing_bracket.intent", new ParseException(
-				"Cannot handle any description unit here : only in sections or chapters.", 10, 22));
+				"Cannot handle any description unit here : only in sections or chapters.",
+				expectedErrorposition, expectedErrorLength));
 	}
 
 	@Test
 	public void testNewLines() {
+		final int expectedErrorposition = 10;
+		final int expectedErrorLength = 21;
 		testErrorsOnFile("dataTests/intentDocuments/errors/newlines.intent", new ParseException(
-				"Cannot handle any description unit here : only in sections or chapters.", 10, 21));
+				"Cannot handle any description unit here : only in sections or chapters.",
+				expectedErrorposition, expectedErrorLength));
 	}
 
 	@Test
 	public void testMisplacedModelingUnit() {
+		final int expectedErrorposition = 40;
+		final int expectedErrorLength = 7;
 		testErrorsOnFile("dataTests/intentDocuments/errors/misplacedModelingUnit.intent", new ParseException(
-				"Cannot handle any modeling unit here : only in sections.", 40, 7));
+				"Cannot handle any modeling unit here : only in sections.", expectedErrorposition,
+				expectedErrorLength));
 	}
 }
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/.checkstyle b/tests/org.eclipse.mylyn.docs.intent.test.server/.checkstyle
new file mode 100644
index 0000000..14d1806
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/.checkstyle
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+    <fileset name="tous" enabled="true" check-config-name="Intent" local="false">
+        <file-match-pattern match-pattern="." include-pattern="true"/>
+    </fileset>
+</fileset-config>
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/.classpath b/tests/org.eclipse.mylyn.docs.intent.test.server/.classpath
new file mode 100644
index 0000000..64c5e31
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/.project b/tests/org.eclipse.mylyn.docs.intent.test.server/.project
new file mode 100644
index 0000000..b344f29
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/.project
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.mylyn.docs.intent.test.server</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+		<nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
+	</natures>
+</projectDescription>
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.mylyn.docs.intent.test.server/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..af0f20f
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/META-INF/MANIFEST.MF b/tests/org.eclipse.mylyn.docs.intent.test.server/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..0172c83
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Server
+Bundle-SymbolicName: org.eclipse.mylyn.docs.intent.test.server
+Bundle-Version: 0.7.0.qualifier
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.cdo.server.db,
+ org.eclipse.emf.cdo.server.net4j,
+ org.eclipse.net4j.db.h2,
+ org.eclipse.net4j.tcp,
+ org.eclipse.emf.cdo.net4j
+Import-Package: org.h2,
+ org.h2.api,
+ org.h2.jdbcx,
+ org.h2.tools,
+ org.h2.util
+Export-Package: org.eclipse.mylyn.docs.intent.test.server
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/about.html b/tests/org.eclipse.mylyn.docs.intent.test.server/about.html
new file mode 100644
index 0000000..670d108
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/about.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
+<html xmlns="http://www.w3.org/1999/xhtml"> 
+<head> 
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> 
+<title>Eclipse Foundation Software User Agreement</title> 
+</head> 
+ 
+<body lang="EN-US"> 
+<h2>Eclipse Foundation Software User Agreement</h2> 
+<p>April 14, 2010</p> 
+ 
+<h3>Usage Of Content</h3> 
+ 
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+   (COLLECTIVELY &quot;CONTENT&quot;).  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p> 
+ 
+<h3>Applicable Licenses</h3> 
+ 
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+   (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p> 
+ 
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p> 
+ 
+<ul> 
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li> 
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li> 
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+      and/or Fragments associated with that Feature.</li> 
+       <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li> 
+</ul> 
+ 
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p> 
+ 
+<ul> 
+       <li>The top-level (root) directory</li> 
+       <li>Plug-in and Fragment directories</li> 
+       <li>Inside Plug-ins and Fragments packaged as JARs</li> 
+       <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li> 
+       <li>Feature directories</li> 
+</ul> 
+ 
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p> 
+ 
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p> 
+ 
+<ul> 
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li> 
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li> 
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li> 
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li> 
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li> 
+</ul> 
+ 
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p> 
+ 
+ 
+<h3>Use of Provisioning Technology</h3> 
+ 
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a 
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> 
+   (&quot;Specification&quot;).</p> 
+ 
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p> 
+ 
+<ol> 
+       <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+       on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li> 
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li> 
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li> 
+</ol> 
+ 
+<h3>Cryptography</h3> 
+ 
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+   possession, or use, and re-export of encryption software, to see if this is permitted.</p> 
+ 
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> 
+</body> 
+</html> 
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/build.properties b/tests/org.eclipse.mylyn.docs.intent.test.server/build.properties
new file mode 100644
index 0000000..aa1a008
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/plugin.properties b/tests/org.eclipse.mylyn.docs.intent.test.server/plugin.properties
new file mode 100644
index 0000000..8eec0c5
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2010, 2011 Obeo.
+# 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
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     Obeo - initial API and implementation
+#################################################################################
+pluginName = Intent UI Test
+providerName = Eclipse Mylyn
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/pom.xml b/tests/org.eclipse.mylyn.docs.intent.test.server/pom.xml
new file mode 100644
index 0000000..5c50db1
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/pom.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright (C) 2011 Obeo
+
+   Cedric Brun <cedric.brun@obeo.fr>
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.eclipse.mylyn.docs.intent-group</groupId>
+    <artifactId>intent-parent</artifactId>
+    <version>0.7.0-SNAPSHOT</version>
+    <relativePath>../..</relativePath>
+  </parent>
+
+  <artifactId>org.eclipse.mylyn.docs.intent.test.server</artifactId>
+  <packaging>eclipse-test-plugin</packaging>
+
+ <build>   
+    <plugins>
+      <plugin>
+        <groupId>org.eclipse.tycho</groupId>
+        <artifactId>tycho-source-plugin</artifactId>
+      </plugin>      
+    </plugins>
+  </build>
+
+
+
+</project>
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/src/org/eclipse/mylyn/docs/intent/test/server/IntentCDORepository.java b/tests/org.eclipse.mylyn.docs.intent.test.server/src/org/eclipse/mylyn/docs/intent/test/server/IntentCDORepository.java
new file mode 100644
index 0000000..9984818
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/src/org/eclipse/mylyn/docs/intent/test/server/IntentCDORepository.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.docs.intent.test.server;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.emf.cdo.server.CDOServerUtil;
+import org.eclipse.emf.cdo.server.IRepository;
+import org.eclipse.emf.cdo.server.IStore;
+import org.eclipse.emf.cdo.server.db.CDODBUtil;
+import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy;
+import org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalMappingStrategy;
+import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil;
+import org.eclipse.net4j.acceptor.IAcceptor;
+import org.eclipse.net4j.db.DBUtil;
+import org.eclipse.net4j.db.IDBAdapter;
+import org.eclipse.net4j.db.IDBConnectionProvider;
+import org.eclipse.net4j.db.h2.H2Adapter;
+import org.eclipse.net4j.util.container.IPluginContainer;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.h2.jdbcx.JdbcDataSource;
+
+/**
+ * A CDO repository used to test Intent.
+ * 
+ * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
+ */
+public final class IntentCDORepository {
+
+	private static IRepository repository;
+
+	private static IAcceptor acceptor;
+
+	private static final String SERVER_LOCATION = "localhost";
+
+	private static final String SERVER_PORT_NUMBER = "2036";
+
+	/**
+	 * Private constructor.
+	 */
+	private IntentCDORepository() {
+
+	}
+
+	/**
+	 * Starts the Intent test Server (if not already launched).
+	 * 
+	 * @param cleanStore
+	 *            true if the store must be clean (i.e. database should be dropped)
+	 * @param repositoryName
+	 *            the name of the repository to launch
+	 */
+	public static void start(boolean cleanStore, String repositoryName) {
+		if (acceptor == null) {
+			// Step 1 : setting up the db
+			// Step 1.1 : defining the datasource
+			JdbcDataSource dataSource = new JdbcDataSource();
+			dataSource.setURL("jdbc:h2:_database/" + repositoryName);
+
+			// Step 1.2 : defining the mapping strategy
+			IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true);
+			Map<String, String> mappingProperties = new LinkedHashMap<String, String>();
+			mappingProperties.put(AbstractHorizontalMappingStrategy.PROP_OBJECT_TYPE_CACHE_SIZE, "1000");
+			mappingProperties.put(AbstractHorizontalMappingStrategy.PROP_QUALIFIED_NAMES,
+					Boolean.TRUE.toString());
+			mappingStrategy.setProperties(mappingProperties);
+
+			// Step 1.3 : use a H2 database
+			IDBAdapter dbAdapter = new H2Adapter();
+			IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
+
+			// Clean the store if needed
+			if (cleanStore) {
+				DBUtil.dropAllTables(dbConnectionProvider.getConnection(), repositoryName);
+			}
+
+			// Step 1.4 : creating the IStore from the specified DB
+			IStore store = CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
+
+			// Step 2 : creating the repository
+			Map<String, String> props = new HashMap<String, String>();
+			props.put(IRepository.Props.OVERRIDE_UUID, repositoryName);
+			props.put(IRepository.Props.SUPPORTING_AUDITS, "false");
+			props.put(IRepository.Props.SUPPORTING_BRANCHES, "false");
+			props.put(IRepository.Props.SUPPORTING_ECORE, "true");
+
+			repository = CDOServerUtil.createRepository(repositoryName, store, props);
+
+			CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
+			CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE);
+
+			// Step 3 : creating an acceptor on the server side
+			acceptor = (IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors", "tcp",
+					SERVER_LOCATION + ":" + SERVER_PORT_NUMBER);
+		}
+	}
+
+	/**
+	 * Stops the currently running Intent test server.
+	 */
+	public static void stop() {
+		if (acceptor != null) {
+			LifecycleUtil.deactivate(acceptor);
+			LifecycleUtil.deactivate(repository);
+			acceptor = null;
+			repository = null;
+		}
+	}
+}