From 8ab1af5c02ed4cc726856e20e0de9f269d0f66ae Mon Sep 17 00:00:00 2001 From: Rene Leonhardt <65483435+reneleonhardt@users.noreply.github.com> Date: Sun, 19 Nov 2023 21:26:07 +0100 Subject: [PATCH] chore(deps): Upgrade to JUnit 5 Signed-off-by: Rene Leonhardt <65483435+reneleonhardt@users.noreply.github.com> --- .github/dependabot.yml | 6 +++++ pom.xml | 20 +++++++-------- test/org/stringtemplate/v4/test/BaseTest.java | 10 ++++---- .../v4/test/TestAggregates.java | 4 +-- .../v4/test/TestAttributes.java | 4 +-- .../TestBuggyDefaultValueRaisesNPETest.java | 7 +++--- .../stringtemplate/v4/test/TestCompiler.java | 4 +-- .../v4/test/TestCoreBasics.java | 4 +-- .../v4/test/TestDebugEvents.java | 4 +-- .../v4/test/TestDictionaries.java | 14 +++++------ .../v4/test/TestDollarDelimiters.java | 22 ++++++++-------- .../v4/test/TestEarlyEvaluation.java | 25 ++++++++++--------- .../stringtemplate/v4/test/TestFunctions.java | 5 ++-- .../v4/test/TestGroupSyntax.java | 6 ++--- .../v4/test/TestGroupSyntaxErrors.java | 4 +-- .../stringtemplate/v4/test/TestGroups.java | 20 +++++++-------- .../v4/test/TestGroupsFromCLASSPATH.java | 4 +-- .../stringtemplate/v4/test/TestImports.java | 6 ++--- .../v4/test/TestIndentation.java | 4 +-- .../v4/test/TestIndirectionAndEarlyEval.java | 5 ++-- .../v4/test/TestInterptimeErrors.java | 4 +-- .../org/stringtemplate/v4/test/TestLexer.java | 2 +- .../stringtemplate/v4/test/TestLineWrap.java | 4 +-- .../org/stringtemplate/v4/test/TestLists.java | 4 +-- .../v4/test/TestModelAdaptors.java | 4 +-- .../v4/test/TestNoNewlineTemplates.java | 4 +-- .../v4/test/TestNullAndEmptyValues.java | 15 +++++------ .../stringtemplate/v4/test/TestOptions.java | 4 +-- .../stringtemplate/v4/test/TestRegions.java | 7 +++--- .../stringtemplate/v4/test/TestRenderers.java | 12 ++++----- .../v4/test/TestSTRawGroupDir.java | 6 ++--- .../stringtemplate/v4/test/TestScopes.java | 4 +-- .../v4/test/TestSubtemplates.java | 4 +-- .../v4/test/TestSyntaxErrors.java | 4 +-- .../v4/test/TestTemplateNames.java | 4 +-- .../test/TestTokensForDollarDelimiters.java | 2 +- .../v4/test/TestTreeConstruction.java | 12 ++++----- .../v4/test/TestTypeRegistry.java | 6 ++--- .../v4/test/TestWhitespace.java | 7 +++--- 39 files changed, 147 insertions(+), 140 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..89937b25 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: +- package-ecosystem: maven # Update pom.xml dependencies and plugins weekly + directory: "/" + schedule: + interval: weekly diff --git a/pom.xml b/pom.xml index 895f10b6..8887380c 100644 --- a/pom.xml +++ b/pom.xml @@ -38,12 +38,12 @@ - - junit - junit - 4.13.2 - test - + + org.junit.jupiter + junit-jupiter-engine + 5.10.1 + test + org.antlr antlr-runtime @@ -72,7 +72,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.6.2 1.8 false @@ -91,12 +91,12 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.4.0 org.apache.maven.plugins maven-surefire-plugin - 2.22.0 + 3.2.2 -Dfile.encoding=UTF-8 @@ -109,7 +109,7 @@ org.antlr antlr3-maven-plugin - 3.5.2 + 3.5.3 src src/org/stringtemplate/v4/compiler diff --git a/test/org/stringtemplate/v4/test/BaseTest.java b/test/org/stringtemplate/v4/test/BaseTest.java index ace543f4..289ebef8 100644 --- a/test/org/stringtemplate/v4/test/BaseTest.java +++ b/test/org/stringtemplate/v4/test/BaseTest.java @@ -27,11 +27,10 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import java.util.concurrent.atomic.AtomicInteger; import org.antlr.runtime.ANTLRStringStream; import org.antlr.runtime.CommonTokenStream; import org.antlr.runtime.Token; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.compiler.Compiler; @@ -55,11 +54,12 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public abstract class BaseTest { @@ -117,7 +117,7 @@ public String toString() { } } - @Before + @BeforeEach public void setUp() { STGroup.defaultGroup = new STGroup(); Compiler.subtemplateCount = new AtomicInteger(0); diff --git a/test/org/stringtemplate/v4/test/TestAggregates.java b/test/org/stringtemplate/v4/test/TestAggregates.java index e0b69f96..afa7c051 100644 --- a/test/org/stringtemplate/v4/test/TestAggregates.java +++ b/test/org/stringtemplate/v4/test/TestAggregates.java @@ -28,12 +28,12 @@ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupString; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** */ public class TestAggregates extends BaseTest { diff --git a/test/org/stringtemplate/v4/test/TestAttributes.java b/test/org/stringtemplate/v4/test/TestAttributes.java index eec4ccef..6a8640ec 100644 --- a/test/org/stringtemplate/v4/test/TestAttributes.java +++ b/test/org/stringtemplate/v4/test/TestAttributes.java @@ -1,9 +1,9 @@ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class TestAttributes extends BaseTest { @Test diff --git a/test/org/stringtemplate/v4/test/TestBuggyDefaultValueRaisesNPETest.java b/test/org/stringtemplate/v4/test/TestBuggyDefaultValueRaisesNPETest.java index 590647e1..bab044c9 100644 --- a/test/org/stringtemplate/v4/test/TestBuggyDefaultValueRaisesNPETest.java +++ b/test/org/stringtemplate/v4/test/TestBuggyDefaultValueRaisesNPETest.java @@ -1,12 +1,13 @@ package org.stringtemplate.v4.test; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; import org.stringtemplate.v4.misc.ErrorBuffer; +import static org.junit.jupiter.api.Assertions.assertEquals; + public class TestBuggyDefaultValueRaisesNPETest extends BaseTest { /** * When the anonymous template specified as a default value for a formalArg @@ -28,7 +29,7 @@ public void testHandleBuggyDefaultArgument() throws Exception { String s = st.render(); // Check the errors. This contained an "NullPointerException" before - Assert.assertEquals( + assertEquals( "t.stg 1:12: mismatched input ')' expecting RDELIM"+newline, errors.toString()); } diff --git a/test/org/stringtemplate/v4/test/TestCompiler.java b/test/org/stringtemplate/v4/test/TestCompiler.java index bc8577d5..1937e8ad 100644 --- a/test/org/stringtemplate/v4/test/TestCompiler.java +++ b/test/org/stringtemplate/v4/test/TestCompiler.java @@ -54,7 +54,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.*; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.*; import org.stringtemplate.v4.compiler.*; import org.stringtemplate.v4.compiler.Compiler; @@ -62,7 +62,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.util.Arrays; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestCompiler extends BaseTest { diff --git a/test/org/stringtemplate/v4/test/TestCoreBasics.java b/test/org/stringtemplate/v4/test/TestCoreBasics.java index 5e018f98..a60c3d4d 100644 --- a/test/org/stringtemplate/v4/test/TestCoreBasics.java +++ b/test/org/stringtemplate/v4/test/TestCoreBasics.java @@ -27,7 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.AutoIndentWriter; import org.stringtemplate.v4.NoIndentWriter; import org.stringtemplate.v4.ST; @@ -45,7 +45,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.util.List; import java.util.Map; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestCoreBasics extends BaseTest { @Test public void testNullAttr() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestDebugEvents.java b/test/org/stringtemplate/v4/test/TestDebugEvents.java index 2cfd48de..47b35647 100644 --- a/test/org/stringtemplate/v4/test/TestDebugEvents.java +++ b/test/org/stringtemplate/v4/test/TestDebugEvents.java @@ -27,13 +27,13 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.*; import org.stringtemplate.v4.debug.InterpEvent; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestDebugEvents extends BaseTest { @Test public void testString() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestDictionaries.java b/test/org/stringtemplate/v4/test/TestDictionaries.java index 5d473d24..50ea2be1 100644 --- a/test/org/stringtemplate/v4/test/TestDictionaries.java +++ b/test/org/stringtemplate/v4/test/TestDictionaries.java @@ -27,8 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; @@ -39,7 +38,8 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class TestDictionaries extends BaseTest { @Test public void testDict() throws Exception { @@ -375,12 +375,12 @@ public class TestDictionaries extends BaseTest { writeFile(tmpdir, "t.stg", templates); STGroup group = new STGroupFile(tmpdir + File.separatorChar + "t.stg"); ST st = group.getInstanceOf("top"); - Assert.assertNotNull(st); + assertNotNull(st); String expecting = " electric " + newline + " force" + newline + " in between"; - Assert.assertEquals(expecting, st.render()); + assertEquals(expecting, st.render()); } @Test public void testTemplatesInDictionary() throws Exception { @@ -404,12 +404,12 @@ public class TestDictionaries extends BaseTest { writeFile(tmpdir, "t.stg", templates); STGroup group = new STGroupFile(tmpdir + File.separatorChar + "t.stg"); ST st = group.getInstanceOf("top"); - Assert.assertNotNull(st); + assertNotNull(st); String expecting = " electric foo" + newline + " foo force" + newline + " in foo between"; - Assert.assertEquals(expecting, st.render()); + assertEquals(expecting, st.render()); } @Test diff --git a/test/org/stringtemplate/v4/test/TestDollarDelimiters.java b/test/org/stringtemplate/v4/test/TestDollarDelimiters.java index 75728c3c..333a524d 100644 --- a/test/org/stringtemplate/v4/test/TestDollarDelimiters.java +++ b/test/org/stringtemplate/v4/test/TestDollarDelimiters.java @@ -28,14 +28,14 @@ package org.stringtemplate.v4.test; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; import org.stringtemplate.v4.STGroupString; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class TestDollarDelimiters extends BaseTest { @Test public void testAttr() throws Exception { @@ -158,14 +158,14 @@ public void testImportTemplatePreservesDelimiters() { // test html template directly ST st = group.getInstanceOf("html"); - Assert.assertNotNull(st); + assertNotNull(st); String expected = ""; String result = st.render(); assertEquals(expected, result); // test from entry template st = group.getInstanceOf("entry"); - Assert.assertNotNull(st); + assertNotNull(st); expected = "
"; result = st.render(); assertEquals(expected, result); @@ -196,14 +196,14 @@ public void testImportGroupPreservesDelimiters() { // test html template directly ST st = group.getInstanceOf("html"); - Assert.assertNotNull(st); + assertNotNull(st); String expected = "
"; String result = st.render(); assertEquals(expected, result); // test from entry template st = group.getInstanceOf("entry"); - Assert.assertNotNull(st); + assertNotNull(st); expected = "
"; result = st.render(); assertEquals(expected, result); @@ -235,14 +235,14 @@ public void testDelimitersClauseOverridesConstructorDelimiters() { // test html template directly ST st = group.getInstanceOf("html"); - Assert.assertNotNull(st); + assertNotNull(st); String expected = "
"; String result = st.render(); assertEquals(expected, result); // test from entry template st = group.getInstanceOf("entry"); - Assert.assertNotNull(st); + assertNotNull(st); expected = "
"; result = st.render(); assertEquals(expected, result); @@ -275,14 +275,14 @@ public void testDelimitersClauseOverridesInheritedDelimiters() { // test html template directly ST st = group.getInstanceOf("html"); - Assert.assertNotNull(st); + assertNotNull(st); String expected = "
"; String result = st.render(); assertEquals(expected, result); // test from entry template st = group.getInstanceOf("entry"); - Assert.assertNotNull(st); + assertNotNull(st); expected = "
"; result = st.render(); assertEquals(expected, result); diff --git a/test/org/stringtemplate/v4/test/TestEarlyEvaluation.java b/test/org/stringtemplate/v4/test/TestEarlyEvaluation.java index 18e9ae8d..132310fc 100644 --- a/test/org/stringtemplate/v4/test/TestEarlyEvaluation.java +++ b/test/org/stringtemplate/v4/test/TestEarlyEvaluation.java @@ -1,7 +1,6 @@ package org.stringtemplate.v4.test; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; @@ -10,6 +9,8 @@ import java.awt.*; import java.util.HashMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + public class TestEarlyEvaluation extends BaseTest { /** * @return true if at least one Window is visible @@ -64,7 +65,7 @@ public void testEarlyEval() throws Exception { ST st = group.getInstanceOf("main"); String s = st.render(); - Assert.assertEquals("-ax-*-ay-", s); + assertEquals("-ax-*-ay-", s); // Calling inspect led to an java.lang.ArrayIndexOutOfBoundsException in // 4.0.2 @@ -96,7 +97,7 @@ public void testEarlyEval2() throws Exception { ST st = group.getInstanceOf("main"); String s = st.render(); - Assert.assertEquals("-ax-*", s); + assertEquals("-ax-*", s); // When is invoked only once inspect throws no Exception in // 4.0.2 @@ -131,7 +132,7 @@ public void testBugArrayIndexOutOfBoundsExceptionInSTRuntimeMessage_getSourceLoc ST st = group.getInstanceOf("main"); String s = st.render(); - Assert.assertEquals("Hello", s); + assertEquals("Hello", s); // Inspecting this template threw an ArrayIndexOutOfBoundsException // in 4.0.2. @@ -160,11 +161,11 @@ public void testEarlyEvalInIfExpr() throws Exception { ST st = group.getInstanceOf("main"); String s = st.render(); - Assert.assertEquals(" bar ", s); + assertEquals(" bar ", s); st.add("x", "true"); s = st.render(); - Assert.assertEquals(" foo ", s); + assertEquals(" foo ", s); } @Test @@ -177,7 +178,7 @@ public void testEarlyEvalOfSubtemplateInIfExpr() throws Exception { ST st = group.getInstanceOf("main"); String s = st.render(); - Assert.assertEquals(" foo ", s); + assertEquals(" foo ", s); } @Test @@ -196,11 +197,11 @@ public void testEarlyEvalOfMapInIfExpr() throws Exception { st.add("x", null); String s = st.render(); - Assert.assertEquals(" pt: other, if ", s); + assertEquals(" pt: other, if ", s); st.add("x", "arr"); s = st.render(); - Assert.assertEquals(" parrt: value, if ", s); + assertEquals(" parrt: value, if ", s); } @Test @@ -216,11 +217,11 @@ public void testEarlyEvalOfMapInIfExprPassInHashMap() throws Exception { st.add("x", null); String s = st.render(); - Assert.assertEquals(" pt: , else ", s); // m[null] has no default value so else clause + assertEquals(" pt: , else ", s); // m[null] has no default value so else clause st.add("x", "arr"); s = st.render(); - Assert.assertEquals(" parrt: value, if ", s); + assertEquals(" parrt: value, if ", s); } } diff --git a/test/org/stringtemplate/v4/test/TestFunctions.java b/test/org/stringtemplate/v4/test/TestFunctions.java index e462ffe6..6435d613 100644 --- a/test/org/stringtemplate/v4/test/TestFunctions.java +++ b/test/org/stringtemplate/v4/test/TestFunctions.java @@ -27,8 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.*; - +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; @@ -39,7 +38,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.util.List; import java.util.Map; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestFunctions extends BaseTest { @Test public void testFirst() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestGroupSyntax.java b/test/org/stringtemplate/v4/test/TestGroupSyntax.java index 119437a8..994c62e7 100644 --- a/test/org/stringtemplate/v4/test/TestGroupSyntax.java +++ b/test/org/stringtemplate/v4/test/TestGroupSyntax.java @@ -27,7 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; @@ -37,8 +37,8 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.io.File; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class TestGroupSyntax extends BaseTest { @Test public void testSimpleGroup() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestGroupSyntaxErrors.java b/test/org/stringtemplate/v4/test/TestGroupSyntaxErrors.java index 321debf7..db426963 100644 --- a/test/org/stringtemplate/v4/test/TestGroupSyntaxErrors.java +++ b/test/org/stringtemplate/v4/test/TestGroupSyntaxErrors.java @@ -27,13 +27,13 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.STErrorListener; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; import org.stringtemplate.v4.misc.ErrorBuffer; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestGroupSyntaxErrors extends BaseTest { @Test public void testMissingImportString() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestGroups.java b/test/org/stringtemplate/v4/test/TestGroups.java index 0b628630..91697687 100644 --- a/test/org/stringtemplate/v4/test/TestGroups.java +++ b/test/org/stringtemplate/v4/test/TestGroups.java @@ -27,8 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.*; import org.stringtemplate.v4.misc.ErrorBuffer; @@ -39,8 +38,9 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.util.Set; import java.util.concurrent.*; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public class TestGroups extends BaseTest { @Test public void testSimpleGroup() throws Exception { @@ -712,14 +712,14 @@ public void testUnloadWithImports() throws Exception { writeFile(tmpdir, "g2.stg", "f() ::= \"g2\"\nf2() ::= \"f2\"\n"); STGroup group = new org.stringtemplate.v4.STGroupFile(tmpdir + "/t.stg"); ST st = group.getInstanceOf("main"); - Assert.assertEquals("v1-g1", st.render()); + assertEquals("v1-g1", st.render()); // Change the text of group t, including the imports. writeFile(tmpdir, "t.stg", "import \"g2.stg\"\n\nmain() ::= <<\nv2-;\n>>"); group.unload(); st = group.getInstanceOf("main"); - Assert.assertEquals("v2-g2;f2", st.render()); + assertEquals("v2-g2;f2", st.render()); } @Test public void testLineBreakInGroup() throws Exception { @@ -731,9 +731,9 @@ public void testUnloadWithImports() throws Exception { writeFile(tmpdir, "t.stg", templates); STGroup group = new STGroupFile(tmpdir + File.separatorChar + "t.stg"); ST st = group.getInstanceOf("t"); - Assert.assertNotNull(st); + assertNotNull(st); String expecting ="Foo bar"; - Assert.assertEquals(expecting, st.render()); + assertEquals(expecting, st.render()); } @Test public void testLineBreakInGroup2() throws Exception { @@ -745,9 +745,9 @@ public void testUnloadWithImports() throws Exception { writeFile(tmpdir, "t.stg", templates); STGroup group = new STGroupFile(tmpdir + File.separatorChar + "t.stg"); ST st = group.getInstanceOf("t"); - Assert.assertNotNull(st); + assertNotNull(st); String expecting ="Foo bar"; - Assert.assertEquals(expecting, st.render()); + assertEquals(expecting, st.render()); } @Test public void testLineBreakMissingTrailingNewline() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestGroupsFromCLASSPATH.java b/test/org/stringtemplate/v4/test/TestGroupsFromCLASSPATH.java index 2a6c1eaa..cb4902fa 100644 --- a/test/org/stringtemplate/v4/test/TestGroupsFromCLASSPATH.java +++ b/test/org/stringtemplate/v4/test/TestGroupsFromCLASSPATH.java @@ -1,13 +1,13 @@ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroupDir; import org.stringtemplate.v4.STGroupFile; import java.net.URL; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestGroupsFromCLASSPATH extends BaseTest { @Test diff --git a/test/org/stringtemplate/v4/test/TestImports.java b/test/org/stringtemplate/v4/test/TestImports.java index 4e792896..fd73535f 100644 --- a/test/org/stringtemplate/v4/test/TestImports.java +++ b/test/org/stringtemplate/v4/test/TestImports.java @@ -27,7 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STErrorListener; import org.stringtemplate.v4.STGroup; @@ -39,8 +39,8 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.net.URL; import java.net.URLClassLoader; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class TestImports extends BaseTest { @Test public void testImportDir() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestIndentation.java b/test/org/stringtemplate/v4/test/TestIndentation.java index e59c6eb9..e34a4d9b 100644 --- a/test/org/stringtemplate/v4/test/TestIndentation.java +++ b/test/org/stringtemplate/v4/test/TestIndentation.java @@ -27,12 +27,12 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.*; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestIndentation extends BaseTest { @Test public void testIndentInFrontOfTwoExpr() diff --git a/test/org/stringtemplate/v4/test/TestIndirectionAndEarlyEval.java b/test/org/stringtemplate/v4/test/TestIndirectionAndEarlyEval.java index 238793f9..32483801 100644 --- a/test/org/stringtemplate/v4/test/TestIndirectionAndEarlyEval.java +++ b/test/org/stringtemplate/v4/test/TestIndirectionAndEarlyEval.java @@ -27,7 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; @@ -36,7 +36,8 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; public class TestIndirectionAndEarlyEval extends BaseTest { @Test public void testEarlyEval() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestInterptimeErrors.java b/test/org/stringtemplate/v4/test/TestInterptimeErrors.java index 37c37e1c..81a5c2b2 100644 --- a/test/org/stringtemplate/v4/test/TestInterptimeErrors.java +++ b/test/org/stringtemplate/v4/test/TestInterptimeErrors.java @@ -27,11 +27,11 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.*; import org.stringtemplate.v4.misc.*; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestInterptimeErrors extends BaseTest { public static class UserHiddenName { diff --git a/test/org/stringtemplate/v4/test/TestLexer.java b/test/org/stringtemplate/v4/test/TestLexer.java index d4422d20..8dee4011 100644 --- a/test/org/stringtemplate/v4/test/TestLexer.java +++ b/test/org/stringtemplate/v4/test/TestLexer.java @@ -27,7 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class TestLexer extends BaseTest { diff --git a/test/org/stringtemplate/v4/test/TestLineWrap.java b/test/org/stringtemplate/v4/test/TestLineWrap.java index 55baae71..37e3e0ce 100644 --- a/test/org/stringtemplate/v4/test/TestLineWrap.java +++ b/test/org/stringtemplate/v4/test/TestLineWrap.java @@ -27,12 +27,12 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.StringWriter; import java.util.ArrayList; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestLineWrap extends BaseTest { @Test public void testLineWrap() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestLists.java b/test/org/stringtemplate/v4/test/TestLists.java index 20043ecf..b785553c 100644 --- a/test/org/stringtemplate/v4/test/TestLists.java +++ b/test/org/stringtemplate/v4/test/TestLists.java @@ -27,12 +27,12 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestLists extends BaseTest { @Test public void testJustCat() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestModelAdaptors.java b/test/org/stringtemplate/v4/test/TestModelAdaptors.java index 97ed6869..bda09477 100644 --- a/test/org/stringtemplate/v4/test/TestModelAdaptors.java +++ b/test/org/stringtemplate/v4/test/TestModelAdaptors.java @@ -1,12 +1,12 @@ package org.stringtemplate.v4.test; -import org.junit.*; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.*; import org.stringtemplate.v4.misc.STNoSuchPropertyException; import org.stringtemplate.v4.misc.STRuntimeMessage; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.TreeMap; diff --git a/test/org/stringtemplate/v4/test/TestNoNewlineTemplates.java b/test/org/stringtemplate/v4/test/TestNoNewlineTemplates.java index cf42b284..2f5ae5a8 100644 --- a/test/org/stringtemplate/v4/test/TestNoNewlineTemplates.java +++ b/test/org/stringtemplate/v4/test/TestNoNewlineTemplates.java @@ -28,13 +28,13 @@ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; import org.stringtemplate.v4.STGroupString; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestNoNewlineTemplates extends BaseTest { @Test diff --git a/test/org/stringtemplate/v4/test/TestNullAndEmptyValues.java b/test/org/stringtemplate/v4/test/TestNullAndEmptyValues.java index 2e9e9392..7d440922 100644 --- a/test/org/stringtemplate/v4/test/TestNullAndEmptyValues.java +++ b/test/org/stringtemplate/v4/test/TestNullAndEmptyValues.java @@ -27,7 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.AutoIndentWriter; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; @@ -41,8 +41,8 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.util.HashMap; import java.util.List; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestNullAndEmptyValues extends BaseTest { public static class T { @@ -217,22 +217,19 @@ public String toString() { @Test public void testSingleValued() throws Exception { List failed = testMatrix(singleValuedTests); List expecting = Collections.emptyList(); - assertArrayEquals("failed tests "+failed, - expecting.toArray(), failed.toArray()); + assertArrayEquals(expecting.toArray(), failed.toArray(), "failed tests "+failed); } @Test public void testMultiValued() throws Exception { List failed = testMatrix(multiValuedTests); List expecting = Collections.emptyList(); - assertArrayEquals("failed tests "+failed, - expecting.toArray(), failed.toArray()); + assertArrayEquals(expecting.toArray(), failed.toArray(), "failed tests "+failed); } @Test public void testLists() throws Exception { List failed = testMatrix(listTests); List expecting = Collections.emptyList(); - assertArrayEquals("failed tests "+failed, - expecting.toArray(), failed.toArray()); + assertArrayEquals(expecting.toArray(), failed.toArray(), "failed tests "+failed); } public List testMatrix(T[] tests) throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestOptions.java b/test/org/stringtemplate/v4/test/TestOptions.java index 020a977f..a8af51d6 100644 --- a/test/org/stringtemplate/v4/test/TestOptions.java +++ b/test/org/stringtemplate/v4/test/TestOptions.java @@ -27,13 +27,13 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.*; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.misc.ErrorBuffer; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestOptions extends BaseTest { @Test public void testSeparator() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestRegions.java b/test/org/stringtemplate/v4/test/TestRegions.java index 85fd7571..b822bc58 100644 --- a/test/org/stringtemplate/v4/test/TestRegions.java +++ b/test/org/stringtemplate/v4/test/TestRegions.java @@ -27,11 +27,12 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.*; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.*; import org.stringtemplate.v4.misc.ErrorBuffer; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestRegions extends BaseTest { @Test public void testEmbeddedRegion() throws Exception { @@ -431,7 +432,7 @@ public class TestRegions extends BaseTest { assertEquals(expected, result); } - @Ignore("will revisit the behavior of indented expressions spanning multiple lines for a future release") + @Disabled("will revisit the behavior of indented expressions spanning multiple lines for a future release") @Test public void testEmbeddedSubtemplate() throws Exception { String dir = getRandomDir(); String groupFile = diff --git a/test/org/stringtemplate/v4/test/TestRenderers.java b/test/org/stringtemplate/v4/test/TestRenderers.java index dce0cdd0..1503f34f 100644 --- a/test/org/stringtemplate/v4/test/TestRenderers.java +++ b/test/org/stringtemplate/v4/test/TestRenderers.java @@ -27,9 +27,9 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.DateRenderer; import org.stringtemplate.v4.NumberRenderer; import org.stringtemplate.v4.ST; @@ -44,7 +44,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.util.Locale; import java.util.TimeZone; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestRenderers extends BaseTest { @@ -53,7 +53,7 @@ public class TestRenderers extends BaseTest { // Make sure to use the US Locale during the tests private Locale origLocale; - @Before + @BeforeEach @Override public void setUp() { super.setUp(); @@ -61,7 +61,7 @@ public void setUp() { Locale.setDefault(Locale.US); } - @After + @AfterEach public void tearDown() { Locale.setDefault(origLocale); } diff --git a/test/org/stringtemplate/v4/test/TestSTRawGroupDir.java b/test/org/stringtemplate/v4/test/TestSTRawGroupDir.java index aa85f4a6..5a995deb 100644 --- a/test/org/stringtemplate/v4/test/TestSTRawGroupDir.java +++ b/test/org/stringtemplate/v4/test/TestSTRawGroupDir.java @@ -1,11 +1,11 @@ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.*; import java.util.*; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class TestSTRawGroupDir extends BaseTest { @Test public void testSimpleGroup() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestScopes.java b/test/org/stringtemplate/v4/test/TestScopes.java index 0121dc5b..442acb25 100644 --- a/test/org/stringtemplate/v4/test/TestScopes.java +++ b/test/org/stringtemplate/v4/test/TestScopes.java @@ -1,10 +1,10 @@ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.*; import org.stringtemplate.v4.misc.*; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestScopes extends BaseTest { @Test public void testSeesEnclosingAttr() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestSubtemplates.java b/test/org/stringtemplate/v4/test/TestSubtemplates.java index dcb9ffef..8dcdd7bb 100644 --- a/test/org/stringtemplate/v4/test/TestSubtemplates.java +++ b/test/org/stringtemplate/v4/test/TestSubtemplates.java @@ -27,7 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.*; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; @@ -37,7 +37,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.util.LinkedHashMap; import java.util.Map; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestSubtemplates extends BaseTest { diff --git a/test/org/stringtemplate/v4/test/TestSyntaxErrors.java b/test/org/stringtemplate/v4/test/TestSyntaxErrors.java index ba2d2a17..01ccfbc2 100644 --- a/test/org/stringtemplate/v4/test/TestSyntaxErrors.java +++ b/test/org/stringtemplate/v4/test/TestSyntaxErrors.java @@ -27,14 +27,14 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.STErrorListener; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; import org.stringtemplate.v4.compiler.STException; import org.stringtemplate.v4.misc.ErrorBuffer; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestSyntaxErrors extends BaseTest { @Test public void testEmptyExpr() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestTemplateNames.java b/test/org/stringtemplate/v4/test/TestTemplateNames.java index ea82bfe9..03baed19 100644 --- a/test/org/stringtemplate/v4/test/TestTemplateNames.java +++ b/test/org/stringtemplate/v4/test/TestTemplateNames.java @@ -1,9 +1,9 @@ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.*; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.stringtemplate.v4.misc.ErrorBuffer; import org.stringtemplate.v4.misc.Misc; diff --git a/test/org/stringtemplate/v4/test/TestTokensForDollarDelimiters.java b/test/org/stringtemplate/v4/test/TestTokensForDollarDelimiters.java index 9302771b..96ebf786 100644 --- a/test/org/stringtemplate/v4/test/TestTokensForDollarDelimiters.java +++ b/test/org/stringtemplate/v4/test/TestTokensForDollarDelimiters.java @@ -27,7 +27,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class TestTokensForDollarDelimiters extends BaseTest { @Test public void testSimpleAttr() throws Exception { diff --git a/test/org/stringtemplate/v4/test/TestTreeConstruction.java b/test/org/stringtemplate/v4/test/TestTreeConstruction.java index f0291d20..be409f50 100644 --- a/test/org/stringtemplate/v4/test/TestTreeConstruction.java +++ b/test/org/stringtemplate/v4/test/TestTreeConstruction.java @@ -2,13 +2,13 @@ import org.antlr.runtime.RuleReturnScope; import org.antlr.runtime.tree.Tree; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -import org.junit.*; - -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestTreeConstruction extends gUnitBase { - @Before public void setup() { + @BeforeEach public void setup() { lexerClassName = "org.stringtemplate.v4.compiler.STLexer"; parserClassName = "org.stringtemplate.v4.compiler.STParser"; } @@ -17,7 +17,7 @@ public class TestTreeConstruction extends gUnitBase { RuleReturnScope rstruct = (RuleReturnScope)execParser("template", "<[]>", 16); Object actual = ((Tree)rstruct.getTree()).toStringTree(); Object expecting = "(EXPR [)"; - assertEquals("testing rule template", expecting, actual); + assertEquals(expecting, actual, "testing rule template"); } @Test public void test_template2() throws Exception { @@ -25,6 +25,6 @@ public class TestTreeConstruction extends gUnitBase { RuleReturnScope rstruct = (RuleReturnScope)execParser("template", "<[a,b]>", 17); Object actual = ((Tree)rstruct.getTree()).toStringTree(); Object expecting = "(EXPR ([ a b))"; - assertEquals("testing rule template", expecting, actual); + assertEquals(expecting, actual, "testing rule template"); } } diff --git a/test/org/stringtemplate/v4/test/TestTypeRegistry.java b/test/org/stringtemplate/v4/test/TestTypeRegistry.java index 1ddc4c9f..3fd8f43a 100644 --- a/test/org/stringtemplate/v4/test/TestTypeRegistry.java +++ b/test/org/stringtemplate/v4/test/TestTypeRegistry.java @@ -1,10 +1,10 @@ package org.stringtemplate.v4.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.misc.TypeRegistry; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; public class TestTypeRegistry { // https://github.com/antlr/stringtemplate4/issues/122 diff --git a/test/org/stringtemplate/v4/test/TestWhitespace.java b/test/org/stringtemplate/v4/test/TestWhitespace.java index c185814c..36c9f968 100644 --- a/test/org/stringtemplate/v4/test/TestWhitespace.java +++ b/test/org/stringtemplate/v4/test/TestWhitespace.java @@ -27,7 +27,8 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */ package org.stringtemplate.v4.test; -import org.junit.*; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.stringtemplate.v4.AutoIndentWriter; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; @@ -35,7 +36,7 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT import java.io.StringWriter; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TestWhitespace extends BaseTest { @Test public void testTrimmedSubtemplates() throws Exception { @@ -143,7 +144,7 @@ public class TestWhitespace extends BaseTest { assertEquals(expected, result); } - @Ignore("will revisit the behavior of indented expressions spanning multiple lines for a future release") + @Disabled("will revisit the behavior of indented expressions spanning multiple lines for a future release") @Test public void testTabBeforeEndInSubtemplates() throws Exception { STGroup group = new STGroup(); group.defineTemplate("test", "names", "