Skip to content

Commit

Permalink
TestExpressionProfileSafe: added skip if JS is not available (JDK 17)
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Oct 4, 2021
1 parent a7158af commit dc8b44a
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2019 Evolveum and contributors
* Copyright (C) 2013-2021 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
Expand All @@ -12,8 +12,8 @@

import com.evolveum.midpoint.prism.PrimitiveType;
import com.evolveum.midpoint.repo.common.expression.ExpressionEvaluationContext;
import com.evolveum.midpoint.schema.expression.VariablesMap;
import com.evolveum.midpoint.repo.common.expression.Source;
import com.evolveum.midpoint.schema.expression.VariablesMap;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType;

Expand All @@ -30,7 +30,7 @@ protected String getExpressionProfileName() {
@Test
@Override
public void test130Const() throws Exception {
// GIVEN
given();
OperationResult result = createOperationResult();

rememberScriptExecutionCount();
Expand All @@ -40,18 +40,17 @@ public void test130Const() throws Exception {
VariablesMap variables = prepareBasicVariables();
ExpressionEvaluationContext expressionContext = new ExpressionEvaluationContext(sources, variables, getTestNameShort(), null);

// WHEN
when();
evaluatePropertyExpressionRestricted(expressionType, PrimitiveType.STRING, expressionContext, result);

// THEN

then();
assertScriptExecutionIncrement(0);
}

@Test
@Override
public void test154ScriptGroovySystemDeny() throws Exception {
// GIVEN
given();
OperationResult result = createOperationResult();

rememberScriptExecutionCount();
Expand All @@ -61,18 +60,18 @@ public void test154ScriptGroovySystemDeny() throws Exception {
VariablesMap variables = prepareBasicVariables();
ExpressionEvaluationContext expressionContext = new ExpressionEvaluationContext(sources, variables, getTestNameShort(), null);

// WHEN
when();
evaluatePropertyExpressionRestricted(expressionType, PrimitiveType.STRING, expressionContext, result);

// THEN

then();
assertScriptExecutionIncrement(0);
}

@Test
@Override
public void test160ScriptJavaScript() throws Exception {
// GIVEN
skipIfEcmaScriptEngineNotSupported();
given();
OperationResult result = createOperationResult();

rememberScriptExecutionCount();
Expand All @@ -82,11 +81,10 @@ public void test160ScriptJavaScript() throws Exception {
VariablesMap variables = prepareBasicVariables();
ExpressionEvaluationContext expressionContext = new ExpressionEvaluationContext(sources, variables, getTestNameShort(), null);

// WHEN
when();
evaluatePropertyExpressionRestricted(expressionType, PrimitiveType.STRING, expressionContext, result);

// THEN

then();
assertScriptExecutionIncrement(0);
}
}

0 comments on commit dc8b44a

Please sign in to comment.