[Checkstyle] Make checkstyle config harder, better & stronger (3 -
Warnings)
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/IntentLinkHelper.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/IntentLinkHelper.java
index 71af52a..d2917e7 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/IntentLinkHelper.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/navigator/IntentLinkHelper.java
@@ -113,10 +113,9 @@
if (selectedElement instanceof IntentIndexEntry) {
alreadyOpenedEditor = IntentEditorOpener
.getAlreadyOpenedEditor(((IntentIndexEntry)selectedElement).getReferencedElement());
- }
- // This case can never happen if jdt is installed, as LinkEditorAction.activateEditorJob only takes
- // the first linkhelper available (if installed, the JDT for an IProject)
- else if (selectedElement instanceof IProject) {
+ } else if (selectedElement instanceof IProject) {
+ // This case can never happen if jdt is installed, as LinkEditorAction.activateEditorJob only
+ // takes the first linkhelper available (if installed, the JDT for an IProject)
try {
if (((IProject)selectedElement).hasNature(IntentNature.NATURE_ID)) {
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/repository/WorkspaceSessionDeltaVisitor.java b/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/repository/WorkspaceSessionDeltaVisitor.java
index fd9b7a7..c429f06 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/repository/WorkspaceSessionDeltaVisitor.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/repository/WorkspaceSessionDeltaVisitor.java
@@ -46,11 +46,6 @@
protected Collection<Resource> removedResources;
/**
- * The path indicating the location of the listened WorkspaceRepository.
- */
- private String repositoryPath;
-
- /**
* WorkspaceSessionDeltaVisitor constructor.
*
* @param repositoryAdapter
@@ -63,7 +58,6 @@
this.repositoryAdapter = repositoryAdapter;
this.changedResources = new ArrayList<Resource>();
this.removedResources = new ArrayList<Resource>();
- this.repositoryPath = repositoryPath.toString();
}
/**
diff --git a/plugins/org.eclipse.mylyn.docs.intent.core.edit/.checkstyle b/plugins/org.eclipse.mylyn.docs.intent.core.edit/.checkstyle
index 884536f..9aee79c 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.core.edit/.checkstyle
+++ b/plugins/org.eclipse.mylyn.docs.intent.core.edit/.checkstyle
@@ -1,9 +1,10 @@
<?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>
- <filter name="FilesFromPackage" enabled="true">
- <filter-data value="src-gen"/>
- </filter>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="intent" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+ <filter name="FilesFromPackage" enabled="true">
+ <filter-data value="src-gen"/>
+ </filter>
</fileset-config>
diff --git a/plugins/org.eclipse.mylyn.docs.intent.core/src-gen/org/eclipse/mylyn/docs/intent/core/document/impl/IntentSectionImpl.java b/plugins/org.eclipse.mylyn.docs.intent.core/src-gen/org/eclipse/mylyn/docs/intent/core/document/impl/IntentSectionImpl.java
index 666ed09..28ba6a2 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.core/src-gen/org/eclipse/mylyn/docs/intent/core/document/impl/IntentSectionImpl.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.core/src-gen/org/eclipse/mylyn/docs/intent/core/document/impl/IntentSectionImpl.java
@@ -72,7 +72,6 @@
*
* @generated NOT
*/
- @SuppressWarnings("unchecked")
public EList<IntentSection> getSubSections() {
Collection<IntentSection> result = new ArrayList<IntentSection>();
Iterator<EObject> it = getIntentContent().iterator();
@@ -91,7 +90,6 @@
*
* @generated NOT
*/
- @SuppressWarnings("unchecked")
public EList<GenericUnit> getUnits() {
Collection<GenericUnit> result = new ArrayList<GenericUnit>();
Iterator<EObject> it = getIntentContent().iterator();
@@ -108,7 +106,6 @@
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
- @SuppressWarnings("unchecked")
public EList<DescriptionUnit> getDescriptionUnits() {
Collection<DescriptionUnit> result = new ArrayList<DescriptionUnit>();
Iterator<EObject> it = getIntentContent().iterator();
@@ -127,7 +124,6 @@
*
* @generated NOT
*/
- @SuppressWarnings("unchecked")
public EList<ModelingUnit> getModelingUnits() {
Collection<ModelingUnit> result = new ArrayList<ModelingUnit>();
Iterator<EObject> it = getIntentContent().iterator();
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.compiler.test/src/org/eclipse/mylyn/docs/intent/client/compiler/test/util/AbstractIntentCompilerTest.java b/tests/org.eclipse.mylyn.docs.intent.client.compiler.test/src/org/eclipse/mylyn/docs/intent/client/compiler/test/util/AbstractIntentCompilerTest.java
index 5c9e805..e2f6853 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.compiler.test/src/org/eclipse/mylyn/docs/intent/client/compiler/test/util/AbstractIntentCompilerTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.compiler.test/src/org/eclipse/mylyn/docs/intent/client/compiler/test/util/AbstractIntentCompilerTest.java
@@ -10,13 +10,16 @@
*******************************************************************************/
package org.eclipse.mylyn.docs.intent.client.compiler.test.util;
+//CHECKSTYLE:OFF
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import junit.framework.Assert;
import junit.framework.AssertionFailedError;
import org.eclipse.core.runtime.ILogListener;
@@ -49,6 +52,7 @@
import org.junit.After;
import org.junit.Before;
+//CHECKSTYLE:ON
/**
* An abstract test class providing API for manage an Intent IDE projects and editors.
*
@@ -174,8 +178,8 @@
} else {
Resource expected = resourceSet.getResource(expectedURI, true);
Comparison comparison = EMFCompareUtils.compare(expected, generatedResource);
- Assert.assertTrue("There are differences between expected and actual", comparison
- .getDifferences().isEmpty());
+ assertTrue("There are differences between expected and actual", comparison.getDifferences()
+ .isEmpty());
}
}
@@ -217,7 +221,7 @@
return;
}
if (candidates.size() == 1) {
- Assert.assertEquals(message, candidates.get(0));
+ assertEquals(message, candidates.get(0));
} else {
if (!candidates.isEmpty()) {
StringBuilder builder = new StringBuilder();
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/.checkstyle b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/.checkstyle
index 6e33fa2..e7ce05a 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/.checkstyle
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/.checkstyle
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<fileset-config file-format-version="1.2.0" simple-config="true">
- <local-check-config name="Intent" location="/org.eclipse.mylyn.docs.intent/dev/code/checkstyleConfiguration.xml" type="project" description="">
- <additional-data name="protect-config-file" value="false"/>
- </local-check-config>
- <fileset name="tous" enabled="true" check-config-name="Intent" local="true">
- <file-match-pattern match-pattern="." include-pattern="true"/>
- </fileset>
- <filter name="NonSrcDirs" enabled="true"/>
-</fileset-config>
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <local-check-config name="Intent" location="/org.eclipse.mylyn.docs.intent/dev/code/checkstyleConfiguration.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="tous" enabled="true" check-config-name="Intent" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+ <filter name="NonSrcDirs" enabled="true"/>
+</fileset-config>
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/about.html b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/about.html
index 34ab520..670d108 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/about.html
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/about.html
@@ -1,106 +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 "CONTENT"). 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
- ("EPL"). 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, "Program" 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 ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</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 ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</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 "features". Within a Feature, files named "feature.xml" 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 ("Included Features"). Within a Feature, files named "feature.xml" 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 "about.html" ("Abouts"). The terms and conditions governing Features and
-Included Features should be contained in files named "license.html" ("Feature Licenses"). 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 "src" 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 ("Feature Update License") 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 "license" property of files named "feature.properties" 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 ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or
- other materials (collectively "Installable Software"). 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>
- ("Specification").</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 ("Provisioning Process") in which a user may execute the Provisioning Technology
- on a machine ("Target Machine") 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 ("Installable Software Agreement") 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>
+<!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 "CONTENT"). 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
+ ("EPL"). 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, "Program" 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 ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</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 ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</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 "features". Within a Feature, files named "feature.xml" 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 ("Included Features"). Within a Feature, files named "feature.xml" 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 "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses"). 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 "src" 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 ("Feature Update License") 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 "license" property of files named "feature.properties" 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 ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively "Installable Software"). 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>
+ ("Specification").</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 ("Provisioning Process") in which a user may execute the Provisioning Technology
+ on a machine ("Target Machine") 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 ("Installable Software Agreement") 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.client.ui.test/build.properties b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/build.properties
index f4ae970..aa1a008 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/build.properties
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/build.properties
@@ -1,5 +1,5 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.properties
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/demo/PatchCreationThroughCompareDialogTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/demo/PatchCreationThroughCompareDialogTest.java
index 0e5310c..8f4347a 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/demo/PatchCreationThroughCompareDialogTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/demo/PatchCreationThroughCompareDialogTest.java
@@ -1,7 +1,7 @@
-package org.eclipse.emf.compare.tests.acceptance.comparedialog.patch;
-
-import org.eclipse.emf.compare.tests.acceptance.SWTBotCompareTestCase;
-
-public class PatchCreationThroughCompareDialogTest extends SWTBotCompareTestCase {
- // TODO
-}
+package org.eclipse.emf.compare.tests.acceptance.comparedialog.patch;
+
+import org.eclipse.emf.compare.tests.acceptance.SWTBotCompareTestCase;
+
+public class PatchCreationThroughCompareDialogTest extends SWTBotCompareTestCase {
+ // TODO
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/demo/demo_as_text b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/demo/demo_as_text
index 238e23d..16f8f02 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/demo/demo_as_text
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/demo/demo_as_text
@@ -1,581 +1,581 @@
-Document {
- Chapter Introduction {
- EMF Compare provides comparison and merge facility for any kind of EMF Model.
-
- It includes a *generic comparison engine*, the ability to *export differences in a model patch* and it is
- integrated with the Eclipse Team API meaning that it enable collaborative work on models using *CVS*, *SVN*
- and *GIT*.
-
- In a nutshell this project provides : a *framework you can easily reuse and extend* to compare
- instances of your models and a tool integrated in the Eclipse IDE to see the differences and merge them.
- }
- Chapter Architecture {
- This Chapter provides an overview of EMF Compare Logical Architecture.
-
- Please refer to
- @see "PhysicialArchitecture" for more technical informations.
-
- Section Comparison process {
- The comparison process is divided in 2 phases : matching and differencing. The matching phase browses both models trying to figure out which element of model
- 1 corresponds to which element of model 2. The differencing process then browses the result of the matching and creates the corresponding delta. The result of
- both phases can be serialized as models.
-
- !images/Process.png!
-
- }
-
- Section Plugins Architecture {
- Here is the plugin architecture of the EMF Compare component :
-
- !images/Plugins.png!
-
- }
-
- Section @API@s {
- The red boxes in the following picture represent the component which were designed for extensibility. On all of these components can be plugged your own engines
- or behavior.
-
- !images/compare_general_extensibility.png!
-
- }
- }
- Chapter Features {
- All the features provided by EMF Compare are listed here.
-
- Section Extensible model comparison {
- With EMF Compare, you can define your own mechanisms for comparing models.
- }
-
- Section SVN Integration {
- EMF Compare provides integration with the SVN tool.
- }
-
- Section CVS Integration {
- EMF Compare provides integration with the CVS tool.
- }
-
- Section Git Integration {
- EMF Compare provides integration with the Git tool.
- }
-
- Section Diff Exploration {
- Exploration of diffs.
- }
-
- Section Merge {
- Merging models.
-
- @M
- Resource productResource {
- content += emfCompareProduct;
- }
- M@
-
-
- The emf compare product :
-
- @M
- new Product emfCompareProduct {
- interactions += new Interaction compareDialog {};
- }
- M@
-
- }
-
- Section Using patches for merging models {
- With EMF Compare, you will soon be able patch differences between two models and apply
- them using the standard Eclipse API.
- }
- }
- Chapter Presentation of the Match model {
- A Match model is used to represent the result of a match operation between two models.
-
- In associates each element of the left model to an element of the right model (if such element can be found).
- This model will be used to compute differences between these two models during a Diff operation (please
- refer to
- @see "ExplorationOfDiffs" for additional informations).
-
- Section Match model : main concepts {
- Let us first present the main concepts used in a Match model.
-
- Section Architecture of the match package {
- The Match metamodel can be found at the following location :
-
- @M matchResourceDefinition
- Resource matchResource {
- URI = "platform:/resource/org.eclipse.emf.compare.match/model/match.ecore";
- content += match;
- }
- M@
-
-
- All concepts are defined in the @match@ EPackage, which is associated to a standard eclipse URI :
-
- @M matchPackage_definition
- new EPackage match {
- nsURI = "http://www.eclipse.org/emf/compare/match/1.1";
- nsPrefix = "match";
- }
- M@
-
- }
-
- Section The MatchModel concept {
- A Match model is used to represent the result of a match operation between two models.
-
- @M MatchModelDefinition
- match {
- eClassifiers += new EClass MatchModel {
- eStructuralFeatures += new EReference {
- name = "matchedElements";
- eType = MatchElement;
- containment = "true";
- upperBound = "-1";
- changeable = "true";
- ordered = "true";
- };
- eStructuralFeatures += new EReference {
- name = "unmatchedElements";
- eType = UnmatchElement;
- containment = "true";
- upperBound = "-1";
- changeable = "true";
- ordered = "true";
- };
- eStructuralFeatures += new EReference {
- name = "leftRoots";
- eType = EObject;
- upperBound = "-1";
- changeable = "true";
- ordered = "true";
- };
- eStructuralFeatures += new EReference {
- name = "rightRoots";
- eType = EObject;
- upperBound = "-1";
- changeable = "true";
- ordered = "true";
- };
- eStructuralFeatures += new EReference {
- name = "ancestorRoots";
- eType = EObject;
- upperBound = "-1";
- changeable = "true";
- ordered = "true";
- };
- };
- }
- M@
-
- }
- }
-
- Section Other concepts {
- Lorem ipsum dolor sit amet, consectetur adipisicing elit,
- sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
- Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
- @label "UnmatchModel" "UnmatchModel definition"
- nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
- reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
- @see "UnmatchModel" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
- sunt in culpa qui officia deserunt mollit anim id est laborum.
-
- @M UnmatchModelDefinition
- match {
- eClassifiers += new EClass UnmatchModel {
- eStructuralFeatures += new EReference {
- name = "roots";
- eType = EObject;
- upperBound = "-1";
- changeable = "true";
- ordered = "true";
- };
- eStructuralFeatures += new EAttribute {
- name = "remote";
- eType = EBoolean;
- changeable = "true";
- ordered = "true";
- };
- eStructuralFeatures += new EAttribute {
- name = "side";
- eType = Side;
- changeable = "true";
- ordered = "true";
- };
- };
- }
- M@
-
-
- Section Presentation of the MatchResourceSet class. {
- Lorem ipsum dolor sit amet, consectetur adipisicing elit,
- sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
- Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
- @label "MatchResourceSet" "MatchResourceSet definition"
- nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
- reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
- @see "MatchResourceSet" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
- sunt in culpa qui officia deserunt mollit anim id est laborum.
-
- @M MatchResourceSetDefinition
- match {
- eClassifiers += new EClass MatchResourceSet {
- eStructuralFeatures += new EReference {
- name = "matchModels";
- eType = MatchModel;
- containment = "true";
- upperBound = "-1";
- changeable = "true";
- ordered = "true";
- };
- eStructuralFeatures += new EReference {
- name = "unmatchedModels";
- eType = UnmatchModel;
- containment = "true";
- upperBound = "-1";
- changeable = "true";
- ordered = "true";
- };
- };
- }
- M@
-
- }
- }
-
- Section Matching elements of the left model with elements of the right model {
- Matchin elements.
-
- Section The MatchElement concept {
- Lorem ipsum dolor sit amet, consectetur adipisicing elit,
- sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
- Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
- @label "MatchElement" "MatchElement definition"
- nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
- reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
- @see "MatchElement" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
- sunt in culpa qui officia deserunt mollit anim id est laborum.
-
- @M MatchElementDefinition
- match {
- eClassifiers += new EClass MatchElement {
- eStructuralFeatures += new EAttribute {
- name = "similarity";
- eType = EDouble;
- lowerBound = "1";
- changeable = "true";
- ordered = "false";
- unique = "false";
- };
- eStructuralFeatures += new EReference {
- name = "subMatchElements";
- eType = MatchElement;
- containment = "true";
- upperBound = "-1";
- changeable = "true";
- ordered = "true";
- };
- };
- }
- M@
-
-
- Section Matching left and right elements {
- Lorem ipsum dolor sit amet, consectetur adipisicing elit,
- sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
- Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
- @label "Match2Elements" "Match2Elements definition"
- nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
- reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
- @see "Match2Elements" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
- sunt in culpa qui officia deserunt mollit anim id est laborum.
-
- @M Match2ElementsDefinition
- match {
- eClassifiers += new EClass Match2Elements {
- eStructuralFeatures += new EReference {
- name = "leftElement";
- eType = EObject;
- lowerBound = "1";
- changeable = "true";
- ordered = "false";
- };
- eStructuralFeatures += new EReference {
- name = "rightElement";
- eType = EObject;
- lowerBound = "1";
- changeable = "true";
- ordered = "false";
- };
- eSuperTypes += MatchElement;
- };
- }
- M@
-
- }
-
- Section Three-way match : left, right and common ancestor {
- Lorem ipsum dolor sit amet, consectetur adipisicing elit,
- sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
- Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
- @label "Match3Elements" "Match3Elements definition"
- nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
- reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
- @see "Match3Elements" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
- sunt in culpa qui officia deserunt mollit anim id est laborum.
-
- @M Match3ElementsDefinition
- match {
- eClassifiers += new EClass Match3Elements {
- eStructuralFeatures += new EReference {
- name = "originElement";
- eType = EObject;
- lowerBound = "1";
- changeable = "true";
- ordered = "false";
- };
- eSuperTypes += Match2Elements;
- };
- }
- M@
-
- }
- }
-
- Section The UnmatchElement concept {
- Lorem ipsum dolor sit amet, consectetur adipisicing elit,
- sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
- Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
- @label "UnmatchElement" "UnmatchElement definition"
- nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
- reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
- @see "UnmatchElement" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
- sunt in culpa qui officia deserunt mollit anim id est laborum.
-
- @M UnmatchElementDefinition
- match {
- eClassifiers += new EClass UnmatchElement {
- eStructuralFeatures += new EReference {
- name = "element";
- eType = EObject;
- lowerBound = "1";
- changeable = "true";
- ordered = "false";
- };
- eStructuralFeatures += new EAttribute {
- name = "conflicting";
- eType = EBoolean;
- changeable = "true";
- ordered = "true";
- };
- eStructuralFeatures += new EAttribute {
- name = "remote";
- eType = EBoolean;
- changeable = "true";
- ordered = "true";
- };
- eStructuralFeatures += new EAttribute {
- name = "side";
- eType = Side;
- changeable = "true";
- ordered = "true";
- };
- };
- }
- M@
-
- }
-
- Section Differencing the left model from right model when comparaison fails {
- During the Match process, deleted or added elements are considered as unmatched.
-
- Two different situations can occur :
-
- * an element defined in the left model is not matching any element in the right model (deleted element)
- * an element defined in the right model is not matching any element in the left model (added element)
-
-
- The MatchModel store suchs an element using @UnmatchElement@s (
- @see "TheUnmatchElementConcept" ). To differenciate
- added element from deleted element, we define the @EEnum@ *Side* :
-
- @M SidedataTypeDefinition
- match {
- eClassifiers += new EEnum Side {
- serializable = "true";
- eLiterals += new EEnumLiteral {
- name = "Left";
- literal = "Left";
- value = "0";
- };
- eLiterals += new EEnumLiteral {
- name = "Right";
- literal = "Right";
- value = "1";
- };
- };
- }
- M@
-
-
- If the feature @side@ of an UnmatchElement is _Right_, then it must be considered as an added element.
- Otherwise, it is a deleted element.
- }
- }
-
- Section Abstractness and other design considerations {
- In this chapter, we will study the abstractness of each class of the Metamodel.
-
- We decide to associate the followin abstracness to MatchModel.
-
- @M MatchModelAbstracness
- MatchModel {
- abstract = "false";
- }
- M@
-
-
- We decide to associate the followin abstracness to UnmatchModel.
-
- @M UnmatchModelAbstracness
- UnmatchModel {
- abstract = "false";
- }
- M@
-
-
- We decide to associate the followin abstracness to MatchResourceSet.
-
- @M MatchResourceSetAbstracness
- MatchResourceSet {
- abstract = "false";
- }
- M@
-
-
- We decide to associate the followin abstracness to MatchElement.
-
- @M MatchElementAbstracness
- MatchElement {
- abstract = "true";
- }
- M@
-
-
- We decide to associate the followin abstracness to Match2Elements.
-
- @M Match2ElementsAbstracness
- Match2Elements {
- abstract = "false";
- }
- M@
-
-
- We decide to associate the followin abstracness to Match3Elements.
-
- @M Match3ElementsAbstracness
- Match3Elements {
- abstract = "false";
- }
- M@
-
-
- We decide to associate the followin abstracness to UnmatchElement.
-
- @M UnmatchElementAbstracness
- UnmatchElement {
- abstract = "false";
- }
- M@
-
- }
- }
- Chapter Presentation of the Diff model {
- The diff model presentation.
-
- Section Architecture of the diff package {
- All concepts are defined in the @diff@ package, which is associated to a standard eclipse URI :
-
- @M diffPackage_definition
- Resource diffResource {
- URI = "platform:/resource/org.eclipse.emf.compare.diff/model/diff.ecore";
- content += diff;
- }
- M@
-
-
- @M
- new EPackage diff {
- nsURI = "http://www.eclipse.org/emf/compare/diff/1.1";
- nsPrefix = "diff";
- }
- M@
-
- }
- }
- Chapter Physical Architecture {
- EMFCompare is divided in 4 main components :
-
- * EMF Compare core
- ** @org.eclipse.emf.compare@ (standalone)
- * EMF Compare match
- ** @org.eclipse.emf.compare.match@ (standalone)
- * EMF Compare diff
- ** @org.eclipse.emf.compare.diff@ (standalone)
- * EMF Compare UI
- ** @org.eclipse.emf.compare.ui@ (depends on the Eclipes environment)
-
-
-
-
- Section EMF Compare core {
- This plugin defines utility classes and Exceptions.
- }
-
- Section EMF Compare match {
- This plugin defines all the logic allowing to Match two different models.
-
- For additional details about the Match metamodel, please refer to the chapter entitled
- @see "PresentationOfTheMatchMetamodel" .
- }
-
- Section EMF Compare diff {
- This plugin defines all the logic allowing to compute differences between two matched models.
-
- It also merges the model using the computed differences.
-
- For additional details about the Match metamodel, please refer to the chapter entitled
- @see "PresentationOfTheMatchMetamodel" .
- }
-
- Section EMF Compare UI {
- This plugin defines all UI related features of EMF Compare.
- }
- }
- Chapter Test architecture of EMF Compare {
- The test architecture of EMF Compare
-
- Section Test projects {
- The org.eclipse.emf.compare.tests plugin contains all tests relative to EMFCompare features.
-
- @M
- Resource compareTestProjectResource {
- URI = "retro:/org.eclipse.emf.compare.tests/*patch*";
- content += emfCompareTestProject;
- }
- new Project emfCompareTestProject {
- id = "org.eclipse.emf.compare.tests";
- }
- M@
-
- }
-
- Section Acceptance tests {
- In this section, we will present all the acceptance tests that have been written in EMF Compare.
- }
-
- Section Unit tests {
- unit test
- }
- }
-}
+Document {
+ Chapter Introduction {
+ EMF Compare provides comparison and merge facility for any kind of EMF Model.
+
+ It includes a *generic comparison engine*, the ability to *export differences in a model patch* and it is
+ integrated with the Eclipse Team API meaning that it enable collaborative work on models using *CVS*, *SVN*
+ and *GIT*.
+
+ In a nutshell this project provides : a *framework you can easily reuse and extend* to compare
+ instances of your models and a tool integrated in the Eclipse IDE to see the differences and merge them.
+ }
+ Chapter Architecture {
+ This Chapter provides an overview of EMF Compare Logical Architecture.
+
+ Please refer to
+ @see "PhysicialArchitecture" for more technical informations.
+
+ Section Comparison process {
+ The comparison process is divided in 2 phases : matching and differencing. The matching phase browses both models trying to figure out which element of model
+ 1 corresponds to which element of model 2. The differencing process then browses the result of the matching and creates the corresponding delta. The result of
+ both phases can be serialized as models.
+
+ !images/Process.png!
+
+ }
+
+ Section Plugins Architecture {
+ Here is the plugin architecture of the EMF Compare component :
+
+ !images/Plugins.png!
+
+ }
+
+ Section @API@s {
+ The red boxes in the following picture represent the component which were designed for extensibility. On all of these components can be plugged your own engines
+ or behavior.
+
+ !images/compare_general_extensibility.png!
+
+ }
+ }
+ Chapter Features {
+ All the features provided by EMF Compare are listed here.
+
+ Section Extensible model comparison {
+ With EMF Compare, you can define your own mechanisms for comparing models.
+ }
+
+ Section SVN Integration {
+ EMF Compare provides integration with the SVN tool.
+ }
+
+ Section CVS Integration {
+ EMF Compare provides integration with the CVS tool.
+ }
+
+ Section Git Integration {
+ EMF Compare provides integration with the Git tool.
+ }
+
+ Section Diff Exploration {
+ Exploration of diffs.
+ }
+
+ Section Merge {
+ Merging models.
+
+ @M
+ Resource productResource {
+ content += emfCompareProduct;
+ }
+ M@
+
+
+ The emf compare product :
+
+ @M
+ new Product emfCompareProduct {
+ interactions += new Interaction compareDialog {};
+ }
+ M@
+
+ }
+
+ Section Using patches for merging models {
+ With EMF Compare, you will soon be able patch differences between two models and apply
+ them using the standard Eclipse API.
+ }
+ }
+ Chapter Presentation of the Match model {
+ A Match model is used to represent the result of a match operation between two models.
+
+ In associates each element of the left model to an element of the right model (if such element can be found).
+ This model will be used to compute differences between these two models during a Diff operation (please
+ refer to
+ @see "ExplorationOfDiffs" for additional informations).
+
+ Section Match model : main concepts {
+ Let us first present the main concepts used in a Match model.
+
+ Section Architecture of the match package {
+ The Match metamodel can be found at the following location :
+
+ @M matchResourceDefinition
+ Resource matchResource {
+ URI = "platform:/resource/org.eclipse.emf.compare.match/model/match.ecore";
+ content += match;
+ }
+ M@
+
+
+ All concepts are defined in the @match@ EPackage, which is associated to a standard eclipse URI :
+
+ @M matchPackage_definition
+ new EPackage match {
+ nsURI = "http://www.eclipse.org/emf/compare/match/1.1";
+ nsPrefix = "match";
+ }
+ M@
+
+ }
+
+ Section The MatchModel concept {
+ A Match model is used to represent the result of a match operation between two models.
+
+ @M MatchModelDefinition
+ match {
+ eClassifiers += new EClass MatchModel {
+ eStructuralFeatures += new EReference {
+ name = "matchedElements";
+ eType = MatchElement;
+ containment = "true";
+ upperBound = "-1";
+ changeable = "true";
+ ordered = "true";
+ };
+ eStructuralFeatures += new EReference {
+ name = "unmatchedElements";
+ eType = UnmatchElement;
+ containment = "true";
+ upperBound = "-1";
+ changeable = "true";
+ ordered = "true";
+ };
+ eStructuralFeatures += new EReference {
+ name = "leftRoots";
+ eType = EObject;
+ upperBound = "-1";
+ changeable = "true";
+ ordered = "true";
+ };
+ eStructuralFeatures += new EReference {
+ name = "rightRoots";
+ eType = EObject;
+ upperBound = "-1";
+ changeable = "true";
+ ordered = "true";
+ };
+ eStructuralFeatures += new EReference {
+ name = "ancestorRoots";
+ eType = EObject;
+ upperBound = "-1";
+ changeable = "true";
+ ordered = "true";
+ };
+ };
+ }
+ M@
+
+ }
+ }
+
+ Section Other concepts {
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+ Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
+ @label "UnmatchModel" "UnmatchModel definition"
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
+ reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
+ @see "UnmatchModel" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
+ sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+ @M UnmatchModelDefinition
+ match {
+ eClassifiers += new EClass UnmatchModel {
+ eStructuralFeatures += new EReference {
+ name = "roots";
+ eType = EObject;
+ upperBound = "-1";
+ changeable = "true";
+ ordered = "true";
+ };
+ eStructuralFeatures += new EAttribute {
+ name = "remote";
+ eType = EBoolean;
+ changeable = "true";
+ ordered = "true";
+ };
+ eStructuralFeatures += new EAttribute {
+ name = "side";
+ eType = Side;
+ changeable = "true";
+ ordered = "true";
+ };
+ };
+ }
+ M@
+
+
+ Section Presentation of the MatchResourceSet class. {
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+ Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
+ @label "MatchResourceSet" "MatchResourceSet definition"
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
+ reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
+ @see "MatchResourceSet" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
+ sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+ @M MatchResourceSetDefinition
+ match {
+ eClassifiers += new EClass MatchResourceSet {
+ eStructuralFeatures += new EReference {
+ name = "matchModels";
+ eType = MatchModel;
+ containment = "true";
+ upperBound = "-1";
+ changeable = "true";
+ ordered = "true";
+ };
+ eStructuralFeatures += new EReference {
+ name = "unmatchedModels";
+ eType = UnmatchModel;
+ containment = "true";
+ upperBound = "-1";
+ changeable = "true";
+ ordered = "true";
+ };
+ };
+ }
+ M@
+
+ }
+ }
+
+ Section Matching elements of the left model with elements of the right model {
+ Matchin elements.
+
+ Section The MatchElement concept {
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+ Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
+ @label "MatchElement" "MatchElement definition"
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
+ reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
+ @see "MatchElement" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
+ sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+ @M MatchElementDefinition
+ match {
+ eClassifiers += new EClass MatchElement {
+ eStructuralFeatures += new EAttribute {
+ name = "similarity";
+ eType = EDouble;
+ lowerBound = "1";
+ changeable = "true";
+ ordered = "false";
+ unique = "false";
+ };
+ eStructuralFeatures += new EReference {
+ name = "subMatchElements";
+ eType = MatchElement;
+ containment = "true";
+ upperBound = "-1";
+ changeable = "true";
+ ordered = "true";
+ };
+ };
+ }
+ M@
+
+
+ Section Matching left and right elements {
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+ Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
+ @label "Match2Elements" "Match2Elements definition"
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
+ reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
+ @see "Match2Elements" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
+ sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+ @M Match2ElementsDefinition
+ match {
+ eClassifiers += new EClass Match2Elements {
+ eStructuralFeatures += new EReference {
+ name = "leftElement";
+ eType = EObject;
+ lowerBound = "1";
+ changeable = "true";
+ ordered = "false";
+ };
+ eStructuralFeatures += new EReference {
+ name = "rightElement";
+ eType = EObject;
+ lowerBound = "1";
+ changeable = "true";
+ ordered = "false";
+ };
+ eSuperTypes += MatchElement;
+ };
+ }
+ M@
+
+ }
+
+ Section Three-way match : left, right and common ancestor {
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+ Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
+ @label "Match3Elements" "Match3Elements definition"
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
+ reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
+ @see "Match3Elements" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
+ sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+ @M Match3ElementsDefinition
+ match {
+ eClassifiers += new EClass Match3Elements {
+ eStructuralFeatures += new EReference {
+ name = "originElement";
+ eType = EObject;
+ lowerBound = "1";
+ changeable = "true";
+ ordered = "false";
+ };
+ eSuperTypes += Match2Elements;
+ };
+ }
+ M@
+
+ }
+ }
+
+ Section The UnmatchElement concept {
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+ Ut enim ad *minim* veniam, quis nostrud exercitation ullamco laboris
+ @label "UnmatchElement" "UnmatchElement definition"
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
+ reprehenderit in voluptate _@velit@_ esse cillum dolore eu fugiat
+ @see "UnmatchElement" nulla pariatur. Excepteur sint occaecat cupidatat non proident,
+ sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+ @M UnmatchElementDefinition
+ match {
+ eClassifiers += new EClass UnmatchElement {
+ eStructuralFeatures += new EReference {
+ name = "element";
+ eType = EObject;
+ lowerBound = "1";
+ changeable = "true";
+ ordered = "false";
+ };
+ eStructuralFeatures += new EAttribute {
+ name = "conflicting";
+ eType = EBoolean;
+ changeable = "true";
+ ordered = "true";
+ };
+ eStructuralFeatures += new EAttribute {
+ name = "remote";
+ eType = EBoolean;
+ changeable = "true";
+ ordered = "true";
+ };
+ eStructuralFeatures += new EAttribute {
+ name = "side";
+ eType = Side;
+ changeable = "true";
+ ordered = "true";
+ };
+ };
+ }
+ M@
+
+ }
+
+ Section Differencing the left model from right model when comparaison fails {
+ During the Match process, deleted or added elements are considered as unmatched.
+
+ Two different situations can occur :
+
+ * an element defined in the left model is not matching any element in the right model (deleted element)
+ * an element defined in the right model is not matching any element in the left model (added element)
+
+
+ The MatchModel store suchs an element using @UnmatchElement@s (
+ @see "TheUnmatchElementConcept" ). To differenciate
+ added element from deleted element, we define the @EEnum@ *Side* :
+
+ @M SidedataTypeDefinition
+ match {
+ eClassifiers += new EEnum Side {
+ serializable = "true";
+ eLiterals += new EEnumLiteral {
+ name = "Left";
+ literal = "Left";
+ value = "0";
+ };
+ eLiterals += new EEnumLiteral {
+ name = "Right";
+ literal = "Right";
+ value = "1";
+ };
+ };
+ }
+ M@
+
+
+ If the feature @side@ of an UnmatchElement is _Right_, then it must be considered as an added element.
+ Otherwise, it is a deleted element.
+ }
+ }
+
+ Section Abstractness and other design considerations {
+ In this chapter, we will study the abstractness of each class of the Metamodel.
+
+ We decide to associate the followin abstracness to MatchModel.
+
+ @M MatchModelAbstracness
+ MatchModel {
+ abstract = "false";
+ }
+ M@
+
+
+ We decide to associate the followin abstracness to UnmatchModel.
+
+ @M UnmatchModelAbstracness
+ UnmatchModel {
+ abstract = "false";
+ }
+ M@
+
+
+ We decide to associate the followin abstracness to MatchResourceSet.
+
+ @M MatchResourceSetAbstracness
+ MatchResourceSet {
+ abstract = "false";
+ }
+ M@
+
+
+ We decide to associate the followin abstracness to MatchElement.
+
+ @M MatchElementAbstracness
+ MatchElement {
+ abstract = "true";
+ }
+ M@
+
+
+ We decide to associate the followin abstracness to Match2Elements.
+
+ @M Match2ElementsAbstracness
+ Match2Elements {
+ abstract = "false";
+ }
+ M@
+
+
+ We decide to associate the followin abstracness to Match3Elements.
+
+ @M Match3ElementsAbstracness
+ Match3Elements {
+ abstract = "false";
+ }
+ M@
+
+
+ We decide to associate the followin abstracness to UnmatchElement.
+
+ @M UnmatchElementAbstracness
+ UnmatchElement {
+ abstract = "false";
+ }
+ M@
+
+ }
+ }
+ Chapter Presentation of the Diff model {
+ The diff model presentation.
+
+ Section Architecture of the diff package {
+ All concepts are defined in the @diff@ package, which is associated to a standard eclipse URI :
+
+ @M diffPackage_definition
+ Resource diffResource {
+ URI = "platform:/resource/org.eclipse.emf.compare.diff/model/diff.ecore";
+ content += diff;
+ }
+ M@
+
+
+ @M
+ new EPackage diff {
+ nsURI = "http://www.eclipse.org/emf/compare/diff/1.1";
+ nsPrefix = "diff";
+ }
+ M@
+
+ }
+ }
+ Chapter Physical Architecture {
+ EMFCompare is divided in 4 main components :
+
+ * EMF Compare core
+ ** @org.eclipse.emf.compare@ (standalone)
+ * EMF Compare match
+ ** @org.eclipse.emf.compare.match@ (standalone)
+ * EMF Compare diff
+ ** @org.eclipse.emf.compare.diff@ (standalone)
+ * EMF Compare UI
+ ** @org.eclipse.emf.compare.ui@ (depends on the Eclipes environment)
+
+
+
+
+ Section EMF Compare core {
+ This plugin defines utility classes and Exceptions.
+ }
+
+ Section EMF Compare match {
+ This plugin defines all the logic allowing to Match two different models.
+
+ For additional details about the Match metamodel, please refer to the chapter entitled
+ @see "PresentationOfTheMatchMetamodel" .
+ }
+
+ Section EMF Compare diff {
+ This plugin defines all the logic allowing to compute differences between two matched models.
+
+ It also merges the model using the computed differences.
+
+ For additional details about the Match metamodel, please refer to the chapter entitled
+ @see "PresentationOfTheMatchMetamodel" .
+ }
+
+ Section EMF Compare UI {
+ This plugin defines all UI related features of EMF Compare.
+ }
+ }
+ Chapter Test architecture of EMF Compare {
+ The test architecture of EMF Compare
+
+ Section Test projects {
+ The org.eclipse.emf.compare.tests plugin contains all tests relative to EMFCompare features.
+
+ @M
+ Resource compareTestProjectResource {
+ URI = "retro:/org.eclipse.emf.compare.tests/*patch*";
+ content += emfCompareTestProject;
+ }
+ new Project emfCompareTestProject {
+ id = "org.eclipse.emf.compare.tests";
+ }
+ M@
+
+ }
+
+ Section Acceptance tests {
+ In this section, we will present all the acceptance tests that have been written in EMF Compare.
+ }
+
+ Section Unit tests {
+ unit test
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/dragdrop/dragdrop.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/dragdrop/dragdrop.intent
index 34d7386..8ed74e3 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/dragdrop/dragdrop.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/dragdrop/dragdrop.intent
@@ -1,22 +1,22 @@
-Document {
- Chapter QuickFixes {
- Tests the creation of modeling units by application of quick fixes.
-
- Section Modeling Unit {
- This section contains the main modeling unit.
-
- @M
- Resource testResource {
- URI = "platform:/resource/dragdrop/test.ecore";
- content += testPackage;
- }
- new EPackage testPackage {
- name = "testPackage";
- nsURI = "testPackageURI";
- nsPrefix = "testPackagePrefix";
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter QuickFixes {
+ Tests the creation of modeling units by application of quick fixes.
+
+ Section Modeling Unit {
+ This section contains the main modeling unit.
+
+ @M
+ Resource testResource {
+ URI = "platform:/resource/dragdrop/test.ecore";
+ content += testPackage;
+ }
+ new EPackage testPackage {
+ name = "testPackage";
+ nsURI = "testPackageURI";
+ nsPrefix = "testPackagePrefix";
+ }
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/dragdrop/final.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/dragdrop/final.intent
index 0f9c5c4..9ac3810 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/dragdrop/final.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/dragdrop/final.intent
@@ -1,71 +1,71 @@
-Document {
- Chapter QuickFixes {
- Tests the creation of modeling units by application of quick fixes.
-
- Section Modeling Unit {
- This section contains the main modeling unit.
-
- @M
- Resource testResource {
- URI = "platform:/resource/dragdrop/test.ecore";
- content += testPackage;
- }
- new EPackage testPackage {
- name = "testPackage";
- nsURI = "testPackageURI";
- nsPrefix = "testPackagePrefix";
- }
- testPackage {
- eClassifiers += new EClass REF0 {
- name = "A";
- eStructuralFeatures += new EAttribute REF1 {
- name = "a1";
- lowerBound = "1";
- upperBound = "-1";
- eType = EInt;
- };
- eStructuralFeatures += new EAttribute REF2 {
- name = "a2";
- lowerBound = "1";
- upperBound = "4";
- eType = EString;
- };
- eStructuralFeatures += new EAttribute REF3 {
- name = "a3";
- upperBound = "-1";
- eType = EBoolean;
- };
- };
- }
- testPackage {
- eSubpackages += new EPackage REF4 {
- name = "sub";
- nsURI = "sub";
- nsPrefix = "sub";
- eClassifiers += new EClass REF5 {
- name = "B";
- eSuperTypes += REF0;
- eSuperTypes += REF6;
- };
- eClassifiers += new EClass REF7 {
- name = "C";
- eStructuralFeatures += new EReference REF8 {
- name = "ref";
- eType = REF5;
- };
- };
- eClassifiers += new EClass REF6 {
- name = "D";
- abstract = "true";
- eStructuralFeatures += new EAttribute REF9 {
- name = "name";
- eType = EString;
- };
- };
- };
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter QuickFixes {
+ Tests the creation of modeling units by application of quick fixes.
+
+ Section Modeling Unit {
+ This section contains the main modeling unit.
+
+ @M
+ Resource testResource {
+ URI = "platform:/resource/dragdrop/test.ecore";
+ content += testPackage;
+ }
+ new EPackage testPackage {
+ name = "testPackage";
+ nsURI = "testPackageURI";
+ nsPrefix = "testPackagePrefix";
+ }
+ testPackage {
+ eClassifiers += new EClass REF0 {
+ name = "A";
+ eStructuralFeatures += new EAttribute REF1 {
+ name = "a1";
+ lowerBound = "1";
+ upperBound = "-1";
+ eType = EInt;
+ };
+ eStructuralFeatures += new EAttribute REF2 {
+ name = "a2";
+ lowerBound = "1";
+ upperBound = "4";
+ eType = EString;
+ };
+ eStructuralFeatures += new EAttribute REF3 {
+ name = "a3";
+ upperBound = "-1";
+ eType = EBoolean;
+ };
+ };
+ }
+ testPackage {
+ eSubpackages += new EPackage REF4 {
+ name = "sub";
+ nsURI = "sub";
+ nsPrefix = "sub";
+ eClassifiers += new EClass REF5 {
+ name = "B";
+ eSuperTypes += REF0;
+ eSuperTypes += REF6;
+ };
+ eClassifiers += new EClass REF7 {
+ name = "C";
+ eStructuralFeatures += new EReference REF8 {
+ name = "ref";
+ eType = REF5;
+ };
+ };
+ eClassifiers += new EClass REF6 {
+ name = "D";
+ abstract = "true";
+ eStructuralFeatures += new EAttribute REF9 {
+ name = "name";
+ eType = EString;
+ };
+ };
+ };
+ }
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/changeEditorUpdateTest.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/changeEditorUpdateTest.intent
index 9041cf8..20c2683 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/changeEditorUpdateTest.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/changeEditorUpdateTest.intent
@@ -1,69 +1,69 @@
-Document {
- Chapter {
-
- The first chapter is the best.
- Section Differencing the left model from right model when comparaison fails {
- During the Match process, deleted or added elements are considered as unmatched.
-
- Two different situations can occur :
-
- * an element defined in the left model is not matching any element in the right model (deleted element)
- * an element defined in the right model is not matching any element in the left model (added element)
-
-
- @M SidedataTypeDefinition
- match {
- eClassifiers += new EEnum Side {
- eLiterals += new EEnumLiteral {
- name = "Left";
- literal = "Left";
- value = "0";
- };
- eLiterals += new EEnumLiteral {
- name = "Right";
- literal = "Right";
- value = "1";
- };
- };
- }
- M@
-
-
- If the feature @side@ of an UnmatchElement is _Right_, then it must be considered as an added element.
- Otherwise, it is a deleted element.
-
- The MatchModel store suchs an element using @UnmatchElement@s (
- @see "TheUnmatchElementConcept" ). To differenciate
- added element from deleted element, we define the @EEnum@ *Side* :
- }
- }
- Chapter {
-
- Section Section 2.1 {
- The 2.1 Section.
- }
-
- Section Section 2.2 {
- The 2.2 Section.
- }
- }
- Chapter {
-
- Section {
- Section Section 3.1.1 {
- Such a good section.
- }
-
- @M myModelingUnit
- Side {
- serializable = "true";
- }
- M@
-
- Section Section 3.2.1 {
- The last Section.
- }
-
- }
- }
-}
+Document {
+ Chapter {
+
+ The first chapter is the best.
+ Section Differencing the left model from right model when comparaison fails {
+ During the Match process, deleted or added elements are considered as unmatched.
+
+ Two different situations can occur :
+
+ * an element defined in the left model is not matching any element in the right model (deleted element)
+ * an element defined in the right model is not matching any element in the left model (added element)
+
+
+ @M SidedataTypeDefinition
+ match {
+ eClassifiers += new EEnum Side {
+ eLiterals += new EEnumLiteral {
+ name = "Left";
+ literal = "Left";
+ value = "0";
+ };
+ eLiterals += new EEnumLiteral {
+ name = "Right";
+ literal = "Right";
+ value = "1";
+ };
+ };
+ }
+ M@
+
+
+ If the feature @side@ of an UnmatchElement is _Right_, then it must be considered as an added element.
+ Otherwise, it is a deleted element.
+
+ The MatchModel store suchs an element using @UnmatchElement@s (
+ @see "TheUnmatchElementConcept" ). To differenciate
+ added element from deleted element, we define the @EEnum@ *Side* :
+ }
+ }
+ Chapter {
+
+ Section Section 2.1 {
+ The 2.1 Section.
+ }
+
+ Section Section 2.2 {
+ The 2.2 Section.
+ }
+ }
+ Chapter {
+
+ Section {
+ Section Section 3.1.1 {
+ Such a good section.
+ }
+
+ @M myModelingUnit
+ Side {
+ serializable = "true";
+ }
+ M@
+
+ Section Section 3.2.1 {
+ The last Section.
+ }
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.intent
index 4c9fb40..ed845fa 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.intent
@@ -1,6 +1,6 @@
-Document {
- Chapter c {
- Section s {
- }
- }
-}
+Document {
+ Chapter c {
+ Section s {
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.update1.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.update1.intent
index 834726f..7f82e7e 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.update1.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.update1.intent
@@ -1,7 +1,7 @@
-Document {
- Chapter c {
- Section s {
- Text
- }
- }
-}
+Document {
+ Chapter c {
+ Section s {
+ Text
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.update2.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.update2.intent
index bed3034..72446db 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.update2.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newMU.update2.intent
@@ -1,13 +1,13 @@
-Document {
- Chapter c {
- Section s {
- @M
- mu {
- }
- M@
-
-
- Text
- }
- }
-}
+Document {
+ Chapter c {
+ Section s {
+ @M
+ mu {
+ }
+ M@
+
+
+ Text
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.intent
index 834726f..7f82e7e 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.intent
@@ -1,7 +1,7 @@
-Document {
- Chapter c {
- Section s {
- Text
- }
- }
-}
+Document {
+ Chapter c {
+ Section s {
+ Text
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.update1.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.update1.intent
index 3bb434b..d58de02 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.update1.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.update1.intent
@@ -1,9 +1,9 @@
-Document {
- Chapter c {
- Text
-
- Section s {
- Text
- }
- }
-}
+Document {
+ Chapter c {
+ Text
+
+ Section s {
+ Text
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.update2.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.update2.intent
index 90ce995..9590a14 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.update2.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/order/newSection.update2.intent
@@ -1,13 +1,13 @@
-Document {
- Chapter c {
- Section new {
- Text
- }
-
- Text
-
- Section s {
- Text
- }
- }
-}
+Document {
+ Chapter c {
+ Section new {
+ Text
+ }
+
+ Text
+
+ Section s {
+ Text
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/refreshTest.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/refreshTest.intent
index 5c5f5d9..5b4c64a 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/refreshTest.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/editorupdates/refreshTest.intent
@@ -1,13 +1,13 @@
-Document {
- Chapter Title {
- Section Title {
- Text
-
- @M
- test {
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter Title {
+ Section Title {
+ Text
+
+ @M
+ test {
+ }
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/empty.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/empty.intent
index 91e28d6..67b601f 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/empty.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/empty.intent
@@ -1,2 +1,2 @@
-Document {
-}
+Document {
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/quickfixes/final.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/quickfixes/final.intent
index e72e4e8..d586e9e 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/quickfixes/final.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/quickfixes/final.intent
@@ -1,67 +1,67 @@
-Document {
- Chapter QuickFixes {
- Tests the creation of modeling units by application of quick fixes.
-
- Section Modeling Unit {
- This section contains the main modeling unit.
-
- @M
- Resource testResource {
- URI = "platform:/resource/quickfixes/test.ecore";
- content += testPackage;
- }
- new EPackage testPackage {
- name = "testPackage";
- nsURI = "testPackageURI";
- nsPrefix = "testPackagePrefix";
- eClassifiers += new EClass REF0 {
- name = "A";
- eStructuralFeatures += new EAttribute REF1 {
- name = "a1";
- lowerBound = "1";
- upperBound = "-1";
- eType = EInt;
- };
- eStructuralFeatures += new EAttribute REF2 {
- name = "a2";
- lowerBound = "1";
- upperBound = "4";
- eType = EString;
- };
- eStructuralFeatures += new EAttribute REF3 {
- name = "a3";
- upperBound = "-1";
- eType = EBoolean;
- };
- };
- eSubpackages += new EPackage REF4 {
- name = "sub";
- nsURI = "sub";
- nsPrefix = "sub";
- eClassifiers += new EClass REF5 {
- name = "B";
- eSuperTypes += REF0;
- eSuperTypes += REF6;
- };
- eClassifiers += new EClass REF7 {
- name = "C";
- eStructuralFeatures += new EReference REF8 {
- name = "ref";
- eType = REF5;
- };
- };
- eClassifiers += new EClass REF6 {
- name = "D";
- abstract = "true";
- eStructuralFeatures += new EAttribute REF9 {
- name = "name";
- eType = EString;
- };
- };
- };
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter QuickFixes {
+ Tests the creation of modeling units by application of quick fixes.
+
+ Section Modeling Unit {
+ This section contains the main modeling unit.
+
+ @M
+ Resource testResource {
+ URI = "platform:/resource/quickfixes/test.ecore";
+ content += testPackage;
+ }
+ new EPackage testPackage {
+ name = "testPackage";
+ nsURI = "testPackageURI";
+ nsPrefix = "testPackagePrefix";
+ eClassifiers += new EClass REF0 {
+ name = "A";
+ eStructuralFeatures += new EAttribute REF1 {
+ name = "a1";
+ lowerBound = "1";
+ upperBound = "-1";
+ eType = EInt;
+ };
+ eStructuralFeatures += new EAttribute REF2 {
+ name = "a2";
+ lowerBound = "1";
+ upperBound = "4";
+ eType = EString;
+ };
+ eStructuralFeatures += new EAttribute REF3 {
+ name = "a3";
+ upperBound = "-1";
+ eType = EBoolean;
+ };
+ };
+ eSubpackages += new EPackage REF4 {
+ name = "sub";
+ nsURI = "sub";
+ nsPrefix = "sub";
+ eClassifiers += new EClass REF5 {
+ name = "B";
+ eSuperTypes += REF0;
+ eSuperTypes += REF6;
+ };
+ eClassifiers += new EClass REF7 {
+ name = "C";
+ eStructuralFeatures += new EReference REF8 {
+ name = "ref";
+ eType = REF5;
+ };
+ };
+ eClassifiers += new EClass REF6 {
+ name = "D";
+ abstract = "true";
+ eStructuralFeatures += new EAttribute REF9 {
+ name = "name";
+ eType = EString;
+ };
+ };
+ };
+ }
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/quickfixes/quickfixes.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/quickfixes/quickfixes.intent
index 7dc88b1..4747ce9 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/quickfixes/quickfixes.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/quickfixes/quickfixes.intent
@@ -1,31 +1,31 @@
-Document {
- Chapter QuickFixes {
- Tests the creation of modeling units by application of quick fixes.
-
- Section Modeling Unit {
- This section contains the main modeling unit.
-
- @M
- Resource testResource {
- URI = "platform:/resource/quickfixes/test.ecore";
- content += testPackage;
- content += toDelete;
- }
- new EPackage testPackage {
- name = "testPackage";
- nsURI = "testPackageURI";
- nsPrefix = "testPackagePrefix";
- eClassifiers += new EClass {
- name = "E";
- };
- }
- new EPackage toDelete {
- name = "toDelete";
- nsURI = "toDelete";
- nsPrefix = "toDelete";
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter QuickFixes {
+ Tests the creation of modeling units by application of quick fixes.
+
+ Section Modeling Unit {
+ This section contains the main modeling unit.
+
+ @M
+ Resource testResource {
+ URI = "platform:/resource/quickfixes/test.ecore";
+ content += testPackage;
+ content += toDelete;
+ }
+ new EPackage testPackage {
+ name = "testPackage";
+ nsURI = "testPackageURI";
+ nsPrefix = "testPackagePrefix";
+ eClassifiers += new EClass {
+ name = "E";
+ };
+ }
+ new EPackage toDelete {
+ name = "toDelete";
+ nsURI = "toDelete";
+ nsPrefix = "toDelete";
+ }
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/scenario/abstract_resources.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/scenario/abstract_resources.intent
index 2989c23..858fe13 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/scenario/abstract_resources.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/scenario/abstract_resources.intent
@@ -1,24 +1,24 @@
-Document {
- Chapter {
- Section Abstract Resources Test {
- These resources are used to define models having no relations with any concrete artifact.
-
- @M
- Resource abstractResource {
- content += myAbstractRoot;
- }
- M@
-
-
- Hence this resource will not be synchronized :
-
- @M
- new EPackage myAbstractRoot {
- eClassifiers += new EClass myEClass {};
- }
- M@
-
- }
- }
-}
-
+Document {
+ Chapter {
+ Section Abstract Resources Test {
+ These resources are used to define models having no relations with any concrete artifact.
+
+ @M
+ Resource abstractResource {
+ content += myAbstractRoot;
+ }
+ M@
+
+
+ Hence this resource will not be synchronized :
+
+ @M
+ new EPackage myAbstractRoot {
+ eClassifiers += new EClass myEClass {};
+ }
+ M@
+
+ }
+ }
+}
+
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/scenario/externalcontentreferences/external_content.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/scenario/externalcontentreferences/external_content.intent
index ac4714d..cafb0ca 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/scenario/externalcontentreferences/external_content.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/scenario/externalcontentreferences/external_content.intent
@@ -1,12 +1,12 @@
-Document {
- Chapter Title {
- Section Placeholder for external content tests {
- //1
-
- //2
-
- //3
- }
-
- }
+Document {
+ Chapter Title {
+ Section Placeholder for external content tests {
+ //1
+
+ //2
+
+ //3
+ }
+
+ }
}
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/synchronizer/synchronizer.intent b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/synchronizer/synchronizer.intent
index 7140b2c..1aa538b 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/synchronizer/synchronizer.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/data/unit/documents/synchronizer/synchronizer.intent
@@ -1,80 +1,80 @@
-Document {
- Chapter Synchronizer {
- Tests the synchronization status.
-
- Section MAIN {
- @M
- Resource testResource {
- URI = "platform:/resource/synchronizer/test.ecore";
- content += testPackage;
- }
- new EPackage testPackage {
- name = "testPackage";
- nsURI = "testPackageURI";
- nsPrefix = "testPackagePrefix";
- eClassifiers += new EClass A {};
- eClassifiers += new EClass B {};
- eClassifiers += new EClass C {};
- }
- M@
-
- }
-
- Section Containement {
- @M
- testPackage {
- eSubpackages += new EPackage OnlyInCurrentDocument {
- name = "OnlyInCurrentDocument";
- nsURI = "OnlyInCurrentDocument";
- nsPrefix = "OnlyInCurrentDocument";
- };
- }
- M@
-
- }
-
- Section References {
- Section Added {
- @M
- testPackage {
- eClassifiers += new EClass AddedReference {
- eSuperTypes += A;
- };
- }
- M@
-
- }
-
- Section Deleted {
- @M
- testPackage {
- eClassifiers += new EClass DeletedReference {};
- }
- M@
-
- }
-
- Section Changed {
- @M
- testPackage {
- eClassifiers += new EClass ChangedReference {
- eSuperTypes += B;
- };
- }
- M@
-
- }
- }
-
- Section Attributes {
- @M
- testPackage {
- eClassifiers += new EClass Attributes {
- abstract = "true";
- };
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter Synchronizer {
+ Tests the synchronization status.
+
+ Section MAIN {
+ @M
+ Resource testResource {
+ URI = "platform:/resource/synchronizer/test.ecore";
+ content += testPackage;
+ }
+ new EPackage testPackage {
+ name = "testPackage";
+ nsURI = "testPackageURI";
+ nsPrefix = "testPackagePrefix";
+ eClassifiers += new EClass A {};
+ eClassifiers += new EClass B {};
+ eClassifiers += new EClass C {};
+ }
+ M@
+
+ }
+
+ Section Containement {
+ @M
+ testPackage {
+ eSubpackages += new EPackage OnlyInCurrentDocument {
+ name = "OnlyInCurrentDocument";
+ nsURI = "OnlyInCurrentDocument";
+ nsPrefix = "OnlyInCurrentDocument";
+ };
+ }
+ M@
+
+ }
+
+ Section References {
+ Section Added {
+ @M
+ testPackage {
+ eClassifiers += new EClass AddedReference {
+ eSuperTypes += A;
+ };
+ }
+ M@
+
+ }
+
+ Section Deleted {
+ @M
+ testPackage {
+ eClassifiers += new EClass DeletedReference {};
+ }
+ M@
+
+ }
+
+ Section Changed {
+ @M
+ testPackage {
+ eClassifiers += new EClass ChangedReference {
+ eSuperTypes += B;
+ };
+ }
+ M@
+
+ }
+ }
+
+ Section Attributes {
+ @M
+ testPackage {
+ eClassifiers += new EClass Attributes {
+ abstract = "true";
+ };
+ }
+ M@
+
+ }
+ }
+}
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
index 6bef211..1275d75 100644
--- 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
@@ -26,6 +26,9 @@
*/
public class CDOIntegrationTest extends AbstractIntentCDOTest {
+ /**
+ * Path of the intent file to use for this test.
+ */
private static final String INTENT_ABSTRACT_RESOURCE_DOCUMENT_PATH = "data/unit/documents/scenario/abstract_resources.intent";
/**
@@ -36,6 +39,7 @@
* </ul>
*
* @throws Exception
+ * if major issue occurs during test
*/
public void testBasicRelationshipBetweenLocalAndRemoteUser() throws Exception {
// Local user creates and get the intent project
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
index bd4a29e..7db4e95 100644
--- 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
@@ -23,8 +23,11 @@
*
* @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
*/
-public class AbstractIntentCDOTest extends AbstractIntentUITest {
+public abstract class AbstractIntentCDOTest extends AbstractIntentUITest {
+ /**
+ * Name of the intent repository.
+ */
private static final String INTENT_REPOSITORY_NAME = "intent-server";
/**
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/ChangeEditorUpdateTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/ChangeEditorUpdateTest.java
index 5adf285..ebbd2eb 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/ChangeEditorUpdateTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/ChangeEditorUpdateTest.java
@@ -1,306 +1,320 @@
-/*******************************************************************************
- * 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.compare;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditor;
-import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditorDocument;
-import org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest;
-import org.eclipse.mylyn.docs.intent.core.document.IntentSection;
-
-/**
- * Tests the correct behavior of Intent editor changes. Ensures that EMF Compare is able to maintain order and
- * structure of the Intent document.
- *
- * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
- * @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
- */
-public class ChangeEditorUpdateTest extends AbstractIntentUITest {
-
- private static final int FOCUS_ON_DOCUMENT = 3;
-
- private static final String SAMPLE_MODELING_CONTENT = "\n\t\n\t@M\n\t\tSide {\n\t\t\tserializable = \"true\";\n\t\t}\n\tM@\n\t\n\n\t";
-
- private static final String MIDDLE_OF_DESCRIPTION_UNIT = "@see \"TheUnmatchElementConcept\" ). T";
-
- private static final String A_NEW_DESCRIPTION_UNIT = "A new description Unit";
-
- private static final String LINEBREAK_AND_INDENT = "\n\t";
-
- private static final String FAILURE_MESSAGE = "Editor update dit not occur as";
-
- private static final String PREFIX_SECTION_1_1 = "* an element defined in the right model is not matching any element in the left model (added element)\n\t\n\n\t";
-
- private static final String PREFIX_SECTION_1_2 = "Otherwise, it is a deleted element.";
-
- private static final String NEW_SECTION_1 = "\n\n\tSection {\n\t\tSubSection1\n\n\t\tMySubSection\n\t}";
-
- private static final String NEW_SECTION_2 = "\n\n\tSection {\n\t\tSubSection2\n\n\t\tMySubSection\n\t}";
-
- private static final String PREFIX_CHAPTER_1 = "Document {\n\tChapter {";
-
- private static final String INTENT_DOCUMENT_EXAMPLE_PATH = "data/unit/documents/editorupdates/changeEditorUpdateTest.intent";
-
- private static final String PREFIX_CHAPTER_2_FOCUS_DOCUMENT = "\t}\n\tChapter {";
-
- private IntentSection section;
-
- private IntentEditor editor;
-
- private IntentEditorDocument document;
-
- /**
- * {@inheritDoc}
- *
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- setUpIntentProject("intentProject", INTENT_DOCUMENT_EXAMPLE_PATH);
- section = getIntentDocument().getSubSections().iterator().next().getSubSections().iterator().next();
-
- }
-
- /**
- * Ensures that, when adding a new paragraph to a chapter containing no description unit, when emf compare
- * is used to update the repository the chapter keeps its expected location and structure.
- */
- public void testAddParagraphToMiddleOfChapterWithoutDescriptionUnitsWithFocusOnChapter() {
- // opening an editor on the second chapter
- editor = openIntentEditor(getIntentSection(2));
-
- genericUpdateTest("The 2.1 Section.\n\t}", "\n\n\t" + A_NEW_DESCRIPTION_UNIT);
- }
-
- /**
- * Ensures that, when adding a new paragraph to a chapter containing no description unit, when emf compare
- * is used to update the repository the chapter keeps its expected location and structure.
- */
- public void testAddParagraphToBeginningOfChapterWithoutDescriptionUnitsWithFocusOnChapter() {
- // opening an editor on the second chapter
- editor = openIntentEditor(getIntentSection(2));
-
- genericUpdateTest("Chapter {", "\n\t" + A_NEW_DESCRIPTION_UNIT + "\n");
- }
-
- /**
- * Ensures that, when adding a new paragraph to a chapter containing no description unit, when emf compare
- * is used to update the repository the chapter keeps its expected location and structure.
- */
- public void testAddParagraphToBottomOfChapterWithoutDescriptionUnitsWithFocusOnChapter() {
- // opening an editor on the second chapter
- editor = openIntentEditor(getIntentSection(2));
-
- genericUpdateTest("The 2.2 Section.\n\t}", "\n\n\t" + A_NEW_DESCRIPTION_UNIT);
- }
-
- /**
- * Ensures that, when adding a new title to a chapter, when emf compare is used to update the repository
- * the chapter keeps its expected location.
- */
- public void testAddTitleToExistingChapterWithFocusOnDocument() {
- // Step 1 : opening an editor on the document
- editor = openIntentEditor();
-
- // getting the document associated to the opened editor
- document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
-
- // Step 2 : update section by adding 2 subsections textually
- String documentContent = document.get();
- String expectedDocumentContent = documentContent.replace(PREFIX_CHAPTER_1, PREFIX_CHAPTER_1
- + "\n\t\tMy Chapter Title");
-
- // Step 3 : check merge
- checkMerging(expectedDocumentContent);
- }
-
- /**
- * Ensures that, when adding a new paragraph to a chapter containing no description unit, when emf compare
- * is used to update the repository the chapter keeps its expected location and structure.
- */
- public void testAddParagraphToChapterWithoutDescriptionUnitsWithFocusOnDocument() {
- // opening an editor on the document
- editor = openIntentEditor();
-
- genericUpdateTest(PREFIX_CHAPTER_2_FOCUS_DOCUMENT, "\n\t\t" + A_NEW_DESCRIPTION_UNIT + "\n");
- }
-
- /**
- * Ensures that, when adding a new modeling unit in the middle of an existing description unit, when emf
- * compare is used to update the repository the chapter keeps its expected location and structure.
- */
- public void testAddModelingUnitBySplittingADescriptionUnitWithFocusOnDocument() {
- // opening an editor on the document
- editor = openIntentEditor();
-
- genericUpdateTest(MIDDLE_OF_DESCRIPTION_UNIT, SAMPLE_MODELING_CONTENT, FOCUS_ON_DOCUMENT);
- }
-
- /**
- * Ensures that, when adding a new modeling unit in the middle of an existing description unit, when emf
- * compare is used to update the repository the chapter keeps its expected location and structure.
- */
- public void testAddModelingUnitBySplittingADescriptionUnitWithFocusOnChapter() {
- // opening an editor on the chapter
- editor = openIntentEditor(getIntentSection(1));
-
- genericUpdateTest(MIDDLE_OF_DESCRIPTION_UNIT, SAMPLE_MODELING_CONTENT, 2);
- }
-
- /**
- * Ensures that, when adding a new modeling unit in the middle of an existing description unit, when emf
- * compare is used to update the repository the chapter keeps its expected location and structure.
- */
- public void testAddModelingUnitBySplittingADescriptionUnitWithFocusOnSection() {
- // opening an editor on the section
- editor = openIntentEditor(getIntentSection(1, 1));
-
- genericUpdateTest(MIDDLE_OF_DESCRIPTION_UNIT, SAMPLE_MODELING_CONTENT, 1);
- }
-
- /**
- * Ensures that when typing new sections inside the Intent Document, when emf compare is used to update
- * the repository the structure is respected.
- */
- public void testSubSectionOrderWithFocusOnDocument() {
- // opening an editor on a section
- editor = openIntentEditor();
-
- genericTestSubSectionOrderWithFocusOnDocuments(3);
- }
-
- /**
- * Ensures that when typing new sections inside the Intent Document, when emf compare is used to update
- * the repository the structure is respected.
- */
- public void testSubSectionOrderWithFocusOnSection() {
- // opening an editor on a section
- editor = openIntentEditor(section);
-
- genericTestSubSectionOrderWithFocusOnDocuments(1);
- }
-
- /**
- * <ul>
- * <li>Replaces the given prefix by prefix + contentToAdd in the current Document</li>
- * <li>Saves the editor</li>
- * <li>after merging with the repository content and serializing, check that the editor now displays the
- * expected document content.
- * <li>
- * </ul>
- *
- * @param contentToAdd
- * the string corresponding to the new content to add
- * @param prefix
- * the prefix to use for identifying the chapter to modify
- */
- private void genericUpdateTest(String prefix, String contentToAdd) {
- genericUpdateTest(prefix, contentToAdd, -1);
- }
-
- /**
- * <ul>
- * <li>Replaces the given prefix by prefix + contentToAdd in the current Document</li>
- * <li>Saves the editor</li>
- * <li>after merging with the repository content and serializing, check that the editor now displays the
- * expected document content.
- * <li>
- * </ul>
- *
- * @param contentToAdd
- * the string corresponding to the new content to add
- * @param prefix
- * the prefix to use for identifying the chapter to modify
- * @param focusLevel
- * the focus level
- */
- private void genericUpdateTest(String prefix, String contentToAdd, int focusLevel) {
- // Step 1 : getting the document associated to the opened editor
- document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
-
- // Step 2 : update the document
- // Step 2.1 : including focus level
- String initialContent = document.get();
- String indent = LINEBREAK_AND_INDENT;
- for (int i = 1; i < focusLevel; i++) {
- indent += "\t";
- }
- String updatedPrefix = prefix.replace(LINEBREAK_AND_INDENT, indent);
- String updatedContentToAdd = contentToAdd.replace(LINEBREAK_AND_INDENT, indent);
-
- // Step 2.2 : change the document
- String expectedDocumentContent = initialContent.replace(updatedPrefix, updatedPrefix
- + updatedContentToAdd);
-
- // Step 3 : check merge
- checkMerging(expectedDocumentContent);
-
- }
-
- /**
- * Ensures that when typing new sections inside the Intent Document, when emf compare is used to update
- * the repository the structure is respected.
- */
- private void genericTestSubSectionOrderWithFocusOnDocuments(int focusLevel) {
- // Step 1 : get the content of the editor
- document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
-
- // Step 2 : update section by adding 2 subsections textually
- String initialContent = document.get();
-
- String indent = LINEBREAK_AND_INDENT;
- for (int i = 1; i < focusLevel; i++) {
- indent += "\t";
- }
- String prefixSection1WithFocusLevel = PREFIX_SECTION_1_1.replace(LINEBREAK_AND_INDENT, indent);
- String prefixSection2WithFocusLevel = PREFIX_SECTION_1_2.replace(LINEBREAK_AND_INDENT, indent);
- String replacementWithFocusLevel1 = NEW_SECTION_1.replace(LINEBREAK_AND_INDENT, indent);
- String replacementWithFocusLevel2 = NEW_SECTION_2.replace(LINEBREAK_AND_INDENT, indent);
- String expectedDocumentContent = initialContent.replace(prefixSection1WithFocusLevel,
- prefixSection1WithFocusLevel + replacementWithFocusLevel1);
- assertFalse(
- "No change made on the document. You should check that the test has been correctly written",
- initialContent.equals(expectedDocumentContent));
- expectedDocumentContent = expectedDocumentContent.replace(prefixSection2WithFocusLevel,
- prefixSection2WithFocusLevel + replacementWithFocusLevel2);
-
- // Step 3 : check merge
- checkMerging(expectedDocumentContent);
- }
-
- /**
- * Ensures that when setting the given document content and then save the editor, after merging with the
- * repository content and serializing, the editor now displays the expected document content.
- *
- * @param expectedDocumentContent
- * the excepted document content
- */
- private void checkMerging(String expectedDocumentContent) {
- // Step 1 : we ensure that the initial content is different from expected content
- String initialContent = document.get();
- assertFalse(
- "No change made on the document. You should check that the test has been correctly written",
- initialContent.equals(expectedDocumentContent));
-
- // Step 2 : setting the new content
- document.set(expectedDocumentContent);
-
- // Step 3 : save editor
- editor.doSave(new NullProgressMonitor());
- waitForAllOperationsInUIThread();
-
- // Step 4 : checking that when reserializing the parsed document we obtain the expected text
- String newDocumentContent = document.get();
- assertEquals(FAILURE_MESSAGE, expectedDocumentContent, newDocumentContent);
- }
-
-}
+/*******************************************************************************
+ * 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.compare;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditor;
+import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditorDocument;
+import org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest;
+import org.eclipse.mylyn.docs.intent.core.document.IntentSection;
+
+/**
+ * Tests the correct behavior of Intent editor changes. Ensures that EMF Compare is able to maintain order and
+ * structure of the Intent document.
+ *
+ * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
+ * @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
+ */
+public class ChangeEditorUpdateTest extends AbstractIntentUITest {
+
+ // Disabling checkstyle because documenting those constants will not bring any information
+ // CHECKSTYLE:OFF
+ private static final int FOCUS_ON_DOCUMENT = 3;
+
+ private static final String SAMPLE_MODELING_CONTENT = "\n\t\n\t@M\n\t\tSide {\n\t\t\tserializable = \"true\";\n\t\t}\n\tM@\n\t\n\n\t";
+
+ private static final String MIDDLE_OF_DESCRIPTION_UNIT = "@see \"TheUnmatchElementConcept\" ). T";
+
+ private static final String A_NEW_DESCRIPTION_UNIT = "A new description Unit";
+
+ private static final String LINEBREAK_AND_INDENT = "\n\t";
+
+ private static final String FAILURE_MESSAGE = "Editor update dit not occur as";
+
+ private static final String PREFIX_SECTION_1_1 = "* an element defined in the right model is not matching any element in the left model (added element)\n\t\n\n\t";
+
+ private static final String PREFIX_SECTION_1_2 = "Otherwise, it is a deleted element.";
+
+ private static final String NEW_SECTION_1 = "\n\n\tSection {\n\t\tSubSection1\n\n\t\tMySubSection\n\t}";
+
+ private static final String NEW_SECTION_2 = "\n\n\tSection {\n\t\tSubSection2\n\n\t\tMySubSection\n\t}";
+
+ private static final String PREFIX_CHAPTER_1 = "Document {\n\tChapter {";
+
+ private static final String PREFIX_CHAPTER_2_FOCUS_DOCUMENT = "\t}\n\tChapter {";
+
+ // CHECKSTYLE:ON
+
+ /**
+ * Path to test file.
+ */
+ private static final String INTENT_DOCUMENT_EXAMPLE_PATH = "data/unit/documents/editorupdates/changeEditorUpdateTest.intent";
+
+ /**
+ * The current editor.
+ */
+ private IntentEditor editor;
+
+ /**
+ * The document associated to the current editor.
+ */
+ private IntentEditorDocument document;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ setUpIntentProject("intentProject", INTENT_DOCUMENT_EXAMPLE_PATH);
+ }
+
+ /**
+ * Ensures that, when adding a new paragraph to a chapter containing no description unit, when emf compare
+ * is used to update the repository the chapter keeps its expected location and structure.
+ */
+ public void testAddParagraphToMiddleOfChapterWithoutDescriptionUnitsWithFocusOnChapter() {
+ // opening an editor on the second chapter
+ editor = openIntentEditor(getIntentSection(2));
+
+ genericUpdateTest("The 2.1 Section.\n\t}", "\n\n\t" + A_NEW_DESCRIPTION_UNIT);
+ }
+
+ /**
+ * Ensures that, when adding a new paragraph to a chapter containing no description unit, when emf compare
+ * is used to update the repository the chapter keeps its expected location and structure.
+ */
+ public void testAddParagraphToBeginningOfChapterWithoutDescriptionUnitsWithFocusOnChapter() {
+ // opening an editor on the second chapter
+ editor = openIntentEditor(getIntentSection(2));
+
+ genericUpdateTest("Chapter {", "\n\t" + A_NEW_DESCRIPTION_UNIT + "\n");
+ }
+
+ /**
+ * Ensures that, when adding a new paragraph to a chapter containing no description unit, when emf compare
+ * is used to update the repository the chapter keeps its expected location and structure.
+ */
+ public void testAddParagraphToBottomOfChapterWithoutDescriptionUnitsWithFocusOnChapter() {
+ // opening an editor on the second chapter
+ editor = openIntentEditor(getIntentSection(2));
+
+ genericUpdateTest("The 2.2 Section.\n\t}", "\n\n\t" + A_NEW_DESCRIPTION_UNIT);
+ }
+
+ /**
+ * Ensures that, when adding a new title to a chapter, when emf compare is used to update the repository
+ * the chapter keeps its expected location.
+ */
+ public void testAddTitleToExistingChapterWithFocusOnDocument() {
+ // Step 1 : opening an editor on the document
+ editor = openIntentEditor();
+
+ // getting the document associated to the opened editor
+ document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
+
+ // Step 2 : update section by adding 2 subsections textually
+ String documentContent = document.get();
+ String expectedDocumentContent = documentContent.replace(PREFIX_CHAPTER_1, PREFIX_CHAPTER_1
+ + "\n\t\tMy Chapter Title");
+
+ // Step 3 : check merge
+ checkMerging(expectedDocumentContent);
+ }
+
+ /**
+ * Ensures that, when adding a new paragraph to a chapter containing no description unit, when emf compare
+ * is used to update the repository the chapter keeps its expected location and structure.
+ */
+ public void testAddParagraphToChapterWithoutDescriptionUnitsWithFocusOnDocument() {
+ // opening an editor on the document
+ editor = openIntentEditor();
+
+ genericUpdateTest(PREFIX_CHAPTER_2_FOCUS_DOCUMENT, "\n\t\t" + A_NEW_DESCRIPTION_UNIT + "\n");
+ }
+
+ /**
+ * Ensures that, when adding a new modeling unit in the middle of an existing description unit, when emf
+ * compare is used to update the repository the chapter keeps its expected location and structure.
+ */
+ public void testAddModelingUnitBySplittingADescriptionUnitWithFocusOnDocument() {
+ // opening an editor on the document
+ editor = openIntentEditor();
+
+ genericUpdateTest(MIDDLE_OF_DESCRIPTION_UNIT, SAMPLE_MODELING_CONTENT, FOCUS_ON_DOCUMENT);
+ }
+
+ /**
+ * Ensures that, when adding a new modeling unit in the middle of an existing description unit, when emf
+ * compare is used to update the repository the chapter keeps its expected location and structure.
+ */
+ public void testAddModelingUnitBySplittingADescriptionUnitWithFocusOnChapter() {
+ // opening an editor on the chapter
+ editor = openIntentEditor(getIntentSection(1));
+
+ genericUpdateTest(MIDDLE_OF_DESCRIPTION_UNIT, SAMPLE_MODELING_CONTENT, 2);
+ }
+
+ /**
+ * Ensures that, when adding a new modeling unit in the middle of an existing description unit, when emf
+ * compare is used to update the repository the chapter keeps its expected location and structure.
+ */
+ public void testAddModelingUnitBySplittingADescriptionUnitWithFocusOnSection() {
+ // opening an editor on the section
+ editor = openIntentEditor(getIntentSection(1, 1));
+
+ genericUpdateTest(MIDDLE_OF_DESCRIPTION_UNIT, SAMPLE_MODELING_CONTENT, 1);
+ }
+
+ /**
+ * Ensures that when typing new sections inside the Intent Document, when emf compare is used to update
+ * the repository the structure is respected.
+ */
+ public void testSubSectionOrderWithFocusOnDocument() {
+ // opening an editor on a section
+ editor = openIntentEditor();
+
+ genericTestSubSectionOrderWithFocusOnDocuments(3);
+ }
+
+ /**
+ * Ensures that when typing new sections inside the Intent Document, when emf compare is used to update
+ * the repository the structure is respected.
+ */
+ public void testSubSectionOrderWithFocusOnSection() {
+ // opening an editor on a section
+ IntentSection section = getIntentDocument().getSubSections().iterator().next().getSubSections()
+ .iterator().next();
+ editor = openIntentEditor(section);
+
+ genericTestSubSectionOrderWithFocusOnDocuments(1);
+ }
+
+ /**
+ * <ul>
+ * <li>Replaces the given prefix by prefix + contentToAdd in the current Document</li>
+ * <li>Saves the editor</li>
+ * <li>after merging with the repository content and serializing, check that the editor now displays the
+ * expected document content.
+ * <li>
+ * </ul>
+ *
+ * @param contentToAdd
+ * the string corresponding to the new content to add
+ * @param prefix
+ * the prefix to use for identifying the chapter to modify
+ */
+ private void genericUpdateTest(String prefix, String contentToAdd) {
+ genericUpdateTest(prefix, contentToAdd, -1);
+ }
+
+ /**
+ * <ul>
+ * <li>Replaces the given prefix by prefix + contentToAdd in the current Document</li>
+ * <li>Saves the editor</li>
+ * <li>after merging with the repository content and serializing, check that the editor now displays the
+ * expected document content.
+ * <li>
+ * </ul>
+ *
+ * @param contentToAdd
+ * the string corresponding to the new content to add
+ * @param prefix
+ * the prefix to use for identifying the chapter to modify
+ * @param focusLevel
+ * the focus level
+ */
+ private void genericUpdateTest(String prefix, String contentToAdd, int focusLevel) {
+ // Step 1 : getting the document associated to the opened editor
+ document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
+
+ // Step 2 : update the document
+ // Step 2.1 : including focus level
+ String initialContent = document.get();
+ String indent = LINEBREAK_AND_INDENT;
+ for (int i = 1; i < focusLevel; i++) {
+ indent += "\t";
+ }
+ String updatedPrefix = prefix.replace(LINEBREAK_AND_INDENT, indent);
+ String updatedContentToAdd = contentToAdd.replace(LINEBREAK_AND_INDENT, indent);
+
+ // Step 2.2 : change the document
+ String expectedDocumentContent = initialContent.replace(updatedPrefix, updatedPrefix
+ + updatedContentToAdd);
+
+ // Step 3 : check merge
+ checkMerging(expectedDocumentContent);
+
+ }
+
+ /**
+ * Ensures that when typing new sections inside the Intent Document, when emf compare is used to update
+ * the repository the structure is respected.
+ *
+ * @param focusLevel
+ * used to create the correct number of tabulations
+ */
+ private void genericTestSubSectionOrderWithFocusOnDocuments(int focusLevel) {
+ // Step 1 : get the content of the editor
+ document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
+
+ // Step 2 : update section by adding 2 subsections textually
+ String initialContent = document.get();
+
+ String indent = LINEBREAK_AND_INDENT;
+ for (int i = 1; i < focusLevel; i++) {
+ indent += "\t";
+ }
+ String prefixSection1WithFocusLevel = PREFIX_SECTION_1_1.replace(LINEBREAK_AND_INDENT, indent);
+ String prefixSection2WithFocusLevel = PREFIX_SECTION_1_2.replace(LINEBREAK_AND_INDENT, indent);
+ String replacementWithFocusLevel1 = NEW_SECTION_1.replace(LINEBREAK_AND_INDENT, indent);
+ String replacementWithFocusLevel2 = NEW_SECTION_2.replace(LINEBREAK_AND_INDENT, indent);
+ String expectedDocumentContent = initialContent.replace(prefixSection1WithFocusLevel,
+ prefixSection1WithFocusLevel + replacementWithFocusLevel1);
+ assertFalse(
+ "No change made on the document. You should check that the test has been correctly written",
+ initialContent.equals(expectedDocumentContent));
+ expectedDocumentContent = expectedDocumentContent.replace(prefixSection2WithFocusLevel,
+ prefixSection2WithFocusLevel + replacementWithFocusLevel2);
+
+ // Step 3 : check merge
+ checkMerging(expectedDocumentContent);
+ }
+
+ /**
+ * Ensures that when setting the given document content and then save the editor, after merging with the
+ * repository content and serializing, the editor now displays the expected document content.
+ *
+ * @param expectedDocumentContent
+ * the excepted document content
+ */
+ private void checkMerging(String expectedDocumentContent) {
+ // Step 1 : we ensure that the initial content is different from expected content
+ String initialContent = document.get();
+ assertFalse(
+ "No change made on the document. You should check that the test has been correctly written",
+ initialContent.equals(expectedDocumentContent));
+
+ // Step 2 : setting the new content
+ document.set(expectedDocumentContent);
+
+ // Step 3 : save editor
+ editor.doSave(new NullProgressMonitor());
+ waitForAllOperationsInUIThread();
+
+ // Step 4 : checking that when reserializing the parsed document we obtain the expected text
+ String newDocumentContent = document.get();
+ assertEquals(FAILURE_MESSAGE, expectedDocumentContent, newDocumentContent);
+ }
+
+}
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 e9ac60a..d274cf8 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
@@ -35,18 +35,32 @@
*/
public class IntentMatchEngineTests extends AbstractIntentUITest {
+ /**
+ * Path of the test file.
+ */
private static final String INTENT_DOCUMENT_FOLDER = "data/unit/documents/editorupdates/";
- private static final String LINEBREAK = "\n";
-
+ /**
+ * All assertion failed errors (are only raised in the end to have the number of failures and not stop at
+ * first one).
+ */
private Collection<AssertionFailedError> errors = Sets.newLinkedHashSet();
+ /**
+ * Number of tested cases.
+ */
private int compareCasesNumber;
+ /**
+ * Ensures that the Intent match engine works as expected on the given test file.
+ */
public void testCompareDocumentWithChapterTitles() {
doTestDiffEngine("compareTest-01.intent");
}
+ /**
+ * Ensures that the Intent match engine works as expected on the given test file.
+ */
public void testCompareDocumentWithoutChapterTitles() {
doTestDiffEngine("compareTest-02.intent");
}
@@ -151,7 +165,6 @@
IntentDocument copy = EcoreUtil.copy(getIntentDocument());
// according to where the chapter is added, we should have the following results :
for (int position = 0; position < getIntentDocument().getSubSections().size(); position++) {
- IntentSection chapterToRemoveInOriginal = getIntentDocument().getSubSections().get(position);
IntentSection chapterToRemoveinCopy = copy.getSubSections().get(position);
copy.getIntentContent().remove(chapterToRemoveinCopy);
String message = "A Chapter deletion should be detected at " + position;
@@ -191,6 +204,15 @@
/**
* Ensures that the creation of any section/subsection in the Intent document is correctly detected.
+ *
+ * @param copy
+ * a copy of the intent document (in which the modification should be made)
+ * @param container
+ * the container in witch the new section should be added
+ * @param containerCopy
+ * the copy of the container in witch the new section should be added
+ * @param containerLevel
+ * the global containment level
*/
private void doTestAddingSectionsRecursive(IntentDocument copy, IntentSection container,
IntentSection containerCopy, int containerLevel) {
@@ -249,6 +271,15 @@
/**
* Ensures that the deletion of any section/subsection in the Intent document is correctly detected.
+ *
+ * @param copy
+ * a copy of the intent document (in which the modification should be made)
+ * @param container
+ * the container in witch the new section should be added
+ * @param containerCopy
+ * the copy of the container in witch the new section should be added
+ * @param containerLevel
+ * the global containment level
*/
private void doTestRemovingSectionsRecursive(IntentDocument copy, IntentSection container,
IntentSection containerCopy, int containerLevel) {
@@ -320,6 +351,13 @@
return childDiff;
}
+ /**
+ * Returns the given differences as string (to show them in assertion message).
+ *
+ * @param differences
+ * the dirrences to get as string
+ * @return the given differences as string (to show them in assertion message)
+ */
protected String getDiffAsString(Collection<Diff> differences) {
String diff = "";
for (Diff element : differences) {
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/SimpleOrderTests.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/SimpleOrderTests.java
index fa1b9de..a2c3af3 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/SimpleOrderTests.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/compare/SimpleOrderTests.java
@@ -1,85 +1,109 @@
-/*******************************************************************************
- * 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.compare;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditor;
-import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditorDocument;
-import org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest;
-import org.eclipse.mylyn.docs.intent.parser.test.utils.FileToStringConverter;
-
-/**
- * Tests the correct behavior of Intent editor changes. Ensures that EMF Compare is able to maintain order and
- * structure of the Intent document.
- *
- * @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
- */
-public class SimpleOrderTests extends AbstractIntentUITest {
-
- private static final String SAMPLES_PATH = "data/unit/documents/editorupdates/order/";
-
- private IntentEditor editor;
-
- private IntentEditorDocument document;
-
- /**
- * {@inheritDoc}
- *
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- setUpIntentProject("intentProject");
- editor = openIntentEditor();
- document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
- }
-
- public void testNewSection() {
- checkSample("newSection");
- }
-
- public void testNewMU() {
- checkSample("newMU");
- }
-
- private void checkSample(String sampleName) {
- try {
- // inits the test
- String init = FileToStringConverter.getFileAsString(new File(SAMPLES_PATH + sampleName
- + ".intent"));
- document.set(init);
- editor.doSave(new NullProgressMonitor());
- waitForAllOperationsInUIThread();
-
- // make the first change
- String update1 = FileToStringConverter.getFileAsString(new File(SAMPLES_PATH + sampleName
- + ".update1.intent"));
- document.set(update1);
- editor.doSave(new NullProgressMonitor());
- waitForAllOperationsInUIThread();
-
- // make the second change
- String update2 = FileToStringConverter.getFileAsString(new File(SAMPLES_PATH + sampleName
- + ".update2.intent"));
- document.set(update2);
- editor.doSave(new NullProgressMonitor());
- waitForAllOperationsInUIThread();
-
- assertEquals(update2, document.get());
- } catch (IOException e) {
- fail(e.getMessage());
- }
- }
-}
+/*******************************************************************************
+ * 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.compare;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditor;
+import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditorDocument;
+import org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest;
+import org.eclipse.mylyn.docs.intent.parser.test.utils.FileToStringConverter;
+
+/**
+ * Tests the correct behavior of Intent editor changes. Ensures that EMF Compare is able to maintain order and
+ * structure of the Intent document.
+ *
+ * @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
+ */
+public class SimpleOrderTests extends AbstractIntentUITest {
+
+ /**
+ * Path indicating the folder containing test samples.
+ */
+ private static final String SAMPLES_PATH = "data/unit/documents/editorupdates/order/";
+
+ /**
+ * The current Intent editor.
+ */
+ private IntentEditor editor;
+
+ /**
+ * The document associated to the current editor.
+ */
+ private IntentEditorDocument document;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ setUpIntentProject("intentProject");
+ editor = openIntentEditor();
+ document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
+ }
+
+ /**
+ * Tests the correct behavior of Intent editor changes. Ensures that EMF Compare is able to maintain order
+ * and structure of the Intent document.
+ */
+ public void testNewSection() {
+ checkSample("newSection");
+ }
+
+ /**
+ * Tests the correct behavior of Intent editor changes. Ensures that EMF Compare is able to maintain order
+ * and structure of the Intent document.
+ */
+ public void testNewMU() {
+ checkSample("newMU");
+ }
+
+ /**
+ * Tests the correct behavior of Intent editor changes. Ensures that EMF Compare is able to maintain order
+ * and structure of the Intent document.
+ *
+ * @param sampleName
+ * name of the test file
+ */
+ private void checkSample(String sampleName) {
+ try {
+ // inits the test
+ String init = FileToStringConverter.getFileAsString(new File(SAMPLES_PATH + sampleName
+ + ".intent"));
+ document.set(init);
+ editor.doSave(new NullProgressMonitor());
+ waitForAllOperationsInUIThread();
+
+ // make the first change
+ String update1 = FileToStringConverter.getFileAsString(new File(SAMPLES_PATH + sampleName
+ + ".update1.intent"));
+ document.set(update1);
+ editor.doSave(new NullProgressMonitor());
+ waitForAllOperationsInUIThread();
+
+ // make the second change
+ String update2 = FileToStringConverter.getFileAsString(new File(SAMPLES_PATH + sampleName
+ + ".update2.intent"));
+ document.set(update2);
+ editor.doSave(new NullProgressMonitor());
+ waitForAllOperationsInUIThread();
+
+ assertEquals(update2, document.get());
+ } catch (IOException e) {
+ fail(e.getMessage());
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/AbstractDemoTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/AbstractDemoTest.java
index 6246c08..b664498 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/AbstractDemoTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/AbstractDemoTest.java
@@ -1,45 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 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.demo;
-
-import org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractZipBasedTest;
-
-/**
- * Tests the Intent demo, part 1: navigation behavior.
- *
- * @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
- */
-public abstract class AbstractDemoTest extends AbstractZipBasedTest {
-
- protected static final String TEST_COMPILER_NO_ERROR_MSG = "The compiler failed to detect errors";
-
- protected static final String TEST_COMPILER_INVALID_ERROR_MSG = "The compiler detected invalid errors";
-
- protected static final String TEST_COMPILER_NO_INFO_MSG = "The compiler failed to detect infos";
-
- protected static final String TEST_COMPILER_INVALID_INFO_MSG = "The compiler detected invalid infos";
-
- protected static final String TEST_SYNCHRONIZER_NO_WARNING_MSG = "The synchronizer failed to detect errors";
-
- protected static final String TEST_SYNCHRONIZER_INVALID_WARNING_MSG = "The synchronizer failed to detect errors";
-
- private static final String DEMO_ZIP_LOCATION = "data/unit/demo/demo.zip";
-
- private static final String INTENT_PROJECT_NAME = "org.eclipse.emf.compare.idoc";
-
- /**
- * Constructor.
- */
- public AbstractDemoTest() {
- super(DEMO_ZIP_LOCATION, INTENT_PROJECT_NAME);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 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.demo;
+
+import org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractZipBasedTest;
+
+/**
+ * Tests the Intent demo, part 1: navigation behavior.
+ *
+ * @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
+ */
+public abstract class AbstractDemoTest extends AbstractZipBasedTest {
+
+ /**
+ * Constant used to create assertion failure messages.
+ */
+ protected static final String TEST_COMPILER_NO_ERROR_MSG = "The compiler failed to detect errors";
+
+ /**
+ * Constant used to create assertion failure messages.
+ */
+ protected static final String TEST_COMPILER_INVALID_ERROR_MSG = "The compiler detected invalid errors";
+
+ /**
+ * Constant used to create assertion failure messages.
+ */
+ protected static final String TEST_COMPILER_NO_INFO_MSG = "The compiler failed to detect infos";
+
+ /**
+ * Constant used to create assertion failure messages.
+ */
+ protected static final String TEST_COMPILER_INVALID_INFO_MSG = "The compiler detected invalid infos";
+
+ /**
+ * Constant used to create assertion failure messages.
+ */
+ protected static final String TEST_SYNCHRONIZER_NO_WARNING_MSG = "The synchronizer failed to detect errors";
+
+ /**
+ * Constant used to create assertion failure messages.
+ */
+ protected static final String TEST_SYNCHRONIZER_INVALID_WARNING_MSG = "The synchronizer failed to detect errors";
+
+ /**
+ * Location of the test archive file.
+ */
+ private static final String DEMO_ZIP_LOCATION = "data/unit/demo/demo.zip";
+
+ /**
+ * Name of the intent project.
+ */
+ private static final String INTENT_PROJECT_NAME = "org.eclipse.emf.compare.idoc";
+
+ /**
+ * Constructor.
+ */
+ public AbstractDemoTest() {
+ super(DEMO_ZIP_LOCATION, INTENT_PROJECT_NAME);
+ }
+
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/compilation/CompileTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/compilation/CompileTest.java
index dfe38b8..4d4c936 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/compilation/CompileTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/compilation/CompileTest.java
@@ -1,123 +1,147 @@
-/*******************************************************************************
- * Copyright (c) 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.demo.compilation;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditor;
-import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditorDocument;
-import org.eclipse.mylyn.docs.intent.client.ui.editor.annotation.IntentAnnotationMessageType;
-import org.eclipse.mylyn.docs.intent.client.ui.test.unit.demo.AbstractDemoTest;
-import org.eclipse.mylyn.docs.intent.client.ui.test.util.AnnotationUtils;
-
-/**
- * Tests the Intent demo, part 2: compilation behavior.
- *
- * @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
- */
-public class CompileTest extends AbstractDemoTest {
-
- private static final String ERROR_TEXT_PATTERN = "nsPrefixx = \"match\";";
-
- private static final String NO_ERROR_TEXT_PATTERN = "nsPrefix = \"match\";";
-
- private static final String COMPILATION_ERROR_MESSAGE = "The feature nsPrefixx doesn't exists in EPackage";
-
- private static final String INFOS_TEXT_PATTERN = "nsURI = \"\";";
-
- private static final String NO_INFOS_TEXT_PATTERN = "nsURI = \"http://www.eclipse.org/emf/compare/match/1.1\";";
-
- private static final String COMPILATION_INFO_MESSAGE = "-The namespace URI '' is not well formed";
-
- private IntentEditor editor;
-
- private IntentEditorDocument document;
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.mylyn.docs.intent.client.ui.test.unit.demo.AbstractDemoTest#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- // Initialization : opening an editor on the document
- editor = openIntentEditor(getIntentSection(4, 1));
- document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
- }
-
- /**
- * Ensures that compilation errors are detected and can be fixed.
- */
- public void testCompilationErrors() {
- // Step 1 : update section by adding incorrect content
- String initialContent = document.get();
- String newContent = initialContent.replaceFirst(NO_ERROR_TEXT_PATTERN, ERROR_TEXT_PATTERN);
- document.set(newContent);
-
- // Step 2 : we start recording for any modification made on the repository
- repositoryListener.clearPreviousEntries();
- // save
- editor.doSave(new NullProgressMonitor());
- // and wait the compiler to be notified
- waitForCompiler();
-
- // Step 3 : ensure that the compilation error has been detected
- assertTrue(TEST_COMPILER_NO_ERROR_MSG, AnnotationUtils.hasIntentAnnotation(editor,
- IntentAnnotationMessageType.COMPILER_ERROR, COMPILATION_ERROR_MESSAGE, true));
- waitForCompiler(false);
- // Step 4 : fix the error by resetting the content
- document.set(initialContent);
- repositoryListener.clearPreviousEntries();
- editor.doSave(new NullProgressMonitor());
-
- waitForCompiler();
-
- // Step 5 : ensure that the compilation error no longer exists
- assertFalse(TEST_COMPILER_INVALID_ERROR_MSG, AnnotationUtils.hasIntentAnnotation(editor,
- IntentAnnotationMessageType.COMPILER_ERROR, COMPILATION_ERROR_MESSAGE, true));
- waitForCompiler(false);
- }
-
- /**
- * Ensures that compilation informations are detected and can be fixed.
- */
- public void testCompilationInfos() {
- // Step 1 : update section by adding incorrect content
- String initialContent = document.get();
- String newContent = initialContent.replaceFirst(NO_INFOS_TEXT_PATTERN, INFOS_TEXT_PATTERN);
- document.set(newContent);
-
- // Step 2 : we start recording for any modification made on the repository
- repositoryListener.clearPreviousEntries();
- // save
- editor.doSave(new NullProgressMonitor());
- // and wait the compiler to be notified
- waitForCompiler();
-
- // Step 2 : ensure that the compilation info has been detected
- assertTrue(TEST_COMPILER_NO_INFO_MSG, AnnotationUtils.hasIntentAnnotation(editor,
- IntentAnnotationMessageType.COMPILER_INFO, COMPILATION_INFO_MESSAGE, true));
- waitForCompiler(false);
-
- // Step 3 : fix the info by resetting the content
- document.set(initialContent);
- repositoryListener.clearPreviousEntries();
- editor.doSave(new NullProgressMonitor());
- waitForCompiler();
-
- // Step 4 : ensure that the compilation info no longer exists
- assertFalse(TEST_COMPILER_INVALID_INFO_MSG, AnnotationUtils.hasIntentAnnotation(editor,
- IntentAnnotationMessageType.COMPILER_INFO, COMPILATION_INFO_MESSAGE, true));
- waitForCompiler(false);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 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.demo.compilation;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditor;
+import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditorDocument;
+import org.eclipse.mylyn.docs.intent.client.ui.editor.annotation.IntentAnnotationMessageType;
+import org.eclipse.mylyn.docs.intent.client.ui.test.unit.demo.AbstractDemoTest;
+import org.eclipse.mylyn.docs.intent.client.ui.test.util.AnnotationUtils;
+
+/**
+ * Tests the Intent demo, part 2: compilation behavior.
+ *
+ * @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
+ */
+public class CompileTest extends AbstractDemoTest {
+
+ /**
+ * Text to type to create a compilation error.
+ */
+ private static final String ERROR_TEXT_PATTERN = "nsPrefixx = \"match\";";
+
+ /**
+ * Text to type that should not raise compilation issue.
+ */
+ private static final String NO_ERROR_TEXT_PATTERN = "nsPrefix = \"match\";";
+
+ /**
+ * Expected compilation error message.
+ */
+ private static final String COMPILATION_ERROR_MESSAGE = "The feature nsPrefixx doesn't exists in EPackage";
+
+ /**
+ * Text to type that should raise a compilation warning.
+ */
+ private static final String INFOS_TEXT_PATTERN = "nsURI = \"\";";
+
+ /**
+ * Text to type that should not raise any compilation warning.
+ */
+ private static final String NO_INFOS_TEXT_PATTERN = "nsURI = \"http://www.eclipse.org/emf/compare/match/1.1\";";
+
+ /**
+ * Expected validation issue message.
+ */
+ private static final String COMPILATION_INFO_MESSAGE = "-The namespace URI '' is not well formed";
+
+ /**
+ * The current intent editor.
+ */
+ private IntentEditor editor;
+
+ /**
+ * The document associated to the current editor.
+ */
+ private IntentEditorDocument document;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.mylyn.docs.intent.client.ui.test.unit.demo.AbstractDemoTest#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Initialization : opening an editor on the document
+ editor = openIntentEditor(getIntentSection(4, 1));
+ document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
+ }
+
+ /**
+ * Ensures that compilation errors are detected and can be fixed.
+ */
+ public void testCompilationErrors() {
+ // Step 1 : update section by adding incorrect content
+ String initialContent = document.get();
+ String newContent = initialContent.replaceFirst(NO_ERROR_TEXT_PATTERN, ERROR_TEXT_PATTERN);
+ document.set(newContent);
+
+ // Step 2 : we start recording for any modification made on the repository
+ repositoryListener.clearPreviousEntries();
+ // save
+ editor.doSave(new NullProgressMonitor());
+ // and wait the compiler to be notified
+ waitForCompiler();
+
+ // Step 3 : ensure that the compilation error has been detected
+ assertTrue(TEST_COMPILER_NO_ERROR_MSG, AnnotationUtils.hasIntentAnnotation(editor,
+ IntentAnnotationMessageType.COMPILER_ERROR, COMPILATION_ERROR_MESSAGE, true));
+ waitForCompiler(false);
+ // Step 4 : fix the error by resetting the content
+ document.set(initialContent);
+ repositoryListener.clearPreviousEntries();
+ editor.doSave(new NullProgressMonitor());
+
+ waitForCompiler();
+
+ // Step 5 : ensure that the compilation error no longer exists
+ assertFalse(TEST_COMPILER_INVALID_ERROR_MSG, AnnotationUtils.hasIntentAnnotation(editor,
+ IntentAnnotationMessageType.COMPILER_ERROR, COMPILATION_ERROR_MESSAGE, true));
+ waitForCompiler(false);
+ }
+
+ /**
+ * Ensures that compilation informations are detected and can be fixed.
+ */
+ public void testCompilationInfos() {
+ // Step 1 : update section by adding incorrect content
+ String initialContent = document.get();
+ String newContent = initialContent.replaceFirst(NO_INFOS_TEXT_PATTERN, INFOS_TEXT_PATTERN);
+ document.set(newContent);
+
+ // Step 2 : we start recording for any modification made on the repository
+ repositoryListener.clearPreviousEntries();
+ // save
+ editor.doSave(new NullProgressMonitor());
+ // and wait the compiler to be notified
+ waitForCompiler();
+
+ // Step 2 : ensure that the compilation info has been detected
+ assertTrue(TEST_COMPILER_NO_INFO_MSG, AnnotationUtils.hasIntentAnnotation(editor,
+ IntentAnnotationMessageType.COMPILER_INFO, COMPILATION_INFO_MESSAGE, true));
+ waitForCompiler(false);
+
+ // Step 3 : fix the info by resetting the content
+ document.set(initialContent);
+ repositoryListener.clearPreviousEntries();
+ editor.doSave(new NullProgressMonitor());
+ waitForCompiler();
+
+ // Step 4 : ensure that the compilation info no longer exists
+ assertFalse(TEST_COMPILER_INVALID_INFO_MSG, AnnotationUtils.hasIntentAnnotation(editor,
+ IntentAnnotationMessageType.COMPILER_INFO, COMPILATION_INFO_MESSAGE, true));
+ waitForCompiler(false);
+ }
+
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/editor/CompletionTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/editor/CompletionTest.java
index 5dca576..dde682e 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/editor/CompletionTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/editor/CompletionTest.java
@@ -24,39 +24,87 @@
*/
public class CompletionTest extends AbstractIntentUITest {
+ /**
+ * Path to test file.
+ */
private static final String INTENT_DOC_PATH = "data/unit/demo/demo_as_text";
+ /**
+ * Path to test file.
+ */
private static final String INTENT_DOC_WITH_ENUMS_PATH = "data/unit/documents/scenario/eenums/docWithEnums.intent";
+ /**
+ * Constant used to test completion.
+ */
private static final String KW_CHAPTER = "Chapter";
+ /**
+ * Constant used to test completion.
+ */
private static final String KW_SECTION = "Section";
+ /**
+ * Constant used to test completion.
+ */
private static final String TEMPLATE_DESC_CHAPTER = "Chapter - Chapter";
+ /**
+ * Constant used to test completion.
+ */
private static final String TEMPLATE_DESC_SECTION = "Section - Section";
+ /**
+ * Constant used to test completion.
+ */
private static final String TEMPLATE_DESC_MU = "Modeling Unit - Modeling Unit";
+ /**
+ * Constant used to test completion.
+ */
private static final String TEMPLATE_DESC_RESOURCE = "Resource - Declaration of a new Resource";
+ /**
+ * Constant used to test completion.
+ */
private static final String TEMPLATE_DESC_INST = "new - Declaration of a new entity";
+ /**
+ * Constant used to test completion.
+ */
private static final String TEMPLATE_DESC_REF = "@ref - Declaration of a new internal entity (stored only inside the intent repository)";
+ /**
+ * Constant used to test completion.
+ */
private static final String TEMPLATE_DESC_URI = "Resource URI - URI indicating the Resource location";
+ /**
+ * Constant used to test completion.
+ */
private static final String TEMPLATE_DESC_CONTENT = "Resource Content - Add content to the Resource";
+ /**
+ * Constant used to test completion.
+ */
private static final String TEMPLATE_DESC_BOOL_VALUE = "value (of type EBoolean) - Default: false - Set a simple value of type EBoolean";
+ /**
+ * The current Intent editor.
+ */
private IntentEditor editor;
- private IContentAssistant contentAssistant;
-
+ /**
+ * The document associated to the current editor.
+ */
private IDocument document;
/**
+ * The content assistant to use to test completion.
+ */
+ private IContentAssistant contentAssistant;
+
+ /**
* Ensures that completion behaves as expected when called on structural features with a EEnum value.
*
* @throws BadLocationException
@@ -201,6 +249,7 @@
* the completion launch offset
* @return the completion proposals at the given offset
* @throws BadLocationException
+ * if offset is invalid
*/
private ICompletionProposal[] getCompletionProposals(int offset) throws BadLocationException {
return contentAssistant.getContentAssistProcessor(document.getContentType(offset))
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/opening/OpenEditorTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/opening/OpenEditorTest.java
index bede0d6..dd0d1ce 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/opening/OpenEditorTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/opening/OpenEditorTest.java
@@ -21,6 +21,9 @@
*/
public class OpenEditorTest extends AbstractDemoTest {
+ /**
+ * Expected names for editors opened by this test.
+ */
private static final String[] EDITOR_REFERENCES_NAMES = new String[] {"IntentDocument", "Architecture",
"Comparison process",
};
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/synchronization/EcoreTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/synchronization/EcoreTest.java
index ab871c6..e6d4361 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/synchronization/EcoreTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/synchronization/EcoreTest.java
@@ -32,21 +32,44 @@
* @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
*/
public class EcoreTest extends AbstractDemoTest {
-
+ /**
+ * Constant used to create assertion failure messages.
+ */
private static final String SYNC_WARNING_MESSAGE_RIGHT = "EAttribute literal in Right has changed.<br/>Documentation : Right<br/><b>Working Copy</b> : New";
+ /**
+ * Constant used to create assertion failure messages.
+ */
private static final String SYNC_WARNING_MESSAGE_LEFT = "EAttribute literal in Left has changed.<br/>Documentation : Left<br/><b>Working Copy</b> : Old";
+ /**
+ * Constant used to create assertion failure messages.
+ */
private static final String SYNC_WARNING_MESSAGE_ANCESTOR = "The EEnumLiteral Ancestor is defined in the Documentation model<br/>but not in the <b>Working Copy</b> model.";
+ /**
+ * URI of the match model.
+ */
private static final String MATCH_MODEL_URI = "platform:/resource/org.eclipse.emf.compare.match/model/match.ecore";
+ /**
+ * Constant used to insert text.
+ */
private static final int INSERTION_INDEX = 912;
+ /**
+ * New content to set to the document.
+ */
private static final String NEW_LITERAL_STRING = "\n\t\t\t\teLiterals += new EEnumLiteral {\n\t\t\t\t\tname = \"Ancestor\";\n\t\t\t\t\tliteral = \"Ancestor\";\n\t\t\t\t\tvalue = \"2\";\n\t\t\t\t};";
+ /**
+ * The current Intent editor.
+ */
private IntentEditor editor;
+ /**
+ * The document associated to the current Intent editor.
+ */
private IntentEditorDocument document;
/**
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/synchronization/JavaTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/synchronization/JavaTest.java
index cfa30bd..df68689 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/synchronization/JavaTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/demo/synchronization/JavaTest.java
@@ -34,26 +34,52 @@
* @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
*/
public class JavaTest extends AbstractDemoTest {
-
+ /**
+ * Constant used to create assertion failure messages.
+ */
private static final String SYNC_WARNING_MSG = "The AcceptanceTest is defined in the Working Copy model<br/>but not in the Documentation model.";
+ /**
+ * Constant representing a section (used to open an editor on it).
+ */
private static final int[] EDITOR_SECTION_3_7 = new int[] {3, 7,
};
+ /**
+ * Constant representing a section (used to open an editor on it).
+ */
private static final int[] EDITOR_SECTION_7_1 = new int[] {7, 1,
};
+ /**
+ * Constant representing a section (used to open an editor on it).
+ */
private static final int[] EDITOR_SECTION_7_2 = new int[] {7, 2,
};
+ /**
+ * Location of test file.
+ */
private static final String SECTION_37_V1_FILENAME = "data/unit/demo/Section_3.7_v1";
+ /**
+ * Location of test file.
+ */
private static final String SECTION_37_V2_FILENAME = "data/unit/demo/Section_3.7_v2";
+ /**
+ * Location of test file.
+ */
private static final String SECTION_37_V3_FILENAME = "data/unit/demo/Section_3.7_v3";
+ /**
+ * Location of test file.
+ */
private static final String SECTION_72_FILENAME = "data/unit/demo/Section_7.2";
+ /**
+ * Location of the java file used in tests.
+ */
private static final String JAVA_TEST_FILENAME = "data/unit/demo/PatchCreationThroughCompareDialogTest.java";
/**
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/hyperlink/IntentHyperLinkDetetectorTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/hyperlink/IntentHyperLinkDetetectorTest.java
index 500c323..c4458aa 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/hyperlink/IntentHyperLinkDetetectorTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/hyperlink/IntentHyperLinkDetetectorTest.java
@@ -35,14 +35,29 @@
*/
public class IntentHyperLinkDetetectorTest extends AbstractIntentUITest {
+ /**
+ * Expected selection offset in the java file opened through hyperlinks.
+ */
private static final int JAVA_METHOD_OFFSET = 1704;
+ /**
+ * Location of the test archive.
+ */
private static final String JAVA_PROJECT_PATH = "data/unit/java/java.example01.zip";
+ /**
+ * Test file.
+ */
private static final String INTENT_DOCUMENT_EXAMPLE_PATH = "data/unit/documents/java/doc_with_java.intent";
+ /**
+ * The current Intent editor.
+ */
private IntentEditor editor;
+ /**
+ * The document associated to the current intent Editor.
+ */
private IntentEditorDocument document;
/**
@@ -85,8 +100,15 @@
}
/**
- * Ensures that when searhcing for hyperlinks at the given offset, one is found and allows to open an
+ * Ensures that when searching for hyperlinks at the given offset, one is found and allows to open an
* editor with the given expectedEditorID, with a selection at the given expectedSelectedOffset.
+ *
+ * @param offset
+ * the offset on which to place caret to get hyperlinks
+ * @param expectedEditorID
+ * the expected id for the editor that will be opened when clicking on the hyperlink
+ * @param expectedSelectedOffset
+ * expected selection offset in the opened editor
*/
public void doTestHyperLink(int offset, String expectedEditorID, int expectedSelectedOffset) {
IRegion region = new Region(offset, 1);
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/indexer/IndexerNotificationsTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/indexer/IndexerNotificationsTest.java
index 6de338b..18ba52c 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/indexer/IndexerNotificationsTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/indexer/IndexerNotificationsTest.java
@@ -35,6 +35,15 @@
*/
public class IndexerNotificationsTest extends AbstractIntentUITest {
+ /**
+ * Ensures that the Intent {@link org.eclipse.mylyn.docs.intent.client.indexer.IndexerRepositoryClient} is
+ * correctly notified.
+ *
+ * @throws ReadOnlyException
+ * if issues occur while commiting modification on the intent repository
+ * @throws SaveException
+ * if issues occur while commiting modification on the intent repository
+ */
public void testIndexerNotifications() throws ReadOnlyException, SaveException {
// Step 1: we initialize an intent project
setUpIntentProject("intentProject",
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/project/ProjectTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/project/ProjectTest.java
index 1b7090b..bfdc719 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/project/ProjectTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/project/ProjectTest.java
@@ -1,70 +1,70 @@
-/*******************************************************************************
- * 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.project;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest;
-
-/**
- * Tests the correct behavior of Intent projects.
- *
- * @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
- */
-public class ProjectTest extends AbstractIntentUITest {
-
- /**
- * {@inheritDoc}
- *
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- setUpIntentProject("intentProject", "data/unit/documents/editorupdates/changeEditorUpdateTest.intent");
- openIntentEditor();
- }
-
- /**
- * Ensures that a project can be closed.
- */
- public void testDeleteProject() {
- // already managed by tearDown()
- }
-
- /**
- * Ensures that a project can be closed.
- */
- public void testCloseProject() {
- try {
- intentProject.close(new NullProgressMonitor());
- } catch (CoreException e) {
- fail(e.getMessage());
- }
- }
-
- // TODO fix or remove incorrect test: the repository is not the same after toggling
- // /**
- // * Ensures that the project nature can be activated/deactivated.
- // */
- // public void testToggleNature() {
- // ToggleNatureAction.toggleNature(intentProject);
- //
- // waitForAllOperationsInUIThread();
- //
- // ToggleNatureAction.toggleNature(intentProject);
- //
- // waitForAllOperationsInUIThread();
- //
- // openIntentEditor();
- // }
-
-}
+/*******************************************************************************
+ * 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.project;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest;
+
+/**
+ * Tests the correct behavior of Intent projects.
+ *
+ * @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
+ */
+public class ProjectTest extends AbstractIntentUITest {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ setUpIntentProject("intentProject", "data/unit/documents/editorupdates/changeEditorUpdateTest.intent");
+ openIntentEditor();
+ }
+
+ /**
+ * Ensures that a project can be closed.
+ */
+ public void testDeleteProject() {
+ // already managed by tearDown()
+ }
+
+ /**
+ * Ensures that a project can be closed.
+ */
+ public void testCloseProject() {
+ try {
+ intentProject.close(new NullProgressMonitor());
+ } catch (CoreException e) {
+ fail(e.getMessage());
+ }
+ }
+
+ // TODO fix or remove incorrect test: the repository is not the same after toggling
+ // /**
+ // * Ensures that the project nature can be activated/deactivated.
+ // */
+ // public void testToggleNature() {
+ // ToggleNatureAction.toggleNature(intentProject);
+ //
+ // waitForAllOperationsInUIThread();
+ //
+ // ToggleNatureAction.toggleNature(intentProject);
+ //
+ // waitForAllOperationsInUIThread();
+ //
+ // openIntentEditor();
+ // }
+
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/refresher/RefresherTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/refresher/RefresherTest.java
index cd865ed..3a21260 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/refresher/RefresherTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/refresher/RefresherTest.java
@@ -30,6 +30,14 @@
*/
public class RefresherTest extends AbstractIntentUITest {
+ /**
+ * Ensures that the Intent project refresher is correctly notified and correctly applies changes.
+ *
+ * @throws ReadOnlyException
+ * if test repository cannot be properly accessed
+ * @throws SaveException
+ * if cannot save on repository
+ */
public void testRefreshProblems() throws ReadOnlyException, SaveException {
// Step 1: we initialize an intent project
setUpIntentProject("intentProject", "data/unit/documents/editorupdates/refreshTest.intent", true);
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 90e8421..47cb1eb 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,22 +39,40 @@
*/
public class IntentRepositoryStructurerTest extends AbstractIntentUITest {
+ // Disabling checkstyle because commentting the following constant will not bring any additional info
+ // CHECKSTYLE:OFF
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}";
+ // CHECKSTYLE:ON
+
/**
* Ensures that the internal structure of the Intent Repository is correctly maintained expected (on file
* per Chapter/Section/Modeling Unit, see
@@ -81,8 +99,9 @@
editor.doSave(new NullProgressMonitor());
waitForAllOperationsInUIThread();
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));
+ 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("}"))
@@ -92,8 +111,9 @@
editor.doSave(new NullProgressMonitor());
waitForAllOperationsInUIThread();
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));
+ 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 = "";
@@ -105,8 +125,9 @@
editor.doSave(new NullProgressMonitor());
waitForAllOperationsInUIThread();
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));
+ 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 = "";
@@ -118,7 +139,8 @@
editor.doSave(new NullProgressMonitor());
waitForAllOperationsInUIThread();
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));
+ 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/repository/IntentURITest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/repository/IntentURITest.java
index 636d403..7895e3d 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/repository/IntentURITest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/repository/IntentURITest.java
@@ -35,6 +35,9 @@
@SuppressWarnings("restriction")
public class IntentURITest extends AbstractIntentUITest {
+ /**
+ * Constant used to create assertion failure messages.
+ */
private static final String INVALID_URI_ERROR_MESSAGE = ": this URI is invalid, an error should have been thrown";
/**
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 11fd16f..39ac81c 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
@@ -28,15 +28,29 @@
* @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
*/
public class CompilerNotificationsTest extends AbstractIntentUITest {
-
+ /**
+ * Constant used to create assertion failure messages.
+ */
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";
-
+ /**
+ * Constant specifying test samples location.
+ */
private static final String INTENT_DATA_FOLDER = "data/unit/documents/scenario/compilerNotifications/";
+ /**
+ * Constant used to identify a specific eclass used during test.
+ */
+ private static final String ECLASS_NAME = "c1";
+
+ /**
+ * The current Intent editor.
+ */
private IntentEditor editor;
+ /**
+ * The document associated to the current Intent editor.
+ */
private IntentEditorDocument document;
/**
@@ -57,6 +71,9 @@
waitForAllOperationsInUIThread();
}
+ /**
+ * Ensures that the compiler client is correctly notified when modifying a modeling unit.
+ */
public void testCompilerIsNotifiedWhenModifyingMU() {
// Update Modeling Unit : make it pass
repositoryListener.clearPreviousEntries();
@@ -79,7 +96,10 @@
// waitForCompiler(false);
}
- public void testCompilerIsNotifiedWhenRenamingSections() throws IOException {
+ /**
+ * Ensures that the compiler client is correctly notified when renaming sections.
+ */
+ public void testCompilerIsNotifiedWhenRenamingSections() {
// Renaming the section
repositoryListener.clearPreviousEntries();
document.set(document.get().replace("Section2", "RenamedSection"));
@@ -104,6 +124,12 @@
}
+ /**
+ * Ensures that the compiler client is correctly notified when adding new modeling units.
+ *
+ * @throws IOException
+ * if failing to get test file
+ */
public void testCompilerIsNotifiedWhenAddingNewMUInsideNewSections() throws IOException {
// Create a new modeling unit inside a new section fixing the compile issue
repositoryListener.clearPreviousEntries();
@@ -134,6 +160,9 @@
// waitForCompiler(false);
}
+ /**
+ * Ensures that the compiler client is correctly notified when removing a modeling unit.
+ */
public void testCompilerIsNotifiedWhenRemovingMU() {
// Removing the modeling unit: no issue should be displayed any more
repositoryListener.clearPreviousEntries();
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/ExternalContentReferencesTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/ExternalContentReferencesTest.java
index af9e32d..3012846 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/ExternalContentReferencesTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/ExternalContentReferencesTest.java
@@ -54,26 +54,59 @@
*/
public class ExternalContentReferencesTest extends AbstractIntentUITest {
+ /**
+ * Name of the java class used in this test.
+ */
private static final String EXAMPLE_JAVA_CLASS_NAME = "ExampleJavaClass.java";
+ /**
+ * Path of the java class used in this test.
+ */
private static final String JAVA_EXAMPLE_PACKAGE_PATH = "org.eclipse.mylyn.docs.intent.java.example/src/org/eclipse/myly/docs/intent/java/example/";
+ /**
+ * ID of the first replacement location in the example document.
+ */
private static final String FIRST_LOCATION = "1";
+ /**
+ * Constant use to create assertion failure messages.
+ */
private static final String WORKING_COPY_AND_REPOSITORY_MODEL_SHOULD_BE_EQUALS = "There should be no differences betwen the working copy model and the cache inside Intent repository";
- private static final String INTENT_URI_FOR_TEST_MODEL = "intent:/intentProject/model.ecore";
-
+ /**
+ * Constant use to create assertion failure messages.
+ */
private static final String SYNCHRONIZER_SHOULD_NOT_DETECT_CHANGE_QUICKFIX_MESSAGE = "Synchronizer should not detect any change any more as issue have been resolved using quick-fix";
- private static final String INTENT_DOCUMENT_EXAMPLE_PATH = "data/unit/documents/scenario/externalcontentreferences/external_content.intent";
-
+ /**
+ * Constant use to create assertion failure messages.
+ */
private static final String JAVA_SYNC_ISSUE_PART1 = "The attribute 'content' in Method protectedMethodWithParameters(ExampleJavaClass,Object) has changed.<br/>Documentation : ";
+ /**
+ * Constant use to create assertion failure messages.
+ */
private static final String JAVA_SYNC_ISSUE_PART2 = "<br/>Working Copy : ";
+ /**
+ * Intent URI used in this test.
+ */
+ private static final String INTENT_URI_FOR_TEST_MODEL = "intent:/intentProject/model.ecore";
+
+ /**
+ * Path to test file.
+ */
+ private static final String INTENT_DOCUMENT_EXAMPLE_PATH = "data/unit/documents/scenario/externalcontentreferences/external_content.intent";
+
+ /**
+ * The current Intent editor.
+ */
private IntentEditor editor;
+ /**
+ * The document associated to the current Intent editor.
+ */
private IntentEditorDocument document;
/**
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentAbstractResourceTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentAbstractResourceTest.java
index 31d5042..bb45f8e 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentAbstractResourceTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentAbstractResourceTest.java
@@ -1,199 +1,208 @@
-/*******************************************************************************
- * 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.scenario;
-
-import java.io.IOException;
-
-import junit.framework.AssertionFailedError;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EcoreFactory;
-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.ui.editor.IntentEditor;
-import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditorDocument;
-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.collab.common.location.IntentLocations;
-
-/**
- * <p>
- * Ensures that the Abstract Resource concept works as expected.
- * </p>
- * <b> Relevant specifications </b> :
- * <ul>
- * <li>org.eclipse.mylyn.docs.intent/discussion/specs/abstractResources.textile</li>
- * </ul>
- *
- * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
- */
-public class IntentAbstractResourceTest extends AbstractIntentUITest {
- private static final String INTENT_DOCUMENT_EXAMPLE_PATH = "data/unit/documents/scenario/abstract_resources.intent";
-
- private IntentEditor editor;
-
- private IntentEditorDocument document;
-
- /**
- * {@inheritDoc}
- *
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- // Step 1 : Generic set up
- setUpIntentProject("intentProject", INTENT_DOCUMENT_EXAMPLE_PATH, true);
-
- // Step 2 : open an editor on the root document
- editor = openIntentEditor();
- document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
- }
-
- /**
- * Ensures that abstract resources are not synchronized.
- */
- public void testAbstractResourceIsNotSynchronized() {
- // Step 1 : make a sample modification on modeling units, just to launch the synchronizer
- String documentContent = document.get();
- String expectedDocumentContent = documentContent.replace("myEClass", "myEClass2");
- document.set(expectedDocumentContent);
-
- // Step 2 : we start recording for any modification made on the repository
- repositoryListener.clearPreviousEntries();
- // save
- editor.doSave(new NullProgressMonitor());
- // and wait the synchronizer to be notified
- waitForCompiler();
-
- // Step 3 : we check that no synchronization error has been detected
- assertFalse("An abstract resource should not be handled by the Intent synchronizer",
- AnnotationUtils.hasIntentAnnotation(editor, IntentAnnotationMessageType.SYNC_WARNING, "",
- false));
- // FIXME add this condition
- // waitForCompiler(false);
- }
-
- /**
- * Ensures that even if not synchronized, the abstract resources are correctly compiled.
- */
- public void testAbstractResourceIsCompiled() {
- // Step 1 : make a sample modification on modeling units, just to launch the compiler
- String documentContent = document.get();
- String expectedDocumentContent = documentContent.replace("myEClass", "myEClass2");
- document.set(expectedDocumentContent);
-
- // Step 2 : we start recording for any modification made on the repository
- repositoryListener.clearPreviousEntries();
- // save
- editor.doSave(new NullProgressMonitor());
- // and wait the compiler to be notified
- waitForCompiler();
-
- // Step 3 : we check that the resource has correctly been compiled :
- // => no error should have been found
- assertFalse("The Abstract Resource was not correctly compiled", AnnotationUtils.hasIntentAnnotation(
- editor, IntentAnnotationMessageType.COMPILER_ERROR, "", false));
-
- // => a compiler warning should inform the end-user that the EPackage's URI and prefix are not
- // properly set
- assertTrue("The Abstract Resource was not correctly validated by Intent compiler",
- AnnotationUtils.hasIntentAnnotation(editor, IntentAnnotationMessageType.COMPILER_INFO, "URI",
- false));
- assertTrue("The Abstract Resource was not correctly validated by Intent compiler",
- AnnotationUtils.hasIntentAnnotation(editor, IntentAnnotationMessageType.COMPILER_INFO,
- "prefix", false));
-
- // => a cache of the resource should have been created inside the repository.
- Resource generatedResource = repositoryAdapter
- .getResource(IntentLocations.GENERATED_RESOURCES_FOLDER_PATH + "/abstractResource");
- assertNotNull("The Abstract Resource was not correctly generated by the compiler", generatedResource);
- assertTrue("The Abstract Resource content was not correctly generated by the compiler",
- generatedResource.getContents().iterator().next() instanceof EPackage);
- assertEquals("The Abstract Resource content was not correctly generated by the compiler",
- "myAbstractRoot", ((EPackage)generatedResource.getContents().iterator().next()).getName());
- // FIXME add this condition
- // waitForCompiler(false);
-
- }
-
- /**
- * Ensures that abstract resources are not synchronized.
- */
- public void testAbstractResourceIsSynchronizedWhenBecamingConcrete() {
-
- try {
- // Step 1 : we create a model file inside the intent project
- ResourceSet rs = new ResourceSetImpl();
- URI modelURI = URI.createURI("platform:/resource/" + intentProject.getName() + "/Model.ecore");
-
- Resource modelResource = rs.createResource(modelURI);
- modelResource.getContents().add(EcoreFactory.eINSTANCE.createEPackage());
- modelResource.save(null);
-
- // Step 2 : we make the abstract resource concrete by associating it to the created model URI
- final String resourceURIDeclaration = "\n\t\t\t\t\tURI = \"" + modelURI.toString() + "\";";
-
- String documentContent = document.get();
- String expectedDocumentContent = documentContent.replace("Resource abstractResource {",
- "Resource abstractResource {" + resourceURIDeclaration);
- document.set(expectedDocumentContent);
-
- // Step 3 : we start recording for any modification made on the repository
- repositoryListener.clearPreviousEntries();
- // save
- editor.doSave(new NullProgressMonitor());
- // and wait the synchronizer to be notified
- waitForSynchronizer();
-
- // Step 4 : we check that new synchronization errors have been detected
- assertTrue("A concrete resource should be handled by the Intent synchronizer",
- AnnotationUtils.hasIntentAnnotation(editor, IntentAnnotationMessageType.SYNC_WARNING, "",
- false));
-
- // Step 5 : we make this concrete resource abstract again
- document.set(document.get().replace(resourceURIDeclaration, ""));
-
- repositoryListener.clearPreviousEntries();
- editor.doSave(new NullProgressMonitor());
- waitForSynchronizer();
-
- // Step 6 : we check that no synchronization errors has been detected
- assertFalse("An abstract resource should not be handled by the Intent synchronizer",
- AnnotationUtils.hasIntentAnnotation(editor, IntentAnnotationMessageType.SYNC_WARNING, "",
- false));
-
- } catch (IOException e) {
- AssertionFailedError assertFailed = new AssertionFailedError(
- "Unexpected exception when creating model file : " + e.getMessage());
- assertFailed.setStackTrace(e.getStackTrace());
- throw assertFailed;
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see junit.framework.TestCase#tearDown()
- */
- @Override
- protected void tearDown() throws Exception {
- if (editor != null) {
- editor.close(false);
- }
- super.tearDown();
- }
-}
+/*******************************************************************************
+ * 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.scenario;
+
+import java.io.IOException;
+
+import junit.framework.AssertionFailedError;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcoreFactory;
+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.ui.editor.IntentEditor;
+import org.eclipse.mylyn.docs.intent.client.ui.editor.IntentEditorDocument;
+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.collab.common.location.IntentLocations;
+
+/**
+ * <p>
+ * Ensures that the Abstract Resource concept works as expected.
+ * </p>
+ * <b> Relevant specifications </b> :
+ * <ul>
+ * <li>org.eclipse.mylyn.docs.intent/discussion/specs/abstractResources.textile</li>
+ * </ul>
+ *
+ * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
+ */
+public class IntentAbstractResourceTest extends AbstractIntentUITest {
+ /**
+ * Path to test file.
+ */
+ private static final String INTENT_DOCUMENT_EXAMPLE_PATH = "data/unit/documents/scenario/abstract_resources.intent";
+
+ /**
+ * The current Intent editor.
+ */
+ private IntentEditor editor;
+
+ /**
+ * The document associated to the current Intent editor.
+ */
+ private IntentEditorDocument document;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Step 1 : Generic set up
+ setUpIntentProject("intentProject", INTENT_DOCUMENT_EXAMPLE_PATH, true);
+
+ // Step 2 : open an editor on the root document
+ editor = openIntentEditor();
+ document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
+ }
+
+ /**
+ * Ensures that abstract resources are not synchronized.
+ */
+ public void testAbstractResourceIsNotSynchronized() {
+ // Step 1 : make a sample modification on modeling units, just to launch the synchronizer
+ String documentContent = document.get();
+ String expectedDocumentContent = documentContent.replace("myEClass", "myEClass2");
+ document.set(expectedDocumentContent);
+
+ // Step 2 : we start recording for any modification made on the repository
+ repositoryListener.clearPreviousEntries();
+ // save
+ editor.doSave(new NullProgressMonitor());
+ // and wait the synchronizer to be notified
+ waitForCompiler();
+
+ // Step 3 : we check that no synchronization error has been detected
+ assertFalse("An abstract resource should not be handled by the Intent synchronizer",
+ AnnotationUtils.hasIntentAnnotation(editor, IntentAnnotationMessageType.SYNC_WARNING, "",
+ false));
+ // FIXME add this condition
+ // waitForCompiler(false);
+ }
+
+ /**
+ * Ensures that even if not synchronized, the abstract resources are correctly compiled.
+ */
+ public void testAbstractResourceIsCompiled() {
+ // Step 1 : make a sample modification on modeling units, just to launch the compiler
+ String documentContent = document.get();
+ String expectedDocumentContent = documentContent.replace("myEClass", "myEClass2");
+ document.set(expectedDocumentContent);
+
+ // Step 2 : we start recording for any modification made on the repository
+ repositoryListener.clearPreviousEntries();
+ // save
+ editor.doSave(new NullProgressMonitor());
+ // and wait the compiler to be notified
+ waitForCompiler();
+
+ // Step 3 : we check that the resource has correctly been compiled :
+ // => no error should have been found
+ assertFalse("The Abstract Resource was not correctly compiled", AnnotationUtils.hasIntentAnnotation(
+ editor, IntentAnnotationMessageType.COMPILER_ERROR, "", false));
+
+ // => a compiler warning should inform the end-user that the EPackage's URI and prefix are not
+ // properly set
+ assertTrue("The Abstract Resource was not correctly validated by Intent compiler",
+ AnnotationUtils.hasIntentAnnotation(editor, IntentAnnotationMessageType.COMPILER_INFO, "URI",
+ false));
+ assertTrue("The Abstract Resource was not correctly validated by Intent compiler",
+ AnnotationUtils.hasIntentAnnotation(editor, IntentAnnotationMessageType.COMPILER_INFO,
+ "prefix", false));
+
+ // => a cache of the resource should have been created inside the repository.
+ Resource generatedResource = repositoryAdapter
+ .getResource(IntentLocations.GENERATED_RESOURCES_FOLDER_PATH + "/abstractResource");
+ assertNotNull("The Abstract Resource was not correctly generated by the compiler", generatedResource);
+ assertTrue("The Abstract Resource content was not correctly generated by the compiler",
+ generatedResource.getContents().iterator().next() instanceof EPackage);
+ assertEquals("The Abstract Resource content was not correctly generated by the compiler",
+ "myAbstractRoot", ((EPackage)generatedResource.getContents().iterator().next()).getName());
+ // FIXME add this condition
+ // waitForCompiler(false);
+
+ }
+
+ /**
+ * Ensures that abstract resources are not synchronized.
+ */
+ public void testAbstractResourceIsSynchronizedWhenBecamingConcrete() {
+
+ try {
+ // Step 1 : we create a model file inside the intent project
+ ResourceSet rs = new ResourceSetImpl();
+ URI modelURI = URI.createURI("platform:/resource/" + intentProject.getName() + "/Model.ecore");
+
+ Resource modelResource = rs.createResource(modelURI);
+ modelResource.getContents().add(EcoreFactory.eINSTANCE.createEPackage());
+ modelResource.save(null);
+
+ // Step 2 : we make the abstract resource concrete by associating it to the created model URI
+ final String resourceURIDeclaration = "\n\t\t\t\t\tURI = \"" + modelURI.toString() + "\";";
+
+ String documentContent = document.get();
+ String expectedDocumentContent = documentContent.replace("Resource abstractResource {",
+ "Resource abstractResource {" + resourceURIDeclaration);
+ document.set(expectedDocumentContent);
+
+ // Step 3 : we start recording for any modification made on the repository
+ repositoryListener.clearPreviousEntries();
+ // save
+ editor.doSave(new NullProgressMonitor());
+ // and wait the synchronizer to be notified
+ waitForSynchronizer();
+
+ // Step 4 : we check that new synchronization errors have been detected
+ assertTrue("A concrete resource should be handled by the Intent synchronizer",
+ AnnotationUtils.hasIntentAnnotation(editor, IntentAnnotationMessageType.SYNC_WARNING, "",
+ false));
+
+ // Step 5 : we make this concrete resource abstract again
+ document.set(document.get().replace(resourceURIDeclaration, ""));
+
+ repositoryListener.clearPreviousEntries();
+ editor.doSave(new NullProgressMonitor());
+ waitForSynchronizer();
+
+ // Step 6 : we check that no synchronization errors has been detected
+ assertFalse("An abstract resource should not be handled by the Intent synchronizer",
+ AnnotationUtils.hasIntentAnnotation(editor, IntentAnnotationMessageType.SYNC_WARNING, "",
+ false));
+
+ } catch (IOException e) {
+ AssertionFailedError assertFailed = new AssertionFailedError(
+ "Unexpected exception when creating model file : " + e.getMessage());
+ assertFailed.setStackTrace(e.getStackTrace());
+ throw assertFailed;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see junit.framework.TestCase#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ if (editor != null) {
+ editor.close(false);
+ }
+ super.tearDown();
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentDocumentationUpdateDoesNotCauseResolvingIssuesTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentDocumentationUpdateDoesNotCauseResolvingIssuesTest.java
index 3d2c57d..90d85c4 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentDocumentationUpdateDoesNotCauseResolvingIssuesTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentDocumentationUpdateDoesNotCauseResolvingIssuesTest.java
@@ -35,10 +35,19 @@
* @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
*/
public class IntentDocumentationUpdateDoesNotCauseResolvingIssuesTest extends AbstractIntentUITest {
+ /**
+ * Path to test file.
+ */
private static final String INTENT_DOC_PATH = "data/unit/documents/empty.intent";
+ /**
+ * The current Intent editor.
+ */
private IntentEditor editor;
+ /**
+ * The document associated to the current Intent editor.
+ */
private IntentEditorDocument document;
/**
@@ -58,6 +67,10 @@
document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
}
+ /**
+ * Ensures that making modifications on the document cannot lead to errors during calls to
+ * ECoreUtils.resolve().
+ */
public void testSimpleModifications() {
document.set("Document {\n\tChapter Title {\n\t\tText\n\n\t\tSection Title {\n\t\t\tText\n\t\t}\n\t}\n\tChapter Title {\n\t\tText\n\t}\n}");
editor.doSave(new NullProgressMonitor());
@@ -68,6 +81,13 @@
waitForAllOperationsInUIThread();
}
+ /**
+ * Ensures that renaming sections of the document cannot lead to errors during calls to
+ * ECoreUtils.resolve().
+ *
+ * @throws IOException
+ * if test file cannot be accessed
+ */
public void testSectionRenaming() throws IOException {
String intialContent = FileToStringConverter.getFileAsString(new File(
"data/unit/documents/scenario/documentUpdate/documentUpdate01.intent"));
@@ -82,6 +102,13 @@
waitForAllOperationsInUIThread();
}
+ /**
+ * Ensures that renaming sections of the document cannot lead to errors during calls to
+ * ECoreUtils.resolve().
+ *
+ * @throws IOException
+ * if test file cannot be accessed
+ */
public void testMultipleContainmentSectionRenaming() throws IOException {
String intialContent = FileToStringConverter.getFileAsString(new File(
"data/unit/documents/scenario/documentUpdate/multipleContainmentSection.intent"));
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentProjectReopeningTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentProjectReopeningTest.java
index 945beec..6a21cde 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentProjectReopeningTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/IntentProjectReopeningTest.java
@@ -11,6 +11,7 @@
package org.eclipse.mylyn.docs.intent.client.ui.test.unit.scenario;
import java.io.File;
+import java.io.IOException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -36,11 +37,19 @@
* @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
*/
public class IntentProjectReopeningTest extends AbstractIntentUITest {
-
+ /**
+ * Path to test file.
+ */
private static final String DOCUMENTS_FOLDER_PATH = "data/unit/documents/scenario/projectReopening/";
+ /**
+ * The current Intent editor.
+ */
private IntentEditor editor;
+ /**
+ * The document associated to the current Intent editor.
+ */
private IntentEditorDocument document;
/**
@@ -60,20 +69,47 @@
document = (IntentEditorDocument)editor.getDocumentProvider().getDocument(editor.getEditorInput());
}
- public void testProjectReopeningWithSection() throws Exception {
+ /**
+ * Ensures that when reopening Intent projects after modifications, there are no lost of contents.
+ *
+ * @throws CoreException
+ * if major issue occur during project reopening
+ * @throws IOException
+ * if test file cannot be accessed
+ */
+ public void testProjectReopeningWithSection() throws IOException, CoreException {
String initalContent = FileToStringConverter.getFileAsString(new File(DOCUMENTS_FOLDER_PATH
+ "projectReopening01.intent"));
String newContent = initalContent.replace("Title", "A");
doTestProjectReopening(initalContent, newContent);
}
- public void testProjectReopeningWithModelingUnitCreation() throws Exception {
+ /**
+ * Ensures that when reopening Intent projects after modifications, there are no lost of contents.
+ *
+ * @throws CoreException
+ * if major issue occur during project reopening
+ * @throws IOException
+ * if test file cannot be accessed
+ */
+ public void testProjectReopeningWithModelingUnitCreation() throws IOException, CoreException {
String initalContent = FileToStringConverter.getFileAsString(new File(DOCUMENTS_FOLDER_PATH
+ "projectReopening02.intent"));
String newContent = initalContent.replace("Title", "A");
doTestProjectReopening(initalContent, newContent);
}
+ /**
+ * Ensures that setting the new content, and then reopening the intent project does not cause any loss of
+ * content.
+ *
+ * @param initalContent
+ * the initial document content
+ * @param newContent
+ * the new document content to set before reopening the project
+ * @throws CoreException
+ * if major issue occur during project reopening
+ */
protected void doTestProjectReopening(String initalContent, String newContent) throws CoreException {
document.set(initalContent);
editor.doSave(new NullProgressMonitor());
@@ -90,6 +126,13 @@
new IntentSerializer().serialize(newDocument));
}
+ /**
+ * Closes and reopens the Intent project, and return the {@link IntentDocument} once project is reopened.
+ *
+ * @return the {@link IntentDocument} once project is reopened
+ * @throws CoreException
+ * if major issue occur during project reopening
+ */
private IntentDocument reopenProjectAndGetDocument() throws CoreException {
editor.doSave(new NullProgressMonitor());
ToggleNatureAction.toggleNature(intentProject);
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/MultipleReplacementInEditorTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/MultipleReplacementInEditorTest.java
index 4bcefd3..987f898 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/MultipleReplacementInEditorTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/scenario/MultipleReplacementInEditorTest.java
@@ -30,12 +30,24 @@
*/
public class MultipleReplacementInEditorTest extends AbstractIntentUITest {
+ /**
+ * Path to test file.
+ */
private static final String INTENT_SMALL_DOC_PATH = "data/unit/documents/scenario/abstract_resources.intent";
+ /**
+ * Path to test file.
+ */
private static final String INTENT_BIG_DOC_PATH = "data/unit/documents/editorupdates/compareTest-03.intent";
+ /**
+ * The current Intent editor.
+ */
private IntentEditor editor;
+ /**
+ * The document associated to the current Intent editor.
+ */
private IntentEditorDocument document;
/**
@@ -59,8 +71,9 @@
* Ensures that pasting several times content inside the document does not cause any issue.
*
* @throws IOException
+ * if test file cannot be properly accessed
*/
- public void testCopyPastBigDocuments() throws IOException {
+ public void testCopyPasteBigDocuments() throws IOException {
String smallDocumentContent = FileToStringConverter.getFileAsString(new File(INTENT_SMALL_DOC_PATH));
String bigDocumentContent = FileToStringConverter.getFileAsString(new File(INTENT_BIG_DOC_PATH));
@@ -118,6 +131,7 @@
* not cause any issue.
*
* @throws IOException
+ * if test file cannot be properly accessed
*/
public void testCopyPastAndEmptyDocuments() throws IOException {
String smallDocumentContent = FileToStringConverter.getFileAsString(new File(INTENT_SMALL_DOC_PATH));
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/synchronizer/SynchronizerTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/synchronizer/SynchronizerTest.java
index dbd47fc..858580a 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/synchronizer/SynchronizerTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/synchronizer/SynchronizerTest.java
@@ -27,10 +27,19 @@
*/
public class SynchronizerTest extends AbstractZipBasedTest {
+ /**
+ * The current intent editor.
+ */
protected IntentEditor editor;
+ /**
+ * The document associated to the current intent editor.
+ */
protected IntentEditorDocument document;
+ /**
+ * Cache on the markers associated to the intent project.
+ */
private IMarker[] markers;
/**
@@ -95,6 +104,7 @@
* @param length
* the sync warning length in the document
* @throws CoreException
+ * if issue occur while getting markers
*/
private void assertMessageExists(String message, int offset, int length) throws CoreException {
boolean found = false;
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/AbstractUpdateTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/AbstractUpdateTest.java
index aeaa075..2e3a620 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/AbstractUpdateTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/AbstractUpdateTest.java
@@ -27,14 +27,25 @@
*
* @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
*/
-public class AbstractUpdateTest extends AbstractZipBasedTest {
+public abstract class AbstractUpdateTest extends AbstractZipBasedTest {
+ /**
+ * The currently opened intent editor.
+ */
protected IntentEditor editor;
+ /**
+ * The document associated to the currently opened intent editor.
+ */
protected IntentEditorDocument document;
/**
* Constructor.
+ *
+ * @param intentProjectArchivePath
+ * path of the archive file
+ * @param intentProjectName
+ * the intent project name
*/
public AbstractUpdateTest(String intentProjectArchivePath, String intentProjectName) {
super(intentProjectArchivePath, intentProjectName);
@@ -53,19 +64,21 @@
}
/**
- * Checks whether the doc is valid or not.
+ * Ensures that the current document is equal to the file located at the given path.
*
+ * @param expectedDocPath
+ * the path of the file containing the expected document
* @throws IOException
* the the final document cannot be read.
*/
- protected void checkDocumentValidity(String finalDocPath) throws IOException {
+ protected void checkDocumentValidity(String expectedDocPath) throws IOException {
// check that the document is valid
List<IntentAnnotation> annotations = AnnotationUtils.getIntentAnnotations(editor,
IntentAnnotationMessageType.SYNC_WARNING);
if (!annotations.isEmpty()) {
AnnotationUtils.displayAnnotations(editor);
}
- assertEquals(FileToStringConverter.getFileAsString(new File(finalDocPath)), document.get());
+ assertEquals(FileToStringConverter.getFileAsString(new File(expectedDocPath)), document.get());
assertTrue(annotations.isEmpty());
}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/DragAndDropTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/DragAndDropTest.java
index e92234e..30b6f25 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/DragAndDropTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/DragAndDropTest.java
@@ -28,10 +28,19 @@
*/
public class DragAndDropTest extends AbstractUpdateTest {
+ /**
+ * Location of the test archive.
+ */
private static final String INTENT_PROJECT_ARCHIVE = "data/unit/documents/dragdrop/dragdrop.zip";
+ /**
+ * Location of the file containing the expected state of the document.
+ */
private static final String FINAL_INTENT_DOC = "data/unit/documents/dragdrop/final.intent";
+ /**
+ * The modeling unit in which content will be droped.
+ */
private ModelingUnit modelingUnit;
/**
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/QuickFixTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/QuickFixTest.java
index 754af49..5f63ac6 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/QuickFixTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/update/QuickFixTest.java
@@ -22,11 +22,19 @@
* @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
*/
public class QuickFixTest extends AbstractUpdateTest {
-
+ /**
+ * Location of the test archive.
+ */
private static final String INTENT_PROJECT_ARCHIVE = "data/unit/documents/quickfixes/quickfixes.zip";
+ /**
+ * Location of the file containing the expected state of the document.
+ */
private static final String FINAL_INTENT_DOC = "data/unit/documents/quickfixes/final.intent";
+ /**
+ * Location of the file containing the expected state of the document.
+ */
private static final String MODIFIED_INTENT_DOC = "data/unit/documents/quickfixes/modifications.intent";
/**
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 ed31b9a..48392e0 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
@@ -63,22 +63,51 @@
* @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
*/
public abstract class AbstractIntentUITest extends TestCase implements ILogListener {
+
+ /**
+ * Id of the new Intent Project wizard.
+ */
public static final String INTENT_NEW_PROJECT_WIZARD_ID = "org.eclipse.mylyn.docs.intent.client.ui.ide.wizards.NewIntentProjectWizard";
+ /**
+ * Path of a file containing an empty Itnent document.
+ */
protected static final String INTENT_EMPTY_DOC_PATH = "data/unit/documents/empty.intent";
+ /**
+ * While waiting for a client to be notified, indicates the time to wait before testing again.
+ */
private static final int WAITING_DELAY_MILLIS = 500;
+ /**
+ * The tested Intent {@link IProject}.
+ */
protected IProject intentProject;
+ /**
+ * The tested Intent {@link Repository}.
+ */
protected Repository repository;
+ /**
+ * A {@link RepositoryAdapter} opened on the tested Repository.
+ */
protected RepositoryAdapter repositoryAdapter;
+ /**
+ * A repository listener allowing to determine wether Intent clients (compiler, synchronizer...) have been
+ * notified or not.
+ */
protected RepositoryListenerForTests repositoryListener;
+ /**
+ * The tested {@link IntentDocument}.
+ */
private IntentDocument intentDocument;
+ /**
+ * All the currently opened {@link IntentEditor}s.
+ */
private List<IntentEditor> openedEditors;
/**
@@ -122,16 +151,6 @@
assertNotNull(IntentNature.class);
}
- private void traceHeapSize() {
- long maxHeapSize = Runtime.getRuntime().maxMemory();
- long allocatedHeapSize = Runtime.getRuntime().totalMemory();
- long usedHeap = allocatedHeapSize - Runtime.getRuntime().freeMemory();
-
- System.out.println(" Heap size : " + usedHeap + "/" + allocatedHeapSize + "("
- + Math.ceil(usedHeap * 100 / allocatedHeapSize) + "% - "
- + Math.ceil(usedHeap * 100 / maxHeapSize) + "% of max heap size)");
- }
-
/**
* {@inheritDoc}
*
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/AbstractZipBasedTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/AbstractZipBasedTest.java
index 5b812dc..967a44c 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/AbstractZipBasedTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/AbstractZipBasedTest.java
@@ -28,16 +28,29 @@
*/
public abstract class AbstractZipBasedTest extends AbstractIntentUITest {
+ /**
+ * Test plugin ID.
+ */
private static final String BUNDLE_NAME = "org.eclipse.mylyn.docs.intent.client.ui.test";
- private static final int TIME_TO_WAIT = 300;
+ /**
+ * Time to wait before checking again the nature of an {@link org.eclipse.core.resources.IProject}.
+ */
+ private static final int TIME_TO_WAIT_FOR_NATURE = 300;
- private static final int RECENT_COMPILATION_DELAY = 60000;
+ /**
+ * Timeout after which a project should be considered as not having the Intent nature.
+ */
+ private static final long TIME_OUT_NATURE_DELAY = 60000;
- private static final long TIME_OUT_DELAY = 60000;
-
+ /**
+ * Location of the archive file.
+ */
private String location;
+ /**
+ * Intent project name.
+ */
private String projectName;
/**
@@ -88,13 +101,24 @@
waitForSynchronizer();
}
+ /**
+ * Waits for the intent project to have the Intent nature.
+ *
+ * @return true if the intent project has the Intent nature, false otherwise
+ * @throws RepositoryConnectionException
+ * if repository cannot be properly accessed
+ * @throws CoreException
+ * if issues occur while getting project natures
+ * @throws InterruptedException
+ * if cannot make the thread sleep
+ */
private boolean waitForNature() throws RepositoryConnectionException, CoreException, InterruptedException {
boolean timeOutDetected = false;
long startTime = System.currentTimeMillis();
// while the project does not have the correct nature or is unaccessible, the repository is null
while (!intentProject.hasNature(IntentNature.NATURE_ID) && !timeOutDetected) {
- timeOutDetected = System.currentTimeMillis() - startTime > TIME_OUT_DELAY;
- Thread.sleep(TIME_TO_WAIT);
+ timeOutDetected = System.currentTimeMillis() - startTime > TIME_OUT_NATURE_DELAY;
+ Thread.sleep(TIME_TO_WAIT_FOR_NATURE);
}
return timeOutDetected;
}
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/RepositoryListenerForTests.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/RepositoryListenerForTests.java
index 87b314f..1c1d35d 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/RepositoryListenerForTests.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/RepositoryListenerForTests.java
@@ -136,6 +136,14 @@
}
}
+ /**
+ * Indicates if this listener has received a message from the client with the given identifier.
+ *
+ * @param clientIdentifier
+ * the client identifier
+ * @return true if this listener has received a message from the client with the given identifier, false
+ * otherwise
+ */
private boolean hasReceivedMessage(String clientIdentifier) {
boolean hasReceivedMessage = !clientsMessages.get(clientIdentifier).isEmpty();
if (hasReceivedMessage) {
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/WorkspaceUtils.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/WorkspaceUtils.java
index a230b33..079e04f 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/WorkspaceUtils.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/util/WorkspaceUtils.java
@@ -48,6 +48,9 @@
*/
public final class WorkspaceUtils {
+ /**
+ * Constant for slashes.
+ */
private static final String SLASH = "/";
/**
@@ -79,7 +82,8 @@
* the project name
* @param monitor
* the progress monitor
- * @param && createaAndOpenProject indicates whether project should be create and opened
+ * @param createaAndOpenProject
+ * indicates whether project should be create and opened
* @return the newly created project or the existing one if present
* @throws CoreException
* if there is an issue creating the project
@@ -110,6 +114,7 @@
* if there is an issue copying a file from the zip
* @throws CoreException
* if there is an issue creating one of the projects
+ * @return all the unziped projects
*/
public static Collection<IProject> unzipAllProjects(String bundleName, String zipLocation,
IProgressMonitor monitor) throws IOException, CoreException {
diff --git a/tests/org.eclipse.mylyn.docs.intent.collab.test/src/org/eclipse/mylyn/docs/intent/collab/test/AbstractRepositoryTest.java b/tests/org.eclipse.mylyn.docs.intent.collab.test/src/org/eclipse/mylyn/docs/intent/collab/test/AbstractRepositoryTest.java
index 22e26f0..80bbe5b 100644
--- a/tests/org.eclipse.mylyn.docs.intent.collab.test/src/org/eclipse/mylyn/docs/intent/collab/test/AbstractRepositoryTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.collab.test/src/org/eclipse/mylyn/docs/intent/collab/test/AbstractRepositoryTest.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.mylyn.docs.intent.collab.test;
-import junit.framework.Assert;
import junit.framework.TestCase;
import org.eclipse.emf.ecore.resource.Resource;
@@ -166,7 +165,7 @@
currentTime = System.currentTimeMillis();
}
// If no notification has been received, receivedNotification is equals to null
- Assert.assertTrue(expectedResult.isNotificationConformToExpected(receivedNotification));
+ assertTrue(expectedResult.isNotificationConformToExpected(receivedNotification));
receivedNotification = null;
}
diff --git a/tests/org.eclipse.mylyn.docs.intent.collab.test/src/org/eclipse/mylyn/docs/intent/collab/test/ide/WorkspaceSessionAndFileEvents.java b/tests/org.eclipse.mylyn.docs.intent.collab.test/src/org/eclipse/mylyn/docs/intent/collab/test/ide/WorkspaceSessionAndFileEvents.java
index 5cc08a6..e0349ae 100644
--- a/tests/org.eclipse.mylyn.docs.intent.collab.test/src/org/eclipse/mylyn/docs/intent/collab/test/ide/WorkspaceSessionAndFileEvents.java
+++ b/tests/org.eclipse.mylyn.docs.intent.collab.test/src/org/eclipse/mylyn/docs/intent/collab/test/ide/WorkspaceSessionAndFileEvents.java
@@ -13,8 +13,6 @@
import java.io.IOException;
import java.util.LinkedHashSet;
-import junit.framework.Assert;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -88,7 +86,7 @@
} catch (IOException e) {
// If you get an assertion error here, it means that the resource cannot been get as a string
// The cause can be an invalid URI, or a charset problem.
- Assert.assertTrue(false);
+ fail(e.getMessage());
}
// We construct the expected version of the element
@@ -145,7 +143,7 @@
} catch (IOException e) {
// If you get an assertion error here, it means that the resource cannot been get as a string
// The cause can be an invalid URI, or a charset problem.
- Assert.assertTrue(false);
+ fail(e.getMessage());
}
// We finally ensure the type listening client is notified (or not) as expected
diff --git a/tests/org.eclipse.mylyn.docs.intent.markup.test/src/org/eclipse/mylyn/docs/intent/markup/test/unit/parsing/TestParsingTextual.java b/tests/org.eclipse.mylyn.docs.intent.markup.test/src/org/eclipse/mylyn/docs/intent/markup/test/unit/parsing/TestParsingTextual.java
index b5bf68b..ec04562 100644
--- a/tests/org.eclipse.mylyn.docs.intent.markup.test/src/org/eclipse/mylyn/docs/intent/markup/test/unit/parsing/TestParsingTextual.java
+++ b/tests/org.eclipse.mylyn.docs.intent.markup.test/src/org/eclipse/mylyn/docs/intent/markup/test/unit/parsing/TestParsingTextual.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.mylyn.docs.intent.markup.test.unit.parsing;
+//CHECKSTYLE:OFF
+import static org.junit.Assert.assertEquals;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -18,8 +21,6 @@
import java.util.HashMap;
import java.util.Map;
-import junit.framework.Assert;
-
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xmi.XMLResource;
@@ -29,6 +30,7 @@
import org.eclipse.mylyn.docs.intent.markup.test.utils.XMISaver;
import org.junit.Test;
+//CHECKSTYLE:ON
/**
* Test textual parsing.
*
@@ -105,8 +107,8 @@
// We ensure that the 2 files are equals,
// and that these files are also equals to the resource's serialisation.
- Assert.assertEquals(expected, actual);
- Assert.assertEquals(expected, fromResource);
+ assertEquals(expected, actual);
+ assertEquals(expected, fromResource);
}
diff --git a/tests/org.eclipse.mylyn.docs.intent.markup.test/src/org/eclipse/mylyn/docs/intent/markup/test/unit/parsing/TestSpecificElements.java b/tests/org.eclipse.mylyn.docs.intent.markup.test/src/org/eclipse/mylyn/docs/intent/markup/test/unit/parsing/TestSpecificElements.java
index b40e6cc..e03b1f0 100644
--- a/tests/org.eclipse.mylyn.docs.intent.markup.test/src/org/eclipse/mylyn/docs/intent/markup/test/unit/parsing/TestSpecificElements.java
+++ b/tests/org.eclipse.mylyn.docs.intent.markup.test/src/org/eclipse/mylyn/docs/intent/markup/test/unit/parsing/TestSpecificElements.java
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.mylyn.docs.intent.markup.test.unit.parsing;
-import junit.framework.Assert;
+//CHECKSTYLE:OFF
+import static org.junit.Assert.assertEquals;
import org.junit.Test;
+//CHECKSTYLE:ON
/**
* Test specific elements.
*
@@ -35,7 +37,7 @@
expected += "And this one also";
expected += "\n\n";
expected += "{toc}\n";
- Assert.assertEquals(expected, actual);
+ assertEquals(expected, actual);
}
@@ -50,6 +52,6 @@
String expected = result[0];
expected = expected.replace("<br/>", "\n");
- Assert.assertEquals(expected, actual);
+ assertEquals(expected, actual);
}
}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/.project b/tests/org.eclipse.mylyn.docs.intent.parser.test/.project
index 388c68a..2d84a11 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/.project
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/.project
@@ -25,10 +25,16 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
</natures>
</projectDescription>
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/about.html b/tests/org.eclipse.mylyn.docs.intent.parser.test/about.html
index 34ab520..670d108 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/about.html
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/about.html
@@ -1,106 +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 "CONTENT"). 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
- ("EPL"). 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, "Program" 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 ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</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 ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</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 "features". Within a Feature, files named "feature.xml" 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 ("Included Features"). Within a Feature, files named "feature.xml" 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 "about.html" ("Abouts"). The terms and conditions governing Features and
-Included Features should be contained in files named "license.html" ("Feature Licenses"). 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 "src" 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 ("Feature Update License") 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 "license" property of files named "feature.properties" 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 ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or
- other materials (collectively "Installable Software"). 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>
- ("Specification").</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 ("Provisioning Process") in which a user may execute the Provisioning Technology
- on a machine ("Target Machine") 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 ("Installable Software Agreement") 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>
+<!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 "CONTENT"). 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
+ ("EPL"). 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, "Program" 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 ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</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 ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</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 "features". Within a Feature, files named "feature.xml" 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 ("Included Features"). Within a Feature, files named "feature.xml" 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 "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses"). 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 "src" 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 ("Feature Update License") 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 "license" property of files named "feature.properties" 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 ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively "Installable Software"). 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>
+ ("Specification").</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 ("Provisioning Process") in which a user may execute the Provisioning Technology
+ on a machine ("Target Machine") 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 ("Installable Software Agreement") 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.parser.test/dataTests/intentDocuments/errors/contribution.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/contribution.intent
index 423445b..d130d98 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/contribution.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/contribution.intent
@@ -1,42 +1,42 @@
-Document {
- Chapter {
- Section Merge {
- Merging models.
-
- @M umlStorageDefinition
- Resource umlResource {
- URI = "platform:/resource/rmTest/generated/uml.ecore";
- contentType = "ECore";
- content += uml;
- }
- M@
-
- We then define the stored EPackage, which will be the root of our metamodel :
- @M umlPackage_definition
- new EPackage uml {
- nsURI = "http://www.eclipse.org/uml2/3.0.0/UML";
- nsPrefix = "uml";
- }
- M@
-
- @M CommentDefinition
- uml {
- eClassifiers += new EClass Comment {
- eStructuralFeatures += new EAttribute {
- name = "body";
- eType = String;
- changeable = "true";
- unsettable = "true";
- };
- eStructuralFeatures += new EReference {
- name = "annotatedElement";
- eType = Element;
- upperBound = "-1";
- changeable = "true";
- };
- eSuperTypes += Element;
- };
- M@
- }
- }
-}
+Document {
+ Chapter {
+ Section Merge {
+ Merging models.
+
+ @M umlStorageDefinition
+ Resource umlResource {
+ URI = "platform:/resource/rmTest/generated/uml.ecore";
+ contentType = "ECore";
+ content += uml;
+ }
+ M@
+
+ We then define the stored EPackage, which will be the root of our metamodel :
+ @M umlPackage_definition
+ new EPackage uml {
+ nsURI = "http://www.eclipse.org/uml2/3.0.0/UML";
+ nsPrefix = "uml";
+ }
+ M@
+
+ @M CommentDefinition
+ uml {
+ eClassifiers += new EClass Comment {
+ eStructuralFeatures += new EAttribute {
+ name = "body";
+ eType = String;
+ changeable = "true";
+ unsettable = "true";
+ };
+ eStructuralFeatures += new EReference {
+ name = "annotatedElement";
+ eType = Element;
+ upperBound = "-1";
+ changeable = "true";
+ };
+ eSuperTypes += Element;
+ };
+ M@
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/instanciation.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/instanciation.intent
index 6d67231..fd0f586 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/instanciation.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/instanciation.intent
@@ -1,23 +1,23 @@
-Document {
- Chapter {
- Section Merge {
- Merging models.
-
- @M umlStorageDefinition
- Resource umlResource {
- URI = "platform:/resource/rmTest/generated/uml.ecore";
- contentType = "ECore";
- content += uml;
- }
- M@
-
- We then define the stored EPackage, which will be the root of our metamodel :
- @M umlPackage_definition
- new EPackage uml {
- nsURI = "http://www.eclipse.org/uml2/3.0.0/UML";
- nsPrefix = "uml";
- M@
-
- }
- }
-}
+Document {
+ Chapter {
+ Section Merge {
+ Merging models.
+
+ @M umlStorageDefinition
+ Resource umlResource {
+ URI = "platform:/resource/rmTest/generated/uml.ecore";
+ contentType = "ECore";
+ content += uml;
+ }
+ M@
+
+ We then define the stored EPackage, which will be the root of our metamodel :
+ @M umlPackage_definition
+ new EPackage uml {
+ nsURI = "http://www.eclipse.org/uml2/3.0.0/UML";
+ nsPrefix = "uml";
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/multiple_affectation.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/multiple_affectation.intent
index 487e37a..c72be34 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/multiple_affectation.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/multiple_affectation.intent
@@ -1,16 +1,16 @@
-Document {
- Chapter {
- Section Merge {
- Merging models.
-
- @M umlStorageDefinition
- Resource umlResource {
- URI = "platform:/resource/rmTest/generated/uml.ecore";
- contentType = "ECore";
- content += uml
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter {
+ Section Merge {
+ Merging models.
+
+ @M umlStorageDefinition
+ Resource umlResource {
+ URI = "platform:/resource/rmTest/generated/uml.ecore";
+ contentType = "ECore";
+ content += uml
+ }
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/newlines.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/newlines.intent
index b56b9d0..7271065 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/newlines.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/newlines.intent
@@ -1,13 +1,13 @@
-Document {
-Chapter Chapitre 1
- {
- Text
-
-
-}
-Chapter Chapitre 2
- {
- Text
-}
-
+Document {
+Chapter Chapitre 1
+ {
+ Text
+
+
+}
+Chapter Chapitre 2
+ {
+ Text
+}
+
}
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/operator.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/operator.intent
index 6b19386..4c3d61f 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/operator.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/operator.intent
@@ -1,14 +1,14 @@
-Document {
- Chapter {
- Section Merge {
- Merging models.
-
- @M
- Resource r {
- URI *= "platform:/resource/intent/My.ecore";
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter {
+ Section Merge {
+ Merging models.
+
+ @M
+ Resource r {
+ URI *= "platform:/resource/intent/My.ecore";
+ }
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/property.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/property.intent
index fa49a08..9714486 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/property.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/property.intent
@@ -1,14 +1,14 @@
-Document {
- Chapter {
- Section Merge {
- Merging models.
-
- @M
- Resource r {
- URdI = "platform:/resource/intent/My.ecore";
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter {
+ Section Merge {
+ Merging models.
+
+ @M
+ Resource r {
+ URdI = "platform:/resource/intent/My.ecore";
+ }
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/resource.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/resource.intent
index 2f0272d..aac9899 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/resource.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/resource.intent
@@ -1,14 +1,14 @@
-Document {
- Chapter {
- Section Merge {
- Merging models.
-
- @M
- Resdource r {
- URI = "platform:/resource/intent/My.ecore";
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter {
+ Section Merge {
+ Merging models.
+
+ @M
+ Resdource r {
+ URI = "platform:/resource/intent/My.ecore";
+ }
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/resource_declaration.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/resource_declaration.intent
index 5487b1f..445875b 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/resource_declaration.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/resource_declaration.intent
@@ -1,13 +1,13 @@
-Document {
- Chapter {
- Section Merge {
- Merging models.
-
- @M
- Resource r {
- URI = "platform:/resource/intent/My.ecore";
- M@
-
- }
- }
-}
+Document {
+ Chapter {
+ Section Merge {
+ Merging models.
+
+ @M
+ Resource r {
+ URI = "platform:/resource/intent/My.ecore";
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/single_affectation.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/single_affectation.intent
index 6b21057..3bd1593 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/single_affectation.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/errors/single_affectation.intent
@@ -1,14 +1,14 @@
-Document {
- Chapter {
- Section Merge {
- Merging models.
-
- @M
- Resource r {
- URI = "platform:/resource/intent/My.ecore"
- }
- M@
-
- }
- }
-}
+Document {
+ Chapter {
+ Section Merge {
+ Merging models.
+
+ @M
+ Resource r {
+ URI = "platform:/resource/intent/My.ecore"
+ }
+ M@
+
+ }
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/documentComplete.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/documentComplete.intent
index d860def..fb19d54 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/documentComplete.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/documentComplete.intent
@@ -1,169 +1,169 @@
-Document {
- Chapter Structural element of a @Intent@ document {
- In this chapter, we will present the main structural elements of a
- @label "Intent" "Methodology inspired from Literate Programming"
- document.
-
- First, let's take a look on the global structure of such documents.
-
- Section Global structure of a Intent document : overview {
- The general purpose of the Intent methodology is to allow
- "M.D.A (Model Driven Architecture)":http://en.wikipedia.org/wiki/Model-driven_architecture
- architects to structure their models specifications exactly like they would structure a design
- description report.
-
- We based the Intent methodology on the
- <a href="http://www-cs-faculty.stanford.edu/~uno/lp.html"> Literate Programming </a> concept, defined
- by Donald E. Knuth. The main idea is to combine a textual language for model description (like EMFAtic
- or EFactory) with a documentation language (like Latex or HTML).
-
- Following this paradigm, we have structured a
- @lazylabel "Intent" document exactly as we would have structure a
- design description report :
-
- * Intent document
- ** chapter
- *** section
- **** Description Unit
- **** SubSection
- ***** Description Unit
- ***** Modeling Unit
- ***** Subsubsection
- ****** ...
-
-
- We see here that an Intent document is composed of a set of chapters.
- Each chapter mixes Description Units (that use the documentation langage to explain the current chapter
- topic and concerns) and a Sections (that present a more specific point of the current chapter).
- Each section can contain Modeling Units (that define a model or a part of that model with the model
- description langage), Description Units (that present the defined model or more general decisions), or
- Sections that explain specific points or define model parts related to this section concern.
-
- For example, in the current section entitled "Global structure of a
- @see "Intent" document", we have
- explained the base of an Intent document structure. This structure will be modelised in the IntentDocument package,
- defined in the following Modeling Unit :
- @M IntentDocumentOverview
- Resource IntentDocumentX {
- URI = "platform:/resource/intentTest/modelised/IntentDocumentPackageXResource.ecore";
- contentType = "ECore";
- content += IntentDocumentPackageX;
- }
- new EPackage IntentDocumentPackageX {
- nsURI = "http://www.eclipse.org/intent/intentdocumentX";
- nsPrefix = "intentdocumentX";
- }
- M@
-
- We will take a closer look on the Modeling Units syntax later. Let's just say that in this modeling unit we
- defined an EPackage called IntentDocumentPackage with the given URI and Prefix. We also declared a Resource
- containing this package. As we see later, a Resource allowing the developer to manage the storage
- of the defined models.
-
- Section Global structure of a Intent document : specification {
- In this section, we will design precisely the global structured defined above.
-
- First of all, we define the generic entity IntentStructuredElement,
- that represents a IntentDocument, a chapter and a section.
- @M IntentStructuredElementDefinition
- IntentDocumentPackageX {
- eClassifiers += new EClass IntentStructuredElementX {
- eStructuralFeatures += new EAttribute formattedTitle {
- eType = EString;
- };
- };
- }
- M@
-
- Any IntentDocument is a IntentStructuredElementX that contains chapter(s) :
- @M documentDefinition
- IntentDocumentPackageX {
- eClassifiers += new EClass IntentDocumentX {
- eStructuralFeatures += new EReference chapters {
- eType = IntentChapterX;
- upperBound = "-1";
- containment = "true";
- };
- };
- }
- M@
-
- An Intent's chapter is a IntentStructuredElement...
- @M chapterDefinition
- IntentDocumentPackageX {
- eClassifiers += new EClass IntentChapterX {
- eStructuralFeatures += new EReference subSections {
- eType = RXMSection;
- upperBound = "-1";
- containment = YES;
- };
- };
- }
- M@
- }
- }
-
- Section Specification of an Intent section {
- h2. Some styled subsection
-
- Now that we _have_ *seen* the @general@ structure of an Intent documentation in the
- @see "GlobalstructureofanIntentDocumentoverview" "previous Section"
- , let's see how Sections are defined.
- @M sectionDefinition
- IntentDocumentPackageX {
- eClassifiers += new EClass IntentSectionX {
- eStructuralFeatures += new EAttribute units {
- eType = IntentSectionX;
- upperBound = "-1";
- containment = "true";
- };
- };
- }
- M@
- }
- }
- Chapter The Sample Package {
- In this chapter, we will present the _@Sample Package@_ specifications.
-
- Section Overview {
- @M samplePackageOverview
- Resource IntentDocumentX {
- URI = "platform:/resource/intentTest/modelised/samplePackage.ecore";
- contentType = "ECore";
- content += SamplePackage;
- }
- new EPackage SamplePackage {
- nsURI = "http://www.eclipse.org/intent/samplepackage";
- nsPrefix = "samplePackage";
- }
- M@
-
- Section The sample Class specification {
- @M
- SamplePackage {
- eClassifiers += new EClass SampleClass {
- eStructuralFeatures += new EReference sampleRef {
- eType = SampleClass;
- upperBound = "-1";
- };
- };
- }
- M@
-
- For personnal reasons, we add a sampleAttribute to this sampleClass.
- @M
- SampleClass {
- eStructuralFeatures += new EAttribute sampleAttribute {
- eType = EInt;
- upperBound = "-1";
- };
- }
- M@
-
-
- }
- }
-
-
- }
+Document {
+ Chapter Structural element of a @Intent@ document {
+ In this chapter, we will present the main structural elements of a
+ @label "Intent" "Methodology inspired from Literate Programming"
+ document.
+
+ First, let's take a look on the global structure of such documents.
+
+ Section Global structure of a Intent document : overview {
+ The general purpose of the Intent methodology is to allow
+ "M.D.A (Model Driven Architecture)":http://en.wikipedia.org/wiki/Model-driven_architecture
+ architects to structure their models specifications exactly like they would structure a design
+ description report.
+
+ We based the Intent methodology on the
+ <a href="http://www-cs-faculty.stanford.edu/~uno/lp.html"> Literate Programming </a> concept, defined
+ by Donald E. Knuth. The main idea is to combine a textual language for model description (like EMFAtic
+ or EFactory) with a documentation language (like Latex or HTML).
+
+ Following this paradigm, we have structured a
+ @lazylabel "Intent" document exactly as we would have structure a
+ design description report :
+
+ * Intent document
+ ** chapter
+ *** section
+ **** Description Unit
+ **** SubSection
+ ***** Description Unit
+ ***** Modeling Unit
+ ***** Subsubsection
+ ****** ...
+
+
+ We see here that an Intent document is composed of a set of chapters.
+ Each chapter mixes Description Units (that use the documentation langage to explain the current chapter
+ topic and concerns) and a Sections (that present a more specific point of the current chapter).
+ Each section can contain Modeling Units (that define a model or a part of that model with the model
+ description langage), Description Units (that present the defined model or more general decisions), or
+ Sections that explain specific points or define model parts related to this section concern.
+
+ For example, in the current section entitled "Global structure of a
+ @see "Intent" document", we have
+ explained the base of an Intent document structure. This structure will be modelised in the IntentDocument package,
+ defined in the following Modeling Unit :
+ @M IntentDocumentOverview
+ Resource IntentDocumentX {
+ URI = "platform:/resource/intentTest/modelised/IntentDocumentPackageXResource.ecore";
+ contentType = "ECore";
+ content += IntentDocumentPackageX;
+ }
+ new EPackage IntentDocumentPackageX {
+ nsURI = "http://www.eclipse.org/intent/intentdocumentX";
+ nsPrefix = "intentdocumentX";
+ }
+ M@
+
+ We will take a closer look on the Modeling Units syntax later. Let's just say that in this modeling unit we
+ defined an EPackage called IntentDocumentPackage with the given URI and Prefix. We also declared a Resource
+ containing this package. As we see later, a Resource allowing the developer to manage the storage
+ of the defined models.
+
+ Section Global structure of a Intent document : specification {
+ In this section, we will design precisely the global structured defined above.
+
+ First of all, we define the generic entity IntentStructuredElement,
+ that represents a IntentDocument, a chapter and a section.
+ @M IntentStructuredElementDefinition
+ IntentDocumentPackageX {
+ eClassifiers += new EClass IntentStructuredElementX {
+ eStructuralFeatures += new EAttribute formattedTitle {
+ eType = EString;
+ };
+ };
+ }
+ M@
+
+ Any IntentDocument is a IntentStructuredElementX that contains chapter(s) :
+ @M documentDefinition
+ IntentDocumentPackageX {
+ eClassifiers += new EClass IntentDocumentX {
+ eStructuralFeatures += new EReference chapters {
+ eType = IntentChapterX;
+ upperBound = "-1";
+ containment = "true";
+ };
+ };
+ }
+ M@
+
+ An Intent's chapter is a IntentStructuredElement...
+ @M chapterDefinition
+ IntentDocumentPackageX {
+ eClassifiers += new EClass IntentChapterX {
+ eStructuralFeatures += new EReference subSections {
+ eType = RXMSection;
+ upperBound = "-1";
+ containment = YES;
+ };
+ };
+ }
+ M@
+ }
+ }
+
+ Section Specification of an Intent section {
+ h2. Some styled subsection
+
+ Now that we _have_ *seen* the @general@ structure of an Intent documentation in the
+ @see "GlobalstructureofanIntentDocumentoverview" "previous Section"
+ , let's see how Sections are defined.
+ @M sectionDefinition
+ IntentDocumentPackageX {
+ eClassifiers += new EClass IntentSectionX {
+ eStructuralFeatures += new EAttribute units {
+ eType = IntentSectionX;
+ upperBound = "-1";
+ containment = "true";
+ };
+ };
+ }
+ M@
+ }
+ }
+ Chapter The Sample Package {
+ In this chapter, we will present the _@Sample Package@_ specifications.
+
+ Section Overview {
+ @M samplePackageOverview
+ Resource IntentDocumentX {
+ URI = "platform:/resource/intentTest/modelised/samplePackage.ecore";
+ contentType = "ECore";
+ content += SamplePackage;
+ }
+ new EPackage SamplePackage {
+ nsURI = "http://www.eclipse.org/intent/samplepackage";
+ nsPrefix = "samplePackage";
+ }
+ M@
+
+ Section The sample Class specification {
+ @M
+ SamplePackage {
+ eClassifiers += new EClass SampleClass {
+ eStructuralFeatures += new EReference sampleRef {
+ eType = SampleClass;
+ upperBound = "-1";
+ };
+ };
+ }
+ M@
+
+ For personnal reasons, we add a sampleAttribute to this sampleClass.
+ @M
+ SampleClass {
+ eStructuralFeatures += new EAttribute sampleAttribute {
+ eType = EInt;
+ upperBound = "-1";
+ };
+ }
+ M@
+
+
+ }
+ }
+
+
+ }
}
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/documentWithInstances.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/documentWithInstances.intent
index a6f05c6..372b6b2 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/documentWithInstances.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/documentWithInstances.intent
@@ -1,228 +1,228 @@
-Document {
- Chapter Structural element of a @Intent@ document {
- In this chapter, we will present the main structural elements of a
- @label "Intent" "Methodoly inspired from Literate Programming"
- document.
-
- First, let's take a look on the global structure of such documents.
-
- Section Global structure of an Intent document : overview {
- The general purpose of the Intent methodology is to allow
- "M.D.A (Model Driven Architecture)":http://en.wikipedia.org/wiki/Model-driven_architecture
- architects to structure their models specifications exactly like they would structure a design
- description report.
-
- We based the Intent methodology on the
- <a href="http://www-cs-faculty.stanford.edu/~uno/lp.html"> Literate Programming </a> concept, defined
- by Donald E. Knuth. The main idea is to combine a textual language for model description (like EMFAtic
- or EFactory) with a documentation language (like Latex or HTML).
-
- Following this paradigm, we have structured a
- @lazylabel "Intent" document exactly as we would have structure a
- design description report :
-
- * Intent document
- ** chapter
- *** section
- **** Description Unit
- **** SubSection
- ***** Description Unit
- ***** Modeling Unit
- ***** Subsubsection
- ****** ...
-
-
- We see here that an Intent document is composed of a set of chapters.
- Each chapter mixes Description Units (that use the documentation langage to explain the current chapter
- topic and concerns) and a Sections (that present a more specific point of the current chapter).
- Each section can contain Modeling Units (that define a model or a part of that model with the model
- description langage), Description Units (that present the defined model or more general decisions), or
- Sections that explain specific points or define model parts related to this section concern.
-
- For example, in the current section entitled "Global structure of a
- @see "Intent" document", we have
- explained the base of an Intent document structure. This structure will be modelised in the IntentDocument package,
- defined in the following Modeling Unit :
-
- @M IntentDocumentOverview
- Resource IntentDocumentX {
- URI = "platform:/resource/intentTest/modelised/IntentDocumentPackageXResource.ecore";
- contentType = "ECore";
- content += IntentDocumentPackageX;
- }
- new EPackage IntentDocumentPackageX {
- nsURI = "http://www.eclipse.org/intent/intentdocumentX";
- nsPrefix = "IntentDocumentX";
- }
- M@
-
-
- We will take a closer look on the Modeling Units syntax later. Let's just say that in this modeling unit we
- defined an EPackage called IntentDocumentPackage with the given URI and Prefix. We also declared a Resource
- containing this package. As we see later, a Resource allowing the developer to manage the storage
- of the defined models.
-
- Section Global structure of an Intent document : specification {
- In this section, we will design precisely the global structured defined above.
-
- First of all, we define the generic entity IntentStructuredElement,
- that represents a IntentDocument, a chapter and a section.
-
- @M IntentStructuredElementDefinition
- IntentDocumentPackageX {
- eClassifiers += new EClass IntentStructuredElementX {
- eStructuralFeatures += new EAttribute formattedTitle {
- eType = EString;
- };
- };
- }
- M@
-
-
- Any IntentDocument is a IntentStructuredElementX that contains chapter(s) :
-
- @M documentDefinition
- IntentDocumentPackageX {
- eClassifiers += new EClass IntentDocumentX {
- eStructuralFeatures += new EReference chapters {
- eType = IntentChapterX;
- upperBound = "-1";
- containment = "true";
- };
- };
- }
- M@
-
-
- An Intent's chapter is a IntentStructuredElement...
-
- @M chapterDefinition
- IntentDocumentPackageX {
- eClassifiers += new EClass IntentChapterX {
- eStructuralFeatures += new EReference subSections {
- eType = RXMSection;
- upperBound = "-1";
- containment = YES;
- };
- };
- }
- M@
-
- }
- }
-
- Section Specification of an Intent section {
- h2. Some styled subsection
-
- Now that we _have_ *seen* the @general@ structure of an Intent documentation in the
- @see "GlobalstructureofanIntentDocumentoverview" "previous Section"
- , let's see how Sections are defined.
-
- @M sectionDefinition
- IntentDocumentPackageX {
- eClassifiers += new EClass IntentSectionX {
- eStructuralFeatures += new EAttribute units {
- eType = IntentSectionX;
- upperBound = "-1";
- containment = "true";
- };
- };
- }
- M@
-
- }
- }
- Chapter The Sample Package {
- In this chapter, we will present the _@Sample Package@_ specifications.
-
- Section Overview {
-
- @M samplePackageOverview
- Resource IntentDocumentX {
- URI = "platform:/resource/intentTest/modelised/samplePackage.ecore";
- contentType = "ECore";
- content += SamplePackage;
- }
- new EPackage SamplePackage {
- nsURI = "http://www.eclipse.org/intent/samplepackage";
- nsPrefix = "samplePackage";
- }
- M@
-
- Section The sample Class specification {
-
- @M
- SamplePackage {
- eClassifiers += new EClass SampleClass {
- eStructuralFeatures += new EReference sampleRef {
- eType = SampleClass;
- upperBound = "-1";
- };
- };
- eClassifiers += new EClass SampleClass2 {
- eStructuralFeatures += new EReference sampleRef2 {
- eType = SampleClass2;
- upperBound = "-1";
- };
- };
- }
- M@
-
-
- For personnal reasons, we add a sampleAttribute to this sampleClass.
-
- @M
- SampleClass {
- eStructuralFeatures += new EAttribute sampleAttribute {
- eType = EInt;
- upperBound = "-1";
- };
- eStructuralFeatures += new EAttribute sampleAttributeINTERNALYADDED {
- eType = EString;
- upperBound = "-1";
- };
- }
- M@
-
- }
- }
- }
- Chapter The Sample Instances {
-
- Section The main sample instances {
- As we used the sample package for these purposes, we had to defined several instances :
-
- @M instanceSample1
- new SampleClass mySample1 {
- sampleAttribute = "3";
- sampleAttributeINTERNALYADDED = [ "a", "b", "c" ];
- sampleRef = mySample2;
- }
- M@
-
- The second instance is also very important :
-
- @M instanceSample2
- new SampleClass mySample2 {
- sampleAttribute += "42";
- sampleRef += mySample1;
- }
- M@
- }
-
- Section The sample Instance Storage {
- We stored all the simple instances in the following resource :
-
- @M instanceResource
- Resource IntentDocumentX {
- URI = "platform:/resource/intentTest/modelised/instances/mySampleInstances.xmi";
- contentType = "XMI";
- content += mySample1;
- content += mySample2;
- }
- M@
-
- }
-
- }
+Document {
+ Chapter Structural element of a @Intent@ document {
+ In this chapter, we will present the main structural elements of a
+ @label "Intent" "Methodoly inspired from Literate Programming"
+ document.
+
+ First, let's take a look on the global structure of such documents.
+
+ Section Global structure of an Intent document : overview {
+ The general purpose of the Intent methodology is to allow
+ "M.D.A (Model Driven Architecture)":http://en.wikipedia.org/wiki/Model-driven_architecture
+ architects to structure their models specifications exactly like they would structure a design
+ description report.
+
+ We based the Intent methodology on the
+ <a href="http://www-cs-faculty.stanford.edu/~uno/lp.html"> Literate Programming </a> concept, defined
+ by Donald E. Knuth. The main idea is to combine a textual language for model description (like EMFAtic
+ or EFactory) with a documentation language (like Latex or HTML).
+
+ Following this paradigm, we have structured a
+ @lazylabel "Intent" document exactly as we would have structure a
+ design description report :
+
+ * Intent document
+ ** chapter
+ *** section
+ **** Description Unit
+ **** SubSection
+ ***** Description Unit
+ ***** Modeling Unit
+ ***** Subsubsection
+ ****** ...
+
+
+ We see here that an Intent document is composed of a set of chapters.
+ Each chapter mixes Description Units (that use the documentation langage to explain the current chapter
+ topic and concerns) and a Sections (that present a more specific point of the current chapter).
+ Each section can contain Modeling Units (that define a model or a part of that model with the model
+ description langage), Description Units (that present the defined model or more general decisions), or
+ Sections that explain specific points or define model parts related to this section concern.
+
+ For example, in the current section entitled "Global structure of a
+ @see "Intent" document", we have
+ explained the base of an Intent document structure. This structure will be modelised in the IntentDocument package,
+ defined in the following Modeling Unit :
+
+ @M IntentDocumentOverview
+ Resource IntentDocumentX {
+ URI = "platform:/resource/intentTest/modelised/IntentDocumentPackageXResource.ecore";
+ contentType = "ECore";
+ content += IntentDocumentPackageX;
+ }
+ new EPackage IntentDocumentPackageX {
+ nsURI = "http://www.eclipse.org/intent/intentdocumentX";
+ nsPrefix = "IntentDocumentX";
+ }
+ M@
+
+
+ We will take a closer look on the Modeling Units syntax later. Let's just say that in this modeling unit we
+ defined an EPackage called IntentDocumentPackage with the given URI and Prefix. We also declared a Resource
+ containing this package. As we see later, a Resource allowing the developer to manage the storage
+ of the defined models.
+
+ Section Global structure of an Intent document : specification {
+ In this section, we will design precisely the global structured defined above.
+
+ First of all, we define the generic entity IntentStructuredElement,
+ that represents a IntentDocument, a chapter and a section.
+
+ @M IntentStructuredElementDefinition
+ IntentDocumentPackageX {
+ eClassifiers += new EClass IntentStructuredElementX {
+ eStructuralFeatures += new EAttribute formattedTitle {
+ eType = EString;
+ };
+ };
+ }
+ M@
+
+
+ Any IntentDocument is a IntentStructuredElementX that contains chapter(s) :
+
+ @M documentDefinition
+ IntentDocumentPackageX {
+ eClassifiers += new EClass IntentDocumentX {
+ eStructuralFeatures += new EReference chapters {
+ eType = IntentChapterX;
+ upperBound = "-1";
+ containment = "true";
+ };
+ };
+ }
+ M@
+
+
+ An Intent's chapter is a IntentStructuredElement...
+
+ @M chapterDefinition
+ IntentDocumentPackageX {
+ eClassifiers += new EClass IntentChapterX {
+ eStructuralFeatures += new EReference subSections {
+ eType = RXMSection;
+ upperBound = "-1";
+ containment = YES;
+ };
+ };
+ }
+ M@
+
+ }
+ }
+
+ Section Specification of an Intent section {
+ h2. Some styled subsection
+
+ Now that we _have_ *seen* the @general@ structure of an Intent documentation in the
+ @see "GlobalstructureofanIntentDocumentoverview" "previous Section"
+ , let's see how Sections are defined.
+
+ @M sectionDefinition
+ IntentDocumentPackageX {
+ eClassifiers += new EClass IntentSectionX {
+ eStructuralFeatures += new EAttribute units {
+ eType = IntentSectionX;
+ upperBound = "-1";
+ containment = "true";
+ };
+ };
+ }
+ M@
+
+ }
+ }
+ Chapter The Sample Package {
+ In this chapter, we will present the _@Sample Package@_ specifications.
+
+ Section Overview {
+
+ @M samplePackageOverview
+ Resource IntentDocumentX {
+ URI = "platform:/resource/intentTest/modelised/samplePackage.ecore";
+ contentType = "ECore";
+ content += SamplePackage;
+ }
+ new EPackage SamplePackage {
+ nsURI = "http://www.eclipse.org/intent/samplepackage";
+ nsPrefix = "samplePackage";
+ }
+ M@
+
+ Section The sample Class specification {
+
+ @M
+ SamplePackage {
+ eClassifiers += new EClass SampleClass {
+ eStructuralFeatures += new EReference sampleRef {
+ eType = SampleClass;
+ upperBound = "-1";
+ };
+ };
+ eClassifiers += new EClass SampleClass2 {
+ eStructuralFeatures += new EReference sampleRef2 {
+ eType = SampleClass2;
+ upperBound = "-1";
+ };
+ };
+ }
+ M@
+
+
+ For personnal reasons, we add a sampleAttribute to this sampleClass.
+
+ @M
+ SampleClass {
+ eStructuralFeatures += new EAttribute sampleAttribute {
+ eType = EInt;
+ upperBound = "-1";
+ };
+ eStructuralFeatures += new EAttribute sampleAttributeINTERNALYADDED {
+ eType = EString;
+ upperBound = "-1";
+ };
+ }
+ M@
+
+ }
+ }
+ }
+ Chapter The Sample Instances {
+
+ Section The main sample instances {
+ As we used the sample package for these purposes, we had to defined several instances :
+
+ @M instanceSample1
+ new SampleClass mySample1 {
+ sampleAttribute = "3";
+ sampleAttributeINTERNALYADDED = [ "a", "b", "c" ];
+ sampleRef = mySample2;
+ }
+ M@
+
+ The second instance is also very important :
+
+ @M instanceSample2
+ new SampleClass mySample2 {
+ sampleAttribute += "42";
+ sampleRef += mySample1;
+ }
+ M@
+ }
+
+ Section The sample Instance Storage {
+ We stored all the simple instances in the following resource :
+
+ @M instanceResource
+ Resource IntentDocumentX {
+ URI = "platform:/resource/intentTest/modelised/instances/mySampleInstances.xmi";
+ contentType = "XMI";
+ content += mySample1;
+ content += mySample2;
+ }
+ M@
+
+ }
+
+ }
}
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/du_order.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/du_order.intent
index 8d5dd62..4f90b06 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/du_order.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/intentDocuments/intentdocumentspecification/du_order.intent
@@ -1,17 +1,17 @@
-Document {
- Chapter My only chapter {
- The One
- The Two.
-
- The Three in a new paragraph @ok@ ?
-
- The four.
- }
- Chapter My Second chapter {
- Here is a complete Description Unit *That I will not modify*.
-
- Why ? Just because
- @label "ok" "ok"
- I should not.
- }
+Document {
+ Chapter My only chapter {
+ The One
+ The Two.
+
+ The Three in a new paragraph @ok@ ?
+
+ The four.
+ }
+ Chapter My Second chapter {
+ Here is a complete Description Unit *That I will not modify*.
+
+ Why ? Just because
+ @label "ok" "ok"
+ I should not.
+ }
}
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidAnnotationLinking.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidAnnotationLinking.intent
index be68665..b5594c1 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidAnnotationLinking.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidAnnotationLinking.intent
@@ -1,6 +1,6 @@
-@M @see "Section1" "textToPrint"
-new A MyA {}
-@see "Section2"
-@label "ok"
-@Annotation "ok"
+@M @see "Section1" "textToPrint"
+new A MyA {}
+@see "Section2"
+@label "ok"
+@Annotation "ok"
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidLabelLinking.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidLabelLinking.intent
index 9be5ee5..129b40c 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidLabelLinking.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidLabelLinking.intent
@@ -1,4 +1,4 @@
-@M @label "labelValue"
-new A MyA {}
-@lazylabel "labelValue" "textToPrint"
+@M @label "labelValue"
+new A MyA {}
+@lazylabel "labelValue" "textToPrint"
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidModelingUnit.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidModelingUnit.intent
index 4d8e384..9c0f8ad 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidModelingUnit.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidModelingUnit.intent
@@ -1,5 +1,5 @@
-@M @label "labelValue"
-new A MyA {}
-@label "labelValue" "textToPrint"
-@SOMETHING WICH MUST NOT BE RECOGNIZED
+@M @label "labelValue"
+new A MyA {}
+@label "labelValue" "textToPrint"
+@SOMETHING WICH MUST NOT BE RECOGNIZED
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidSectionRefrenceLinking.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidSectionRefrenceLinking.intent
index 258e2b6..4aff764 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidSectionRefrenceLinking.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/incorrectFiles/invalidSectionRefrenceLinking.intent
@@ -1,5 +1,5 @@
-@M @Annotation annotationID cle="val", cle2="val2"
-new A MyA {}
-@lazylabel "labelValue" "textToPrint"
-@Annotation annotationID cle="val", cle2="val2"
+@M @Annotation annotationID cle="val", cle2="val2"
+new A MyA {}
+@lazylabel "labelValue" "textToPrint"
+@Annotation annotationID cle="val", cle2="val2"
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/qualifiedNames/qualifiedName.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/qualifiedNames/qualifiedName.intent
index 5569985..aeb9198 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/qualifiedNames/qualifiedName.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/qualifiedNames/qualifiedName.intent
@@ -1,9 +1,9 @@
-@M
- Resource R {
- content += p;
- }
- new ecore.EPackage p {
- nsURI = "p";
- nsPrefix = "p";
- }
+@M
+ Resource R {
+ content += p;
+ }
+ new ecore.EPackage p {
+ nsURI = "p";
+ nsPrefix = "p";
+ }
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/qualifiedNames/qualifiedNameNewInstance.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/qualifiedNames/qualifiedNameNewInstance.intent
index 65ca14c..74e4ac7 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/qualifiedNames/qualifiedNameNewInstance.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/qualifiedNames/qualifiedNameNewInstance.intent
@@ -1,45 +1,45 @@
-@M
- Resource R1 {
- content += p1;
- content += p2;
- }
- new EPackage p1 {
- nsURI = "p1URI";
- nsPrefix = "p1Prefix";
- eSubpackages += sub1;
- }
- new EPackage sub1 {
- nsURI = "sub1URI";
- nsPrefix = "sub1Prefix";
- eClassifiers += new EClass Type {
- eStructuralFeatures += new EAttribute {
- name = "sub1attr";
- eType = EString;
- changeable = "true";
- ordered = "true";
- };
- };
- }
- new EPackage p2 {
- nsURI = "p2URI";
- nsPrefix = "p2Prefix";
- eClassifiers += new EClass Type {
- eStructuralFeatures += new EAttribute {
- name = "p2attr";
- eType = EString;
- changeable = "true";
- ordered = "true";
- };
- };
- }
- Resource R2 {
- content += instance1;
- content += instance2;
- }
- new p1.sub1.Type instance1 {
- sub1attr = "instance1";
- }
- new p2.Type instance2 {
- p2attr = "instance2";
- }
+@M
+ Resource R1 {
+ content += p1;
+ content += p2;
+ }
+ new EPackage p1 {
+ nsURI = "p1URI";
+ nsPrefix = "p1Prefix";
+ eSubpackages += sub1;
+ }
+ new EPackage sub1 {
+ nsURI = "sub1URI";
+ nsPrefix = "sub1Prefix";
+ eClassifiers += new EClass Type {
+ eStructuralFeatures += new EAttribute {
+ name = "sub1attr";
+ eType = EString;
+ changeable = "true";
+ ordered = "true";
+ };
+ };
+ }
+ new EPackage p2 {
+ nsURI = "p2URI";
+ nsPrefix = "p2Prefix";
+ eClassifiers += new EClass Type {
+ eStructuralFeatures += new EAttribute {
+ name = "p2attr";
+ eType = EString;
+ changeable = "true";
+ ordered = "true";
+ };
+ };
+ }
+ Resource R2 {
+ content += instance1;
+ content += instance2;
+ }
+ new p1.sub1.Type instance1 {
+ sub1attr = "instance1";
+ }
+ new p2.Type instance2 {
+ p2attr = "instance2";
+ }
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/resourcesRelatedTest/resourceDeclaration.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/resourcesRelatedTest/resourceDeclaration.intent
index 3bc1b82..153d639 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/resourcesRelatedTest/resourceDeclaration.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/resourcesRelatedTest/resourceDeclaration.intent
@@ -1,27 +1,27 @@
-@M
- Resource myCompleteRes {
- URI = "cdo:/repo1/myResource";
- contentType = "ECore";
- content += myRoot1;
- content += myRoot2;
- }
- Resource myResWithoutURI {
- contentType = "ECore";
- content += myRoot1;
- content += myRoot2;
- }
- Resource myResWithoutContentType {
- URI = "platform:/resource/myproject/myResource";
- content += myRoot1;
- content += myRoot2;
- }
- @Annotation annotationID cle="val1"
- @label "testLabel" "myPrettyResource"
- Resource myResWithoutContent {
- URI = "file:/D:/MyResourceFolder/myResource";
- contentType = "ECore";
- }
- @see "TestSectionReference"
- Resource emptyResource {
- }
+@M
+ Resource myCompleteRes {
+ URI = "cdo:/repo1/myResource";
+ contentType = "ECore";
+ content += myRoot1;
+ content += myRoot2;
+ }
+ Resource myResWithoutURI {
+ contentType = "ECore";
+ content += myRoot1;
+ content += myRoot2;
+ }
+ Resource myResWithoutContentType {
+ URI = "platform:/resource/myproject/myResource";
+ content += myRoot1;
+ content += myRoot2;
+ }
+ @Annotation annotationID cle="val1"
+ @label "testLabel" "myPrettyResource"
+ Resource myResWithoutContent {
+ URI = "file:/D:/MyResourceFolder/myResource";
+ contentType = "ECore";
+ }
+ @see "TestSectionReference"
+ Resource emptyResource {
+ }
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/AllKindOfLabels.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/AllKindOfLabels.intent
index 397c9d5..90f6cb2 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/AllKindOfLabels.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/AllKindOfLabels.intent
@@ -1,10 +1,10 @@
-@M
- @label "labelValue"
- new A MyA {}
- @label "labelValue" "textToPrint"
- new B MyB {}
- @lazylabel "labelValue"
- new C MyC {}
- @lazylabel "labelValue" "textToPrint"
- new D MyD {}
+@M
+ @label "labelValue"
+ new A MyA {}
+ @label "labelValue" "textToPrint"
+ new B MyB {}
+ @lazylabel "labelValue"
+ new C MyC {}
+ @lazylabel "labelValue" "textToPrint"
+ new D MyD {}
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit.intent
index 3009433..5ff5ca5 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit.intent
@@ -1,24 +1,24 @@
-@M completeModelingUnit1
- @Annotation annotationID cle="val", cle2="val2"
- @label "myB" "instance de la classe B"
- new B myB {
- myAttMulti += [ "val1" , "val2" ];
- myAtt0 = "bAtt";
- }
- @see "Section1.2.3" "textToPrint"
- new A myA {
- myAtt1 = "41";
- myAtt2 = new B {
- myAtt0 = "okAtt";
- };
- myAtt3 = myB;
- }
- myB {
- myAtt1 = "41";
- @label "myAtt2" "justification de mon Att2"
- myAtt2 = new B {
- myAtt0 = "okAtt";
- };
- myAtt3 = myB;
- }
+@M completeModelingUnit1
+ @Annotation annotationID cle="val", cle2="val2"
+ @label "myB" "instance de la classe B"
+ new B myB {
+ myAttMulti += [ "val1" , "val2" ];
+ myAtt0 = "bAtt";
+ }
+ @see "Section1.2.3" "textToPrint"
+ new A myA {
+ myAtt1 = "41";
+ myAtt2 = new B {
+ myAtt0 = "okAtt";
+ };
+ myAtt3 = myB;
+ }
+ myB {
+ myAtt1 = "41";
+ @label "myAtt2" "justification de mon Att2"
+ myAtt2 = new B {
+ myAtt0 = "okAtt";
+ };
+ myAtt3 = myB;
+ }
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit2.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit2.intent
index ba7a2f2..46ac608 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit2.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit2.intent
@@ -1,25 +1,25 @@
-@M completeModelingUnit2
- @lazylabel "myA" "instance representative de la classe A"
- new A myA {
- myAttMulti = "val2";
- myAtt0 = "bAtt";
- }
- @label "myB"
- new B myB {
- myAtt1 = "41";
- myAtt2 = new B {
- myAtt0 = "okAtt";
- };
- myAtt3 = myB;
- }
- @see "Mysection where I have defined by B"
- @see "Another Section" "reasons for separation of concerns"
- @Annotation associateBashFileID bashFile="bashFile1", mode="superAdmin"
- myB {
- myAttCompleted = "that's all folks!";
- myAtt2 = new C {
- myAtt0 = "okAtt";
- };
- myAttCompleted += [ "that's all folks!" , "ok" ];
- }
+@M completeModelingUnit2
+ @lazylabel "myA" "instance representative de la classe A"
+ new A myA {
+ myAttMulti = "val2";
+ myAtt0 = "bAtt";
+ }
+ @label "myB"
+ new B myB {
+ myAtt1 = "41";
+ myAtt2 = new B {
+ myAtt0 = "okAtt";
+ };
+ myAtt3 = myB;
+ }
+ @see "Mysection where I have defined by B"
+ @see "Another Section" "reasons for separation of concerns"
+ @Annotation associateBashFileID bashFile="bashFile1", mode="superAdmin"
+ myB {
+ myAttCompleted = "that's all folks!";
+ myAtt2 = new C {
+ myAtt0 = "okAtt";
+ };
+ myAttCompleted += [ "that's all folks!" , "ok" ];
+ }
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit3.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit3.intent
index dd7a17d..edaa8d7 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit3.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/CompleteModelingUnit3.intent
@@ -1,40 +1,40 @@
-@M myModelingUnitName
- // Label definition (type : implicit), attached to myA by the linkResolver
- @lazylabel "myA" "representative instance of class A"
- new A myA {
- // StructuralFeatures affectation
- myAttMultiValued += [ "val1", "val2" ];
- mySimpleAtt = "myAttValue";
- }
- // Label definition (type : explicit)
- @label "myB"
- new B myB {
- myAtt1 = "41";
- // New instance in right-part of an affectation
- myAtt2 = new B {
- myAtt0 = "okAtt";
- };
- // Instance reference in righ-part of an affectation
- myAtt3 = myB;
- }
- // Section Reference : attached to the next Modeling Element
- @see "Mysection where I have defined by B"
- @see "Another Section" "reasons for separation of concerns"
- // Generic Annotation mechanism.
- @Annotation associateBashFileID bashFile="bashFile1", mode="admin"
- myA {
- myAttMultiValued = "Completion of the definition made earlier";
- myAttRelativeToPersistence = new PersistenceInformationHandler {
- isPersistent = "true";
- };
- }
- // Ressource Declaration : should not be made in the same time than a resource reference
- @label "myResourceForPersistence" "you can attache information to resources too"
- Resource myResourceForPersistence {
- URI = "cdo:/repo1/myResource";
- // ModelInstance is the default type : doesn't need to be declared
- contentType = "ModelInstance";
- content += myRoot1;
- content += myRoot2;
- }
+@M myModelingUnitName
+ // Label definition (type : implicit), attached to myA by the linkResolver
+ @lazylabel "myA" "representative instance of class A"
+ new A myA {
+ // StructuralFeatures affectation
+ myAttMultiValued += [ "val1", "val2" ];
+ mySimpleAtt = "myAttValue";
+ }
+ // Label definition (type : explicit)
+ @label "myB"
+ new B myB {
+ myAtt1 = "41";
+ // New instance in right-part of an affectation
+ myAtt2 = new B {
+ myAtt0 = "okAtt";
+ };
+ // Instance reference in righ-part of an affectation
+ myAtt3 = myB;
+ }
+ // Section Reference : attached to the next Modeling Element
+ @see "Mysection where I have defined by B"
+ @see "Another Section" "reasons for separation of concerns"
+ // Generic Annotation mechanism.
+ @Annotation associateBashFileID bashFile="bashFile1", mode="admin"
+ myA {
+ myAttMultiValued = "Completion of the definition made earlier";
+ myAttRelativeToPersistence = new PersistenceInformationHandler {
+ isPersistent = "true";
+ };
+ }
+ // Ressource Declaration : should not be made in the same time than a resource reference
+ @label "myResourceForPersistence" "you can attache information to resources too"
+ Resource myResourceForPersistence {
+ URI = "cdo:/repo1/myResource";
+ // ModelInstance is the default type : doesn't need to be declared
+ contentType = "ModelInstance";
+ content += myRoot1;
+ content += myRoot2;
+ }
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/ModelingAndResource.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/ModelingAndResource.intent
index 54c9ba7..211ede3 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/ModelingAndResource.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/ModelingAndResource.intent
@@ -1,11 +1,11 @@
-@M IntentDocumentStructure
-Resource IntentDocument {
- URI = "platform:/resource/myProjet/IntentDocumentPackage";
- contentType = "ECore";
- content += IntentDocumentPackage;
-}
-new EPackage IntentDocumentPackage {
- nsURI = "http://www.eclipse.org/intent/intentdocument/0.8";
- nsPrefix = "IntentDocument";
-}
+@M IntentDocumentStructure
+Resource IntentDocument {
+ URI = "platform:/resource/myProjet/IntentDocumentPackage";
+ contentType = "ECore";
+ content += IntentDocumentPackage;
+}
+new EPackage IntentDocumentPackage {
+ nsURI = "http://www.eclipse.org/intent/intentdocument/0.8";
+ nsPrefix = "IntentDocument";
+}
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/SimpleModelingUnit.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/SimpleModelingUnit.intent
index 3387043..98e0d35 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/SimpleModelingUnit.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/SimpleModelingUnit.intent
@@ -1,14 +1,14 @@
-@M
- new B myB {
- myAttMulti += [ "val1" , "val2" ];
- myAtt0 = "bAtt";
- myAtt0 = "bAtt2";
- }
- new A myA {
- myAtt1 = "41";
- myAtt2 = new B {
- myAtt0 = "okAtt";
- };
- myAtt3 = myB;
- }
+@M
+ new B myB {
+ myAttMulti += [ "val1" , "val2" ];
+ myAtt0 = "bAtt";
+ myAtt0 = "bAtt2";
+ }
+ new A myA {
+ myAtt1 = "41";
+ myAtt2 = new B {
+ myAtt0 = "okAtt";
+ };
+ myAtt3 = myB;
+ }
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/SpecialValues.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/SpecialValues.intent
index aef6c69..09bbb3b 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/SpecialValues.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/simpleTests/SpecialValues.intent
@@ -1,7 +1,7 @@
-@M
- new A myA {
- myAtt1 = "41";
- myAtt2 = "string with ; : ! % } { characters";
- myAtt3 = "string with ; : ! % } characters";
- }
+@M
+ new A myA {
+ myAtt1 = "41";
+ myAtt2 = "string with ; : ! % } { characters";
+ myAtt3 = "string with ; : ! % } characters";
+ }
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/unresolvedIssues/multivaluedFeatures.intent b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/unresolvedIssues/multivaluedFeatures.intent
index ec3813f..b4a83ee 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/unresolvedIssues/multivaluedFeatures.intent
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/dataTests/modelingUnits/unresolvedIssues/multivaluedFeatures.intent
@@ -1,7 +1,7 @@
-@M
- new B myB {
- myAtt1 = "41";
- myAttMultiValued += [ "val1" , "val2" ];
- myAtt3 += "41";
- }
+@M
+ new B myB {
+ myAtt1 = "41";
+ myAttMultiValued += [ "val1" , "val2" ];
+ myAtt3 += "41";
+ }
M@
\ No newline at end of file
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/intentDocuments/reference.xmi b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/intentDocuments/reference.xmi
index 12000b6..6210535 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/intentDocuments/reference.xmi
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/intentDocuments/reference.xmi
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="ASCII"?>
-<intentDocument:IntentDocument xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:intentDU="http://www.eclipse.org/intent/descriptionunit/0.8" xmlns:intentDocument="http://www.eclipse.org/intent/intentdocument/0.8" xmlns:intentGU="http://www.eclipse.org/intent/genericunit/0.8" xmlns:markup="http://www.eclipse.org/intent/markup/0.8" xsi:schemaLocation="http://www.eclipse.org/intent/descriptionunit/0.8 expectedResults/packagesModels/descriptionUnit.ecore http://www.eclipse.org/intent/intentdocument/0.8 expectedResults/packagesModels/org.eclipse.mylyn.docs.intent.core.document.ecore http://www.eclipse.org/intent/genericunit/0.8 expectedResults/packagesModels/genericUnit.ecore http://www.eclipse.org/intent/markup/0.8 expectedResults/packagesModels/markup.ecore">
- <chapters>
- <title xmi:type="markup:Paragraph">
- <attributes/>
- <content xmi:type="markup:Text" data="title"/>
- </title>
- <intentContent xmi:type="intentDU:DescriptionUnit">
- <instructions xmi:type="intentGU:LabelReferenceInstruction" type="EXPLICIT">
- <referencedLabel intentHref="ref"/>
- </instructions>
- </intentContent>
- </chapters>
-</intentDocument:IntentDocument>
+<?xml version="1.0" encoding="ASCII"?>
+<intentDocument:IntentDocument xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:intentDU="http://www.eclipse.org/intent/descriptionunit/0.8" xmlns:intentDocument="http://www.eclipse.org/intent/intentdocument/0.8" xmlns:intentGU="http://www.eclipse.org/intent/genericunit/0.8" xmlns:markup="http://www.eclipse.org/intent/markup/0.8" xsi:schemaLocation="http://www.eclipse.org/intent/descriptionunit/0.8 expectedResults/packagesModels/descriptionUnit.ecore http://www.eclipse.org/intent/intentdocument/0.8 expectedResults/packagesModels/org.eclipse.mylyn.docs.intent.core.document.ecore http://www.eclipse.org/intent/genericunit/0.8 expectedResults/packagesModels/genericUnit.ecore http://www.eclipse.org/intent/markup/0.8 expectedResults/packagesModels/markup.ecore">
+ <chapters>
+ <title xmi:type="markup:Paragraph">
+ <attributes/>
+ <content xmi:type="markup:Text" data="title"/>
+ </title>
+ <intentContent xmi:type="intentDU:DescriptionUnit">
+ <instructions xmi:type="intentGU:LabelReferenceInstruction" type="EXPLICIT">
+ <referencedLabel intentHref="ref"/>
+ </instructions>
+ </intentContent>
+ </chapters>
+</intentDocument:IntentDocument>
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/incorrectFiles/invalidLabelLinking.xmi b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/incorrectFiles/invalidLabelLinking.xmi
index 056ad0d..60480f7 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/incorrectFiles/invalidLabelLinking.xmi
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/incorrectFiles/invalidLabelLinking.xmi
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="ASCII"?>
-<intentMU:ModelingUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:intentMU="http://www.eclipse.org/intent/modelingunit/0.8">
- <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue"" type="EXPLICIT"/>
- <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="MyA">
- <metaType typeName="A"/>
- </instructions>
- <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue"" textToPrint=""textToPrint""/>
-</intentMU:ModelingUnit>
+<?xml version="1.0" encoding="ASCII"?>
+<intentMU:ModelingUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:intentMU="http://www.eclipse.org/intent/modelingunit/0.8">
+ <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue"" type="EXPLICIT"/>
+ <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="MyA">
+ <metaType typeName="A"/>
+ </instructions>
+ <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue"" textToPrint=""textToPrint""/>
+</intentMU:ModelingUnit>
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/AllKindOfLabels.xmi b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/AllKindOfLabels.xmi
index 65e384b..d0e2536 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/AllKindOfLabels.xmi
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/AllKindOfLabels.xmi
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="ASCII"?>
-<intentMU:ModelingUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:intentMU="http://www.eclipse.org/intent/modelingunit/0.8">
- <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue"" type="EXPLICIT"/>
- <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="MyA">
- <metaType typeName="A"/>
- </instructions>
- <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue"" textToPrint=""textToPrint"" type="EXPLICIT"/>
- <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="MyB">
- <metaType typeName="B"/>
- </instructions>
- <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue""/>
- <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="MyC">
- <metaType typeName="C"/>
- </instructions>
- <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue"" textToPrint=""textToPrint""/>
- <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="MyD">
- <metaType typeName="D"/>
- </instructions>
-</intentMU:ModelingUnit>
+<?xml version="1.0" encoding="ASCII"?>
+<intentMU:ModelingUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:intentMU="http://www.eclipse.org/intent/modelingunit/0.8">
+ <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue"" type="EXPLICIT"/>
+ <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="MyA">
+ <metaType typeName="A"/>
+ </instructions>
+ <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue"" textToPrint=""textToPrint"" type="EXPLICIT"/>
+ <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="MyB">
+ <metaType typeName="B"/>
+ </instructions>
+ <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue""/>
+ <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="MyC">
+ <metaType typeName="C"/>
+ </instructions>
+ <instructions xmi:type="intentMU:LabelInModelingUnit" lineBreak="true" labelValue=""labelValue"" textToPrint=""textToPrint""/>
+ <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="MyD">
+ <metaType typeName="D"/>
+ </instructions>
+</intentMU:ModelingUnit>
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/ExternalContentReferences.xmi b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/ExternalContentReferences.xmi
index 8af38d4..6177acf 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/ExternalContentReferences.xmi
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/ExternalContentReferences.xmi
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="ASCII"?>
-<intentMU:ModelingUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:intentMU="http://www.eclipse.org/intent/modelingunit/0.8">
- <instructions xmi:type="intentMU:ExternalContentReference" lineBreak="true" uri="platform:/resource/myproject/myecore.ecore"/>
- <instructions xmi:type="intentMU:ExternalContentReference" lineBreak="true" uri="platform:/resource/myproject/myecore.ecore#//c1"/>
-</intentMU:ModelingUnit>
+<?xml version="1.0" encoding="ASCII"?>
+<intentMU:ModelingUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:intentMU="http://www.eclipse.org/intent/modelingunit/0.8">
+ <instructions xmi:type="intentMU:ExternalContentReference" lineBreak="true" uri="platform:/resource/myproject/myecore.ecore"/>
+ <instructions xmi:type="intentMU:ExternalContentReference" lineBreak="true" uri="platform:/resource/myproject/myecore.ecore#//c1"/>
+</intentMU:ModelingUnit>
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/SimpleModelingUnit.xmi b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/SimpleModelingUnit.xmi
index 3f3c68b..b3d4aa8 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/SimpleModelingUnit.xmi
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/simpleTests/SimpleModelingUnit.xmi
@@ -1,37 +1,37 @@
-<?xml version="1.0" encoding="ASCII"?>
-<intentMU:ModelingUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:intentMU="http://www.eclipse.org/intent/modelingunit/0.8">
- <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="myB">
- <metaType typeName="B"/>
- <structuralFeatures lineBreak="true" name="myAttMulti" usedOperator="MULTI_VALUED_AFFECTATION">
- <values xmi:type="intentMU:NativeValue" value=""val1""/>
- <values xmi:type="intentMU:NativeValue" value=""val2""/>
- </structuralFeatures>
- <structuralFeatures lineBreak="true" name="myAtt0">
- <values xmi:type="intentMU:NativeValue" value=""bAtt""/>
- </structuralFeatures>
- <structuralFeatures lineBreak="true" name="myAtt0">
- <values xmi:type="intentMU:NativeValue" value=""bAtt2""/>
- </structuralFeatures>
- </instructions>
- <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="myA">
- <metaType typeName="A"/>
- <structuralFeatures lineBreak="true" name="myAtt1">
- <values xmi:type="intentMU:NativeValue" value=""41""/>
- </structuralFeatures>
- <structuralFeatures lineBreak="true" name="myAtt2">
- <values xmi:type="intentMU:NewObjectValue">
- <value>
- <metaType typeName="B"/>
- <structuralFeatures lineBreak="true" name="myAtt0">
- <values xmi:type="intentMU:NativeValue" value=""okAtt""/>
- </structuralFeatures>
- </value>
- </values>
- </structuralFeatures>
- <structuralFeatures lineBreak="true" name="myAtt3">
- <values xmi:type="intentMU:ReferenceValue">
- <instanciationReference instanceName="myB"/>
- </values>
- </structuralFeatures>
- </instructions>
-</intentMU:ModelingUnit>
+<?xml version="1.0" encoding="ASCII"?>
+<intentMU:ModelingUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:intentMU="http://www.eclipse.org/intent/modelingunit/0.8">
+ <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="myB">
+ <metaType typeName="B"/>
+ <structuralFeatures lineBreak="true" name="myAttMulti" usedOperator="MULTI_VALUED_AFFECTATION">
+ <values xmi:type="intentMU:NativeValue" value=""val1""/>
+ <values xmi:type="intentMU:NativeValue" value=""val2""/>
+ </structuralFeatures>
+ <structuralFeatures lineBreak="true" name="myAtt0">
+ <values xmi:type="intentMU:NativeValue" value=""bAtt""/>
+ </structuralFeatures>
+ <structuralFeatures lineBreak="true" name="myAtt0">
+ <values xmi:type="intentMU:NativeValue" value=""bAtt2""/>
+ </structuralFeatures>
+ </instructions>
+ <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="myA">
+ <metaType typeName="A"/>
+ <structuralFeatures lineBreak="true" name="myAtt1">
+ <values xmi:type="intentMU:NativeValue" value=""41""/>
+ </structuralFeatures>
+ <structuralFeatures lineBreak="true" name="myAtt2">
+ <values xmi:type="intentMU:NewObjectValue">
+ <value>
+ <metaType typeName="B"/>
+ <structuralFeatures lineBreak="true" name="myAtt0">
+ <values xmi:type="intentMU:NativeValue" value=""okAtt""/>
+ </structuralFeatures>
+ </value>
+ </values>
+ </structuralFeatures>
+ <structuralFeatures lineBreak="true" name="myAtt3">
+ <values xmi:type="intentMU:ReferenceValue">
+ <instanciationReference instanceName="myB"/>
+ </values>
+ </structuralFeatures>
+ </instructions>
+</intentMU:ModelingUnit>
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/tempFile.xmi b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/tempFile.xmi
index 198eaa3..33efbfd 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/tempFile.xmi
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/expectedResults/modelingUnits/tempFile.xmi
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="ASCII"?>
-<intentMU:ModelingUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:intentMU="http://www.eclipse.org/intent/modelingunit/0.8" xsi:schemaLocation="http://www.eclipse.org/intent/modelingunit/0.8 expectedResults/packagesModels/org.eclipse.mylyn.docs.intent.core.modelingunit.ecore" unitName="IntentDocumentStructure">
- <instructions xmi:type="intentMU:ResourceDeclaration" lineBreak="true" uri=""platform:/resource/myProjet/IntentDocumentPackage"" name="IntentDocument" contentType=""ECore"">
- <content intentHref="IntentDocumentPackage"/>
- </instructions>
- <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="IntentDocumentPackage">
- <metaType typeName="EPackage"/>
- <structuralFeatures lineBreak="true" name="nsURI">
- <values xmi:type="intentMU:NativeValue" value=""http://www.eclipse.org/intent/intentdocument/0.8""/>
- </structuralFeatures>
- <structuralFeatures lineBreak="true" name="nsPrefix">
- <values xmi:type="intentMU:NativeValue" value=""IntentDocument""/>
- </structuralFeatures>
- </instructions>
-</intentMU:ModelingUnit>
+<?xml version="1.0" encoding="ASCII"?>
+<intentMU:ModelingUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:intentMU="http://www.eclipse.org/intent/modelingunit/0.8" xsi:schemaLocation="http://www.eclipse.org/intent/modelingunit/0.8 expectedResults/packagesModels/org.eclipse.mylyn.docs.intent.core.modelingunit.ecore" unitName="IntentDocumentStructure">
+ <instructions xmi:type="intentMU:ResourceDeclaration" lineBreak="true" uri=""platform:/resource/myProjet/IntentDocumentPackage"" name="IntentDocument" contentType=""ECore"">
+ <content intentHref="IntentDocumentPackage"/>
+ </instructions>
+ <instructions xmi:type="intentMU:InstanciationInstruction" lineBreak="true" name="IntentDocumentPackage">
+ <metaType typeName="EPackage"/>
+ <structuralFeatures lineBreak="true" name="nsURI">
+ <values xmi:type="intentMU:NativeValue" value=""http://www.eclipse.org/intent/intentdocument/0.8""/>
+ </structuralFeatures>
+ <structuralFeatures lineBreak="true" name="nsPrefix">
+ <values xmi:type="intentMU:NativeValue" value=""IntentDocument""/>
+ </structuralFeatures>
+ </instructions>
+</intentMU:ModelingUnit>
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/AbstractTestParserErrors.java b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/AbstractTestParserErrors.java
index 433b513..9287934 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/AbstractTestParserErrors.java
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/AbstractTestParserErrors.java
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.mylyn.docs.intent.parser.errors.test;
+//CHECKSTYLE:OFF
+import static org.junit.Assert.assertEquals;
+
import java.io.File;
import java.io.IOException;
-import junit.framework.Assert;
import junit.framework.AssertionFailedError;
import org.eclipse.mylyn.docs.intent.parser.IntentParser;
@@ -21,6 +23,7 @@
import org.eclipse.mylyn.docs.intent.parser.test.utils.FileToStringConverter;
import org.junit.Before;
+//CHECKSTYLE:ON
/**
* Utilities to test the parsing errors.
*
@@ -28,6 +31,9 @@
*/
public abstract class AbstractTestParserErrors {
+ /**
+ * Constant to indicate unrecognized content.
+ */
protected static final String UNRECOGNIZED_CONTENT_ERROR = "Unrecognized content";
/**
@@ -65,9 +71,9 @@
System.err.println("Error found on " + fileName + ", " + actual.getErrorOffset() + "("
+ actual.getErrorLength() + ") : " + actual.getMessage());
} else {
- Assert.assertEquals("different message", expected.getMessage(), actual.getMessage());
- Assert.assertEquals("different offset", expected.getErrorOffset(), actual.getErrorOffset());
- Assert.assertEquals("different length", expected.getErrorLength(), actual.getErrorLength());
+ assertEquals("different message", expected.getMessage(), actual.getMessage());
+ assertEquals("different offset", expected.getErrorOffset(), actual.getErrorOffset());
+ assertEquals("different length", expected.getErrorLength(), actual.getErrorLength());
errorFound = true;
}
}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/TestModelingUnitErrors.java b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/TestModelingUnitErrors.java
index 1f064e2..2efa7a0 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/TestModelingUnitErrors.java
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/errors/test/TestModelingUnitErrors.java
@@ -20,19 +20,29 @@
*/
public class TestModelingUnitErrors extends AbstractTestParserErrors {
+ /**
+ * Ensures that parsing the given file does not lead to error.
+ */
@Test
public void testNoErrors() {
testNoErrorsOnFile("dataTests/intentDocuments/scalability/uml.intent");
}
+ // Disabling checkstyle to avoid to declare each expected position for parsed exceptions as constants
+ // (would make test less readable)
// CHECKSTYLE:OFF
-
+ /**
+ * Ensures that parsing the given file raises the expected errors.
+ */
@Test
public void testResource() {
testErrorsOnFile("dataTests/intentDocuments/errors/resource.intent", new ParseException(
UNRECOGNIZED_CONTENT_ERROR, 73, 68));
}
+ /**
+ * Ensures that parsing the given file raises the expected errors.
+ */
@Test
public void testProperty() {
testErrorsOnFile("dataTests/intentDocuments/errors/property.intent", new ParseException(
@@ -45,35 +55,48 @@
UNRECOGNIZED_CONTENT_ERROR, 91, 44));
}
+ /**
+ * Ensures that parsing the given file raises the expected errors.
+ */
@Test
public void testContribution() {
testErrorsOnFile("dataTests/intentDocuments/errors/contribution.intent", new ParseException(
"Contribution instruction uml { does not end correctly.", 495, 5));
}
+ /**
+ * Ensures that parsing the given file raises the expected errors.
+ */
@Test
public void testInstanciation() {
testErrorsOnFile("dataTests/intentDocuments/errors/instanciation.intent", new ParseException(
"Instanciation instruction new EPackage uml { does not end correctly.", 354, 18));
}
+ /**
+ * Ensures that parsing the given file raises the expected errors.
+ */
@Test
public void testResourceDeclaration() {
testErrorsOnFile("dataTests/intentDocuments/errors/resource_declaration.intent", new ParseException(
"Resource declaration Resource r { does not end correctly.", 73, 12));
}
+ /**
+ * Ensures that parsing the given file raises the expected errors.
+ */
@Test
public void testSingleAffectation() {
testErrorsOnFile("dataTests/intentDocuments/errors/single_affectation.intent", new ParseException(
"Affectation URI = does not end correctly.", 91, 6));
}
+ /**
+ * Ensures that parsing the given file raises the expected errors.
+ */
@Test
public void testMultipleAffectation() {
testErrorsOnFile("dataTests/intentDocuments/errors/multiple_affectation.intent", new ParseException(
"Affectation content += does not end correctly.", 211, 11));
}
- // CHECKSTYLE:ON
-
}
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 ee5d459..d5da2aa 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
@@ -19,7 +19,9 @@
* @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
*/
public class TestParserErrors extends AbstractTestParserErrors {
-
+ /**
+ * Ensures that parsing the given file raises the expected errors.
+ */
@Test
public void testMissingBracket() {
final int expectedErrorposition = 10;
@@ -29,6 +31,9 @@
expectedErrorposition, expectedErrorLength));
}
+ /**
+ * Ensures that parsing the given file raises the expected errors.
+ */
@Test
public void testNewLines() {
final int expectedErrorposition = 10;
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/modelingunit/test/TestModelingUnitParser.java b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/modelingunit/test/TestModelingUnitParser.java
index 92ae2fa..1f5d423 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/modelingunit/test/TestModelingUnitParser.java
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/modelingunit/test/TestModelingUnitParser.java
@@ -1,227 +1,231 @@
-/*******************************************************************************
- * 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.parser.modelingunit.test;
-
-import java.io.File;
-import java.io.IOException;
-
-import junit.framework.Assert;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
-import org.eclipse.mylyn.docs.intent.core.modelingunit.ModelingUnit;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.ModelingUnitParser;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.ModelingUnitParserImpl;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.ParseException;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.test.utils.ModelingUnitParsingTestConfigurator;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.test.utils.XMISaver;
-import org.eclipse.mylyn.docs.intent.parser.test.utils.FileToStringConverter;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test the parsing of ModelingUnit files.
- *
- * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
- */
-public class TestModelingUnitParser {
-
- /**
- * Parser used to parse modeling units.
- */
- private static ModelingUnitParser modelingUnitParser;
-
- /**
- * Initialization of the Test environment : launching the StandaloneParsingManager.
- */
- @Before
- public void setUp() {
- modelingUnitParser = new ModelingUnitParserImpl();
- // Registering resource factories so that test can be laucnhed in standalone mode
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap()
- .put("xmi", new XMIResourceFactoryImpl());
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore",
- new XMIResourceFactoryImpl());
- }
-
- /**
- * Parses the content of the file located at the given filePath, and compare the parse result to the
- * expected result.
- *
- * @param fileToTest
- * path of the file starting from the DATATESTS_FOLDER and without any extension
- * @param supposedToWork
- * indicates if the parser is supposed to succeed.
- * @return the file's AST
- */
- static EObject parseAndCompareToExpected(String fileToTest, boolean supposedToWork) {
-
- // Step 1 : we parse the model and obtain the AST
- ModelingUnit parsedAST = null;
- try {
- parsedAST = (ModelingUnit)ModelingUnitParsingTestConfigurator.parseFile(modelingUnitParser,
- fileToTest);
- /*
- * Resource r = new XtextResource(URI.createFileURI(ModelingUnitParsingTestConfigurator
- * .getDatatestsFolder() + fileToTest + ModelingUnitParsingTestConfigurator.getFileExtensions()));
- * r.getContents().add(parsedAST); for (Issue issue : modelingUnitParser.getValidationErrors(r)) {
- * System.err.println(issue.getLineNumber() + ":" + issue.getMessage()); }
- */
-
- // Step 2 : we save this model in an xmi file
- String actual = XMISaver.saveASXMI(parsedAST);
-
- // Step 3 : we get the file corresponding to the expected result.
- File expectedASTFile = new File(ModelingUnitParsingTestConfigurator.getExpectedFolder()
- + fileToTest + ".xmi");
- // -- if the File doesn't exist, we save this AST as Expected AST.
- if (!expectedASTFile.canRead()) {
- XMISaver.saveASXMI(parsedAST, expectedASTFile);
- }
-
- // Step 4 : we compare the textual version of the two xmiFiles.
- String expected = FileToStringConverter.getFileAsString(expectedASTFile);
- Assert.assertEquals(expected, actual);
- Assert.assertEquals(supposedToWork, true);
- } catch (ParseException e) {
- System.err.println("----------------------------------------");
- System.err.println("--- Parsing errors for file : " + fileToTest);
- System.err.println(e.getMessage());
- Assert.assertEquals(supposedToWork, false);
- } catch (IOException e) {
- e.printStackTrace();
- Assert.assertEquals(supposedToWork, false);
- }
- return parsedAST;
-
- }
-
- /**
- * Test which purpose is to test the correct parsing of a simple Intent file.
- */
- @Test
- public void testSimpleParsing() {
- parseAndCompareToExpected("simpleTests/SimpleModelingUnit", true);
- }
-
- /**
- * Test which purpose is to test the correct parsing of a special values.
- */
- @Test
- public void testSpecialvalues() {
- parseAndCompareToExpected("simpleTests/SpecialValues", true);
- }
-
- /**
- * Test which purpose is to test the correct parsing of a complete Intent file.
- */
- @Test
- public void testCompleteParsing() {
- parseAndCompareToExpected("simpleTests/CompleteModelingUnit", true);
- }
-
- /**
- * Test which purpose is to test the correct parsing of a complete Intent file.
- */
- @Test
- public void testCompleteParsing2() {
- parseAndCompareToExpected("simpleTests/CompleteModelingUnit2", true);
- }
-
- /**
- * Test which purpose is to test the correct parsing of a complete Intent file.
- */
- @Test
- public void testCompleteParsing3() {
- parseAndCompareToExpected("simpleTests/CompleteModelingUnit3", true);
- }
-
- /**
- * Test which purpose is to test the correct parsing of label declarations.
- */
- @Test
- public void testLabelParsing() {
- parseAndCompareToExpected("simpleTests/AllKindOfLabels", true);
- }
-
- /**
- * Test which purpose is to test the correct parsing of resource declarations.
- */
- @Test
- public void resourceDeclaration() {
- parseAndCompareToExpected("resourcesRelatedTest/resourceDeclaration", true);
- }
-
- /* Parsings supposed to fail */
-
- /**
- * Test which purpose is to test that an invalid linking (declaration of an Annotation with no possible
- * target) is detected an throw an appropriate ParseError.
- */
- @Test
- public void invalidAnnotationLinking() {
- parseAndCompareToExpected("incorrectFiles/invalidAnnotationLinking", false);
- }
-
- /**
- * Test which purpose is to test that an invalid linking (declaration of an Label with no possible target)
- * is detected an throw an appropriate ParseError.
- */
- @Test
- public void invalidLabelLinking() {
- parseAndCompareToExpected("incorrectFiles/invalidLabelLinking", true);
- }
-
- /**
- * Test which purpose is to test that an invalid linkin g(declaration of an Refrence with no possible
- * target) is detected an throw an appropriate ParseError.
- */
- @Test
- public void invalidSectionRefrenceLinking() {
- parseAndCompareToExpected("incorrectFiles/invalidSectionRefrenceLinking", false);
- }
-
- /**
- * Test which purpose is to test that an parsing of invalid files throw an appropriate ParseError.
- */
- @Test
- public void invalidParsing() {
- parseAndCompareToExpected("incorrectFiles/invalidModelingUnit", false);
- }
-
- /**
- * Test which purpose is to test the given modeling unit, declaragin element and resource in the same
- * time.
- */
- @Test
- public void modelingAndResource() {
- parseAndCompareToExpected("simpleTests/ModelingAndResource", true);
- }
-
- /**
- * Tests that {@link org.eclipse.mylyn.docs.intent.core.modelingunit.ExternalContentReference} are
- * correctly parsed.
- */
- @Test
- public void externalReferencesParsing() {
- parseAndCompareToExpected("simpleTests/ExternalContentReferences", true);
- }
- // @Test
- // public void testDiagnostic() {
- //
- // ModelingUnit parsedAST = (ModelingUnit)parseAndCompareToExpected("simpleTests/CompleteModelingUnit",
- // true);
- // // ((LabelinModelingUnit)parsedAST.getInstructions().get(0)).setUnit(ModelingUnitFactory.eINSTANCE
- // // .createModelingUnit());
- // // modelingUnitParser.validateAST(parsedAST);
- // }
-}
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+//CHECKSTYLE:OFF
+package org.eclipse.mylyn.docs.intent.parser.modelingunit.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.eclipse.mylyn.docs.intent.core.modelingunit.ModelingUnit;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.ModelingUnitParser;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.ModelingUnitParserImpl;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.ParseException;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.test.utils.ModelingUnitParsingTestConfigurator;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.test.utils.XMISaver;
+import org.eclipse.mylyn.docs.intent.parser.test.utils.FileToStringConverter;
+import org.junit.Before;
+import org.junit.Test;
+
+//CHECKSTYLE:ON
+/**
+ * Test the parsing of ModelingUnit files.
+ *
+ * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
+ */
+public class TestModelingUnitParser {
+
+ /**
+ * Parser used to parse modeling units.
+ */
+ private static ModelingUnitParser modelingUnitParser;
+
+ /**
+ * Initialization of the Test environment : launching the StandaloneParsingManager.
+ */
+ @Before
+ public void setUp() {
+ modelingUnitParser = new ModelingUnitParserImpl();
+ // Registering resource factories so that test can be laucnhed in standalone mode
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap()
+ .put("xmi", new XMIResourceFactoryImpl());
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore",
+ new XMIResourceFactoryImpl());
+ }
+
+ /**
+ * Parses the content of the file located at the given filePath, and compare the parse result to the
+ * expected result.
+ *
+ * @param fileToTest
+ * path of the file starting from the DATATESTS_FOLDER and without any extension
+ * @param supposedToWork
+ * indicates if the parser is supposed to succeed.
+ * @return the file's AST
+ */
+ static EObject parseAndCompareToExpected(String fileToTest, boolean supposedToWork) {
+
+ // Step 1 : we parse the model and obtain the AST
+ ModelingUnit parsedAST = null;
+ try {
+ parsedAST = (ModelingUnit)ModelingUnitParsingTestConfigurator.parseFile(modelingUnitParser,
+ fileToTest);
+ /*
+ * Resource r = new XtextResource(URI.createFileURI(ModelingUnitParsingTestConfigurator
+ * .getDatatestsFolder() + fileToTest + ModelingUnitParsingTestConfigurator.getFileExtensions()));
+ * r.getContents().add(parsedAST); for (Issue issue : modelingUnitParser.getValidationErrors(r)) {
+ * System.err.println(issue.getLineNumber() + ":" + issue.getMessage()); }
+ */
+
+ // Step 2 : we save this model in an xmi file
+ String actual = XMISaver.saveASXMI(parsedAST);
+
+ // Step 3 : we get the file corresponding to the expected result.
+ File expectedASTFile = new File(ModelingUnitParsingTestConfigurator.getExpectedFolder()
+ + fileToTest + ".xmi");
+ // -- if the File doesn't exist, we save this AST as Expected AST.
+ if (!expectedASTFile.canRead()) {
+ XMISaver.saveASXMI(parsedAST, expectedASTFile);
+ }
+
+ // Step 4 : we compare the textual version of the two xmiFiles.
+ String expected = FileToStringConverter.getFileAsString(expectedASTFile);
+ assertEquals(expected, actual);
+ assertTrue("File should have raised parsing exception", supposedToWork);
+ } catch (ParseException e) {
+ System.err.println("----------------------------------------");
+ System.err.println("--- Parsing errors for file : " + fileToTest);
+ System.err.println(e.getMessage());
+ assertFalse("File should not have raised parsing exception", supposedToWork);
+ } catch (IOException e) {
+ e.printStackTrace();
+ assertEquals(supposedToWork, false);
+ }
+ return parsedAST;
+
+ }
+
+ /**
+ * Test which purpose is to test the correct parsing of a simple Intent file.
+ */
+ @Test
+ public void testSimpleParsing() {
+ parseAndCompareToExpected("simpleTests/SimpleModelingUnit", true);
+ }
+
+ /**
+ * Test which purpose is to test the correct parsing of a special values.
+ */
+ @Test
+ public void testSpecialvalues() {
+ parseAndCompareToExpected("simpleTests/SpecialValues", true);
+ }
+
+ /**
+ * Test which purpose is to test the correct parsing of a complete Intent file.
+ */
+ @Test
+ public void testCompleteParsing() {
+ parseAndCompareToExpected("simpleTests/CompleteModelingUnit", true);
+ }
+
+ /**
+ * Test which purpose is to test the correct parsing of a complete Intent file.
+ */
+ @Test
+ public void testCompleteParsing2() {
+ parseAndCompareToExpected("simpleTests/CompleteModelingUnit2", true);
+ }
+
+ /**
+ * Test which purpose is to test the correct parsing of a complete Intent file.
+ */
+ @Test
+ public void testCompleteParsing3() {
+ parseAndCompareToExpected("simpleTests/CompleteModelingUnit3", true);
+ }
+
+ /**
+ * Test which purpose is to test the correct parsing of label declarations.
+ */
+ @Test
+ public void testLabelParsing() {
+ parseAndCompareToExpected("simpleTests/AllKindOfLabels", true);
+ }
+
+ /**
+ * Test which purpose is to test the correct parsing of resource declarations.
+ */
+ @Test
+ public void resourceDeclaration() {
+ parseAndCompareToExpected("resourcesRelatedTest/resourceDeclaration", true);
+ }
+
+ /* Parsings supposed to fail */
+
+ /**
+ * Test which purpose is to test that an invalid linking (declaration of an Annotation with no possible
+ * target) is detected an throw an appropriate ParseError.
+ */
+ @Test
+ public void invalidAnnotationLinking() {
+ parseAndCompareToExpected("incorrectFiles/invalidAnnotationLinking", false);
+ }
+
+ /**
+ * Test which purpose is to test that an invalid linking (declaration of an Label with no possible target)
+ * is detected an throw an appropriate ParseError.
+ */
+ @Test
+ public void invalidLabelLinking() {
+ parseAndCompareToExpected("incorrectFiles/invalidLabelLinking", true);
+ }
+
+ /**
+ * Test which purpose is to test that an invalid linkin g(declaration of an Refrence with no possible
+ * target) is detected an throw an appropriate ParseError.
+ */
+ @Test
+ public void invalidSectionRefrenceLinking() {
+ parseAndCompareToExpected("incorrectFiles/invalidSectionRefrenceLinking", false);
+ }
+
+ /**
+ * Test which purpose is to test that an parsing of invalid files throw an appropriate ParseError.
+ */
+ @Test
+ public void invalidParsing() {
+ parseAndCompareToExpected("incorrectFiles/invalidModelingUnit", false);
+ }
+
+ /**
+ * Test which purpose is to test the given modeling unit, declaragin element and resource in the same
+ * time.
+ */
+ @Test
+ public void modelingAndResource() {
+ parseAndCompareToExpected("simpleTests/ModelingAndResource", true);
+ }
+
+ /**
+ * Tests that {@link org.eclipse.mylyn.docs.intent.core.modelingunit.ExternalContentReference} are
+ * correctly parsed.
+ */
+ @Test
+ public void externalReferencesParsing() {
+ parseAndCompareToExpected("simpleTests/ExternalContentReferences", true);
+ }
+ // @Test
+ // public void testDiagnostic() {
+ //
+ // ModelingUnit parsedAST = (ModelingUnit)parseAndCompareToExpected("simpleTests/CompleteModelingUnit",
+ // true);
+ // // ((LabelinModelingUnit)parsedAST.getInstructions().get(0)).setUnit(ModelingUnitFactory.eINSTANCE
+ // // .createModelingUnit());
+ // // modelingUnitParser.validateAST(parsedAST);
+ // }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/modelingunit/test/TestModelingUnitSerialization.java b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/modelingunit/test/TestModelingUnitSerialization.java
index 3f32d36..807f473 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/modelingunit/test/TestModelingUnitSerialization.java
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/modelingunit/test/TestModelingUnitSerialization.java
@@ -1,131 +1,165 @@
-/*******************************************************************************
- * 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.parser.modelingunit.test;
-
-import java.io.File;
-import java.io.IOException;
-
-import junit.framework.Assert;
-
-import org.eclipse.mylyn.docs.intent.core.modelingunit.ModelingUnit;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.ModelingUnitFormatter;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.ModelingUnitParser;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.ModelingUnitParserImpl;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.ParseException;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.serializer.ModelingUnitSerializer;
-import org.eclipse.mylyn.docs.intent.parser.modelingunit.test.utils.ModelingUnitParsingTestConfigurator;
-import org.eclipse.mylyn.docs.intent.parser.test.utils.FileToStringConverter;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Tests the serialization of Modeling Units.
- *
- * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
- */
-public class TestModelingUnitSerialization {
- /**
- * Parser used to parse modeling units.
- */
- private static ModelingUnitParser modelingUnitParser;
-
- private static ModelingUnitSerializer modelingUnitSerializer;
-
- /**
- * Initialisation of the Test environnement : launching the StandaloneParsingManager.
- */
- @Before
- public void setUp() {
- modelingUnitParser = new ModelingUnitParserImpl();
- modelingUnitSerializer = new ModelingUnitSerializer();
- }
-
- static void parseAndCompareSerializationToExpected(String fileToTest, boolean supposedToWork) {
- // Step 1 : we parse the model and obtain the AST
- ModelingUnit parsedAST;
- try {
- parsedAST = (ModelingUnit)ModelingUnitParsingTestConfigurator.parseFile(modelingUnitParser,
- fileToTest);
-
- // xtextRes.getContents().add(parsedAST);
-
- // Step 2 : we serialize this AST
- String actual = modelingUnitSerializer.serialize(parsedAST);
- actual = ModelingUnitFormatter.indentAccordingToBrackets(modelingUnitSerializer, actual);
-
- // Step 3 : we get the file as a String
- File expectedFile = new File(ModelingUnitParsingTestConfigurator.getDatatestsFolder()
- + fileToTest + ModelingUnitParsingTestConfigurator.getFileExtensions());
- String expected = FileToStringConverter.getFileAsString(expectedFile);
-
- // Step 4 : we compare these to String
- Assert.assertEquals(expected, actual);
- Assert.assertEquals(supposedToWork, true);
- } catch (ParseException e) {
- System.err.println("----------------------------------------");
- System.err.println("Parsing errors for file : " + fileToTest);
- System.err.println(e.getMessage());
- Assert.assertEquals(supposedToWork, false);
- } catch (IOException e) {
- e.printStackTrace();
- Assert.assertEquals(supposedToWork, false);
- }
- }
-
- @Test
- public void testSimpleSerialization() {
- parseAndCompareSerializationToExpected("simpleTests/SimpleModelingUnit", true);
- }
-
- @Test
- public void testSpecialvalues() {
- parseAndCompareSerializationToExpected("simpleTests/SpecialValues", true);
- }
-
- @Test
- public void testCompleteSerialization() {
- parseAndCompareSerializationToExpected("simpleTests/CompleteModelingUnit", true);
- parseAndCompareSerializationToExpected("simpleTests/CompleteModelingUnit2", true);
- }
-
- @Test
- @Ignore
- // not supported
- public void testCommentsSerialization() {
- parseAndCompareSerializationToExpected("simpleTests/CompleteModelingUnit3", true);
- }
-
- @Test
- public void testLabelsSerialization() {
- parseAndCompareSerializationToExpected("simpleTests/AllKindOfLabels", true);
- }
-
- @Test
- public void testResourceDeclarationSerialization() {
- parseAndCompareSerializationToExpected("resourcesRelatedTest/resourceDeclaration", true);
- }
-
- @Test
- public void testQualifiedNamesSerialization() {
- parseAndCompareSerializationToExpected("qualifiedNames/qualifiedName", true);
- parseAndCompareSerializationToExpected("qualifiedNames/qualifiedNameNewInstance", true);
- }
-
- /**
- * Tests that {@link org.eclipse.mylyn.docs.intent.core.modelingunit.ExternalContentReference} are
- * correctly serialized.
- */
- @Test
- public void testExternalContentReferencesSerialization() {
- parseAndCompareSerializationToExpected("simpleTests/ExternalContentReferences", true);
- }
-}
+/*******************************************************************************
+ * 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.parser.modelingunit.test;
+
+//CHECKSTYLE:OFF
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.mylyn.docs.intent.core.modelingunit.ModelingUnit;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.ModelingUnitFormatter;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.ModelingUnitParser;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.ModelingUnitParserImpl;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.ParseException;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.serializer.ModelingUnitSerializer;
+import org.eclipse.mylyn.docs.intent.parser.modelingunit.test.utils.ModelingUnitParsingTestConfigurator;
+import org.eclipse.mylyn.docs.intent.parser.test.utils.FileToStringConverter;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+//CHECKSTYLE:ON
+/**
+ * Tests the serialization of Modeling Units.
+ *
+ * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
+ */
+public class TestModelingUnitSerialization {
+ /**
+ * Parser used to parse modeling units.
+ */
+ private static ModelingUnitParser modelingUnitParser;
+
+ /**
+ * Serializer used to serialize modeling units.
+ */
+ private static ModelingUnitSerializer modelingUnitSerializer;
+
+ /**
+ * Initialization of the Test environment : launching the StandaloneParsingManager.
+ */
+ @Before
+ public void setUp() {
+ modelingUnitParser = new ModelingUnitParserImpl();
+ modelingUnitSerializer = new ModelingUnitSerializer();
+ }
+
+ /**
+ * Ensures that parsing and re-serializing the given file does not modify the file.
+ *
+ * @param fileToTest
+ * the name of the file to test
+ * @param supposedToWork
+ * if false, the file should contain syntax errors (and hence is not supposed to be parseable)
+ */
+ static void parseAndCompareSerializationToExpected(String fileToTest, boolean supposedToWork) {
+ // Step 1 : we parse the model and obtain the AST
+ ModelingUnit parsedAST;
+ try {
+ parsedAST = (ModelingUnit)ModelingUnitParsingTestConfigurator.parseFile(modelingUnitParser,
+ fileToTest);
+
+ // xtextRes.getContents().add(parsedAST);
+
+ // Step 2 : we serialize this AST
+ String actual = modelingUnitSerializer.serialize(parsedAST);
+ actual = ModelingUnitFormatter.indentAccordingToBrackets(modelingUnitSerializer, actual);
+
+ // Step 3 : we get the file as a String
+ File expectedFile = new File(ModelingUnitParsingTestConfigurator.getDatatestsFolder()
+ + fileToTest + ModelingUnitParsingTestConfigurator.getFileExtensions());
+ String expected = FileToStringConverter.getFileAsString(expectedFile);
+
+ // Step 4 : we compare these to String
+ assertEquals(expected, actual);
+ assertEquals(supposedToWork, true);
+ } catch (ParseException e) {
+ System.err.println("----------------------------------------");
+ System.err.println("Parsing errors for file : " + fileToTest);
+ System.err.println(e.getMessage());
+ assertEquals(supposedToWork, false);
+ } catch (IOException e) {
+ e.printStackTrace();
+ assertEquals(supposedToWork, false);
+ }
+ }
+
+ /**
+ * Ensures that parsing and re-serializing the given file does not modify the file.
+ */
+ @Test
+ public void testSimpleSerialization() {
+ parseAndCompareSerializationToExpected("simpleTests/SimpleModelingUnit", true);
+ }
+
+ /**
+ * Ensures that parsing and re-serializing the given file does not modify the file.
+ */
+ @Test
+ public void testSpecialvalues() {
+ parseAndCompareSerializationToExpected("simpleTests/SpecialValues", true);
+ }
+
+ /**
+ * Ensures that parsing and re-serializing the given file does not modify the file.
+ */
+ @Test
+ public void testCompleteSerialization() {
+ parseAndCompareSerializationToExpected("simpleTests/CompleteModelingUnit", true);
+ parseAndCompareSerializationToExpected("simpleTests/CompleteModelingUnit2", true);
+ }
+
+ /**
+ * Ensures that parsing and re-serializing the given file does not modify the file.
+ */
+ @Test
+ @Ignore
+ // not supported
+ public void testCommentsSerialization() {
+ parseAndCompareSerializationToExpected("simpleTests/CompleteModelingUnit3", true);
+ }
+
+ /**
+ * Ensures that parsing and re-serializing the given file does not modify the file.
+ */
+ @Test
+ public void testLabelsSerialization() {
+ parseAndCompareSerializationToExpected("simpleTests/AllKindOfLabels", true);
+ }
+
+ /**
+ * Ensures that parsing and re-serializing the given file does not modify the file.
+ */
+ @Test
+ public void testResourceDeclarationSerialization() {
+ parseAndCompareSerializationToExpected("resourcesRelatedTest/resourceDeclaration", true);
+ }
+
+ /**
+ * Ensures that parsing and re-serializing the given file does not modify the file.
+ */
+ @Test
+ public void testQualifiedNamesSerialization() {
+ parseAndCompareSerializationToExpected("qualifiedNames/qualifiedName", true);
+ parseAndCompareSerializationToExpected("qualifiedNames/qualifiedNameNewInstance", true);
+ }
+
+ /**
+ * Tests that {@link org.eclipse.mylyn.docs.intent.core.modelingunit.ExternalContentReference} are
+ * correctly serialized.
+ */
+ @Test
+ public void testExternalContentReferencesSerialization() {
+ parseAndCompareSerializationToExpected("simpleTests/ExternalContentReferences", true);
+ }
+}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/test/IntentParserTest.java b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/test/IntentParserTest.java
index 55e16ee..49bb525 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/test/IntentParserTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/test/IntentParserTest.java
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.mylyn.docs.intent.parser.test;
+//CHECKSTYLE:OFF
+import static org.junit.Assert.assertEquals;
+
import java.io.File;
import java.io.IOException;
-import junit.framework.Assert;
import junit.framework.AssertionFailedError;
import org.eclipse.emf.ecore.EObject;
@@ -23,6 +25,7 @@
import org.eclipse.mylyn.docs.intent.serializer.IntentSerializer;
import org.junit.Test;
+//CHECKSTYLE:ON
/**
* Tests for the IntentParser.
*
@@ -30,8 +33,14 @@
*/
public class IntentParserTest {
+ /**
+ * The parser used to parse intent content.
+ */
private IntentParser parser;
+ /**
+ * The serializer used to serialize intent elements.
+ */
private IntentSerializer serializer;
/**
@@ -42,6 +51,9 @@
serializer = new IntentSerializer();
}
+ /**
+ * Ensures that parsing and re-serializing the given file does not modify the file.
+ */
@Test
public void testSerialization() {
try {
@@ -50,7 +62,7 @@
String section = FileToStringConverter.getFileAsString(file);
EObject generated = parser.parse(section);
// XMISaver.saveASXMI(generated, new File("expectedResults/intentDocuments/intentDocument.xmi"));
- Assert.assertEquals(section, serializer.serialize(generated));
+ assertEquals(section, serializer.serialize(generated));
} catch (IOException e) {
throw new AssertionFailedError(e.getMessage());
} catch (ParseException e) {
@@ -58,6 +70,9 @@
}
}
+ /**
+ * Ensures that parsing and re-serializing the given file does not modify the file.
+ */
@Test
public void testSerializationWithSingleReference() {
try {
@@ -65,7 +80,7 @@
String section = FileToStringConverter.getFileAsString(file);
EObject generated = parser.parse(section);
- Assert.assertEquals(section, serializer.serialize(generated));
+ assertEquals(section, serializer.serialize(generated));
} catch (IOException e) {
throw new AssertionFailedError(e.getMessage());
} catch (ParseException e) {
@@ -83,7 +98,7 @@
String section = FileToStringConverter.getFileAsString(file);
EObject generated = parser.parse(section);
- Assert.assertEquals(section, serializer.serialize(generated));
+ assertEquals(section, serializer.serialize(generated));
} catch (IOException e) {
throw new AssertionFailedError(e.getMessage());
} catch (ParseException e) {
@@ -106,7 +121,7 @@
// .getDescriptionUnits().iterator().next().getInstructions().iterator().next())
// .getDescriptionBloc().getContent().iterator().next()).getContent());
- Assert.assertEquals(section, serializer.serialize(generated));
+ assertEquals(section, serializer.serialize(generated));
} catch (IOException e) {
throw new AssertionFailedError(e.getMessage());
} catch (ParseException e) {
@@ -124,7 +139,7 @@
String section = FileToStringConverter.getFileAsString(file);
EObject generated = parser.parse(section);
- Assert.assertEquals(section, serializer.serialize(generated));
+ assertEquals(section, serializer.serialize(generated));
} catch (IOException e) {
throw new AssertionFailedError(e.getMessage());
} catch (ParseException e) {
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/test/descriptionunit/DescriptionUnitParserTest.java b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/test/descriptionunit/DescriptionUnitParserTest.java
index 5a36daa..ac2b84d 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/test/descriptionunit/DescriptionUnitParserTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/docs/intent/parser/test/descriptionunit/DescriptionUnitParserTest.java
@@ -10,11 +10,13 @@
*******************************************************************************/
package org.eclipse.mylyn.docs.intent.parser.test.descriptionunit;
-import junit.framework.Assert;
+//CHECKSTYLE:OFF
+import static org.junit.Assert.assertEquals;
import org.eclipse.mylyn.docs.intent.parser.descriptionunit.DescriptionUnitParser;
import org.junit.Test;
+//CHECKSTYLE:ON
/**
* Ensure the good behavior of the DescriptionUnit Parser.
*
@@ -29,21 +31,21 @@
public void testExtractFirstString() {
DescriptionUnitParser parser = new DescriptionUnitParser();
// 'FirstString'
- Assert.assertEquals("firstString", parser.extractFirstString("'firstString' and 'secondString'"));
+ assertEquals("firstString", parser.extractFirstString("'firstString' and 'secondString'"));
// "FirstS'tring"
- Assert.assertEquals("firstS'tring", parser.extractFirstString("\"firstS'tring\" and 'secondString'"));
+ assertEquals("firstS'tring", parser.extractFirstString("\"firstS'tring\" and 'secondString'"));
// 'Firs\'String'
- Assert.assertEquals("firs'tString", parser.extractFirstString("'firs\\'tString'"));
+ assertEquals("firs'tString", parser.extractFirstString("'firs\\'tString'"));
// "first\"String" => first"String
- Assert.assertEquals("firs\"tString", parser.extractFirstString("\"firs\\\"tString\""));
+ assertEquals("firs\"tString", parser.extractFirstString("\"firs\\\"tString\""));
// 'firs\\'tString' => firs\\
- Assert.assertEquals("firs\\", parser.extractFirstString("'firs\\\\'tString'"));
+ assertEquals("firs\\", parser.extractFirstString("'firs\\\\'tString'"));
// "'first\\\"String'" => 'first\"String'
- Assert.assertEquals("'first\\\"String'", parser.extractFirstString("\"'first\\\\\\\"String'\""));
+ assertEquals("'first\\\"String'", parser.extractFirstString("\"'first\\\\\\\"String'\""));
// => 'first\'String'
- Assert.assertEquals("'first\\'String'", parser.extractFirstString("\"'first\\\\\\'String'\""));
+ assertEquals("'first\\'String'", parser.extractFirstString("\"'first\\\\\\'String'\""));
- Assert.assertEquals(null, parser.extractFirstString(" ' something"));
+ assertEquals(null, parser.extractFirstString(" ' something"));
}
}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserGeneral.java b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserGeneral.java
index ffde363..4d53f6f 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserGeneral.java
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserGeneral.java
@@ -8,16 +8,19 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
+// CHECKSTYLE:OFF
package org.eclipse.mylyn.wikitext.textile.model.tests.unit.parsing;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
import java.io.File;
import java.io.FileInputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
-import junit.framework.Assert;
-
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.resource.Resource;
@@ -29,6 +32,8 @@
import org.eclipse.mylyn.docs.intent.parser.test.utils.FileToStringConverter;
import org.junit.Test;
+//CHECKSTYLE:ON
+
/**
* Test simple parsing of textile files.
*
@@ -36,48 +41,69 @@
*/
public class TestWikiTextParserGeneral {
- static String[] getTextSerializations(String fileToTest) throws Exception {
+ /**
+ * From the given textile file, returns a table containing:
+ * <ul>
+ * <li>the expected result (as a textile)</li>
+ * <li>the actual result (from file)</li>
+ * <li>the actual result (textile serialization obtained from parsed model).</li>
+ * </ul>
+ *
+ * @param fileToTest
+ * the textile file to test
+ * @return a result table
+ */
+ static String[] getTextSerializations(String fileToTest) {
String fileToGenerate = fileToTest;
// Step 1 : creation of an inputStream on the file to Test.
- // InputStream input = getClass().getClassLoader().getResourceAsStream(
- // TestParsingTextile.PARSING_TEST_DATA + fileToTest);
InputStream input = null;
- input = new FileInputStream(
- new File(WikiTextParserTestConfigurator.getDatatestsFolder() + fileToTest));
-
- // Step 2 : creation of a Wikitext Resource linked from this
- // inputStream.
- Resource resourceTextile = new WikitextResourceFactory().createResource(URI
- .createFileURI(WikiTextParserTestConfigurator.getGeneratedFolder() + fileToGenerate));
-
- // Step 3 : Generation of a textile file.
- Map<String, String> options = new HashMap<String, String>();
- options.put(XMLResource.OPTION_ENCODING, "UTF8");
- resourceTextile.load(input, options);
-
- resourceTextile.save(options);
-
- // Step 4 : Build the result
- String expected;
-
- expected = FileToStringConverter.getFileAsString(new File(WikiTextParserTestConfigurator
- .getDatatestsFolder() + fileToTest));
-
- EPackage.Registry.INSTANCE.put(MarkupPackage.eNS_URI, MarkupPackage.eINSTANCE);
-
- final File file = new File(WikiTextParserTestConfigurator.getGeneratedFolder() + fileToGenerate);
- String actual = FileToStringConverter.getFileAsString(file);
- String fromResource = WikiTextResourceSerializer.getSerializer().serialize(resourceTextile);
-
String[] result = new String[3];
- result[0] = expected;
- result[1] = actual;
- result[2] = fromResource;
+ try {
+ input = new FileInputStream(new File(WikiTextParserTestConfigurator.getDatatestsFolder()
+ + fileToTest));
+
+ // Step 2 : creation of a Wikitext Resource linked from this
+ // inputStream.
+ Resource resourceTextile = new WikitextResourceFactory().createResource(URI
+ .createFileURI(WikiTextParserTestConfigurator.getGeneratedFolder() + fileToGenerate));
+
+ // Step 3 : Generation of a textile file.
+ Map<String, String> options = new HashMap<String, String>();
+ options.put(XMLResource.OPTION_ENCODING, "UTF8");
+
+ resourceTextile.load(input, options);
+
+ resourceTextile.save(options);
+
+ // Step 4 : Build the result
+ String expected;
+
+ expected = FileToStringConverter.getFileAsString(new File(WikiTextParserTestConfigurator
+ .getDatatestsFolder() + fileToTest));
+
+ EPackage.Registry.INSTANCE.put(MarkupPackage.eNS_URI, MarkupPackage.eINSTANCE);
+
+ final File file = new File(WikiTextParserTestConfigurator.getGeneratedFolder() + fileToGenerate);
+ String actual = FileToStringConverter.getFileAsString(file);
+ String fromResource = WikiTextResourceSerializer.getSerializer().serialize(resourceTextile);
+
+ result[0] = expected;
+ result[1] = actual;
+ result[2] = fromResource;
+ } catch (IOException e) {
+ fail(e.getMessage());
+ }
return result;
}
- static void compareTextSerialization(String fileToTest) throws Exception {
+ /**
+ * Ensures that parsing and re-serializing the given file to test allows to obtain the same file.
+ *
+ * @param fileToTest
+ * the file to test
+ */
+ static void compareTextSerialization(String fileToTest) {
String[] serialization = getTextSerializations(fileToTest);
String expected = serialization[0];
@@ -86,8 +112,8 @@
// We ensure that the 2 files are equals,
// and that these files are also equals to the resource's serialisation.
- Assert.assertEquals(expected, actual);
- Assert.assertEquals(expected, fromResource);
+ assertEquals(expected, actual);
+ assertEquals(expected, fromResource);
}
@@ -96,72 +122,81 @@
* code and TOC). compareTextSerialization("simpleDocument.textile"); }
*/
+ /**
+ * Tests parsing of all types of lits (embedded...).
+ */
@Test
- public void testLists() throws Exception {
- // Objectives :
- // parse correctly all types of lits (embedded...).
+ public void testLists() {
compareTextSerialization("lists.textile");
}
+ /**
+ * Tests parsing of embedded and complex formats.
+ */
@Test
- public void testFormats() throws Exception {
- // Objectives :
- // render correctly embedded and complex formats
+ public void testFormats() {
compareTextSerialization("manyFormats.textile");
}
+ /**
+ * Tests parsing of Images embedded in lists.
+ */
@Test
- public void testEmbededImages() throws Exception {
- // Objectives :
- // render correctly Image embedded in lists.
+ public void testEmbededImages() {
compareTextSerialization("new_noteworthy.textile");
}
+ /**
+ * Tests CharacterEscaped Managment (for all HTMLEntities like <br/>
+ * see the SpecificElement Tests).
+ */
@Test
- public void testCharacterEscaped() throws Exception {
- // Objectives
- // Test CharacterEscaped Managment (for all HTMLEntities like <br/> see
- // the SpecificElement Tests)
+ public void testCharacterEscaped() {
compareTextSerialization("User_Guide.textile");
}
+ /**
+ * Tests Table parsing (and also blocQuotes ended by new Sections).
+ */
@Test
- public void testTable() throws Exception {
- // Objectives
- // Correctly render a Table (and also blocQuotes ended by new Sections).
+ public void testTable() {
compareTextSerialization("Using_Compare_Services.textile");
compareTextSerialization("tables.textile");
-
}
+ /**
+ * Tests external links parsing.
+ */
@Test
- public void testLinks() throws Exception {
- // Objectives :
- // parse correctly internal and external links
- // TODO : internal links (seems difficult)
+ public void testLinks() {
compareTextSerialization("testLink.textile");
}
+ /**
+ * Tests fancy paragraphs with padding, alignement...
+ */
@Test
- public void testFancyText() throws Exception {
- // Objectives :
- // parse correctly fancy paragraphs with padding, alignement...
+ public void testFancyText() {
compareTextSerialization("fancyText.textile");
}
+ /**
+ * Test on a complete example.
+ */
@Test
- public void testCompleteExamples() throws Exception {
- // Objectives :
- // Preformatted text, links, TOC...
+ public void testCompleteExamples() {
compareTextSerialization("EMF_Compare_Export_Tutorial.textile");
compareTextSerialization("Adapting_Comparison_Process.textile");
}
+ /**
+ * Ensures that parser is able to handle big Textile file correctly and quickly.
+ */
@Test
- public void performanceTest() throws Exception {
+ public void performanceTest() {
// Objectives :
- // Parse a big Textile file correctly and rapidly.
+ //
compareTextSerialization("specifier-guide.textile");
}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserSpecificElements.java b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserSpecificElements.java
index dce34f4..9f6cbe0 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserSpecificElements.java
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserSpecificElements.java
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.mylyn.wikitext.textile.model.tests.unit.parsing;
-import junit.framework.Assert;
+//CHECKSTYLE:OFF
+import static org.junit.Assert.assertEquals;
import org.junit.Test;
+//CHECKSTYLE:ON
/**
* Test the wikiText parser on specific syntaxic details.
*
@@ -21,11 +23,11 @@
*/
public class TestWikiTextParserSpecificElements {
+ /**
+ * Ensures that TOC are correctly detected (see the textile File for details).
+ */
@Test
- public void testTOCDetection() throws Exception {
- // Objectives :
- // Ensure that TOC are correctly detected (see the textile File for details).
-
+ public void testTOCDetection() {
String[] result = TestWikiTextParserGeneral
.getTextSerializations("specificElements/tocDetection.textile");
String actual = result[1];
@@ -36,21 +38,21 @@
expected += "And this one also";
expected += "\n\n";
expected += "{toc}\n";
- Assert.assertEquals(expected, actual);
+ assertEquals(expected, actual);
}
+ /**
+ * Ensures that HTMLEntites are correctly managed.
+ */
@Test
- public void testHTMLEntities() throws Exception {
- // Objectives :
- // Ensure that HTMLEntites are correctly managed.
-
+ public void testHTMLEntities() {
String[] result = TestWikiTextParserGeneral
.getTextSerializations("specificElements/testHTMLEntities.textile");
String actual = result[1];
String expected = result[0];
expected = expected.replace("<br/>", "\n");
- Assert.assertEquals(expected, actual);
+ assertEquals(expected, actual);
}
}
diff --git a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserUnresolvedProblems.java b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserUnresolvedProblems.java
index 87f9849..4998e5d 100644
--- a/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserUnresolvedProblems.java
+++ b/tests/org.eclipse.mylyn.docs.intent.parser.test/src/org/eclipse/mylyn/wikitext/textile/model/tests/unit/parsing/TestWikiTextParserUnresolvedProblems.java
@@ -19,10 +19,11 @@
*/
public class TestWikiTextParserUnresolvedProblems {
+ /**
+ * Container test for unresolved problems.
+ */
@Test
- public void unresolvedProblems() throws Exception {
- // Objectives :
- // show that some problems remains
+ public void unresolvedProblems() {
// TestWikiTextParserGeneral.compareTextSerialization("unresolvedProblems/fancyUnresolved.textile");
}
}
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/.checkstyle b/tests/org.eclipse.mylyn.docs.intent.test.server/.checkstyle
index 3fe7dfd..959808a 100644
--- a/tests/org.eclipse.mylyn.docs.intent.test.server/.checkstyle
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/.checkstyle
@@ -1,6 +1,7 @@
-<?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="Sun Checks" local="false">
- <file-match-pattern match-pattern="." include-pattern="true"/>
- </fileset>
-</fileset-config>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" 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/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.mylyn.docs.intent.test.server/.settings/org.eclipse.jdt.core.prefs
index af0f20f..416f4fb 100644
--- 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
@@ -1,7 +1,11 @@
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.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
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/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.mylyn.docs.intent.test.server/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..3a3a870
--- /dev/null
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,54 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=true
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=true
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
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
index 15b5477..9b0ad2c 100644
--- 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
@@ -37,12 +37,24 @@
*/
public final class IntentCDORepository {
+ /**
+ * The actual CDO repository.
+ */
private static IRepository repository;
+ /**
+ * The acceptor used to accept requests on this repository.
+ */
private static IAcceptor acceptor;
+ /**
+ * The server location.
+ */
private static final String SERVER_LOCATION = "localhost";
+ /**
+ * The server port number.
+ */
private static final String SERVER_PORT_NUMBER = "1027";
/**