Skip to content

Commit

Permalink
Bug 568632 Implement feature grant acquire/release
Browse files Browse the repository at this point in the history
Fix typo in class name
Rework test for better coverage.

Signed-off-by: eparovyshnaya <[email protected]>
  • Loading branch information
eparovyshnaya committed Nov 9, 2020
1 parent b9dc089 commit 9be9d47
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public Mine() {

}

public static final class Aquire extends ConditionAction {
public static final class Acquire extends ConditionAction {

public Aquire() {
public Acquire() {
super("acquire"); //$NON-NLS-1$
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
*
* FIXME: for development: #564815
*/
final class LicenseUser extends StringNamedData {
public final class LicenseUser extends StringNamedData {

protected LicenseUser(String value) {
public LicenseUser(String value) {
super(value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.eclipse.passage.lic.internal.base.ProductIdentifier;
import org.eclipse.passage.lic.internal.base.ProductVersion;
import org.eclipse.passage.lic.internal.base.conditions.mining.LicensingContentType;
import org.eclipse.passage.lic.internal.hc.remote.impl.LicenseUser;
import org.eclipse.passage.lic.internal.hc.remote.impl.RemoteConditionsRequest;
import org.eclipse.passage.lic.internal.hc.remote.impl.ServerAuthenticationExpression;
import org.eclipse.passage.lic.internal.hc.remote.impl.ServerAuthenticationType;
Expand All @@ -57,13 +58,29 @@ public void urlContainsAllParameters() throws IOException {
assertEquals(host, url.getHost());
assertEquals(port, url.getPort());
assertNotNull(url.getQuery());
assertTrue(url.getQuery().contains(new ProductIdentifier("any").key())); //$NON-NLS-1$
assertTrue(url.getQuery().contains(new ProductVersion("any").key())); //$NON-NLS-1$
assertTrue(url.getQuery().contains(new LicensingAction(new ConditionAction.Of("any")).key())); //$NON-NLS-1$
assertTrue(url.getQuery().contains(new ServerAuthenticationExpression("any").key())); //$NON-NLS-1$
assertTrue(url.getQuery().contains(new ServerAuthenticationType("any").key())); //$NON-NLS-1$
assertTrue(url.getQuery().contains("user")); //$NON-NLS-1$
assertTrue(url.getQuery().contains(new LicensingContentType(new ContentType.Of("any")).key())); //$NON-NLS-1$
queryHas(url, new ProductIdentifier("any").key()); //$NON-NLS-1$
queryHas(url, new ProductVersion("any").key()); //$NON-NLS-1$
queryHas(url, //
new LicensingAction(new ConditionAction.Of("any")).key(), //$NON-NLS-1$
new ConditionAction.Mine().name());
queryHas(url, //
new ServerAuthenticationExpression("any").key(), //$NON-NLS-1$
expression);
queryHas(url, //
new ServerAuthenticationType("any").key(), //$NON-NLS-1$
environment);
queryHas(url, //
new LicenseUser(user).key(), //
user);
queryHas(url, //
new LicensingContentType(new ContentType.Of("any")).key(), //$NON-NLS-1$
new ContentType.Xml().contentType());
}

private void queryHas(URL url, String... values) {
for (String value : values) {
assertTrue(url.getQuery().contains(value));
}
}

private URL url() {
Expand Down

0 comments on commit 9be9d47

Please sign in to comment.