projet-genie-logiciel-systeme/workspace/fr.n7.game.tests/xtend-gen/xtext/tests/GameParsingTest.java

48 lines
1.6 KiB
Java
Raw Normal View History

2021-11-30 17:25:45 +00:00
/**
* generated by Xtext 2.23.0
*/
package xtext.tests;
import com.google.inject.Inject;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.testing.InjectWith;
import org.eclipse.xtext.testing.extensions.InjectionExtension;
import org.eclipse.xtext.testing.util.ParseHelper;
import org.eclipse.xtext.xbase.lib.Exceptions;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import xtext.game.Jeu;
import xtext.tests.GameInjectorProvider;
@ExtendWith(InjectionExtension.class)
@InjectWith(GameInjectorProvider.class)
@SuppressWarnings("all")
public class GameParsingTest {
@Inject
private ParseHelper<Jeu> parseHelper;
@Test
public void loadModel() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("Hello Xtext!");
_builder.newLine();
final Jeu result = this.parseHelper.parse(_builder);
Assertions.assertNotNull(result);
final EList<Resource.Diagnostic> errors = result.eResource().getErrors();
boolean _isEmpty = errors.isEmpty();
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("Unexpected errors: ");
String _join = IterableExtensions.join(errors, ", ");
_builder_1.append(_join);
Assertions.assertTrue(_isEmpty, _builder_1.toString());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
}