Skip to content

Commit 519d2c2

Browse files
committed
JUnit 5 migration - libhover
1 parent fff1452 commit 519d2c2

File tree

6 files changed

+170
-25
lines changed

6 files changed

+170
-25
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
eclipse.preferences.version=1
2+
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
3+
sp_cleanup.add_all=false
4+
sp_cleanup.add_default_serial_version_id=true
5+
sp_cleanup.add_generated_serial_version_id=false
6+
sp_cleanup.add_missing_annotations=true
7+
sp_cleanup.add_missing_deprecated_annotations=true
8+
sp_cleanup.add_missing_methods=false
9+
sp_cleanup.add_missing_nls_tags=false
10+
sp_cleanup.add_missing_override_annotations=true
11+
sp_cleanup.add_missing_override_annotations_interface_methods=true
12+
sp_cleanup.add_serial_version_id=false
13+
sp_cleanup.also_simplify_lambda=true
14+
sp_cleanup.always_use_blocks=true
15+
sp_cleanup.always_use_parentheses_in_expressions=false
16+
sp_cleanup.always_use_this_for_non_static_field_access=false
17+
sp_cleanup.always_use_this_for_non_static_method_access=false
18+
sp_cleanup.array_with_curly=false
19+
sp_cleanup.arrays_fill=false
20+
sp_cleanup.bitwise_conditional_expression=false
21+
sp_cleanup.boolean_literal=false
22+
sp_cleanup.boolean_value_rather_than_comparison=false
23+
sp_cleanup.break_loop=false
24+
sp_cleanup.collection_cloning=false
25+
sp_cleanup.comparing_on_criteria=false
26+
sp_cleanup.comparison_statement=false
27+
sp_cleanup.controlflow_merge=false
28+
sp_cleanup.convert_functional_interfaces=false
29+
sp_cleanup.convert_to_enhanced_for_loop=false
30+
sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false
31+
sp_cleanup.convert_to_switch_expressions=false
32+
sp_cleanup.correct_indentation=false
33+
sp_cleanup.do_while_rather_than_while=false
34+
sp_cleanup.double_negation=false
35+
sp_cleanup.else_if=false
36+
sp_cleanup.embedded_if=false
37+
sp_cleanup.evaluate_nullable=false
38+
sp_cleanup.extract_increment=false
39+
sp_cleanup.format_source_code=true
40+
sp_cleanup.format_source_code_changes_only=true
41+
sp_cleanup.hash=false
42+
sp_cleanup.if_condition=false
43+
sp_cleanup.insert_inferred_type_arguments=false
44+
sp_cleanup.instanceof=false
45+
sp_cleanup.instanceof_keyword=false
46+
sp_cleanup.invert_equals=false
47+
sp_cleanup.join=false
48+
sp_cleanup.lazy_logical_operator=false
49+
sp_cleanup.make_local_variable_final=true
50+
sp_cleanup.make_parameters_final=false
51+
sp_cleanup.make_private_fields_final=true
52+
sp_cleanup.make_type_abstract_if_missing_method=false
53+
sp_cleanup.make_variable_declarations_final=false
54+
sp_cleanup.map_cloning=false
55+
sp_cleanup.merge_conditional_blocks=false
56+
sp_cleanup.multi_catch=false
57+
sp_cleanup.never_use_blocks=false
58+
sp_cleanup.never_use_parentheses_in_expressions=true
59+
sp_cleanup.no_string_creation=false
60+
sp_cleanup.no_super=false
61+
sp_cleanup.number_suffix=false
62+
sp_cleanup.objects_equals=false
63+
sp_cleanup.on_save_use_additional_actions=false
64+
sp_cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false
65+
sp_cleanup.operand_factorization=false
66+
sp_cleanup.organize_imports=true
67+
sp_cleanup.overridden_assignment=false
68+
sp_cleanup.overridden_assignment_move_decl=true
69+
sp_cleanup.plain_replacement=false
70+
sp_cleanup.precompile_regex=false
71+
sp_cleanup.primitive_comparison=false
72+
sp_cleanup.primitive_parsing=false
73+
sp_cleanup.primitive_rather_than_wrapper=false
74+
sp_cleanup.primitive_serialization=false
75+
sp_cleanup.pull_out_if_from_if_else=false
76+
sp_cleanup.pull_up_assignment=false
77+
sp_cleanup.push_down_negation=false
78+
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
79+
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
80+
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
81+
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
82+
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
83+
sp_cleanup.reduce_indentation=false
84+
sp_cleanup.redundant_comparator=false
85+
sp_cleanup.redundant_falling_through_block_end=false
86+
sp_cleanup.remove_private_constructors=true
87+
sp_cleanup.remove_redundant_modifiers=false
88+
sp_cleanup.remove_redundant_semicolons=false
89+
sp_cleanup.remove_redundant_type_arguments=false
90+
sp_cleanup.remove_trailing_whitespaces=false
91+
sp_cleanup.remove_trailing_whitespaces_all=true
92+
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
93+
sp_cleanup.remove_unnecessary_array_creation=false
94+
sp_cleanup.remove_unnecessary_casts=true
95+
sp_cleanup.remove_unnecessary_nls_tags=false
96+
sp_cleanup.remove_unused_imports=false
97+
sp_cleanup.remove_unused_local_variables=false
98+
sp_cleanup.remove_unused_method_parameters=false
99+
sp_cleanup.remove_unused_private_fields=true
100+
sp_cleanup.remove_unused_private_members=false
101+
sp_cleanup.remove_unused_private_methods=true
102+
sp_cleanup.remove_unused_private_types=true
103+
sp_cleanup.replace_deprecated_calls=false
104+
sp_cleanup.return_expression=false
105+
sp_cleanup.simplify_lambda_expression_and_method_ref=false
106+
sp_cleanup.single_used_field=false
107+
sp_cleanup.sort_members=false
108+
sp_cleanup.sort_members_all=false
109+
sp_cleanup.standard_comparison=false
110+
sp_cleanup.static_inner_class=false
111+
sp_cleanup.strictly_equal_or_different=false
112+
sp_cleanup.stringbuffer_to_stringbuilder=false
113+
sp_cleanup.stringbuilder=false
114+
sp_cleanup.stringbuilder_for_local_vars=true
115+
sp_cleanup.stringconcat_stringbuffer_stringbuilder=false
116+
sp_cleanup.stringconcat_to_textblock=false
117+
sp_cleanup.substring=false
118+
sp_cleanup.switch=false
119+
sp_cleanup.system_property=false
120+
sp_cleanup.system_property_boolean=false
121+
sp_cleanup.system_property_file_encoding=false
122+
sp_cleanup.system_property_file_separator=false
123+
sp_cleanup.system_property_line_separator=false
124+
sp_cleanup.system_property_path_separator=false
125+
sp_cleanup.ternary_operator=false
126+
sp_cleanup.try_with_resource=false
127+
sp_cleanup.unlooped_while=false
128+
sp_cleanup.unreachable_block=false
129+
sp_cleanup.use_anonymous_class_creation=false
130+
sp_cleanup.use_autoboxing=false
131+
sp_cleanup.use_blocks=true
132+
sp_cleanup.use_blocks_only_for_return_and_throw=false
133+
sp_cleanup.use_directly_map_method=false
134+
sp_cleanup.use_lambda=true
135+
sp_cleanup.use_parentheses_in_expressions=false
136+
sp_cleanup.use_string_is_blank=false
137+
sp_cleanup.use_this_for_non_static_field_access=false
138+
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
139+
sp_cleanup.use_this_for_non_static_method_access=false
140+
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
141+
sp_cleanup.use_unboxing=false
142+
sp_cleanup.use_var=false
143+
sp_cleanup.useless_continue=false
144+
sp_cleanup.useless_return=false
145+
sp_cleanup.valueof_rather_than_instantiation=false

libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Bundle-Name: %Bundle-Name
44
Bundle-SymbolicName: org.eclipse.linuxtools.cdt.libhover.devhelp.tests
55
Bundle-Version: 1.0.1.qualifier
66
Bundle-Vendor: %provider
7-
Require-Bundle: org.junit,
7+
Require-Bundle: junit-jupiter-api,
88
org.eclipse.core.resources
99
Bundle-ActivationPolicy: lazy
1010
Bundle-RequiredExecutionEnvironment: JavaSE-21

libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/CheckDevhelpTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
*******************************************************************************/
1010
package org.eclipse.linuxtools.cdt.libhover.devhelp.test;
1111

12-
import static org.junit.Assert.assertEquals;
13-
import static org.junit.Assert.assertFalse;
14-
import static org.junit.Assert.assertNotNull;
15-
import static org.junit.Assert.assertTrue;
12+
import static org.junit.jupiter.api.Assertions.assertEquals;
13+
import static org.junit.jupiter.api.Assertions.assertFalse;
14+
import static org.junit.jupiter.api.Assertions.assertNotNull;
15+
import static org.junit.jupiter.api.Assertions.assertTrue;
1616

1717
import java.io.File;
1818
import java.io.FileOutputStream;
@@ -45,23 +45,23 @@
4545
import org.eclipse.linuxtools.internal.cdt.libhover.devhelp.DevHelpTocProvider;
4646
import org.eclipse.linuxtools.internal.cdt.libhover.devhelp.ParseDevHelp;
4747
import org.eclipse.linuxtools.internal.cdt.libhover.devhelp.preferences.PreferenceConstants;
48-
import org.junit.Before;
49-
import org.junit.Test;
48+
import org.junit.jupiter.api.BeforeEach;
49+
import org.junit.jupiter.api.Test;
5050
import org.osgi.framework.Bundle;
5151
import org.osgi.framework.BundleReference;
5252

5353
public class CheckDevhelpTest {
5454

5555
public final static String CACHE_EXT_LIBHOVER = "org.eclipse.linuxtools.cdt.libhover.testCacheExtLibhover"; //$NON-NLS-1$
5656

57-
@Before
57+
@BeforeEach
5858
public void setUp() {
5959
IPath p = LibhoverPlugin.getDefault().getStateLocation().append("C"); //$NON-NLS-1$
6060
File f = new File(p.toOSString());
6161
f.delete();
6262
}
6363

64-
@Test
64+
@Test
6565
public void testParse() throws IOException {
6666
ParseDevHelp.DevHelpParser p = new ParseDevHelp.DevHelpParser(
6767
"/usr/share/gtk-doc/html"); //$NON-NLS-1$

libhover/org.eclipse.linuxtools.cdt.libhover.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="5.7.0",
1010
org.eclipse.core.runtime;bundle-version="3.10.0",
1111
org.eclipse.ui;bundle-version="3.106.0",
1212
org.eclipse.cdt.ui;bundle-version="5.8.0",
13-
org.junit;bundle-version="4.11.0",
13+
junit-jupiter-api,
1414
org.eclipse.jface.text;bundle-version="3.9.0",
1515
org.eclipse.ui.ide;bundle-version="3.10.0",
1616
org.eclipse.ui.workbench.texteditor;bundle-version="3.9.0",

libhover/org.eclipse.linuxtools.cdt.libhover.tests/src/org/eclipse/linuxtools/cdt/libhover/tests/BaseUITestCase.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*******************************************************************************/
1313
package org.eclipse.linuxtools.cdt.libhover.tests;
1414

15-
import static org.junit.Assert.assertTrue;
15+
import static org.junit.jupiter.api.Assertions.assertTrue;
1616

1717
import org.eclipse.cdt.core.model.ICProject;
1818
import org.eclipse.cdt.internal.core.CCoreInternals;
@@ -27,8 +27,8 @@
2727
import org.eclipse.ui.IWorkbenchPage;
2828
import org.eclipse.ui.IWorkbenchWindow;
2929
import org.eclipse.ui.PlatformUI;
30-
import org.junit.After;
31-
import org.junit.Before;
30+
import org.junit.jupiter.api.AfterEach;
31+
import org.junit.jupiter.api.BeforeEach;
3232

3333
@SuppressWarnings("restriction")
3434
public class BaseUITestCase {
@@ -42,7 +42,7 @@ public class BaseUITestCase {
4242
protected static final int INDEXER_TIMEOUT_SEC =
4343
Integer.parseInt(System.getProperty(INDEXER_TIMEOUT_PROPERTY, DEFAULT_INDEXER_TIMEOUT_SEC));
4444

45-
@Before
45+
@BeforeEach
4646
public void setUp() {
4747
CPPASTNameBase.sAllowRecursionBindings= false;
4848
CPPASTNameBase.sAllowNameComputation= false;
@@ -54,7 +54,7 @@ public void setUp() {
5454
}
5555
}
5656

57-
@After
57+
@AfterEach
5858
public void tearDown() throws Exception {
5959
runEventQueue(0);
6060
ResourceHelper.cleanUp();

libhover/org.eclipse.linuxtools.cdt.libhover.tests/src/org/eclipse/linuxtools/cdt/libhover/tests/ContentAssistTests.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
*******************************************************************************/
1515
package org.eclipse.linuxtools.cdt.libhover.tests;
1616

17-
import static org.junit.Assert.assertEquals;
18-
import static org.junit.Assert.assertTrue;
19-
import static org.junit.Assert.fail;
17+
import static org.junit.jupiter.api.Assertions.assertEquals;
18+
import static org.junit.jupiter.api.Assertions.assertTrue;
19+
import static org.junit.jupiter.api.Assertions.fail;
2020

2121
import java.io.ByteArrayInputStream;
2222
import java.io.InputStream;
@@ -42,18 +42,18 @@
4242
import org.eclipse.ui.IWorkbenchPage;
4343
import org.eclipse.ui.PlatformUI;
4444
import org.eclipse.ui.part.FileEditorInput;
45-
import org.junit.After;
46-
import org.junit.Before;
47-
import org.junit.Ignore;
48-
import org.junit.Test;
45+
import org.junit.jupiter.api.AfterEach;
46+
import org.junit.jupiter.api.BeforeEach;
47+
import org.junit.jupiter.api.Disabled;
48+
import org.junit.jupiter.api.Test;
4949

5050
@SuppressWarnings("restriction")
5151
public class ContentAssistTests extends BaseUITestCase {
5252
private final NullProgressMonitor monitor= new NullProgressMonitor();
5353
static IProject project;
5454
static ICProject cproject;
5555

56-
@Before
56+
@BeforeEach
5757
public void setUpD() throws InterruptedException {
5858

5959
if (project == null) {
@@ -95,7 +95,7 @@ public void cleanupProject() {
9595
}
9696
}
9797

98-
@After
98+
@AfterEach
9999
public void tearDownD() throws Exception {
100100
if (project == null || !project.exists()) {
101101
return;
@@ -191,7 +191,7 @@ public void testBug69334b() throws Exception {
191191
assertEquals( "veryLongName : int", results[0].getDisplayString() ); //$NON-NLS-1$
192192
}
193193

194-
@Test @Ignore
194+
@Test @Disabled
195195
public void testBug428037() throws Exception {
196196
StringWriter writer = new StringWriter();
197197
writer.write( "class Strategy { \n"); //$NON-NLS-1$

0 commit comments

Comments
 (0)