projet-mini-genie-logiciel-.../eclipse-workspace/fr.n7.pdl2.tests/xtend-gen/fr/n7/tests/PDL2ParsingTest.java
Laurent Fainsin de42fac315 TP7
2021-10-12 18:49:13 +02:00

47 lines
1.6 KiB
Java

/**
* generated by Xtext 2.23.0
*/
package fr.n7.tests;
import com.google.inject.Inject;
import fr.n7.tests.PDL2InjectorProvider;
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;
@ExtendWith(InjectionExtension.class)
@InjectWith(PDL2InjectorProvider.class)
@SuppressWarnings("all")
public class PDL2ParsingTest {
@Inject
private ParseHelper<fr.n7.pDL2.Process> parseHelper;
@Test
public void loadModel() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("Hello Xtext!");
_builder.newLine();
final fr.n7.pDL2.Process 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);
}
}
}