diff --git a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/conditions/ConditionActions.java b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/conditions/ConditionActions.java index e3a5e5a97..07da1e981 100644 --- a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/conditions/ConditionActions.java +++ b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/conditions/ConditionActions.java @@ -12,11 +12,15 @@ *******************************************************************************/ package org.eclipse.passage.lic.api.conditions; +import org.eclipse.passage.lic.internal.api.conditions.ConditionAction; + /** * Actions to be performed with {@link LicensingCondition}(s) * * @since 0.5.0 + * @deprecated use {@link ConditionAction} */ +@Deprecated public class ConditionActions { private ConditionActions() { @@ -28,21 +32,27 @@ private ConditionActions() { * be periodically confirmed with {@link #KEEP} action * * @since 0.5.0 + * @deprecated use {@link ConditionAction.Aquire} */ + @Deprecated public static final String ACQUIRE = "acquire"; //$NON-NLS-1$ /** * Keep the {@link LicensingCondition} for the usage * * @since 0.5.0 + * @deprecated use {@link ConditionAction.Keep} */ + @Deprecated public static final String KEEP = "keep"; //$NON-NLS-1$ /** * Release the {@link LicensingCondition} to be available for others * * @since 0.5.0 + * @deprecated use {@link ConditionAction.Release} */ + @Deprecated public static final String RELEASE = "release"; //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/ConditionAction.java b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/ConditionAction.java new file mode 100644 index 000000000..6cd6cda2d --- /dev/null +++ b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/ConditionAction.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * 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.api.conditions; + +import java.util.Objects; + +public abstract class ConditionAction { + + private final String name; + + protected ConditionAction(String name) { + Objects.requireNonNull(name, "ConditionAction::name"); //$NON-NLS-1$ + this.name = name; + } + + @Override + public boolean equals(Object obj) { + if (!ConditionAction.class.isInstance(obj)) { + return false; + } + return name.equals(((ConditionAction) obj).name()); + } + + @Override + public int hashCode() { + return name.hashCode(); + } + + public final String name() { + return name; + } + + @Override + public String toString() { + return name; + } + + public static final class Aquire extends ConditionAction { + + public Aquire() { + super("acquire"); //$NON-NLS-1$ + } + + } + + public static final class Keep extends ConditionAction { + + public Keep() { + super("keep"); //$NON-NLS-1$ + } + + } + + public static final class Release extends ConditionAction { + + public Release() { + super("release"); //$NON-NLS-1$ + } + + } + + public static final class Of extends ConditionAction { + + public Of(String name) { + super(name); + } + + } + +} diff --git a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/UserRole.java b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/UserRole.java new file mode 100644 index 000000000..9c6be05d1 --- /dev/null +++ b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/UserRole.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * 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.api.conditions; + +import java.util.Objects; + +public abstract class UserRole { + + private final String role; + + protected UserRole(String role) { + Objects.requireNonNull(role, "UserRole::role"); //$NON-NLS-1$ + this.role = role; + } + + @Override + public boolean equals(Object obj) { + if (!ConditionAction.class.isInstance(obj)) { + return false; + } + return role.equals(((ConditionAction) obj).name()); + } + + @Override + public int hashCode() { + return role.hashCode(); + } + + public final String name() { + return role; + } + + @Override + public String toString() { + return role; + } + + public static final class Admin extends UserRole { + + public Admin() { + super("admin"); //$NON-NLS-1$ + } + + } + + public static final class Licensee extends UserRole { + + public Licensee() { + super("licensee"); //$NON-NLS-1$ + } + + } + + public static final class Operator extends UserRole { + + public Operator() { + super("operator"); //$NON-NLS-1$ + } + + } + + public static final class Of extends UserRole { + + public Of(String role) { + super(role); + } + + } + +} diff --git a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/i18n/HcMessages.java b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/i18n/HcMessages.java index dde21e857..f4df679bf 100644 --- a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/i18n/HcMessages.java +++ b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/i18n/HcMessages.java @@ -23,6 +23,8 @@ public class HcMessages extends NLS { public static String HttpClient_final_error_message; public static String HttpClient_not_ok_response; + public static String RemoteConditionsRequest_failed_to_compose_url; + static { NLS.initializeMessages(BUNDLE_NAME, HcMessages.class); } diff --git a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/i18n/HcMessages.properties b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/i18n/HcMessages.properties index 71c4b4700..1264e3436 100644 --- a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/i18n/HcMessages.properties +++ b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/i18n/HcMessages.properties @@ -15,3 +15,4 @@ DecryptedConditions_no_transport_for_content_type=Unknown content type: no regis DecryptedConditions_reading_error=Error reading remote condition data HttpClient_final_error_message=Error mining conditions HttpClient_not_ok_response=Mining connection responded not OK: %d ($s) +RemoteConditionsRequest_failed_to_compose_url=Failed to compose licensing server connection url diff --git a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/Request.java b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/Request.java index a017eddba..62644a26e 100644 --- a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/Request.java +++ b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/Request.java @@ -14,9 +14,12 @@ import java.net.URL; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningException; + +@SuppressWarnings("restriction") public interface Request { - URL url(); + URL url() throws ConditionMiningException; Configuration config(); diff --git a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/LicensingServerRequest.java b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/LicensingServerRequest.java deleted file mode 100644 index a69abf06f..000000000 --- a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/LicensingServerRequest.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * 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.hc.remote.impl; - -import java.net.HttpURLConnection; -import java.net.URL; - -import org.eclipse.passage.lic.internal.hc.remote.Configuration; -import org.eclipse.passage.lic.internal.hc.remote.Request; - -// read settings and know all the params and properties -final class LicensingServerRequest implements Request { - - @Override - public URL url() { - throw new UnsupportedOperationException(); - } - - @Override - public Configuration config() { - throw new UnsupportedOperationException(); - } - -} diff --git a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditions.java b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditions.java index c1caa9de5..3aed241c9 100644 --- a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditions.java +++ b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditions.java @@ -13,7 +13,9 @@ package org.eclipse.passage.lic.internal.hc.remote.impl; import java.util.Collection; +import java.util.function.Supplier; +import org.eclipse.passage.lic.internal.api.LicensedProduct; import org.eclipse.passage.lic.internal.api.conditions.Condition; import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningException; import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionTransportRegistry; @@ -24,9 +26,11 @@ public final class RemoteConditions implements MinedConditions { private final StringServiceId id = new StringServiceId("remote"); //$NON-NLS-1$ + private final Supplier product; private final ConditionTransportRegistry transports; - public RemoteConditions(ConditionTransportRegistry transports) { + public RemoteConditions(Supplier product, ConditionTransportRegistry transports) { + this.product = product; this.transports = transports; } @@ -39,7 +43,7 @@ public StringServiceId id() { @Override public Collection all() throws ConditionMiningException { return new HttpClient().remoteConditions(// - new LicensingServerRequest(), // + new RemoteConditionsRequest(product.get()), // new DecryptedConditions(transports)); } diff --git a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditionsRequest.java b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditionsRequest.java new file mode 100644 index 000000000..2d0bc5ff8 --- /dev/null +++ b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditionsRequest.java @@ -0,0 +1,92 @@ +/******************************************************************************* + * 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.hc.remote.impl; + +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; +import java.util.Arrays; + +import org.eclipse.passage.lic.internal.api.LicensedProduct; +import org.eclipse.passage.lic.internal.api.LicensingException; +import org.eclipse.passage.lic.internal.api.conditions.ConditionAction; +import org.eclipse.passage.lic.internal.api.conditions.UserRole; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningException; +import org.eclipse.passage.lic.internal.base.NamedData; +import org.eclipse.passage.lic.internal.base.ProductIdentifier; +import org.eclipse.passage.lic.internal.base.ProductVersion; +import org.eclipse.passage.lic.internal.equinox.io.InstallationPath; +import org.eclipse.passage.lic.internal.hc.i18n.HcMessages; +import org.eclipse.passage.lic.internal.hc.remote.Configuration; +import org.eclipse.passage.lic.internal.hc.remote.Request; +import org.eclipse.passage.lic.internal.net.LicensingAction; +import org.eclipse.passage.lic.internal.net.LicensingRole; +import org.eclipse.passage.lic.internal.net.LicensingServerCoordinates; +import org.eclipse.passage.lic.internal.net.LicensingServerCoordinates.HostPort; + +/** + * Basing on + * + * @author user + */ +@SuppressWarnings("restriction") +final class RemoteConditionsRequest implements Request { + + private final LicensedProduct product; + + public RemoteConditionsRequest(LicensedProduct product) { + this.product = product; + } + + @Override + public URL url() throws ConditionMiningException { + try { + HostPort corrdinates = new LicensingServerCoordinates(new InstallationPath()).get(); + return new URL("http", //$NON-NLS-1$ + corrdinates.host(), // + Integer.parseInt(corrdinates.port()), // + '?' + parameters()); + } catch (LicensingException // + | NumberFormatException // + | MalformedURLException // + | UnsupportedEncodingException e) { + throw new ConditionMiningException(HcMessages.RemoteConditionsRequest_failed_to_compose_url, e); + } + } + + private String parameters() throws UnsupportedEncodingException { + StringBuilder params = new StringBuilder(); + Arrays.stream(// + new NamedData[] { // + new ProductIdentifier(encode(product.identifier())), // + new ProductVersion(encode(product.version())), // + new LicensingAction(new ConditionAction.Aquire()), // + new LicensingRole(new UserRole.Admin()) }) // + .map(NamedData.Writable::new)// + .forEach(writable -> writable.write(params, "=", "&")); //$NON-NLS-1$ //$NON-NLS-2$ + return params.toString(); + + } + + private String encode(String value) throws UnsupportedEncodingException { + return URLEncoder.encode(value, "UTF-8"); //$NON-NLS-1$ + } + + @Override + public Configuration config() { + throw new UnsupportedOperationException(); + } + +} diff --git a/bundles/org.eclipse.passage.lic.net/src/org/eclipse/passage/lic/internal/net/LicensingAction.java b/bundles/org.eclipse.passage.lic.net/src/org/eclipse/passage/lic/internal/net/LicensingAction.java new file mode 100644 index 000000000..489141ec4 --- /dev/null +++ b/bundles/org.eclipse.passage.lic.net/src/org/eclipse/passage/lic/internal/net/LicensingAction.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * 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.net; + +import java.util.Map; +import java.util.function.Function; + +import org.eclipse.passage.lic.internal.api.conditions.ConditionAction; +import org.eclipse.passage.lic.internal.base.BaseNamedData; + +@SuppressWarnings("restriction") +public final class LicensingAction extends BaseNamedData { + + public LicensingAction(Function retrieve) { + super(retrieve); + } + + public LicensingAction(Map data) { + super(key -> new ConditionAction.Of(data.get(key))); + } + + public LicensingAction(ConditionAction action) { + super(key -> action); + } + + @Override + public String key() { + return "action"; //$NON-NLS-1$ + } + +} diff --git a/bundles/org.eclipse.passage.lic.net/src/org/eclipse/passage/lic/internal/net/LicensingRole.java b/bundles/org.eclipse.passage.lic.net/src/org/eclipse/passage/lic/internal/net/LicensingRole.java new file mode 100644 index 000000000..89004e5dd --- /dev/null +++ b/bundles/org.eclipse.passage.lic.net/src/org/eclipse/passage/lic/internal/net/LicensingRole.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * 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.net; + +import java.util.Map; +import java.util.function.Function; + +import org.eclipse.passage.lic.internal.api.conditions.UserRole; +import org.eclipse.passage.lic.internal.base.BaseNamedData; + +@SuppressWarnings("restriction") +public final class LicensingRole extends BaseNamedData { + + public LicensingRole(Function retrieve) { + super(retrieve); + } + + public LicensingRole(Map data) { + super(key -> new UserRole.Of(data.get(key))); + } + + public LicensingRole(UserRole role) { + super(key -> role); + } + + @Override + public String key() { + return "role"; //$NON-NLS-1$ + } + +} diff --git a/bundles/org.eclipse.passage.lic.net/src/org/eclipse/passage/lic/net/LicensingNet.java b/bundles/org.eclipse.passage.lic.net/src/org/eclipse/passage/lic/net/LicensingNet.java index e393ef990..f0e60a6ea 100644 --- a/bundles/org.eclipse.passage.lic.net/src/org/eclipse/passage/lic/net/LicensingNet.java +++ b/bundles/org.eclipse.passage.lic.net/src/org/eclipse/passage/lic/net/LicensingNet.java @@ -12,14 +12,20 @@ *******************************************************************************/ package org.eclipse.passage.lic.net; +import org.eclipse.passage.lic.internal.api.conditions.UserRole; +import org.eclipse.passage.lic.internal.net.LicensingAction; +import org.eclipse.passage.lic.internal.net.LicensingRole; import org.eclipse.passage.lic.internal.net.LicensingServerHost; import org.eclipse.passage.lic.internal.net.LicensingServerPort; /** - * + * @deprecated use proper constructions form + * {@code org.eclipse.passage.lic.internal.api.conditions} and + * {@code org.eclipse.passage.lic.internal.net} * @since 0.5.0 - * */ +@Deprecated +@SuppressWarnings("restriction") public class LicensingNet { /** @@ -33,11 +39,31 @@ public class LicensingNet { @Deprecated public static final String LICENSING_SERVER_PORT = "licensing.server.port"; //$NON-NLS-1$ + /** + * @deprecated use {@link LicensingRole} + */ + @Deprecated public static final String ROLE = "role"; //$NON-NLS-1$ + /** + * @deprecated use {@link UserRole.Admin} + */ + @Deprecated public static final String ROLE_ADMIN = "admin"; //$NON-NLS-1$ + /** + * @deprecated use {@link UserRole.Licensee} + */ + @Deprecated public static final String ROLE_LICENSEE = "licensee"; //$NON-NLS-1$ + /** + * @deprecated use {@link UserRole.Operator} + */ + @Deprecated public static final String ROLE_OPERATOR = "operator"; //$NON-NLS-1$ + /** + * @deprecated use {@link LicensingAction} + */ + @Deprecated public static final String ACTION = "action"; //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/DemoFramework.java b/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/DemoFramework.java index d80767e91..06831410c 100644 --- a/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/DemoFramework.java +++ b/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/DemoFramework.java @@ -28,8 +28,8 @@ final class DemoFramework implements Framework { static final Framework demo = new DemoFramework(); private DemoFramework() { - access = new SealedAccessCycleConfiguration(); product = productRead(); + access = new SealedAccessCycleConfiguration(this::product); } private LicensedProduct productRead() { diff --git a/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/SealedAccessCycleConfiguration.java b/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/SealedAccessCycleConfiguration.java index 212f606f4..92dabb356 100644 --- a/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/SealedAccessCycleConfiguration.java +++ b/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/SealedAccessCycleConfiguration.java @@ -13,8 +13,10 @@ package org.eclipse.passage.seal.internal.demo; import java.util.Arrays; +import java.util.function.Supplier; import org.eclipse.passage.lic.internal.api.AccessCycleConfiguration; +import org.eclipse.passage.lic.internal.api.LicensedProduct; import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionTransport; import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionTransportRegistry; import org.eclipse.passage.lic.internal.api.conditions.mining.ContentType; @@ -37,7 +39,7 @@ final class SealedAccessCycleConfiguration implements AccessCycleConfiguration { private final Registry conditions; private final Registry transports; - SealedAccessCycleConfiguration() { + SealedAccessCycleConfiguration(Supplier product) { requirements = // new ReadOnlyRegistry<>(Arrays.asList(// new BundleRequirements(), // @@ -45,7 +47,7 @@ final class SealedAccessCycleConfiguration implements AccessCycleConfiguration { ); conditions = // new ReadOnlyRegistry<>(Arrays.asList(// - new RemoteConditions(transports())// + new RemoteConditions(product, transports())// )// ); transports = new ReadOnlyRegistry<>(Arrays.asList(// diff --git a/releng/org.eclipse.passage.lic.aggregator/pom.xml b/releng/org.eclipse.passage.lic.aggregator/pom.xml index e753dbc3a..26e3c9f65 100644 --- a/releng/org.eclipse.passage.lic.aggregator/pom.xml +++ b/releng/org.eclipse.passage.lic.aggregator/pom.xml @@ -55,6 +55,7 @@ ../../bundles/org.eclipse.passage.lic.hc ../../features/org.eclipse.passage.lic.hc.feature + ../../tests/org.eclipse.passage.lic.hc.tests ../../bundles/org.eclipse.passage.lic.json ../../features/org.eclipse.passage.lic.json.feature diff --git a/tests/org.eclipse.passage.lic.hc.tests/.classpath b/tests/org.eclipse.passage.lic.hc.tests/.classpath new file mode 100644 index 000000000..3e5654f17 --- /dev/null +++ b/tests/org.eclipse.passage.lic.hc.tests/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tests/org.eclipse.passage.lic.hc.tests/.project b/tests/org.eclipse.passage.lic.hc.tests/.project new file mode 100644 index 000000000..a314cf578 --- /dev/null +++ b/tests/org.eclipse.passage.lic.hc.tests/.project @@ -0,0 +1,34 @@ + + + org.eclipse.passage.lic.hc.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..8f9ec5cde --- /dev/null +++ b/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,101 @@ +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.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +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=ignore +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +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=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning +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=error +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=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=warning +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +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.terminalDeprecation=warning +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.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +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.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +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 diff --git a/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..906381876 --- /dev/null +++ b/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,122 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=false +cleanup.remove_redundant_type_arguments=false +cleanup.remove_trailing_whitespaces=false +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +org.eclipse.jdt.ui.text.custom_code_templates= +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=true +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=true +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_modifiers=false +sp_cleanup.remove_redundant_semicolons=false +sp_cleanup.remove_redundant_type_arguments=false +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 diff --git a/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.pde.ds.annotations.prefs b/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.pde.ds.annotations.prefs new file mode 100644 index 000000000..73a356b6d --- /dev/null +++ b/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.pde.ds.annotations.prefs @@ -0,0 +1,8 @@ +classpath=true +dsVersion=V1_3 +eclipse.preferences.version=1 +enabled=true +generateBundleActivationPolicyLazy=true +path=OSGI-INF +validationErrorLevel=error +validationErrorLevel.missingImplicitUnbindMethod=error diff --git a/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.pde.prefs b/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..47bd5bdfc --- /dev/null +++ b/tests/org.eclipse.passage.lic.hc.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,34 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=1 +compilers.p.no-required-att=0 +compilers.p.no.automatic.module=1 +compilers.p.not-externalized-att=0 +compilers.p.service.component.without.lazyactivation=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +eclipse.preferences.version=1 diff --git a/tests/org.eclipse.passage.lic.hc.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.passage.lic.hc.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..ce8eae39b --- /dev/null +++ b/tests/org.eclipse.passage.lic.hc.tests/META-INF/MANIFEST.MF @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Automatic-Module-Name: org.eclipse.passage.lic.hc.tests +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.passage.lic.hc.tests +Bundle-Version: 0.1.0.qualifier +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Copyright: %Bundle-Copyright +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.junit diff --git a/tests/org.eclipse.passage.lic.hc.tests/OSGI-INF/l10n/bundle.properties b/tests/org.eclipse.passage.lic.hc.tests/OSGI-INF/l10n/bundle.properties new file mode 100644 index 000000000..42abb0fe7 --- /dev/null +++ b/tests/org.eclipse.passage.lic.hc.tests/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,23 @@ +#Properties file for org.eclipse.passage.lic.hc.tests +############################################################################### +# Copyright (c) 2020 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 +# https://www.eclipse.org/legal/epl-2.0/. +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# ArSysOp - initial API and implementation +############################################################################### + +Bundle-Name = Passage LIC HC Tests +Bundle-Vendor = Eclipse Passage +Bundle-Copyright = Copyright (c) 2020 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/tests/org.eclipse.passage.lic.hc.tests/build.properties b/tests/org.eclipse.passage.lic.hc.tests/build.properties new file mode 100644 index 000000000..fa01af22a --- /dev/null +++ b/tests/org.eclipse.passage.lic.hc.tests/build.properties @@ -0,0 +1,18 @@ +############################################################################### +# Copyright (c) 2020 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 +# https://www.eclipse.org/legal/epl-2.0/. +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# ArSysOp - initial API and implementation +############################################################################### + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/ diff --git a/tests/org.eclipse.passage.lic.hc.tests/src/org/eclipse/passage/lic/internal/hc/tests/RemoteConditionsRequestTest.java b/tests/org.eclipse.passage.lic.hc.tests/src/org/eclipse/passage/lic/internal/hc/tests/RemoteConditionsRequestTest.java new file mode 100644 index 000000000..3b07e449b --- /dev/null +++ b/tests/org.eclipse.passage.lic.hc.tests/src/org/eclipse/passage/lic/internal/hc/tests/RemoteConditionsRequestTest.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * 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.hc.tests; + +import org.junit.Test; + +public final class RemoteConditionsRequestTest { + + @Test + public void f() { + + } +}