Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Why MyDslParsingTest re-create each time?(Unit Test)
Why MyDslParsingTest re-create each time? [message #1773803] Wed, 04 October 2017 19:52 Go to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Hello All,

I observe the strange behavior of build system. The Unit Test MyDslParsing.xtend was generated while project was initiated. I prefer to use clear java instead of xtend, so I set
preferXtendStubs=false
in my mwe2 configuration file. Then I deleted xtend file and write java code instead. I was surprised that MyDslParsing.xtend generates again and again. How can switch off this strange behavior

Thanks in advance
Alex.
Re: Why MyDslParsingTest re-create each time? [message #1773806 is a reply to message #1773803] Wed, 04 October 2017 20:28 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

The Junit4Fragment2 only supports Xtend. You may give Xtend a try, especially writing unit tests can be much more fun in Xtend than in Java.

Otherwise, disable stubb generation with generateStub=false and create the Java class.
Re: Why MyDslParsingTest re-create each time? [message #1773866 is a reply to message #1773806] Thu, 05 October 2017 15:19 Go to previous messageGo to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Are there more detailed documentation regarding mwe2 configuration. I've look at
https://www.eclipse.org/Xtext/documentation/306_mwe2.html
and
https://www.eclipse.org/Xtext/documentation/302_configuration.html
I did not find reference to JUnitFragment2.
I suppose I should something like


component = XtextGenerator {
		configuration = {
			project = StandardProjectConfig {
				baseName = "com.psl.atom"
				rootPath = rootPath
				runtimeTest = {
					enabled = true
				}
				eclipsePlugin = {
					enabled = true
				}
				eclipsePluginTest = {
					enabled = true
                                         JUnit4Fragment2 {
                                          generatedStub=false
                                       }
				}
				createEclipseMetaData = true
			}
			code = {
				encoding = "windows-1252"
				lineDelimiter = "\r\n"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
				preferXtendStubs=false
			}
		}
		language = StandardLanguage {
			name = "com.psl.atom.PSL"
			fileExtensions = "psl"

			serializer = {
				generateStub = false
			}
			validator = {
				// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
			}
		}
	}
}

}

[Updated on: Thu, 05 October 2017 15:26]

Report message to a moderator

Re: Why MyDslParsingTest re-create each time? [message #1773867 is a reply to message #1773866] Thu, 05 October 2017 15:42 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
you should have content assist in mwe files
you should be able to do crtl+click and find references

language = StandardLanguage {
name = "org.xtext.example.mydsl.MyDsl"
fileExtensions = "mydsl"

serializer = {
generateStub = false
}
validator = {
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
junitSupport = {
generateStub = false
}
}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:package declaration in runtime editor
Next Topic:Unordered group separator
Goto Forum:
  


Current Time: Tue Mar 19 08:31:48 GMT 2024

Powered by FUDForum. Page generated in 0.02137 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top