@@ -0,0 +1,1391 @@
+package org.eclipse.xtext.parsetree.reconstr;%0A%0Aimport java.io.ByteArrayOutputStream;%0A%0Aimport org.eclipse.emf.common.util.URI;%0Aimport org.eclipse.emf.ecore.resource.Resource;%0Aimport org.eclipse.xtext.Grammar;%0Aimport org.eclipse.xtext.XtextStandaloneSetup;%0Aimport org.eclipse.xtext.resource.XtextResourceSet;%0Aimport org.eclipse.xtext.tests.AbstractGeneratorTest;%0Aimport org.eclipse.xtext.util.StringInputStream;%0A%0Apublic class XtextGrammarReconcilationTest extends AbstractGeneratorTest %7B%0A%09@Override%0A%09protected void setUp() throws Exception %7B%0A%09%09super.setUp();%0A%09%09XtextStandaloneSetup.doSetup();%0A%09%09with(XtextStandaloneSetup.class);%0A%09%7D%0A%09%0A%09public void testSimple() throws Exception %7B%0A%09%09// this fails see bug #252181%0A//%09%09String model = %22language foo Honolulu : name=ID;%22;%0A//%0A//%09%09// load grammar model%0A//%09%09XtextResourceSet rs = new XtextResourceSet();%0A//%09%09Resource resource = rs.createResource(URI.createURI(%22foo.xtext%22));%0A//%09%09resource.load(new StringInputStream(model),null);%0A//%09%09Grammar object = (Grammar) resource.getContents().get(0);%0A//%09%09%0A//%09%09// modify first rule%0A//%09%09object.getRules().get(0).setName(%22HONOLULU%22);%0A//%09%09%0A//%09%09// save%0A//%09%09ByteArrayOutputStream out = new ByteArrayOutputStream();%0A//%09%09resource.save(out, null);%0A//%09%09String result = new String(out.toByteArray());%0A//%09%09%0A//%09%09// check%0A//%09%09assertFalse(model.equals(result));%0A//%09%09assertEquals(model.toLowerCase(),result.toLowerCase());%0A%09%7D%0A%7D%0A

test for bug #252181