mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
autotools: Modernize o.e.cdt.autotools.ui.tests bundle.
* Bump BREE to Java 1.8. * Enable more warnings and save actions. * Use lambdas. * Use try-with-resources. Change-Id: I688dd1865353380a9791ff28779b4c98f21403f6 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
parent
6839fa9c6b
commit
62f349f013
8 changed files with 208 additions and 65 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
|
|
|
@ -1,8 +1,101 @@
|
|||
#Thu Mar 25 17:32:29 EDT 2010
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
|
||||
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
|
||||
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
|
||||
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
|
||||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deadCode=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
|
||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
|
||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
|
||||
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
||||
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
eclipse.preferences.version=1
|
||||
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
|
||||
sp_cleanup.add_default_serial_version_id=true
|
||||
sp_cleanup.add_generated_serial_version_id=false
|
||||
sp_cleanup.add_missing_annotations=true
|
||||
sp_cleanup.add_missing_deprecated_annotations=true
|
||||
sp_cleanup.add_missing_methods=false
|
||||
sp_cleanup.add_missing_nls_tags=false
|
||||
sp_cleanup.add_missing_override_annotations=true
|
||||
sp_cleanup.add_missing_override_annotations_interface_methods=true
|
||||
sp_cleanup.add_serial_version_id=false
|
||||
sp_cleanup.always_use_blocks=true
|
||||
sp_cleanup.always_use_parentheses_in_expressions=false
|
||||
sp_cleanup.always_use_this_for_non_static_field_access=false
|
||||
sp_cleanup.always_use_this_for_non_static_method_access=false
|
||||
sp_cleanup.convert_functional_interfaces=false
|
||||
sp_cleanup.convert_to_enhanced_for_loop=false
|
||||
sp_cleanup.correct_indentation=false
|
||||
sp_cleanup.format_source_code=false
|
||||
sp_cleanup.format_source_code_changes_only=false
|
||||
sp_cleanup.insert_inferred_type_arguments=false
|
||||
sp_cleanup.make_local_variable_final=true
|
||||
sp_cleanup.make_parameters_final=false
|
||||
sp_cleanup.make_private_fields_final=true
|
||||
sp_cleanup.make_type_abstract_if_missing_method=false
|
||||
sp_cleanup.make_variable_declarations_final=false
|
||||
sp_cleanup.never_use_blocks=false
|
||||
sp_cleanup.never_use_parentheses_in_expressions=true
|
||||
sp_cleanup.on_save_use_additional_actions=false
|
||||
sp_cleanup.organize_imports=true
|
||||
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
|
||||
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
|
||||
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
|
||||
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
|
||||
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
|
||||
sp_cleanup.remove_private_constructors=true
|
||||
sp_cleanup.remove_redundant_type_arguments=true
|
||||
sp_cleanup.remove_trailing_whitespaces=false
|
||||
sp_cleanup.remove_trailing_whitespaces_all=true
|
||||
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
|
||||
sp_cleanup.remove_unnecessary_casts=true
|
||||
sp_cleanup.remove_unnecessary_nls_tags=false
|
||||
sp_cleanup.remove_unused_imports=false
|
||||
sp_cleanup.remove_unused_local_variables=false
|
||||
sp_cleanup.remove_unused_private_fields=true
|
||||
sp_cleanup.remove_unused_private_members=false
|
||||
sp_cleanup.remove_unused_private_methods=true
|
||||
sp_cleanup.remove_unused_private_types=true
|
||||
sp_cleanup.sort_members=false
|
||||
sp_cleanup.sort_members_all=false
|
||||
sp_cleanup.use_anonymous_class_creation=false
|
||||
sp_cleanup.use_blocks=false
|
||||
sp_cleanup.use_blocks_only_for_return_and_throw=false
|
||||
sp_cleanup.use_lambda=true
|
||||
sp_cleanup.use_parentheses_in_expressions=false
|
||||
sp_cleanup.use_this_for_non_static_field_access=false
|
||||
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
|
||||
sp_cleanup.use_this_for_non_static_method_access=false
|
||||
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
|
||||
sp_cleanup.use_type_arguments=false
|
|
@ -16,6 +16,7 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.eclipse.cdt.autotools.core,
|
||||
org.eclipse.cdt.autotools.ui,
|
||||
org.eclipse.cdt.core,
|
||||
org.eclipse.cdt.core.native,
|
||||
org.eclipse.cdt.launch,
|
||||
org.eclipse.cdt.make.core,
|
||||
org.eclipse.cdt.make.ui,
|
||||
|
@ -24,5 +25,5 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.eclipse.cdt.managedbuilder.ui,
|
||||
org.eclipse.cdt.ui
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Bundle-Vendor: %provider
|
||||
|
|
|
@ -45,7 +45,6 @@ import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
|
|||
import org.eclipse.swtbot.swt.finder.finders.ContextMenuHelper;
|
||||
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
|
||||
import org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory;
|
||||
import org.eclipse.swtbot.swt.finder.results.VoidResult;
|
||||
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
|
||||
import org.eclipse.swtbot.swt.finder.waits.Conditions;
|
||||
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
|
||||
|
@ -101,21 +100,19 @@ public abstract class AbstractTest {
|
|||
if (Platform.getOS().equals(Platform.OS_MACOSX)) {
|
||||
// On Mac, the Preferences menu is under the system menu
|
||||
final IWorkbench workbench = PlatformUI.getWorkbench();
|
||||
workbench.getDisplay().asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
|
||||
if (window != null) {
|
||||
Menu appMenu = workbench.getDisplay().getSystemMenu();
|
||||
for (MenuItem item : appMenu.getItems()) {
|
||||
if (item.getText().startsWith("Preferences")) {
|
||||
Event event = new Event();
|
||||
event.time = (int) System.currentTimeMillis();
|
||||
event.widget = item;
|
||||
event.display = workbench.getDisplay();
|
||||
item.setSelection(true);
|
||||
item.notifyListeners(SWT.Selection, event);
|
||||
break;
|
||||
}
|
||||
workbench.getDisplay().asyncExec(() -> {
|
||||
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
|
||||
if (window != null) {
|
||||
Menu appMenu = workbench.getDisplay().getSystemMenu();
|
||||
for (MenuItem item : appMenu.getItems()) {
|
||||
if (item.getText().startsWith("Preferences")) {
|
||||
Event event = new Event();
|
||||
event.time = (int) System.currentTimeMillis();
|
||||
event.widget = item;
|
||||
event.display = workbench.getDisplay();
|
||||
item.setSelection(true);
|
||||
item.notifyListeners(SWT.Selection, event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -250,25 +247,21 @@ public abstract class AbstractTest {
|
|||
*/
|
||||
public static void clickRadioButtonInGroup(String mnemonicText,
|
||||
final String inGroup) {
|
||||
UIThreadRunnable.syncExec(new VoidResult() {
|
||||
@Override
|
||||
public void run() {
|
||||
@SuppressWarnings("unchecked")
|
||||
Matcher<Widget> matcher = allOf(inGroup(inGroup),
|
||||
widgetOfType(Button.class),
|
||||
withStyle(SWT.RADIO, "SWT.RADIO"));
|
||||
int i = 0;
|
||||
while (true) {
|
||||
Button b;
|
||||
try {
|
||||
b = (Button) bot.widget(matcher, i++);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
return;
|
||||
}
|
||||
if (b.getSelection()) {
|
||||
b.setSelection(false);
|
||||
return;
|
||||
}
|
||||
UIThreadRunnable.syncExec(() -> {
|
||||
@SuppressWarnings("unchecked")
|
||||
Matcher<Widget> matcher = allOf(inGroup(inGroup), widgetOfType(Button.class),
|
||||
withStyle(SWT.RADIO, "SWT.RADIO"));
|
||||
int i = 0;
|
||||
while (true) {
|
||||
Button b;
|
||||
try {
|
||||
b = (Button) bot.widget(matcher, i++);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
return;
|
||||
}
|
||||
if (b.getSelection()) {
|
||||
b.setSelection(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -386,13 +379,9 @@ public abstract class AbstractTest {
|
|||
String shellTitle = shell.getText();
|
||||
if (shellTitle.length() > 0
|
||||
&& !shellTitle.startsWith("Quick Access")) {
|
||||
UIThreadRunnable.syncExec(new VoidResult() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (shell.widget.getParent() != null
|
||||
&& !shell.isOpen()) {
|
||||
shell.close();
|
||||
}
|
||||
UIThreadRunnable.syncExec(() -> {
|
||||
if (shell.widget.getParent() != null && !shell.isOpen()) {
|
||||
shell.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -416,7 +405,7 @@ public abstract class AbstractTest {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean test() throws Exception {
|
||||
public boolean test() {
|
||||
if (view.isActive()) {
|
||||
String output = view.bot().styledText().getText();
|
||||
java.util.regex.Matcher m = pattern.matcher(output);
|
||||
|
|
|
@ -49,7 +49,7 @@ import org.w3c.dom.NodeList;
|
|||
public class SetConfigurationParameter extends AbstractTest {
|
||||
|
||||
@BeforeClass
|
||||
public static void initClass() throws Exception {
|
||||
public static void initClass() {
|
||||
initConfigParm();
|
||||
}
|
||||
|
||||
|
|
|
@ -122,20 +122,20 @@ public class TestEnvironmentVars extends AbstractTest {
|
|||
// Create a fake configure script which prints out the values of
|
||||
// envvars some_var1, some_var2, and some_var3
|
||||
File f = new File(path.append("fake_configure").toOSString());
|
||||
BufferedWriter w = new BufferedWriter(new FileWriter(f));
|
||||
w.append("echo VAR1 is ${some_var1}");
|
||||
w.newLine();
|
||||
w.append("echo VAR2 is ${some_var2}");
|
||||
w.newLine();
|
||||
w.append("echo VAR3 is ${some_var3}");
|
||||
w.newLine();
|
||||
w.append("echo VAR4 is ${some_var4}");
|
||||
w.newLine();
|
||||
w.append("echo VAR5 is ${some_var5}");
|
||||
w.newLine();
|
||||
w.append("echo VAR6 is ${some_var6}");
|
||||
w.newLine();
|
||||
w.close();
|
||||
try (BufferedWriter w = new BufferedWriter(new FileWriter(f))) {
|
||||
w.append("echo VAR1 is ${some_var1}");
|
||||
w.newLine();
|
||||
w.append("echo VAR2 is ${some_var2}");
|
||||
w.newLine();
|
||||
w.append("echo VAR3 is ${some_var3}");
|
||||
w.newLine();
|
||||
w.append("echo VAR4 is ${some_var4}");
|
||||
w.newLine();
|
||||
w.append("echo VAR5 is ${some_var5}");
|
||||
w.newLine();
|
||||
w.append("echo VAR6 is ${some_var6}");
|
||||
w.newLine();
|
||||
}
|
||||
// Now change the configure script command to be the fake configure
|
||||
// script
|
||||
// and set the three envvars on the command itself
|
||||
|
|
|
@ -309,7 +309,7 @@ public class TestToolActions extends AbstractTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void t8canReconfigureProject() throws Exception {
|
||||
public void t8canReconfigureProject() {
|
||||
IPath path = checkProject().getLocation();
|
||||
// Remove a number of generated files
|
||||
File f = new File(path.append("src/Makefile.in").toOSString());
|
||||
|
|
Loading…
Add table
Reference in a new issue