Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Migrate FilterTest to Junit5 #3946

Merged
merged 2 commits into from
May 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/test/java/spoon/test/filters/FilterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
package spoon.test.filters;

import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import spoon.Launcher;
import spoon.legacy.NameFilter;
import spoon.reflect.code.CtCFlowBreak;
Expand Down Expand Up @@ -97,14 +97,14 @@
import java.util.List;
import java.util.TreeSet;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import static spoon.testing.utils.ModelUtils.build;

public class FilterTest {

Factory factory;

@Before
@BeforeEach
public void setup() throws Exception {
factory = build(Foo.class);
}
Expand Down Expand Up @@ -1134,7 +1134,7 @@ public void testEarlyTerminatingQuery() {
class Context {
boolean wasTerminated = false;
void failIfTerminated(String place) {
assertTrue("The "+place+" is called after query was terminated.", wasTerminated==false);
assertTrue(wasTerminated==false, "The "+place+" is called after query was terminated.");
}
}

Expand Down Expand Up @@ -1277,7 +1277,7 @@ public void exit(CtElement element) {

})).forEach(ele->{
context2.nrOfResults++;
assertTrue("ele instanceof "+ele.getClass(),ele instanceof CtPackage || ele instanceof CtType || ele instanceof CtModule);
assertTrue(ele instanceof CtPackage || ele instanceof CtType || ele instanceof CtModule, "ele instanceof "+ele.getClass());
//check that first and second query returned same results
assertSame(ele, iter.next());
});
Expand Down