-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1227 from jplag/fix/emfatic-mapping
Fix the token to line mapping for the EMF language and the Emfatic views
- Loading branch information
Showing
8 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
languages/emf-metamodel/src/test/java/de/jplag/emf/EmfLanguageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package de.jplag.emf; | ||
|
||
import static de.jplag.emf.MetamodelTokenType.ATTRIBUTE; | ||
import static de.jplag.emf.MetamodelTokenType.CLASS; | ||
import static de.jplag.emf.MetamodelTokenType.CLASS_END; | ||
import static de.jplag.emf.MetamodelTokenType.CONTAINMENT_MULT; | ||
import static de.jplag.emf.MetamodelTokenType.PACKAGE; | ||
import static de.jplag.emf.MetamodelTokenType.PACKAGE_END; | ||
|
||
import org.junit.jupiter.api.AfterEach; | ||
|
||
import de.jplag.testutils.FileUtil; | ||
import de.jplag.testutils.LanguageModuleTest; | ||
import de.jplag.testutils.datacollector.TestDataCollector; | ||
import de.jplag.testutils.datacollector.TestSourceIgnoredLinesCollector; | ||
|
||
/** | ||
* Basic EMF test that mainly serves the purpose of checking ascending line indices for the tokens with Emfatic views. | ||
*/ | ||
public class EmfLanguageTest extends LanguageModuleTest { | ||
|
||
public EmfLanguageTest() { | ||
super(new EmfLanguage(), MetamodelTokenType.class); | ||
} | ||
|
||
@Override | ||
protected void collectTestData(TestDataCollector collector) { | ||
collector.testAllOfType(EmfLanguage.FILE_ENDING).testContainedTokens(PACKAGE, PACKAGE_END, CLASS, CLASS_END, ATTRIBUTE, CONTAINMENT_MULT); | ||
|
||
} | ||
|
||
@Override | ||
protected void configureIgnoredLines(TestSourceIgnoredLinesCollector collector) { | ||
// None, does not really apply for modeling artifacts. | ||
} | ||
|
||
@AfterEach | ||
protected void tearDown() { | ||
FileUtil.clearFiles(getTestFileLocation(), EmfLanguage.VIEW_FILE_SUFFIX); // clean up the view files. | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.