Project

General

Profile

strict-junit5.diff

Vladimir Tsichevski, 09/21/2022 12:12 PM

Download (17.3 KB)

View differences:

test/com/goldencode/p2j/comauto/TestComObject.java 2022-09-19 15:43:04 +0000
62 62
*/
63 63
package com.goldencode.p2j.comauto;
64 64

  
65
import static org.junit.Assert.*;
66
import static org.junit.jupiter.api.Assertions.assertEquals;
67 65
import static com.goldencode.p2j.comauto.ComObject.convertInputParameter;
66
import static org.junit.jupiter.api.Assertions.*;
68 67

  
69 68
import java.time.*;
70
import org.junit.*;
69
import org.junit.jupiter.api.*;
71 70

  
72 71
import com.goldencode.p2j.util.*;
73 72

  
test/com/goldencode/p2j/testing/AbstractFWDTest.java 2022-09-19 15:41:16 +0000
67 67
*/
68 68
package com.goldencode.p2j.testing;
69 69

  
70
import static org.junit.Assert.*;
70
import static org.junit.jupiter.api.Assertions.*;
71 71

  
72
import org.junit.function.*;
72
import org.junit.jupiter.api.function.*;
73 73

  
74 74
import com.goldencode.p2j.*;
75 75
import com.goldencode.p2j.util.*;
......
93 93
       *        the argument for the code
94 94
       * @throws ErrorConditionException
95 95
       */
96
      void run(final T arg)
97
      throws ErrorConditionException;
96
      void run(final T arg) throws ErrorConditionException;
98 97
   }
99
   
98

  
100 99
   /**
101 100
    * A helper method to check that code throws the OE error 14312.
102 101
    * 
......
106 105
    *        the format to pass to the code
107 106
    *        
108 107
    */
109
   public final static void assertMustThrowError14312(final ErrorCode code,
110
            final String format)
108
   public final static void assertMustThrowError14312(final ErrorCode code, final String format)
111 109
   {
112 110
      assertMustThrowError(code, 14312, "Too many 'S' characters in format \"%s\"", format,
113 111
               format);
......
123 121
    *        the format to pass to the code
124 122
    *        
125 123
    */
126
   public final static void assertMustThrowError154(final ErrorCode code,
127
            final String format)
124
   public final static void assertMustThrowError154(final ErrorCode code, final String format)
128 125
   {
129 126
      assertMustThrowError(code, 154, "Date format %s is incomplete", format, format);
130 127
   }
......
138 135
    *        the format to pass to the code
139 136
    *        
140 137
    */
141
   public final static void assertMustThrowError164(final ErrorCode code,
142
            final String format)
138
   public final static void assertMustThrowError164(final ErrorCode code, final String format)
143 139
   {
144 140
      assertMustThrowError(code, 164, "Character format %s is incomplete", format, format);
145 141
   }
......
155 151
    * @param offendingCharIndex
156 152
    *        the index of the offending character
157 153
    */
158
   public final static void assertMustThrowError22(final ErrorCode code,
159
            final String format, final int offendingCharIndex)
154
   public final static void assertMustThrowError22(final ErrorCode code, final String format,
155
            final int offendingCharIndex)
160 156
   {
161 157
      assertMustThrowError(code, 22, "Character number %d of format %s is invalid", format,
162 158
               offendingCharIndex, format);
......
174 170
    *        the value to format
175 171
    *        
176 172
    */
177
   public final static void assertMustThrowError74(final ErrorCode code,
178
            final String format, final String value)
173
   public final static void assertMustThrowError74(final ErrorCode code, final String format,
174
            final String value)
179 175
   {
180 176
      assertMustThrowError(code, 74, "Value %s cannot be displayed using %s", format, value,
181 177
               format);
......
189 185
    * @param format
190 186
    *        the format to pass to the code
191 187
    */
192
   protected final static void assertMustThrowError148(final ErrorCode code,
193
            final String format)
188
   protected final static void assertMustThrowError148(final ErrorCode code, final String format)
194 189
   {
195 190
      assertMustThrowError(code, 148, "Numeric format %s provides for no digits", format, format);
196 191
   }
......
261 256
    * @param args
262 257
    *        other arguments if the message format expects them
263 258
    */
264
   private final static void assertMustThrowErrorConditional(final ThrowingRunnable code,
259
   private final static void assertMustThrowErrorConditional(final Executable code,
265 260
            final int errorCodeExpected, final String expectedMessageFormat, Object... args)
266 261
   {
267
      final ErrorConditionException exc = assertThrows("Must throw",
268
               ErrorConditionException.class, code);
262
      final ErrorConditionException exc = assertThrows(ErrorConditionException.class, code,
263
               "Must throw");
269 264
      final Throwable cause = exc.getCause();
270 265
      assertTrue(cause instanceof NumberedException);
271 266
      NumberedException numbered = (NumberedException) cause;
test/com/goldencode/p2j/testing/FormatTestSuite.java 2022-09-19 18:25:16 +0000
65 65
*/
66 66
package com.goldencode.p2j.testing;
67 67

  
68
import org.junit.runner.*;
69
import org.junit.runners.*;
68
import org.junit.platform.suite.api.*;
70 69

  
71 70
import com.goldencode.p2j.ui.client.format.*;
72 71
import com.goldencode.p2j.util.*;
......
74 73
/**
75 74
 * Test suite for parsing 4gl formats.
76 75
 */
77
@RunWith(Suite.class)
78
@Suite.SuiteClasses({
79
   TestLogicalSplitformat.class,
80
   TestCharacterToStringFormatted.class,
81
   TestCharacterFormatParser.class,
82
   TestCharacterFormatter.class,
83
   TestCharacterPreprocessFormatString.class,
84
   TestCharacterValueOf.class,
85
   TestDateFormatting.class,
86
   TestDateFormatParse.class,
87
   TestDatetimeFormatting.class,
88
   TestDatetimeFormatParsing.class,
89
   TestNumberTypeParseFormat.class,
90
   TestRowid.class,
91
   TestStringFormatParse.class
92
})
76
@Suite
77
@SelectClasses(value = { TestLogicalSplitformat.class, TestCharacterToStringFormatted.class,
78
         TestCharacterFormatParser.class, TestCharacterFormatter.class,
79
         TestCharacterPreprocessFormatString.class, TestCharacterValueOf.class,
80
         TestDateFormatting.class, TestDateFormatParse.class, TestDatetimeFormatting.class,
81
         TestDatetimeFormatParsing.class, TestNumberTypeParseFormat.class, TestRowid.class,
82
         TestStringFormatParse.class })
93 83
public class FormatTestSuite
94 84
{
95 85
   // empty
test/com/goldencode/p2j/ui/client/format/TestDatetimeFormatParsing.java 2022-09-19 15:52:03 +0000
64 64
*/
65 65
package com.goldencode.p2j.ui.client.format;
66 66

  
67
import static org.junit.Assert.*;
67
import static org.junit.jupiter.api.Assertions.*;
68 68

  
69 69
import java.lang.reflect.*;
70 70

  
71
import org.junit.*;
71
import org.junit.jupiter.api.*;
72 72

  
73 73
import com.goldencode.p2j.util.*;
74 74

  
test/com/goldencode/p2j/ui/client/format/TestStringFormatParse.java 2022-09-19 15:52:47 +0000
65 65
*/
66 66
package com.goldencode.p2j.ui.client.format;
67 67

  
68
import static org.junit.Assert.assertNotNull;
68
import static org.junit.jupiter.api.Assertions.assertNotNull;
69 69

  
70
import org.junit.*;
70
import org.junit.jupiter.api.*;
71 71

  
72 72
import com.goldencode.p2j.util.*;
73 73

  
test/com/goldencode/p2j/util/AbstractCharacterFormatTest.java 2022-09-19 15:25:47 +0000
63 63
*/
64 64
package com.goldencode.p2j.util;
65 65

  
66
import org.junit.*;
66
import org.junit.jupiter.api.*;
67 67

  
68 68
/**
69 69
 * This class provides common methods and data for all character parsing/formatting tests.
test/com/goldencode/p2j/util/AbstractDateFormatTest.java 2022-09-19 15:25:47 +0000
65 65

  
66 66
import java.util.*;
67 67

  
68
import org.junit.*;
68
import org.junit.jupiter.api.*;
69 69

  
70 70
import com.goldencode.p2j.ui.client.format.*;
71 71

  
test/com/goldencode/p2j/util/AbstractDatetimeFormatTest.java 2022-09-19 15:25:47 +0000
64 64
*/
65 65
package com.goldencode.p2j.util;
66 66

  
67
import org.junit.*;
67
import org.junit.jupiter.api.*;
68 68

  
69 69
/**
70 70
 * Datetime-related tests helper class
test/com/goldencode/p2j/util/AbstractLogicalFormatParseTest.java 2022-09-19 15:25:47 +0000
61 61
*/
62 62
package com.goldencode.p2j.util;
63 63

  
64
import org.junit.*;
64
import org.junit.jupiter.api.*;
65 65

  
66 66
/**
67 67
 * Common methods and data for all OE logical values parsing/formatting tests.
test/com/goldencode/p2j/util/AbstractNumberFormatParseTest.java 2022-09-19 15:25:47 +0000
69 69

  
70 70
import java.math.*;
71 71

  
72
import org.junit.*;
72
import org.junit.jupiter.api.*;
73 73

  
74 74
/**
75 75
 * Common fields and methods for testing 4gl number formats.
test/com/goldencode/p2j/util/AbstractNumberFormatterTest.java 2022-09-19 15:41:59 +0000
64 64
*/
65 65
package com.goldencode.p2j.util;
66 66

  
67
import static org.junit.Assert.assertEquals;
67
import static org.junit.jupiter.api.Assertions.assertEquals;
68 68

  
69 69
import java.math.*;
70 70

  
71
import org.junit.*;
71
import org.junit.jupiter.api.*;
72 72

  
73 73
/**
74 74
 * Common fields and methods for testing formatting with 4gl number formats.
test/com/goldencode/p2j/util/TestCharacterFormatParser.java 2022-09-19 15:25:47 +0000
66 66

  
67 67
import static org.junit.jupiter.api.Assertions.assertEquals;
68 68

  
69
import org.junit.*;
69
import org.junit.jupiter.api.*;
70 70

  
71 71
/**
72 72
 * Tests for {@link CharacterFormatParser#parse(String)}
test/com/goldencode/p2j/util/TestCharacterPreprocessFormatString.java 2022-09-19 15:42:28 +0000
67 67
*/
68 68
package com.goldencode.p2j.util;
69 69

  
70
import static org.junit.Assert.assertNotNull;
71
import static org.junit.jupiter.api.Assertions.assertEquals;
70
import static org.junit.jupiter.api.Assertions.*;
72 71

  
73
import org.junit.*;
72
import org.junit.jupiter.api.*;
74 73

  
75 74
/**
76 75
 * Tests for {@link character#preprocessFormatString(String)}.
test/com/goldencode/p2j/util/TestCharacterToStringFormatted.java 2022-09-19 15:42:41 +0000
68 68
*/
69 69
package com.goldencode.p2j.util;
70 70

  
71
import static org.junit.Assert.assertNotNull;
71
import static org.junit.jupiter.api.Assertions.assertNotNull;
72 72

  
73
import org.junit.*;
73
import org.junit.jupiter.api.*;
74 74

  
75 75
/**
76 76
 * Tests for {@link character#toString(String)}.
test/com/goldencode/p2j/util/TestCharacterValueOf.java 2022-09-19 15:42:51 +0000
67 67
*/
68 68
package com.goldencode.p2j.util;
69 69

  
70
import static org.junit.Assert.assertTrue;
70
import static org.junit.jupiter.api.Assertions.assertTrue;
71 71

  
72
import org.junit.*;
72
import org.junit.jupiter.api.*;
73 73

  
74 74
/**
75 75
 * Tests for {@link character#valueOf(String)}.
test/com/goldencode/p2j/util/TestDateFormatParse.java 2022-09-19 18:25:39 +0000
68 68
*/
69 69
package com.goldencode.p2j.util;
70 70

  
71
import static org.junit.Assert.*;
71
import static org.junit.jupiter.api.Assertions.*;
72 72

  
73
import org.junit.*;
73
import org.junit.jupiter.api.*;
74 74

  
75 75
/**
76 76
 * Tests for parsing date format with {@link ParsedDateFormat#getInstance(String)}.
......
138 138
   /**
139 139
    * This method is called once by the test engine before all test methods in this class.
140 140
    */
141
   @BeforeClass
141
   @BeforeAll
142 142
   public static void beforeClass()
143 143
   {
144 144
      date.setDateOrder(AbstractDateFormatTest.ORDER_DMY);
test/com/goldencode/p2j/util/TestDateFormatter.java 2022-09-19 15:43:17 +0000
62 62
*/
63 63
package com.goldencode.p2j.util;
64 64

  
65
import static org.junit.Assert.assertEquals;
65
import static org.junit.jupiter.api.Assertions.assertEquals;
66 66

  
67
import org.junit.*;
67
import org.junit.jupiter.api.*;
68 68

  
69 69
/**
70 70
 * Tests for formatting dates.
test/com/goldencode/p2j/util/TestDateFormatting.java 2022-09-19 15:50:47 +0000
63 63
*/
64 64
package com.goldencode.p2j.util;
65 65

  
66
import static org.junit.Assert.assertEquals;
66
import static org.junit.jupiter.api.Assertions.assertEquals;
67 67

  
68
import org.junit.*;
68
import org.junit.jupiter.api.*;
69 69

  
70 70
/**
71 71
 * Tests for formatting dates with {@link date#toString(String)}.
......
87 87
   /**
88 88
    * This method is called once by the test engine before all test methods in this class.
89 89
    */
90
   @BeforeClass
90
   @BeforeAll
91 91
   public static void beforeClass()
92 92
   {
93 93
      date.setDateOrder(AbstractDateFormatTest.ORDER_DMY);
test/com/goldencode/p2j/util/TestDatetimeFormatting.java 2022-09-19 15:50:56 +0000
63 63
*/
64 64
package com.goldencode.p2j.util;
65 65

  
66
import static org.junit.Assert.assertEquals;
66
import static org.junit.jupiter.api.Assertions.assertEquals;
67 67

  
68
import org.junit.*;
68
import org.junit.jupiter.api.*;
69 69

  
70 70
/**
71 71
 * Tests for formatting with {@link datetime#toString(String)}
......
146 146
   /**
147 147
    * This method is called once by the test engine before all test methods in this class.
148 148
    */
149
   @BeforeClass
149
   @BeforeAll
150 150
   public static void beforeClass()
151 151
   {
152 152
      date.setDateOrder(AbstractDateFormatTest.ORDER_DMY);
test/com/goldencode/p2j/util/TestLogicalSplitformat.java 2022-09-19 15:52:20 +0000
69 69
package com.goldencode.p2j.util;
70 70

  
71 71
import static com.goldencode.p2j.util.character.valueOf;
72
import static org.junit.Assert.*;
72
import static org.junit.jupiter.api.Assertions.*;
73 73

  
74
import org.junit.*;
74
import org.junit.jupiter.api.*;
75 75

  
76 76
/**
77 77
 * Tests for {@link logical#splitFormat(String)} and some related functions of {@link logical}.
test/com/goldencode/p2j/util/TestNumberTypeParseFormat.java 2022-09-19 15:52:35 +0000
68 68
*/
69 69
package com.goldencode.p2j.util;
70 70

  
71
import static org.junit.Assert.*;
71
import static org.junit.jupiter.api.Assertions.*;
72 72

  
73
import org.junit.*;
73
import org.junit.jupiter.api.*;
74 74

  
75 75
import com.goldencode.p2j.util.NumberType.*;
76 76

  
test/com/goldencode/p2j/util/TestRowid.java 2022-09-19 15:51:13 +0000
64 64
*/
65 65
package com.goldencode.p2j.util;
66 66

  
67
import static org.junit.Assert.assertNull;
67
import static org.junit.jupiter.api.Assertions.assertNull;
68 68
import static org.junit.jupiter.api.Assertions.assertEquals;
69 69

  
70 70
import java.util.function.*;
71 71

  
72
import org.junit.*;
72
import org.junit.jupiter.api.*;
73 73

  
74 74
/**
75 75
 * Various tests for ROWID parsing and formatting. Includes tests for
test/com/goldencode/util/TestPrintable.java 2022-09-19 15:25:47 +0000
64 64

  
65 65
import static org.junit.jupiter.api.Assertions.assertEquals;
66 66

  
67
import org.junit.*;
67
import org.junit.jupiter.api.*;
68 68

  
69 69
/**
70 70
 * Test classes, which implement {@link Printable} interface.