Skip to content

Commit

Permalink
test: Migrate FilterTest to Junit5 (#3946)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohitesh-Kumar-Jain authored May 24, 2021
1 parent eda52de commit df7521e
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit df7521e

Please sign in to comment.