From b3f2ad82d0676dd1647f8d927a3d2f85689f9284 Mon Sep 17 00:00:00 2001 From: Riccardo Azzolini Date: Mon, 12 Aug 2019 17:45:20 +0200 Subject: [PATCH] Migrate from JUnit 4 to 5 --- core/pom.xml | 4 +- .../math/rules/dsl/DslAggregateException.java | 14 ---- .../java/it/cavallium/warppi/AppTest.java | 35 ---------- .../math/rules/dsl/PatternRuleTest.java | 17 ++--- .../warppi/math/rules/dsl/PatternTest.java | 40 ++++++------ .../warppi/math/rules/dsl/RulesDslTest.java | 64 ++++++++----------- .../rules/dsl/errorutils/LineMapTest.java | 28 ++++---- .../math/rules/dsl/frontend/LexerTest.java | 26 ++++---- .../math/rules/dsl/frontend/ParserTest.java | 60 ++++++++--------- pom.xml | 6 +- 10 files changed, 121 insertions(+), 173 deletions(-) delete mode 100644 core/src/test/java/it/cavallium/warppi/AppTest.java diff --git a/core/pom.xml b/core/pom.xml index ba81e79a..06afcbeb 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -46,8 +46,8 @@ commons-lang3 - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/core/src/main/java/it/cavallium/warppi/math/rules/dsl/DslAggregateException.java b/core/src/main/java/it/cavallium/warppi/math/rules/dsl/DslAggregateException.java index ea4cb2d7..ac453c46 100644 --- a/core/src/main/java/it/cavallium/warppi/math/rules/dsl/DslAggregateException.java +++ b/core/src/main/java/it/cavallium/warppi/math/rules/dsl/DslAggregateException.java @@ -29,18 +29,4 @@ public class DslAggregateException extends Exception { public List getErrors() { return errors; } - - @Override - public boolean equals(final Object o) { - if (!(o instanceof DslAggregateException)) { - return false; - } - final DslAggregateException other = (DslAggregateException) o; - return this.errors.equals(other.errors); - } - - @Override - public int hashCode() { - return Objects.hash(errors); - } } diff --git a/core/src/test/java/it/cavallium/warppi/AppTest.java b/core/src/test/java/it/cavallium/warppi/AppTest.java deleted file mode 100644 index d8da2569..00000000 --- a/core/src/test/java/it/cavallium/warppi/AppTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package it.cavallium.warppi; - -import junit.framework.Assert; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest extends TestCase { - /** - * Create the test case - * - * @param testName - * name of the test case - */ - public AppTest(final String testName) { - super(testName); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() { - return new TestSuite(AppTest.class); - } - - /** - * Rigourous Test :-) - */ - public void testApp() { - Assert.assertTrue(true); - } -} \ No newline at end of file diff --git a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/PatternRuleTest.java b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/PatternRuleTest.java index 9e67ded8..0bdac569 100644 --- a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/PatternRuleTest.java +++ b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/PatternRuleTest.java @@ -10,13 +10,13 @@ import it.cavallium.warppi.math.rules.RuleType; import it.cavallium.warppi.math.rules.dsl.patterns.*; import it.cavallium.warppi.util.Error; import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.math.BigDecimal; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; -public class PatternRuleTest { +class PatternRuleTest { private final MathContext mathContext = new MathContext(); private final Pattern x = new SubFunctionPattern("x"); @@ -26,7 +26,7 @@ public class PatternRuleTest { ); @Test - public void testNonMatching() throws InterruptedException, Error { + void testNonMatching() throws InterruptedException, Error { final Function func = new Sum( mathContext, new Number(mathContext, 1), @@ -38,7 +38,7 @@ public class PatternRuleTest { } @Test - public void testMatching() throws InterruptedException, Error { + void testMatching() throws InterruptedException, Error { final Function func = new Sum( mathContext, new Number(mathContext, 1), @@ -57,7 +57,7 @@ public class PatternRuleTest { } @Test - public void testMatchingRecursive() throws InterruptedException, Error { + void testMatchingRecursive() throws InterruptedException, Error { final Function func = new Sum( mathContext, new Number(mathContext, 3), @@ -85,13 +85,14 @@ public class PatternRuleTest { } @Test - public void testMultipleReplacements() throws InterruptedException, Error { + void testMultipleReplacements() throws InterruptedException, Error { final Number one = new Number(mathContext, 1); final Number two = new Number(mathContext, 2); final Function func = new SumSubtraction(mathContext, one, two); final Pattern x = new SubFunctionPattern("x"); final Pattern y = new SubFunctionPattern("y"); + @SuppressWarnings("SuspiciousNameCombination") final PatternRule rule = new PatternRule( "TestRule", RuleType.EXPANSION, @@ -108,7 +109,7 @@ public class PatternRuleTest { } @Test - public void testNoReplacements() throws InterruptedException, Error { + void testNoReplacements() throws InterruptedException, Error { final Function func = new Sum( mathContext, new Number(mathContext, 1), diff --git a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/PatternTest.java b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/PatternTest.java index e8636e1b..afa228af 100644 --- a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/PatternTest.java +++ b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/PatternTest.java @@ -10,18 +10,18 @@ import it.cavallium.warppi.math.functions.equations.EquationsSystem; import it.cavallium.warppi.math.functions.trigonometry.*; import it.cavallium.warppi.math.rules.dsl.patterns.*; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.math.BigDecimal; import java.util.*; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; -public class PatternTest { +class PatternTest { private final MathContext mathContext = new MathContext(); @Test - public void subFunctionPattern() { + void subFunctionPattern() { final Pattern pattern = new SubFunctionPattern("x"); final Function func = new Sum( @@ -36,16 +36,19 @@ public class PatternTest { assertEquals(func, pattern.replace(mathContext, subFunctions.get())); } - @Test(expected = UndefinedSubFunctionException.class) // TODO assert exception.getSubFunctionName().equals("x") - public void undefinedSubFunction() { + @Test + void undefinedSubFunction() { final Pattern pattern = new SubFunctionPattern("x"); final Map subFunctions = Collections.singletonMap("y", new Number(mathContext, 1)); - pattern.replace(mathContext, subFunctions); + final var exception = assertThrows(UndefinedSubFunctionException.class, () -> + pattern.replace(mathContext, subFunctions) + ); + assertEquals("x", exception.getSubFunctionName()); } @Test - public void sumPattern() { + void sumPattern() { final Pattern pattern = new SumPattern( new SubFunctionPattern("x"), new SubFunctionPattern("y") @@ -69,7 +72,7 @@ public class PatternTest { } @Test - public void repeatedSubFunction() { + void repeatedSubFunction() { final Pattern pattern = new SumPattern( new SubFunctionPattern("x"), new SubFunctionPattern("x") @@ -93,7 +96,7 @@ public class PatternTest { } @Test - public void numberPattern() { + void numberPattern() { final Pattern pattern = new NumberPattern(BigDecimal.valueOf(Math.PI)); final Function shouldNotMatch = new Number(mathContext, 2); @@ -106,7 +109,7 @@ public class PatternTest { } @Test - public void negativePattern() { + void negativePattern() { final Pattern pattern = new NegativePattern( new SubFunctionPattern("x") ); @@ -124,7 +127,7 @@ public class PatternTest { } @Test - public void negativePatternForNumber() { + void negativePatternForNumber() { final Pattern pattern = new NegativePattern( new NumberPattern(new BigDecimal(1)) ); @@ -139,7 +142,7 @@ public class PatternTest { } @Test - public void undefinedPattern() { + void undefinedPattern() { final Pattern pattern = new UndefinedPattern(); final Function shouldNotMatch = new Number(mathContext, 0); @@ -152,7 +155,7 @@ public class PatternTest { } @Test - public void equationsSystemPattern() { + void equationsSystemPattern() { final Pattern pattern = new EquationsSystemPattern(new Pattern[]{ new SubFunctionPattern("x"), new SubFunctionPattern("y"), @@ -182,7 +185,7 @@ public class PatternTest { } @Test - public void rootPatternForRootSquare() { + void rootPatternForRootSquare() { final Pattern pattern = new RootPattern( new SubFunctionPattern("x"), new SubFunctionPattern("y") @@ -210,7 +213,7 @@ public class PatternTest { } @Test - public void constantPattern() { + void constantPattern() { final Pattern pattern = new ConstantPattern(MathematicalSymbols.PI); final Function shouldNotMatch = new Variable( @@ -231,7 +234,7 @@ public class PatternTest { } @Test - public void otherBinaryPatterns() { + void otherBinaryPatterns() { final Number one = new Number(mathContext, 1); final Number two = new Number(mathContext, 2); final SubFunctionPattern x = new SubFunctionPattern("x"); @@ -239,6 +242,7 @@ public class PatternTest { final Function shouldNotMatch = new Sum(mathContext, one, two); + @SuppressWarnings("SuspiciousNameCombination") final List> patternsAndMatchingFunctions = Arrays.asList( new ImmutablePair<>( new DivisionPattern(x, y), @@ -278,7 +282,7 @@ public class PatternTest { } @Test - public void otherUnaryPatterns() { + void otherUnaryPatterns() { final Number one = new Number(mathContext, 1); final SubFunctionPattern x = new SubFunctionPattern("x"); diff --git a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/RulesDslTest.java b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/RulesDslTest.java index 9eb52d8c..9111460d 100644 --- a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/RulesDslTest.java +++ b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/RulesDslTest.java @@ -10,23 +10,18 @@ import it.cavallium.warppi.math.rules.dsl.patterns.NegativePattern; import it.cavallium.warppi.math.rules.dsl.patterns.NumberPattern; import it.cavallium.warppi.math.rules.dsl.patterns.SubFunctionPattern; import it.cavallium.warppi.math.rules.dsl.patterns.SumPattern; -import org.junit.Test; -import org.junit.rules.ExpectedException; +import org.junit.jupiter.api.Test; import java.math.BigDecimal; import java.util.Arrays; import java.util.Collections; import java.util.List; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.*; - -public class RulesDslTest { - @org.junit.Rule - public ExpectedException thrown = ExpectedException.none(); +import static org.junit.jupiter.api.Assertions.*; +class RulesDslTest { @Test - public void validRules() throws DslAggregateException { + void validRules() throws DslAggregateException { final List rules = RulesDsl.makeRules( "reduction test1: x -> x\n" + "expansion test2:\n" + @@ -63,38 +58,35 @@ public class RulesDslTest { } @Test - public void lexerError() throws DslAggregateException { - thrown.expect(DslAggregateException.class); - thrown.expect(equalTo( - new DslAggregateException(Collections.singletonList( - new IncompleteNumberLiteral(16, "2.") - )) - )); - - RulesDsl.makeRules("reduction test: 2. 5 -> 1"); + void lexerError() { + final var exception = assertThrows(DslAggregateException.class, () -> + RulesDsl.makeRules("reduction test: 2. 5 -> 1") + ); + final var expectedErrors = Collections.singletonList( + new IncompleteNumberLiteral(16, "2.") + ); + assertEquals(expectedErrors, exception.getErrors()); } @Test - public void parserError() throws DslAggregateException { - thrown.expect(DslAggregateException.class); - thrown.expect(equalTo( - new DslAggregateException(Collections.singletonList( - new UnexpectedToken(new Token(TokenType.EOF, "", 24)) - )) - )); - - RulesDsl.makeRules("existence test: x + y ->"); + void parserError() { + final var exception = assertThrows(DslAggregateException.class, () -> + RulesDsl.makeRules("existence test: x + y ->") + ); + final var expectedErrors = Collections.singletonList( + new UnexpectedToken(new Token(TokenType.EOF, "", 24)) + ); + assertEquals(expectedErrors, exception.getErrors()); } @Test - public void undefinedSubFunction() throws DslAggregateException { - thrown.expect(DslAggregateException.class); - thrown.expect(equalTo( - new DslAggregateException(Collections.singletonList( - new UndefinedSubFunction(new Token(TokenType.IDENTIFIER, "y", 25)) - )) - )); - - RulesDsl.makeRules("expansion test: x -> x + y"); + void undefinedSubFunction() { + final var exception = assertThrows(DslAggregateException.class, () -> + RulesDsl.makeRules("expansion test: x -> x + y") + ); + final var expectedErrors = Collections.singletonList( + new UndefinedSubFunction(new Token(TokenType.IDENTIFIER, "y", 25)) + ); + assertEquals(expectedErrors, exception.getErrors()); } } diff --git a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/errorutils/LineMapTest.java b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/errorutils/LineMapTest.java index 3f020611..9de3d440 100644 --- a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/errorutils/LineMapTest.java +++ b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/errorutils/LineMapTest.java @@ -1,16 +1,16 @@ package it.cavallium.warppi.math.rules.dsl.errorutils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.Collections; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; -public class LineMapTest { +class LineMapTest { @Test - public void emptyText() { + void emptyText() { String text = ""; LineMap map = new LineMap(text); @@ -18,7 +18,7 @@ public class LineMapTest { } @Test - public void noLineSeparators() { + void noLineSeparators() { String text = "single line"; LineMap map = new LineMap(text); @@ -29,7 +29,7 @@ public class LineMapTest { } @Test - public void trailingLf() { + void trailingLf() { String text = "single line\n"; LineMap map = new LineMap(text); @@ -40,7 +40,7 @@ public class LineMapTest { } @Test - public void trailingCr() { + void trailingCr() { String text = "single line\r"; LineMap map = new LineMap(text); @@ -51,7 +51,7 @@ public class LineMapTest { } @Test - public void trailingCrLf() { + void trailingCrLf() { String text = "single line\r\n"; LineMap map = new LineMap(text); @@ -62,7 +62,7 @@ public class LineMapTest { } @Test - public void multipleNonEmptyLines() { + void multipleNonEmptyLines() { String text = "line 1\nline 2\rline 3\r\nline 4"; LineMap map = new LineMap(text); @@ -76,7 +76,7 @@ public class LineMapTest { } @Test - public void singleEmptyLine() { + void singleEmptyLine() { String text = "\n"; LineMap map = new LineMap(text); @@ -87,7 +87,7 @@ public class LineMapTest { } @Test - public void multipleEmptyLines() { + void multipleEmptyLines() { String text = "\r\n\n\r"; LineMap map = new LineMap(text); @@ -100,7 +100,7 @@ public class LineMapTest { } @Test - public void mixedEmptyAndNonEmptyLines() { + void mixedEmptyAndNonEmptyLines() { String text = "line 1\nline 2\r\r\nline 4\n\n"; LineMap map = new LineMap(text); @@ -115,7 +115,7 @@ public class LineMapTest { } @Test - public void emptySubstrings() { + void emptySubstrings() { String text = "single line\n"; LineMap map = new LineMap(text); @@ -128,7 +128,7 @@ public class LineMapTest { } @Test - public void substringIsJustLineSeparator() { + void substringIsJustLineSeparator() { String separator = "\n"; String text = "line 1" + separator + "line 2"; LineMap map = new LineMap(text); diff --git a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/frontend/LexerTest.java b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/frontend/LexerTest.java index 6d1ef4e5..d96c9d2d 100644 --- a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/frontend/LexerTest.java +++ b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/frontend/LexerTest.java @@ -1,8 +1,8 @@ package it.cavallium.warppi.math.rules.dsl.frontend; import it.cavallium.warppi.math.rules.dsl.DslError; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.Arrays; @@ -10,18 +10,18 @@ import java.util.Collections; import java.util.List; import static it.cavallium.warppi.math.rules.dsl.frontend.TokenType.*; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; -public class LexerTest { +class LexerTest { private final List errors = new ArrayList<>(); - @Before - public void setUp() { + @BeforeEach + void setUp() { errors.clear(); } @Test - public void emptyInput() { + void emptyInput() { final Lexer lexer = new Lexer("", errors::add); final List expected = Collections.singletonList( new Token(EOF, "", 0) @@ -30,7 +30,7 @@ public class LexerTest { } @Test - public void validRule() { + void validRule() { final Lexer lexer = new Lexer( "reduction TestRule_123:\n" + " x + y * z = -(a_123 +- 3 / 2.2) -> [\n" + @@ -85,7 +85,7 @@ public class LexerTest { } @Test - public void incompleteNumberOtherChar() { + void incompleteNumberOtherChar() { final Lexer lexer = new Lexer("2. 5 + 3", errors::add); final List expectedTokens = Arrays.asList( @@ -103,7 +103,7 @@ public class LexerTest { } @Test - public void incompleteNumberEof() { + void incompleteNumberEof() { final Lexer lexer = new Lexer("2.", errors::add); final List expectedTokens = Collections.singletonList( @@ -118,7 +118,7 @@ public class LexerTest { } @Test - public void unexpectedCharacters() { + void unexpectedCharacters() { final Lexer lexer = new Lexer("reduction @| .: {}", errors::add); final List expectedTokens = Arrays.asList( @@ -137,7 +137,7 @@ public class LexerTest { } @Test - public void unterminatedComment() { + void unterminatedComment() { final Lexer lexer = new Lexer("reduction /* test:\n x -> x", errors::add); final List expectedTokens = Arrays.asList( @@ -153,7 +153,7 @@ public class LexerTest { } @Test - public void errorOrder() { + void errorOrder() { final Lexer lexer = new Lexer(".2. @", errors::add); final List expectedTokens = Collections.singletonList( diff --git a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/frontend/ParserTest.java b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/frontend/ParserTest.java index 1f75150d..4554c264 100644 --- a/core/src/test/java/it/cavallium/warppi/math/rules/dsl/frontend/ParserTest.java +++ b/core/src/test/java/it/cavallium/warppi/math/rules/dsl/frontend/ParserTest.java @@ -7,8 +7,8 @@ import it.cavallium.warppi.math.rules.dsl.Pattern; import it.cavallium.warppi.math.rules.dsl.PatternRule; import it.cavallium.warppi.math.rules.dsl.patterns.*; import org.apache.commons.lang3.ObjectUtils; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.math.BigDecimal; import java.util.ArrayList; @@ -19,18 +19,18 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import static it.cavallium.warppi.math.rules.dsl.frontend.TokenType.*; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; -public class ParserTest { +class ParserTest { private final List errors = new ArrayList<>(); - @Before - public void setUp() { + @BeforeEach + void setUp() { errors.clear(); } @Test - public void noRules() { + void noRules() { final List tokens = Collections.singletonList( new Token(EOF, "", 0) ); @@ -39,7 +39,7 @@ public class ParserTest { } @Test - public void validRuleMultipleReplacements() { + void validRuleMultipleReplacements() { final List tokens = Arrays.asList( new Token(REDUCTION, "reduction", 0), new Token(IDENTIFIER, "TestRule_123", 10), @@ -127,7 +127,7 @@ public class ParserTest { } @Test - public void validRuleNoReplacements() { + void validRuleNoReplacements() { final List tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), @@ -154,7 +154,7 @@ public class ParserTest { } @Test - public void validRuleOneReplacement() { + void validRuleOneReplacement() { final List tokens = Arrays.asList( new Token(REDUCTION, "reduction", 0), new Token(IDENTIFIER, "test", 0), @@ -188,7 +188,7 @@ public class ParserTest { } @Test - public void validRuleOneReplacementBrackets() { + void validRuleOneReplacementBrackets() { final List tokens = Arrays.asList( new Token(REDUCTION, "reduction", 0), new Token(IDENTIFIER, "test", 0), @@ -232,7 +232,7 @@ public class ParserTest { } @Test - public void multipleValidRules() { + void multipleValidRules() { final List tokens = Arrays.asList( new Token(REDUCTION, "reduction", 0), new Token(IDENTIFIER, "test1", 0), @@ -291,7 +291,7 @@ public class ParserTest { } @Test - public void subFunctionIdentifiers() { + void subFunctionIdentifiers() { final List rule0x = new ArrayList<>(); final List rule1x = new ArrayList<>(); final List rule1y = new ArrayList<>(); @@ -400,8 +400,8 @@ public class ParserTest { // The EOF token is inserted by the lexer, therefore it can only be missing // in case of programming errors, and not directly because of user input. - @Test(expected = RuntimeException.class) - public void missingEof() { + @Test + void missingEof() { final List tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), @@ -414,11 +414,11 @@ public class ParserTest { new Token(RIGHT_BRACKET, "]", 0) ); final Parser parser = new Parser(tokens, errors::add); - parser.parse(); + assertThrows(RuntimeException.class, parser::parse); } @Test - public void incompleteRule() { + void incompleteRule() { final List tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), @@ -440,7 +440,7 @@ public class ParserTest { } @Test - public void missingRuleType() { + void missingRuleType() { final List tokens = Arrays.asList( new Token(IDENTIFIER, "test", 0), new Token(EOF, "", 0) @@ -457,7 +457,7 @@ public class ParserTest { } @Test - public void unexpectedTokenPrimary() { + void unexpectedTokenPrimary() { final List tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), @@ -481,7 +481,7 @@ public class ParserTest { } @Test - public void missingRuleName() { + void missingRuleName() { final List tokens = Arrays.asList( new Token(REDUCTION, "reduction", 0), new Token(COLON, ":", 0), @@ -499,7 +499,7 @@ public class ParserTest { } @Test - public void missingColon() { + void missingColon() { final List tokens = Arrays.asList( new Token(REDUCTION, "reduction", 0), new Token(IDENTIFIER, "test", 0), @@ -520,7 +520,7 @@ public class ParserTest { } @Test - public void missingArrow() { + void missingArrow() { final List tokens = Arrays.asList( new Token(REDUCTION, "reduction", 0), new Token(IDENTIFIER, "test", 0), @@ -541,7 +541,7 @@ public class ParserTest { } @Test - public void missingRightBracket() { + void missingRightBracket() { final List tokens = Arrays.asList( new Token(REDUCTION, "reduction", 0), new Token(IDENTIFIER, "test", 0), @@ -564,7 +564,7 @@ public class ParserTest { } @Test - public void missingOneArgFunctionLeftParen() { + void missingOneArgFunctionLeftParen() { final List tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), @@ -589,7 +589,7 @@ public class ParserTest { } @Test - public void missingOneArgFunctionRightParen() { + void missingOneArgFunctionRightParen() { final List tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), @@ -614,7 +614,7 @@ public class ParserTest { } @Test - public void missingTwoArgFunctionLeftParen() { + void missingTwoArgFunctionLeftParen() { final List tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), @@ -641,7 +641,7 @@ public class ParserTest { } @Test - public void missingTwoArgFunctionComma() { + void missingTwoArgFunctionComma() { final List tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), @@ -668,7 +668,7 @@ public class ParserTest { } @Test - public void missingTwoArgFunctionRightParen() { + void missingTwoArgFunctionRightParen() { final List tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), @@ -695,7 +695,7 @@ public class ParserTest { } @Test - public void missingExpressionRightParen() { + void missingExpressionRightParen() { final List tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), @@ -719,7 +719,7 @@ public class ParserTest { } @Test - public void recoveryToNextRule() { + void recoveryToNextRule() { final List tokens = Arrays.asList( new Token(REDUCTION, "reduction", 0), new Token(IDENTIFIER, "test1", 0), diff --git a/pom.xml b/pom.xml index 6c199b9d..fc7486a7 100755 --- a/pom.xml +++ b/pom.xml @@ -92,9 +92,9 @@ - junit - junit - 4.12 + org.junit.jupiter + junit-jupiter + 5.5.1 test