Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #437 from eclipse/cd_core_issue716
Browse files Browse the repository at this point in the history
[eclipse/xtext-core#716] Fixed tests after changes in xtext-core
  • Loading branch information
cdietrich authored Apr 26, 2018
2 parents 1ad4e80 + ed06712 commit 4b96797
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,16 @@ class XtendIncrementalBuilderTest extends AbstractIncrementalBuilderTest {
build(newBuildRequest [
deletedFiles = #[uri('src/foo/B.xtend').delete]
afterValidate = [ uri, issues |
assertEquals(uri('src/A.xtend'), uri)
assertTrue(issues.head.message, issues.head.message.contains("foo.B cannot be resolved to a type"))
validateCalled.set(true)
return false
if (uri('src/A.xtend') == uri) {
assertTrue(issues.head.message, issues.head.message.contains("foo.B cannot be resolved to a type"))
validateCalled.set(true)
return false
} else if (uri('src/foo/B.xtend') == uri) {
assertEquals("zero issues expected", 0, issues.size)
return true
} else {
throw new IllegalStateException("unexpected issues for " + uri)
}
]
])
assertTrue(validateCalled.get)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.eclipse.xtend.core.tests.build;

import com.google.common.base.Objects;
import com.google.inject.Inject;
import com.google.inject.Injector;
import java.util.Collections;
Expand Down Expand Up @@ -289,10 +290,22 @@ public void testDelete_01() {
URI _delete = this.delete(this.uri("src/foo/B.xtend"));
it.setDeletedFiles(Collections.<URI>unmodifiableList(CollectionLiterals.<URI>newArrayList(_delete)));
final BuildRequest.IPostValidationCallback _function_2 = (URI uri, Iterable<Issue> issues) -> {
Assert.assertEquals(this.uri("src/A.xtend"), uri);
Assert.assertTrue(IterableExtensions.<Issue>head(issues).getMessage(), IterableExtensions.<Issue>head(issues).getMessage().contains("foo.B cannot be resolved to a type"));
validateCalled.set(true);
return false;
URI _uri = this.uri("src/A.xtend");
boolean _equals = Objects.equal(_uri, uri);
if (_equals) {
Assert.assertTrue(IterableExtensions.<Issue>head(issues).getMessage(), IterableExtensions.<Issue>head(issues).getMessage().contains("foo.B cannot be resolved to a type"));
validateCalled.set(true);
return false;
} else {
URI _uri_1 = this.uri("src/foo/B.xtend");
boolean _equals_1 = Objects.equal(_uri_1, uri);
if (_equals_1) {
Assert.assertEquals("zero issues expected", 0, IterableExtensions.size(issues));
return true;
} else {
throw new IllegalStateException(("unexpected issues for " + uri));
}
}
};
it.setAfterValidate(_function_2);
};
Expand Down

0 comments on commit 4b96797

Please sign in to comment.