Skip to content

Commit

Permalink
Bug 565011 rebuild the core of condition expression evaluation
Browse files Browse the repository at this point in the history
 - extend `AccessCycleConfiguration` with newly designed service
registries
 - implement extensions in sealed configuration
 - cover new facilities with tests in scope of `FrameworkContractTest`
suite

Signed-off-by: elena.parovyshnaya <[email protected]>
  • Loading branch information
eparovyshnaya committed Jul 8, 2020
1 parent 46fb574 commit 14f1b73
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public interface AccessCycleConfiguration {

ExpressionEvaluatorsRegistry expressionEvaluators();

ExpressionTokenAssessorsRegistry tokenEvaluators();
ExpressionTokenAssessorsRegistry expressionAssessors();

}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ final class SealedAccessCycleConfiguration implements AccessCycleConfiguration {
emitters = new ReadOnlyRegistry<>(Arrays.asList(//
new BasePermissionEmittingService(//
expressionParsers(), //
tokenEvaluators(), //
expressionAssessors(), //
expressionEvaluators())//
));
expressionParsers = new ReadOnlyRegistry<>(Arrays.asList(//
Expand Down Expand Up @@ -164,7 +164,7 @@ public ExpressionEvaluatorsRegistry expressionEvaluators() {
}

@Override
public ExpressionTokenAssessorsRegistry tokenEvaluators() {
public ExpressionTokenAssessorsRegistry expressionAssessors() {
return () -> tokenEvaluators;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,17 @@ public final void hasEvaluatorForDefaultExpressionFormat() {
@Test
@Ignore // yet to be implemented (OSHI-based)
public final void canAssessConditionExpressionsSegment() {
assertServiceRegistryIsFunctional(config().tokenEvaluators().get());
assertServiceRegistryIsFunctional(config().expressionAssessors().get());
}

@Test
public final void prohibitsExpressionSegmentAssessmentServicesExtension() {
assertTrue(readOnly(config().tokenEvaluators().get()));
assertTrue(readOnly(config().expressionAssessors().get()));
}

@Test
public final void prohibitsInjectionIntoSegmentAssessmentServices() {
assertServiceInjectionsIsProhibited(config().tokenEvaluators().get(),
assertServiceInjectionsIsProhibited(config().expressionAssessors().get(),
new FakeExpressionTokenAssessmentService());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public ExpressionEvaluatorsRegistry expressionEvaluators() {
}

@Override
public ExpressionTokenAssessorsRegistry tokenEvaluators() {
public ExpressionTokenAssessorsRegistry expressionAssessors() {
return () -> noService();
}

Expand Down

0 comments on commit 14f1b73

Please sign in to comment.