Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Junit for Dependent DSL(How to Create a Dependent Junit Test case of two dependent Grammars)
Junit for Dependent DSL [message #1248210] Sun, 16 February 2014 22:14 Go to next message
Eclipse UserFriend
I try to test Model using Junit like below code :
===================================================
@RunWith(typeof(XtextRunner))
@InjectWith(typeof (MyDslInjectorProvider))
class MyDslParserTest{
@Inject extension ParseHelper modelParserHelper
@Inject extension ValidationTestHelper

@Test
def testMyDslParser(){
var model=modelParserHelper.parse("'

Hello Test!!
viewName:Player
"')
model.assertNoErrors()

}

}

==========================================
I get below result when I run above Junit :

java.lang.AssertionError: Expected no errors, but got :ERROR (org.eclipse.xtext.diagnostics.Diagnostic.Linking) 'Couldn't resolve reference to ViewType 'Player'.' on ViewDefinition

=========================================
here View Name is Grammar that has been imported from other grammar file AdSym.

The problem is in such scenario, how do I write Junit to test grammar included by other grammars also .

Cheers

Kunal
Re: Junit for Dependent DSL [message #1248355 is a reply to message #1248210] Mon, 17 February 2014 01:58 Go to previous message
Eclipse UserFriend
Hi this was answered just a few days ago
http://www.eclipse.org/forums/index.php/t/648014/

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Previous Topic:Use code generator from Eclipse and CLI
Next Topic:Exporting DSL Plugins as Eclipse Product
Goto Forum:
  


Current Time: Wed Jul 23 16:31:11 EDT 2025

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

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

Back to the top