_builder.append("include \"b.tpd\"");
_builder.newLine();
_builder.append("location A \"locationURI1\"");
_builder.newLine();
URI _createURI = URI.createURI("tmp:/a.tpd");
final TargetPlatform tpa = this.parser.parse(_builder, _createURI, resourceSet);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("target \"tp.b\"");
_builder_1.newLine();
_builder_1.append("include \"c.tpd\"");
_builder_1.newLine();
_builder_1.append("location A \"locationURI1\"");
_builder_1.newLine();
URI _createURI_1 = URI.createURI("tmp:/b.tpd");
final TargetPlatform tpb = this.parser.parse(_builder_1, _createURI_1, resourceSet);
StringConcatenation _builder_2 = new StringConcatenation();
_builder_2.append("target \"tp.c\"");
_builder_2.newLine();
_builder_2.append("location C \"locationURI1\"");
_builder_2.newLine();
URI _createURI_2 = URI.createURI("tmp:/c.tpd");
final TargetPlatform tpc = this.parser.parse(_builder_2, _createURI_2, resourceSet);
Resource _eResource = tpa.eResource();
EList<Resource.Diagnostic> _errors = _eResource.getErrors();
boolean _isEmpty = _errors.isEmpty();
Assert.assertTrue(_isEmpty);
TargetPlatformValidator _validator = tester.validator();
_validator.checkSameIDForAllLocationWithSameURI(tpa);
AssertableDiagnostics _diagnose = tester.diagnose();
Iterable<Diagnostic> _allDiagnostics = _diagnose.getAllDiagnostics();
Iterable<AbstractValidationDiagnostic> _filter = Iterables.<AbstractValidationDiagnostic>filter(_allDiagnostics, AbstractValidationDiagnostic.class);
List<AbstractValidationDiagnostic> diagnotics = IterableExtensions.<AbstractValidationDiagnostic>toList(_filter);
int _size = diagnotics.size();
Assert.assertEquals(1, _size);
final Function1<AbstractValidationDiagnostic, Boolean> _function = new Function1<AbstractValidationDiagnostic, Boolean>() {
public Boolean apply(final AbstractValidationDiagnostic it) {
EObject _sourceEObject = it.getSourceEObject();
return Boolean.valueOf((_sourceEObject instanceof IncludeDeclaration));
}
};
boolean _forall = IterableExtensions.<AbstractValidationDiagnostic>forall(diagnotics, _function);
Assert.assertTrue(_forall);
final Procedure1<AbstractValidationDiagnostic> _function_1 = new Procedure1<AbstractValidationDiagnostic>() {
public void apply(final AbstractValidationDiagnostic it) {
String _issueCode = it.getIssueCode();
Assert.assertEquals(TargetPlatformValidator.CHECK__CONFLICTUAL_ID__BETWEEN_INCLUDED_LOCATION, _issueCode);
EObject _sourceEObject = it.getSourceEObject();
String _importURI = ((IncludeDeclaration) _sourceEObject).getImportURI();
Assert.assertEquals("b.tpd", _importURI);
EObject _sourceEObject_1 = it.getSourceEObject();
Resource _eResource = ((IncludeDeclaration) _sourceEObject_1).eResource();
URI _uRI = _eResource.getURI();
String _string = _uRI.toString();
Assert.assertEquals("tmp:/a.tpd", _string);
}
};
IterableExtensions.<AbstractValidationDiagnostic>forEach(diagnotics, _function_1);
Resource _eResource_1 = tpb.eResource();
EList<Resource.Diagnostic> _errors_1 = _eResource_1.getErrors();
boolean _isEmpty_1 = _errors_1.isEmpty();
Assert.assertTrue(_isEmpty_1);
TargetPlatformValidator _validator_1 = tester.validator();
_validator_1.checkSameIDForAllLocationWithSameURI(tpb);
AssertableDiagnostics _diagnose_1 = tester.diagnose();
Iterable<Diagnostic> _allDiagnostics_1 = _diagnose_1.getAllDiagnostics();
Iterable<AbstractValidationDiagnostic> _filter_1 = Iterables.<AbstractValidationDiagnostic>filter(_allDiagnostics_1, AbstractValidationDiagnostic.class);
List<AbstractValidationDiagnostic> _list = IterableExtensions.<AbstractValidationDiagnostic>toList(_filter_1);
diagnotics = _list;
int _size_1 = diagnotics.size();
Assert.assertEquals(1, _size_1);
final Function1<AbstractValidationDiagnostic, Boolean> _function_2 = new Function1<AbstractValidationDiagnostic, Boolean>() {
public Boolean apply(final AbstractValidationDiagnostic it) {
EObject _sourceEObject = it.getSourceEObject();
return Boolean.valueOf((_sourceEObject instanceof Location));
}
};
boolean _forall_1 = IterableExtensions.<AbstractValidationDiagnostic>forall(diagnotics, _function_2);
Assert.assertTrue(_forall_1);
final Procedure1<AbstractValidationDiagnostic> _function_3 = new Procedure1<AbstractValidationDiagnostic>() {
public void apply(final AbstractValidationDiagnostic it) {
String _issueCode = it.getIssueCode();
Assert.assertEquals(TargetPlatformValidator.CHECK__INCLUDED_LOCATION_CONFLICTUAL_ID, _issueCode);
EObject _sourceEObject = it.getSourceEObject();
String _uri = ((Location) _sourceEObject).getUri();
Assert.assertEquals("locationURI1", _uri);
EObject _sourceEObject_1 = it.getSourceEObject();
Resource _eResource = ((Location) _sourceEObject_1).eResource();
URI _uRI = _eResource.getURI();
String _string = _uRI.toString();
Assert.assertEquals("tmp:/b.tpd", _string);
}
};
IterableExtensions.<AbstractValidationDiagnostic>forEach(diagnotics, _function_3);
Resource _eResource_2 = tpc.eResource();
EList<Resource.Diagnostic> _errors_2 = _eResource_2.getErrors();
boolean _isEmpty_2 = _errors_2.isEmpty();
Assert.assertTrue(_isEmpty_2);
TargetPlatformValidator _validator_2 = tester.validator();
_validator_2.checkSameIDForAllLocationWithSameURI(tpc);