diff --git a/bundles/org.eclipse.passage.lbc.equinox/OSGI-INF/org.eclipse.passage.lbc.internal.equinox.ServerRunnerImpl.xml b/bundles/org.eclipse.passage.lbc.equinox/OSGI-INF/org.eclipse.passage.lbc.internal.equinox.ServerRunnerImpl.xml index d4b3fa6b5..7edcd015c 100644 --- a/bundles/org.eclipse.passage.lbc.equinox/OSGI-INF/org.eclipse.passage.lbc.internal.equinox.ServerRunnerImpl.xml +++ b/bundles/org.eclipse.passage.lbc.equinox/OSGI-INF/org.eclipse.passage.lbc.internal.equinox.ServerRunnerImpl.xml @@ -1,5 +1,5 @@ - + diff --git a/bundles/org.eclipse.passage.lbc.equinox/src/org/eclipse/passage/lbc/internal/equinox/ServerRunnerImpl.java b/bundles/org.eclipse.passage.lbc.equinox/src/org/eclipse/passage/lbc/internal/equinox/ServerRunnerImpl.java index 0fdf61e94..33d2c523b 100644 --- a/bundles/org.eclipse.passage.lbc.equinox/src/org/eclipse/passage/lbc/internal/equinox/ServerRunnerImpl.java +++ b/bundles/org.eclipse.passage.lbc.equinox/src/org/eclipse/passage/lbc/internal/equinox/ServerRunnerImpl.java @@ -29,7 +29,7 @@ import org.osgi.service.log.Logger; import org.osgi.service.log.LoggerFactory; -@Component +@Component(immediate = true) public class ServerRunnerImpl implements BackendCluster { private List backendLaunchers = new ArrayList<>(); diff --git a/features/org.eclipse.passage.lbc.execute.feature/.project b/features/org.eclipse.passage.lbc.execute.feature/.project new file mode 100644 index 000000000..a729ea732 --- /dev/null +++ b/features/org.eclipse.passage.lbc.execute.feature/.project @@ -0,0 +1,17 @@ + + + org.eclipse.passage.lbc.execute.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/features/org.eclipse.passage.lbc.feature/build.properties b/features/org.eclipse.passage.lbc.execute.feature/build.properties similarity index 100% rename from features/org.eclipse.passage.lbc.feature/build.properties rename to features/org.eclipse.passage.lbc.execute.feature/build.properties diff --git a/features/org.eclipse.passage.lbc.feature/feature.properties b/features/org.eclipse.passage.lbc.execute.feature/feature.properties similarity index 96% rename from features/org.eclipse.passage.lbc.feature/feature.properties rename to features/org.eclipse.passage.lbc.execute.feature/feature.properties index 2535f38e5..7284fa3a1 100644 --- a/features/org.eclipse.passage.lbc.feature/feature.properties +++ b/features/org.eclipse.passage.lbc.execute.feature/feature.properties @@ -10,7 +10,7 @@ # Contributors: # ArSysOp - initial API and implementation ############################################################################### -featureName=Passage LBC +featureName=Passage LBC Server providerName=Eclipse Passage description=Passage Licensing Back-end Components: OSGi-based server to manage licensing data. copyright=Copyright (c) 2018-2019 ArSysOp and others.\n\ diff --git a/features/org.eclipse.passage.lbc.feature/feature.xml b/features/org.eclipse.passage.lbc.execute.feature/feature.xml similarity index 91% rename from features/org.eclipse.passage.lbc.feature/feature.xml rename to features/org.eclipse.passage.lbc.execute.feature/feature.xml index ab1043195..5010a82fc 100644 --- a/features/org.eclipse.passage.lbc.feature/feature.xml +++ b/features/org.eclipse.passage.lbc.execute.feature/feature.xml @@ -12,7 +12,7 @@ ArSysOp - initial API and implementation --> + + + + - org.eclipse.passage.lbc.feature + org.eclipse.passage.lbc.target.feature diff --git a/features/org.eclipse.passage.lbc.target.feature/build.properties b/features/org.eclipse.passage.lbc.target.feature/build.properties new file mode 100644 index 000000000..40bc3016d --- /dev/null +++ b/features/org.eclipse.passage.lbc.target.feature/build.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 019 ArSysOp and others +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# ArSysOp - initial API and implementation +############################################################################### +bin.includes = feature.xml,\ + feature.properties diff --git a/features/org.eclipse.passage.lbc.target.feature/feature.properties b/features/org.eclipse.passage.lbc.target.feature/feature.properties new file mode 100644 index 000000000..f7ffe397f --- /dev/null +++ b/features/org.eclipse.passage.lbc.target.feature/feature.properties @@ -0,0 +1,23 @@ +############################################################################### +# Copyright (c) 2019 ArSysOp and others +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# ArSysOp - initial API and implementation +############################################################################### +featureName=Passage LBC Target +providerName=Eclipse Passage +description=Passage Licensing Back-end Components: required target dependencies. +copyright=Copyright (c) 2019 ArSysOp and others.\n\ +\n\ +This program and the accompanying materials are made\n\ +available under the terms of the Eclipse Public License 2.0\n\ +which is available at https://www.eclipse.org/legal/epl-2.0/\n\ +\n\ +SPDX-License-Identifier: EPL-2.0\n\ + diff --git a/features/org.eclipse.passage.lbc.target.feature/feature.xml b/features/org.eclipse.passage.lbc.target.feature/feature.xml new file mode 100644 index 000000000..420cfb894 --- /dev/null +++ b/features/org.eclipse.passage.lbc.target.feature/feature.xml @@ -0,0 +1,76 @@ + + + + + + %description + + + + %copyright + + + + %license + + + + + + + + + + + + + + + diff --git a/products/org.eclipse.passage.lbc.server.product/org.eclipse.passage.lbc.server.product b/products/org.eclipse.passage.lbc.server.product/org.eclipse.passage.lbc.server.product index 423a64f8e..7550963a8 100644 --- a/products/org.eclipse.passage.lbc.server.product/org.eclipse.passage.lbc.server.product +++ b/products/org.eclipse.passage.lbc.server.product/org.eclipse.passage.lbc.server.product @@ -1,7 +1,7 @@ - + @@ -26,96 +26,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + - - + - + + diff --git a/releng/org.eclipse.passage.lbc.aggregator/pom.xml b/releng/org.eclipse.passage.lbc.aggregator/pom.xml index b17266bf6..754b46dc0 100644 --- a/releng/org.eclipse.passage.lbc.aggregator/pom.xml +++ b/releng/org.eclipse.passage.lbc.aggregator/pom.xml @@ -27,12 +27,14 @@ ../../releng/org.eclipse.passage.parent + ../../features/org.eclipse.passage.lbc.target.feature + ../../bundles/org.eclipse.passage.lbc.api ../../bundles/org.eclipse.passage.lbc.base ../../bundles/org.eclipse.passage.lbc.equinox ../../bundles/org.eclipse.passage.lbc.jetty ../../bundles/org.eclipse.passage.lbc.server - ../../features/org.eclipse.passage.lbc.feature + ../../features/org.eclipse.passage.lbc.execute.feature ../../tests/org.eclipse.passage.lbc.server.test diff --git a/releng/org.eclipse.passage.lbc.repository/category.xml b/releng/org.eclipse.passage.lbc.repository/category.xml index 648d3da66..ce452713a 100644 --- a/releng/org.eclipse.passage.lbc.repository/category.xml +++ b/releng/org.eclipse.passage.lbc.repository/category.xml @@ -20,7 +20,11 @@ + id="org.eclipse.passage.lbc.target.feature"> + + + + id="org.eclipse.passage.lbc.execute.feature.source"> diff --git a/tests/org.eclipse.passage.lbc.server.test/src/org/eclipse/passage/lbc/test/ServerBackendLauncherTests.java b/tests/org.eclipse.passage.lbc.server.test/src/org/eclipse/passage/lbc/test/ServerBackendLauncherTests.java index 0688b7780..88fb07752 100644 --- a/tests/org.eclipse.passage.lbc.server.test/src/org/eclipse/passage/lbc/test/ServerBackendLauncherTests.java +++ b/tests/org.eclipse.passage.lbc.server.test/src/org/eclipse/passage/lbc/test/ServerBackendLauncherTests.java @@ -18,10 +18,13 @@ import static org.junit.Assert.assertTrue; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import org.eclipse.passage.lbc.api.BackendCluster; import org.eclipse.passage.lbc.api.BackendLauncher; +import org.eclipse.passage.lic.api.LicensingResult; +import org.junit.Before; import org.junit.Test; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; @@ -31,21 +34,38 @@ public class ServerBackendLauncherTests { private static final int DEFAULT_CAPACITY = 2; + private BundleContext context; - @Test - public void checkServerRegistredComponents() { + @Before + public void getContext() { Bundle bundle = FrameworkUtil.getBundle(ServerBackendLauncherTests.class); - BundleContext context = bundle.getBundleContext(); + context = bundle.getBundleContext(); + } + + @Test + public void serverBackendLauncherTest() { + assertNotNull(context); ServiceReference serviceReference = context.getServiceReference(BackendCluster.class); assertNotNull(serviceReference); BackendCluster service = context.getService(serviceReference); assertNotNull(service); Iterable backendLaunchers = service.getBackendLaunchers(); assertNotNull(backendLaunchers); - List launchers = new ArrayList<>(); + List launchers = new ArrayList<>(); backendLaunchers.forEach(launchers::add); assertNotNull(launchers); assertFalse(launchers.isEmpty()); assertTrue(launchers.size() >= DEFAULT_CAPACITY); + + launchers.stream().forEach(launcher -> { + LicensingResult result = launcher.launch(Collections.emptyMap()); + assertTrue(result.getSeverity() == LicensingResult.OK); + }); + + launchers.stream().forEach(launcher -> { + LicensingResult result = launcher.terminate(); + assertTrue(result.getSeverity() == LicensingResult.OK); + }); + } }