Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 629f9c114d8da2b17dbe5426be4a752df78edac1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package org.eclipse.emf.ecore.xcore.tests;

import org.eclipse.emf.ecore.xcore.XPackage;
import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider;
import org.eclipse.xtext.junit4.InjectWith;
import org.eclipse.xtext.junit4.XtextRunner;
import org.eclipse.xtext.junit4.util.ParseHelper;
import org.junit.Test;
import org.junit.runner.RunWith;

import com.google.inject.Inject;

import static org.junit.Assert.*;

@RunWith(XtextRunner.class)
@InjectWith(XcoreInjectorProvider.class)
public class ParserTest
{

	@Inject
	private ParseHelper<XPackage> parser;

	@Test
	public void parseSimpleFile() throws Exception
	{
		XPackage parse = parser.parse("package foo");
		assertEquals("foo", parse.getName());
	}

}

Back to the top