Skip to content

Commit

Permalink
Build o.e.equinox.compendium.tests and o.e.equinox.region.tests
Browse files Browse the repository at this point in the history
- Disable currently failing RegionTests.
- Remove unnecessary test-suites that included all tests and just
execute all tests in the project.
- Move required Java version to 17.
  • Loading branch information
HannesWell authored and akurtakov committed Sep 8, 2023
1 parent abaf2a4 commit dd83565
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 212 deletions.
6 changes: 5 additions & 1 deletion bundles/org.eclipse.equinox.compendium.tests/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="bundle_tests/metatype/getMinMax.tb1" path="bundles_src/metatype/getMinMax.tb1"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" output="bundle_tests/metatype/tb1" path="bundles_src/metatype/tb1"/>
<classpathentry kind="src" output="bundle_tests/metatype/tb2" path="bundles_src/metatype/tb2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=ignore
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand All @@ -26,6 +26,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
Expand Down Expand Up @@ -53,6 +54,7 @@ org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
Expand All @@ -74,7 +76,8 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=en
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
Expand All @@ -96,7 +99,6 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assertion_message=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
Expand Down Expand Up @@ -227,7 +229,6 @@ org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
Expand Down Expand Up @@ -301,7 +302,6 @@ org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert
org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
Expand Down Expand Up @@ -461,7 +461,6 @@ org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ Bundle-SymbolicName: org.eclipse.equinox.compendium.tests
Bundle-Version: 1.2.300.qualifier
Bundle-Activator: org.eclipse.equinox.compendium.tests.Activator
Require-Bundle: org.eclipse.core.runtime,
org.junit;bundle-version="4.12.0"
org.junit;bundle-version="4.12.0",
org.eclipse.equinox.coordinator,
org.eclipse.equinox.useradmin,
org.eclipse.equinox.event,
org.eclipse.equinox.metatype,
org.apache.felix.scr
Import-Package: org.eclipse.equinox.metatype;version="1.2.0",
org.eclipse.equinox.metatype.impl;version="1.2.0",
org.eclipse.osgi.tests.bundles,
Expand All @@ -15,7 +20,7 @@ Import-Package: org.eclipse.equinox.metatype;version="1.2.0",
org.osgi.service.metatype;version="1.2",
org.osgi.service.packageadmin;version="1.2.0",
org.osgi.service.useradmin;version="1.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: plugin
Bundle-Vendor: %bundleVendor
Automatic-Module-Name: org.eclipse.equinox.compendium.tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ jars.compile.order = bundle_tests/metatype/metatype.tb1.jar,\

# Maven properties, see https://github.com/eclipse/tycho/wiki/Tycho-Pomless
pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings}
pom.model.property.skipTests = true
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
*******************************************************************************/
package org.eclipse.equinox.compendium.tests;

import org.eclipse.core.runtime.Platform;
import org.osgi.framework.*;
import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.util.tracker.ServiceTracker;

/**
* The activator class controls the plug-in life cycle
Expand All @@ -26,63 +25,18 @@ public class Activator implements BundleActivator {
public static String BUNDLE_METATYPE = "org.eclipse.equinox.metatype"; //$NON-NLS-1$
public static String BUNDLE_USERADMIN = "org.eclipse.equinox.useradmin"; //$NON-NLS-1$

private static Activator plugin;
private static BundleContext context;

private ServiceTracker packageAdminTracker;

/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext bc) throws Exception {
plugin = this;
packageAdminTracker = new ServiceTracker(bc, PackageAdmin.class.getName(), null);
packageAdminTracker.open();
Activator.context = bc;
}

/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext bc) throws Exception {
if (packageAdminTracker != null) {
packageAdminTracker.close();
packageAdminTracker = null;
}
plugin = null;
FrameworkUtil.getBundle(org.apache.felix.scr.info.ScrInfo.class).start();
}

private static Activator getDefault() {
return plugin;
public void stop(BundleContext bc) throws Exception { // no-op
}

public static synchronized BundleContext getBundleContext() {
return context;
public static BundleContext getBundleContext() {
return FrameworkUtil.getBundle(Activator.class).getBundleContext();
}

public static synchronized Bundle getBundle(String symbolicName) {
PackageAdmin packageAdmin = Activator.getDefault().getPackageAdmin();
if (packageAdmin == null)
return null;

Bundle[] bundles = packageAdmin.getBundles(symbolicName, null);
if (bundles == null)
return null;
for (Bundle bundle : bundles) {
if ((bundle.getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) {
return bundle;
}
}
return null;
}

private PackageAdmin getPackageAdmin() {
if (packageAdminTracker == null) {
return null;
}
return (PackageAdmin) packageAdminTracker.getService();
public static Bundle getBundle(String symbolicName) {
return Platform.getBundle(symbolicName);
}

}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ public void tearDown() throws Exception {
Activator.getBundle(Activator.BUNDLE_USERADMIN).stop();
}

@SuppressWarnings("unchecked")
private void createUser1() {
User user = (User) userAdmin.createRole("testUserCreate1", Role.USER); //$NON-NLS-1$
assertNotNull(user);
Expand All @@ -144,19 +143,18 @@ private void removeUser1Silently() {
}
}

@SuppressWarnings("unchecked")
private void createUser2() {
User user = (User) userAdmin.createRole("testUserCreate2", Role.USER); //$NON-NLS-1$
assertNotNull(user);
assertEquals("testUserCreate2", user.getName()); //$NON-NLS-1$
assertTrue(user.getType() == Role.USER);
user.getProperties().put("test1", "valu"); //$NON-NLS-1$ //$NON-NLS-2$
user.getProperties().put("test2", "xxxyyyzzz"); //$NON-NLS-1$ //$NON-NLS-2$
user.getProperties().put("test3", new byte[] {1, 2, 3}); //$NON-NLS-1$
user.getProperties().put("test3", new byte[] { 1, 2, 3 }); //$NON-NLS-1$

user.getCredentials().put("test1", "valu"); //$NON-NLS-1$ //$NON-NLS-2$
user.getCredentials().put("test2", "xxxyyyzzz"); //$NON-NLS-1$ //$NON-NLS-2$
user.getCredentials().put("test3", new byte[] {1, 2, 3}); //$NON-NLS-1$
user.getCredentials().put("test3", new byte[] { 1, 2, 3 }); //$NON-NLS-1$
}

private void removeUser2() {
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.equinox.region.tests/.classpath
Original file line number Diff line number Diff line change
@@ -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.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
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.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand Down Expand Up @@ -97,8 +97,8 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enab
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
Expand Down
10 changes: 2 additions & 8 deletions bundles/org.eclipse.equinox.region.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Equinox Region Tests
Bundle-SymbolicName: org.eclipse.equinox.region.tests
Bundle-Version: 1.6.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Version: 1.6.100.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Import-Package: junit.framework;version="4.8.1",
org.aspectj.internal.lang.annotation;version="[1.6.3,2.0.0)";resolution:=optional,
org.aspectj.lang;version="[1.6.3,2.0.0)";resolution:=optional,
org.aspectj.lang.annotation;version="[1.6.3,2.0.0)";resolution:=optional,
org.aspectj.lang.reflect;version="[1.6.3,2.0.0)";resolution:=optional,
org.aspectj.runtime.internal;version="[1.6.3,2.0.0)";resolution:=optional,
org.aspectj.runtime.reflect;version="[1.6.3,2.0.0)";resolution:=optional,
org.eclipse.core.tests.harness;resolution:=optional,
org.eclipse.equinox.region;version="1.1.0",
org.eclipse.osgi.service.urlconversion;version="1.0.0",
Expand Down
Loading

0 comments on commit dd83565

Please sign in to comment.