From aec9c06c08d6d31403ba6197ce026320471c3ba9 Mon Sep 17 00:00:00 2001 From: "elena.parovyshnaya" Date: Sun, 5 Apr 2020 14:02:59 +0300 Subject: [PATCH 1/3] Bug 561435 API revision: requirements resolution: test coverage - BundleRequirements test set is complete Signed-off-by: elena.parovyshnaya --- .../equinox/i18n/EquinoxMessages.properties | 14 ++++----- .../equinox/requirements/BundleVendor.java | 4 ++- .../RequirementFromCapability.java | 1 + .../META-INF/MANIFEST.MF | 5 +++- .../requirements/BundleRequirementsTest.java | 9 ++---- .../CapabilityLicFeatureIdTest.java | 3 +- .../equinox/requirements/DataBundle.java | 24 +++++++++++++-- ...singFeatureCapabilitiesFromBundleTest.java | 13 ++++++++- .../RequirementsFromCapabilityTest.java | 29 ++++++++++++++++--- .../equinox/requirements/Unsatisfiable.java | 20 +++++++++++++ 10 files changed, 99 insertions(+), 23 deletions(-) create mode 100644 tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/Unsatisfiable.java diff --git a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.properties b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.properties index 07262c342..361216c73 100644 --- a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.properties +++ b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.properties @@ -20,9 +20,9 @@ EquinoxRestrictions_title=Issues with licensing ComponentConfigurationResolver_error_invalid_bundle_context=Unable to extract configuration requirements: invalid BundleContext ComponentConfigurationResolver_error_invalid_component_rt=Unable to extract configuration requirements: invalid ServiceComponentRuntime -ComponentRequirements_error_no_resource=Unable to extract configuration requirements: invalid {1} -ComponentRequirements_requirement_for_resource={1} for {2} OSGi-component -BundleRequirements_no_context=Bundle context for {1} OSGi-component +ComponentRequirements_error_no_resource=Unable to extract configuration requirements: invalid {0} +ComponentRequirements_requirement_for_resource={0} for {1} OSGi-component +BundleRequirements_no_context=Bundle context for {0 OSGi-component BundleRequirements_error_bundle_context=Unable to extract configuration requirements: invalid BundleContext EquinoxRestrictionExecutorRegistry_error_name=Error EquinoxRestrictionExecutorRegistry_error_title=Interrupt the execution for the restricted functionality with error, but allow to use other scenarios @@ -32,7 +32,7 @@ EquinoxRestrictionExecutorRegistry_info_name=Info EquinoxRestrictionExecutorRegistry_info_title=Inform about functionality restriction without pausing the execution flow EquinoxRestrictionExecutorRegistry_warning_name=Warning EquinoxRestrictionExecutorRegistry_warning_title=Pause the execution flow with warning, but allow to proceed without functionality blocking -RequirementsFromCapability_no_attributes=Attributes for capability {1} in bundle {2} is required -RequirementsFromCapability_no_feature_id=Configuration of a feature identifier in capability {1} of bundle {2} is required -RequirementsFromComponent_no_feature_id=Feature identifier in properties of OSGi component {1} -RequirementsFromComponent_no_properties=Properties for OSGi-component {1} +RequirementsFromCapability_no_attributes=Attributes for capability {0} in bundle {1} is required +RequirementsFromCapability_no_feature_id=Configuration of a feature identifier in capability {0} of bundle {1} is required +RequirementsFromComponent_no_feature_id=Feature identifier in properties of OSGi component {0} +RequirementsFromComponent_no_properties=Properties for OSGi-component {0} diff --git a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleVendor.java b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleVendor.java index f40538892..89d6e1988 100644 --- a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleVendor.java +++ b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleVendor.java @@ -13,6 +13,7 @@ package org.eclipse.passage.lic.internal.equinox.requirements; import java.util.Objects; +import java.util.Optional; import java.util.function.Supplier; import org.osgi.framework.Bundle; @@ -33,7 +34,8 @@ protected BundleVendor(Bundle bundle) { @Override public String get() { - return bundle.getHeaders().get(Constants.BUNDLE_VENDOR); + return Optional.ofNullable(bundle.getHeaders().get(Constants.BUNDLE_VENDOR))// + .orElse("Unknown vendor"); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementFromCapability.java b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementFromCapability.java index 50d6a1690..79e2c96f4 100644 --- a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementFromCapability.java +++ b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementFromCapability.java @@ -60,6 +60,7 @@ public Requirement get() { } private Requirement requirementFromAttributes(String feature, Map attributes) { + System.out.println(">>" + attributes); //$NON-NLS-1$ String version = new CapabilityLicFeatureVersion(attributes).get()// .map(LicensingVersions::toVersionValue)// .orElse(LicensingVersions.VERSION_DEFAULT); diff --git a/tests/org.eclipse.passage.lic.equinox.tests.data.requirements/META-INF/MANIFEST.MF b/tests/org.eclipse.passage.lic.equinox.tests.data.requirements/META-INF/MANIFEST.MF index ddc66cb6a..e5dc13782 100644 --- a/tests/org.eclipse.passage.lic.equinox.tests.data.requirements/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.passage.lic.equinox.tests.data.requirements/META-INF/MANIFEST.MF @@ -8,4 +8,7 @@ Bundle-Name: Data for Passage LIC Equinox requirements tests Bundle-Vendor: Eclipse Passage Bundle-Copyright: %Bundle-Copyright Provide-Capability: licensing.feature;licensing.feature="PI";version="3.14.15";name="PI of version PI";level="error", - licensing.feature;licensing.feature="E";version="2.71.82";name="Euler number";level="info";provider="Euler" + licensing.feature;licensing.feature="E";version="2.71.82";name="Euler number";level="info";provider="Euler", + licensing.feature;licensing.feature="Incomplete", + licensing.feature + diff --git a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleRequirementsTest.java b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleRequirementsTest.java index 8f4f876f4..9b2a7675e 100644 --- a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleRequirementsTest.java +++ b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleRequirementsTest.java @@ -24,7 +24,6 @@ import org.eclipse.passage.lic.internal.api.requirements.Requirement; import org.eclipse.passage.lic.internal.api.requirements.ResolvedRequirements; -import org.junit.Ignore; import org.junit.Test; import org.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; @@ -39,17 +38,15 @@ public void providedAsResolvedRequirementsImpl() throws InvalidSyntaxException { } @Test - @Ignore public void allRequirements() throws InvalidSyntaxException { - Collection list = service().all(); - assertTrue(list.stream() // + Collection requirements = service().all(); + assertTrue(requirements.stream() // .collect(Collectors.toSet())// .containsAll(// - new DataBundle().requirements())); + new DataBundle().validRequirements())); } @Test - @Ignore public void requirementsForFeature() throws InvalidSyntaxException { Collection list = new ResolvedRequirements.Smart(service()).forFeature("PI"); //$NON-NLS-1$ assertEquals(// diff --git a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/CapabilityLicFeatureIdTest.java b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/CapabilityLicFeatureIdTest.java index 6ade37741..d5cca292e 100644 --- a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/CapabilityLicFeatureIdTest.java +++ b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/CapabilityLicFeatureIdTest.java @@ -31,7 +31,8 @@ protected StringNamedData infoSupplier(Map attributes) { protected Set expectations() { return new HashSet(Arrays.asList(// "PI", //$NON-NLS-1$ - "E" //$NON-NLS-1$ + "E", //$NON-NLS-1$ + "Incomplete" //$NON-NLS-1$ )); } diff --git a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/DataBundle.java b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/DataBundle.java index 6a7551760..223cd7447 100644 --- a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/DataBundle.java +++ b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/DataBundle.java @@ -39,8 +39,8 @@ public Bundle get() { return bundle.get(); } - Set requirements() { - return new HashSet(Arrays.asList(pi(), e())); + Set validRequirements() { + return new HashSet(Arrays.asList(pi(), e(), incomplete())); } BaseRequirement e() { @@ -65,8 +65,28 @@ BaseRequirement pi() { id); } + BaseRequirement incomplete() { + return new BaseRequirement(// + new BaseFeature(// + "Incomplete", //$NON-NLS-1$ + "0.0.0", //$NON-NLS-1$ + "Incomplete", //$NON-NLS-1$ + "Eclipse Passage"), //$NON-NLS-1$ + new RestrictionLevel.Warning(), // + id); + } + List capabilities() { return get().adapt(BundleWiring.class).getCapabilities(// new LicensingFeatureCapabilitiesFromBundle(get()).key()); } + // BaseRequirement [feature=BaseFeature [id=PI, version=3.14.15, name=PI of version PI, provider=Eclipse Passage], restriction=error, source=org.eclipse.passage.lic.equinox.tests.data.requirements], + // BaseRequirement [feature=BaseFeature [id=Incomplete, version=0.0.0, name=Incomplete, provider=Eclipse Passage], restriction=warn, source=org.eclipse.passage.lic.equinox.tests.data.requirements], + // BaseRequirement [feature=BaseFeature [id=E, version=2.71.82, name=Euler number, provider=Euler], restriction=info, source=org.eclipse.passage.lic.equinox.tests.data.requirements]]> but was:<[ + + // BaseRequirement [feature=BaseFeature [id=PI, version=3.14.15, name=PI of version PI, provider=Eclipse Passage], restriction=error, source=org.eclipse.passage.lic.equinox.tests.data.requirements], + // BaseRequirement [feature=BaseFeature [id=17149af8056, version=0.0.0, name=Configuration of a feature identifier in capability Data for Passage LIC Equinox requirements tests of bundle is required, provider=Passage License Management], restriction=error, source=org.eclipse.passage.lic.equinox.tests.data.requirements_0.1.0.qualifier [461]], + // BaseRequirement [feature=BaseFeature [id=Incomplete, version=0.0.0, name=Incomplete, provider=Eclipse Passage], restriction=warn, source=org.eclipse.passage.lic.equinox.tests.data.requirements], + // BaseRequirement [feature=BaseFeature [id=E, version=2.71.82, name=Euler number, provider=Euler], restriction=info, source=org.eclipse.passage.lic.equinox.tests.data.requirements + } diff --git a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/LicensingFeatureCapabilitiesFromBundleTest.java b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/LicensingFeatureCapabilitiesFromBundleTest.java index c82ec9513..55f588aea 100644 --- a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/LicensingFeatureCapabilitiesFromBundleTest.java +++ b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/LicensingFeatureCapabilitiesFromBundleTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; +import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; @@ -32,13 +33,23 @@ public void read() { Optional> capabilities = new LicensingFeatureCapabilitiesFromBundle(// new DataBundle().get()).get(); assertTrue(capabilities.isPresent()); + assertEquals(4, capabilities.get().size()); + assertExpectedContent(capabilities); + } + + private void assertExpectedContent(Optional> capabilities) { String key = new CapabilityLicFeatureId("").key(); //$NON-NLS-1$ assertEquals(// new HashSet(Arrays.asList(// + "Incomplete", //$NON-NLS-1$ "PI", //$NON-NLS-1$ "E")), //$NON-NLS-1$ capabilities.get().stream() // - .map(c -> c.getAttributes().get(key))// + .filter(c -> Optional.ofNullable(c.getAttributes()).isPresent()) // + .map(c -> c.getAttributes())// + .filter(attributes -> attributes.containsKey(key))// + .map(attributes -> attributes.get(key))// + .filter(Objects::nonNull) // .map(Object::toString) // .collect(Collectors.toSet())); } diff --git a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementsFromCapabilityTest.java b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementsFromCapabilityTest.java index cc93d54e9..b79e92bf5 100644 --- a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementsFromCapabilityTest.java +++ b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementsFromCapabilityTest.java @@ -13,21 +13,42 @@ package org.eclipse.passage.lic.internal.equinox.requirements; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import java.util.Set; import java.util.stream.Collectors; +import org.eclipse.passage.lic.internal.api.requirements.Requirement; import org.junit.Test; +@SuppressWarnings("restriction") public final class RequirementsFromCapabilityTest { @Test public void read() { DataBundle data = new DataBundle(); + Set found = data.capabilities().stream() // + .map(c -> new RequirementFromCapability(data.get(), c)) // + .map(RequirementFromCapability::get) // + .collect(Collectors.toSet()); + assertContainsUnsatisfiableRequirement(found); + assertContainsAllExpectedRequirements(data, found); + } + + private void assertContainsUnsatisfiableRequirement(Set requirements) { + assertTrue(// + requirements.stream()// + .filter(new Unsatisfiable())// + .findAny() // + .isPresent()// + ); + } + + private void assertContainsAllExpectedRequirements(DataBundle data, Set requirements) { assertEquals(// - data.requirements(), // - data.capabilities().stream() // - .map(c -> new RequirementFromCapability(data.get(), c)) // - .map(RequirementFromCapability::get) // + data.validRequirements(), // + requirements.stream()// + .filter(r -> !new Unsatisfiable().test(r)) // .collect(Collectors.toSet())// ); } diff --git a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/Unsatisfiable.java b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/Unsatisfiable.java new file mode 100644 index 000000000..fe3e348e8 --- /dev/null +++ b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/Unsatisfiable.java @@ -0,0 +1,20 @@ +package org.eclipse.passage.lic.internal.equinox.requirements; + +import java.util.function.Predicate; + +import org.eclipse.passage.lic.internal.api.requirements.Requirement; + +@SuppressWarnings("restriction") +final class Unsatisfiable implements Predicate { + + @Override + public boolean test(Requirement requirement) { + String identifier = requirement.feature().identifier(); + if (identifier.length() < 4) { + return false; + } + return Long.toHexString(System.currentTimeMillis())// + .startsWith(identifier.substring(0, 4)); + } + +} From 333c1eb2523b23ca2b73f022d577701745b853aa Mon Sep 17 00:00:00 2001 From: "elena.parovyshnaya" Date: Sun, 5 Apr 2020 14:04:29 +0300 Subject: [PATCH 2/3] Bug 561435 API revision: requirements resolution: test coverage - add license header to the new class Signed-off-by: elena.parovyshnaya --- .../internal/equinox/requirements/Unsatisfiable.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/Unsatisfiable.java b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/Unsatisfiable.java index fe3e348e8..b508ed54c 100644 --- a/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/Unsatisfiable.java +++ b/tests/org.eclipse.passage.lic.equinox.tests/src/org/eclipse/passage/lic/internal/equinox/requirements/Unsatisfiable.java @@ -1,3 +1,15 @@ +/******************************************************************************* + * Copyright (c) 2020 ArSysOp + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0/. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * ArSysOp - initial API and implementation + *******************************************************************************/ package org.eclipse.passage.lic.internal.equinox.requirements; import java.util.function.Predicate; From 6e0e6b8d3d2be027ba3870dee9140cd3b55db570 Mon Sep 17 00:00:00 2001 From: "elena.parovyshnaya" Date: Sun, 5 Apr 2020 19:46:12 +0300 Subject: [PATCH 3/3] Bug 561435 API revision: requirements resolution: test coverage - fix code review findings: i18n for "unknown vendor", suspicious print, error in an i18n-message template format Signed-off-by: elena.parovyshnaya --- .../lic/internal/equinox/i18n/EquinoxMessages.java | 8 ++------ .../lic/internal/equinox/i18n/EquinoxMessages.properties | 3 ++- .../lic/internal/equinox/requirements/BundleVendor.java | 3 ++- .../equinox/requirements/RequirementFromCapability.java | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.java b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.java index a23bff813..8385238c2 100644 --- a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.java +++ b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.java @@ -20,20 +20,18 @@ public class EquinoxMessages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.passage.lic.internal.equinox.i18n.EquinoxMessages"; //$NON-NLS-1$ public static String ApplicationConfigurations_contact_defaults; - public static String EquinoxPaths_uri_retrieval_error; public static String EquinoxRestrictions_feature_is_licensed; public static String EquinoxRestrictions_feature_is_not_licensed; public static String EquinoxRestrictions_title; - public static String ComponentConfigurationResolver_error_invalid_bundle_context; public static String ComponentConfigurationResolver_error_invalid_component_rt; - public static String ComponentRequirements_error_no_resource; public static String ComponentRequirements_requirement_for_resource; public static String BundleRequirements_error_bundle_context; - public static String BundleRequirements_no_context; + + public static String BundleVendor_unknown_vendor; public static String EquinoxRestrictionExecutorRegistry_error_name; public static String EquinoxRestrictionExecutorRegistry_error_title; public static String EquinoxRestrictionExecutorRegistry_fatal_name; @@ -42,9 +40,7 @@ public class EquinoxMessages extends NLS { public static String EquinoxRestrictionExecutorRegistry_info_title; public static String EquinoxRestrictionExecutorRegistry_warning_name; public static String EquinoxRestrictionExecutorRegistry_warning_title; - public static String RequirementsFromCapability_no_attributes; - public static String RequirementsFromCapability_no_feature_id; public static String RequirementsFromComponent_no_feature_id; diff --git a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.properties b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.properties index 361216c73..c5abf96d4 100644 --- a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.properties +++ b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/i18n/EquinoxMessages.properties @@ -22,8 +22,9 @@ ComponentConfigurationResolver_error_invalid_bundle_context=Unable to extract co ComponentConfigurationResolver_error_invalid_component_rt=Unable to extract configuration requirements: invalid ServiceComponentRuntime ComponentRequirements_error_no_resource=Unable to extract configuration requirements: invalid {0} ComponentRequirements_requirement_for_resource={0} for {1} OSGi-component -BundleRequirements_no_context=Bundle context for {0 OSGi-component +BundleRequirements_no_context=Bundle context for {0} OSGi-component BundleRequirements_error_bundle_context=Unable to extract configuration requirements: invalid BundleContext +BundleVendor_unknown_vendor=Unknown vendor EquinoxRestrictionExecutorRegistry_error_name=Error EquinoxRestrictionExecutorRegistry_error_title=Interrupt the execution for the restricted functionality with error, but allow to use other scenarios EquinoxRestrictionExecutorRegistry_fatal_name=Fatal diff --git a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleVendor.java b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleVendor.java index 89d6e1988..47364df70 100644 --- a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleVendor.java +++ b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/BundleVendor.java @@ -16,6 +16,7 @@ import java.util.Optional; import java.util.function.Supplier; +import org.eclipse.passage.lic.internal.equinox.i18n.EquinoxMessages; import org.osgi.framework.Bundle; import org.osgi.framework.Constants; @@ -35,7 +36,7 @@ protected BundleVendor(Bundle bundle) { @Override public String get() { return Optional.ofNullable(bundle.getHeaders().get(Constants.BUNDLE_VENDOR))// - .orElse("Unknown vendor"); //$NON-NLS-1$ + .orElse(EquinoxMessages.BundleVendor_unknown_vendor); } } diff --git a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementFromCapability.java b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementFromCapability.java index 79e2c96f4..50d6a1690 100644 --- a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementFromCapability.java +++ b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/requirements/RequirementFromCapability.java @@ -60,7 +60,6 @@ public Requirement get() { } private Requirement requirementFromAttributes(String feature, Map attributes) { - System.out.println(">>" + attributes); //$NON-NLS-1$ String version = new CapabilityLicFeatureVersion(attributes).get()// .map(LicensingVersions::toVersionValue)// .orElse(LicensingVersions.VERSION_DEFAULT);