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.
  • Loading branch information
HannesWell committed Jun 16, 2022
1 parent 48152cb commit 3982fae
Show file tree
Hide file tree
Showing 18 changed files with 466 additions and 222 deletions.
2 changes: 1 addition & 1 deletion bundles/org.eclipse.equinox.compendium.tests/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<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-11"/>
<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=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.compliance=11
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=11
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 @@ -16,7 +16,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-11
Bundle-Localization: plugin
Bundle-Vendor: %bundleVendor
Automatic-Module-Name: org.eclipse.equinox.compendium.tests
69 changes: 66 additions & 3 deletions bundles/org.eclipse.equinox.compendium.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,79 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>tests-pom</artifactId>
<groupId>org.eclipse.equinox</groupId>
<artifactId>parent</artifactId>
<version>4.25.0-SNAPSHOT</version>
<relativePath>../../tests-pom/</relativePath>
<relativePath>../..</relativePath>
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.compendium.tests</artifactId>
<version>1.2.300-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
<skipTests>true</skipTests>
<skipAPIAnalysis>true</skipAPIAnalysis>
<testClass>org.eclipse.equinox.compendium.tests.AllTests</testClass>
<code.ignoredWarnings>${tests.ignoredWarnings}</code.ignoredWarnings>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>3.0.0-SNAPSHOT</version>
<configuration>
<testClass>org.eclipse.equinox.compendium.tests.AllTests</testClass>
<bundleStartLevel>
<bundle>
<id>org.apache.felix.scr</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
</bundleStartLevel>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<dependency-resolution>
<extraRequirements>
<requirement>
<id>org.eclipse.osgi.compatibility.state</id>
<type>eclipse-plugin</type>
<versionRange>0.0.0</versionRange>
</requirement>
<requirement>
<id>org.eclipse.equinox.coordinator</id>
<type>eclipse-plugin</type>
<versionRange>0.0.0</versionRange>
</requirement>
<requirement>
<id>org.eclipse.equinox.event</id>
<type>eclipse-plugin</type>
<versionRange>0.0.0</versionRange>
</requirement>
<requirement>
<id>org.eclipse.equinox.metatype</id>
<type>eclipse-plugin</type>
<versionRange>0.0.0</versionRange>
</requirement>
<requirement>
<id>org.eclipse.equinox.useradmin</id>
<type>eclipse-plugin</type>
<versionRange>0.0.0</versionRange>
</requirement>
<requirement>
<id>org.apache.felix.scr</id>
<type>eclipse-plugin</type>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
</plugins>
</build>

</project>
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-Version: 1.6.100.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
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
27 changes: 27 additions & 0 deletions bundles/org.eclipse.equinox.region.tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012 Eclipse Foundation.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/org/documents/edl-v10.php
Contributors:
Igor Fedorenko - initial implementation
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.equinox.bundles</groupId>
<artifactId>rt.equinox.bundles</artifactId>
<version>4.24.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>org.eclipse.equinox.region.tests</artifactId>
<version>1.6.100-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
<skipAPIAnalysis>true</skipAPIAnalysis>
<testClass>org.eclipse.equinox.region.tests.AllTests</testClass>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
import java.util.Iterator;
import org.eclipse.equinox.region.*;
import org.eclipse.equinox.region.RegionDigraph.FilteredRegion;
import org.junit.Before;
import org.junit.Test;
import org.junit.*;
import org.osgi.framework.*;

@Ignore
public class BundleIdBasedRegionTests {

private static final String OTHER_REGION_NAME = "other";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.junit.*;
import org.osgi.framework.*;

@Ignore
public class StandardRegionDigraphPeristenceTests {

private RegionDigraph digraph;
Expand Down Expand Up @@ -122,7 +123,8 @@ public void testInvalidOperations() throws IOException, BundleException {
Assert.assertEquals(b, p);
// TODO seems testing this will require a reference handler to be present
// b = boot.installBundle("file:dynamic.add.a.2");
// boot.addBundle(b); // needed because we don't have a bundle hook to add it for us
// boot.addBundle(b); // needed because we don't have a bundle hook to add it
// for us

RegionDigraph copy = copy(digraph);
Region bootCopy = copy.getRegion(BOOT_REGION);
Expand Down Expand Up @@ -213,9 +215,12 @@ private RegionFilter createFilter(String... input) throws InvalidSyntaxException
RegionFilterBuilder builder = digraph.createRegionFilterBuilder();
for (String param : input) {
builder.allow(RegionFilter.VISIBLE_BUNDLE_NAMESPACE, "(bundle-symbolic-name=" + param + ")");
builder.allow(RegionFilter.VISIBLE_HOST_NAMESPACE, "(" + RegionFilter.VISIBLE_HOST_NAMESPACE + "=" + param + ")");
builder.allow(RegionFilter.VISIBLE_PACKAGE_NAMESPACE, "(" + RegionFilter.VISIBLE_PACKAGE_NAMESPACE + "=" + param + ")");
builder.allow(RegionFilter.VISIBLE_REQUIRE_NAMESPACE, "(" + RegionFilter.VISIBLE_REQUIRE_NAMESPACE + "=" + param + ")");
builder.allow(RegionFilter.VISIBLE_HOST_NAMESPACE,
"(" + RegionFilter.VISIBLE_HOST_NAMESPACE + "=" + param + ")");
builder.allow(RegionFilter.VISIBLE_PACKAGE_NAMESPACE,
"(" + RegionFilter.VISIBLE_PACKAGE_NAMESPACE + "=" + param + ")");
builder.allow(RegionFilter.VISIBLE_REQUIRE_NAMESPACE,
"(" + RegionFilter.VISIBLE_REQUIRE_NAMESPACE + "=" + param + ")");
builder.allow(RegionFilter.VISIBLE_SERVICE_NAMESPACE, "(" + Constants.OBJECTCLASS + "=" + param + ")");
}
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
import org.eclipse.equinox.region.RegionDigraph.FilteredRegion;
import org.eclipse.virgo.teststubs.osgi.framework.StubBundle;
import org.eclipse.virgo.teststubs.osgi.framework.StubBundleContext;
import org.junit.Before;
import org.junit.Test;
import org.junit.*;
import org.osgi.framework.*;

@Ignore
public class StandardRegionDigraphTests {

private RegionDigraph digraph;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
import org.eclipse.equinox.region.RegionFilter;
import org.eclipse.equinox.region.RegionFilterBuilder;
import org.eclipse.virgo.teststubs.osgi.framework.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.*;
import org.osgi.framework.*;
import org.osgi.framework.wiring.BundleCapability;
import org.osgi.framework.wiring.BundleRevision;

@Ignore
public class StandardRegionFilterTests {

private static final String BUNDLE_SYMBOLIC_NAME = "A";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.osgi.framework.*;
import org.osgi.framework.hooks.bundle.CollisionHook;

@Ignore
public class RegionBundleCollisionHookTests {

private static final String BUNDLE_X = "X";
Expand Down Expand Up @@ -266,7 +267,8 @@ private Bundle createBundle(String bundleSymbolicName) {
}

private Bundle createBundle(String bundleSymbolicName, boolean cache) {
Bundle stubBundle = new StubBundle(this.bundleId++, bundleSymbolicName, BUNDLE_VERSION, "loc:" + bundleSymbolicName);
Bundle stubBundle = new StubBundle(this.bundleId++, bundleSymbolicName, BUNDLE_VERSION,
"loc:" + bundleSymbolicName);
if (cache)
this.bundles.put(bundleSymbolicName, stubBundle);
return stubBundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.osgi.framework.*;
import org.osgi.framework.hooks.bundle.EventHook;

@Ignore
public class RegionBundleEventHookTests {

private static final String BUNDLE_X = "X";
Expand Down Expand Up @@ -71,7 +72,8 @@ public void setUp() throws Exception {
stubBundleContext.addInstalledBundle(stubSystemBundle);
this.threadLocal = new ThreadLocal<Region>();
this.digraph = RegionReflectionUtils.newStandardRegionDigraph(stubBundleContext, this.threadLocal);
this.bundleEventHook = RegionReflectionUtils.newRegionBundleEventHook(digraph, threadLocal, stubSystemBundle.getBundleId());
this.bundleEventHook = RegionReflectionUtils.newRegionBundleEventHook(digraph, threadLocal,
stubSystemBundle.getBundleId());

// Create regions A, B, C, D containing bundles A, B, C, D, respectively.
createRegion(REGION_A, BUNDLE_A);
Expand Down Expand Up @@ -226,7 +228,8 @@ private void doTestEventInCyclicGraph(boolean negate) throws BundleException, In
@Test
public void testEventFromSystemBundle() {
Bundle systemBundle = new StubBundle(0L, "sys", BUNDLE_VERSION, "");
Collection<BundleContext> contexts = new ArrayList<BundleContext>(Arrays.asList(systemBundle.getBundleContext()));
Collection<BundleContext> contexts = new ArrayList<BundleContext>(
Arrays.asList(systemBundle.getBundleContext()));
this.bundleEventHook.event(bundleEvent(BUNDLE_A), contexts);
assertTrue(contexts.contains(systemBundle.getBundleContext()));
}
Expand All @@ -243,12 +246,14 @@ public void testEventFromBundleInNoRegion() {
public void testDefaultRegion() {
this.digraph.setDefaultRegion(null);
Bundle x = createBundle("installed.X");
this.bundleEventHook.event(new BundleEvent(BundleEvent.INSTALLED, x, bundle(BUNDLE_A)), Collections.<BundleContext> emptyList());
this.bundleEventHook.event(new BundleEvent(BundleEvent.INSTALLED, x, bundle(BUNDLE_A)),
Collections.<BundleContext>emptyList());
assertTrue(this.digraph.getRegion(x).equals(region(REGION_A)));

this.digraph.setDefaultRegion(region(REGION_B));
Bundle y = createBundle("installed.Y");
this.bundleEventHook.event(new BundleEvent(BundleEvent.INSTALLED, y, bundle(BUNDLE_A)), Collections.<BundleContext> emptyList());
this.bundleEventHook.event(new BundleEvent(BundleEvent.INSTALLED, y, bundle(BUNDLE_A)),
Collections.<BundleContext>emptyList());
assertTrue(this.digraph.getRegion(y).equals(region(REGION_B)));
}

Expand Down Expand Up @@ -277,14 +282,17 @@ private RegionFilter createFilter(boolean negate, String... bundleSymbolicNames)
}

if (negate) {
String negateFilter = "(!(|" + "(" + RegionFilter.VISIBLE_ALL_NAMESPACE_ATTRIBUTE + "=" + RegionFilter.VISIBLE_BUNDLE_NAMESPACE + ")" + "(" + RegionFilter.VISIBLE_ALL_NAMESPACE_ATTRIBUTE + "=" + RegionFilter.VISIBLE_BUNDLE_LIFECYCLE_NAMESPACE + ")" + "))";
String negateFilter = "(!(|" + "(" + RegionFilter.VISIBLE_ALL_NAMESPACE_ATTRIBUTE + "="
+ RegionFilter.VISIBLE_BUNDLE_NAMESPACE + ")" + "(" + RegionFilter.VISIBLE_ALL_NAMESPACE_ATTRIBUTE
+ "=" + RegionFilter.VISIBLE_BUNDLE_LIFECYCLE_NAMESPACE + ")" + "))";
builder.allow(RegionFilter.VISIBLE_ALL_NAMESPACE, negateFilter);
}
return builder.build();
}

private Bundle createBundle(String bundleSymbolicName) {
Bundle stubBundle = new StubBundle(this.bundleId++, bundleSymbolicName, BUNDLE_VERSION, "loc:" + bundleSymbolicName);
Bundle stubBundle = new StubBundle(this.bundleId++, bundleSymbolicName, BUNDLE_VERSION,
"loc:" + bundleSymbolicName);
this.bundles.put(bundleSymbolicName, stubBundle);
return stubBundle;
}
Expand Down
Loading

0 comments on commit 3982fae

Please sign in to comment.