Skip to content
Snippets Groups Projects
Commit a2342ad9 authored by dfurrer's avatar dfurrer
Browse files

OO-1929: added new functions to be able to access the userproperty in...

OO-1929: added new functions to be able to access the userproperty in expert-mode conditions, added corresponding test and error warning
parent 102b7a9f
No related branches found
No related tags found
No related merge requests found
...@@ -92,6 +92,7 @@ solution.error.undefvariable=Hinweis\: \u00DCberpr\u00FCfen Sie das m\u00F6glich ...@@ -92,6 +92,7 @@ solution.error.undefvariable=Hinweis\: \u00DCberpr\u00FCfen Sie das m\u00F6glich
solution.example.date.infunction=Beispiel\: {0}("13.10.2005 18\:25") solution.example.date.infunction=Beispiel\: {0}("13.10.2005 18\:25")
solution.example.institutionalname.infunction=Hinweis\: Umschliessen Sie den Institutsnamen mit "". solution.example.institutionalname.infunction=Hinweis\: Umschliessen Sie den Institutsnamen mit "".
solution.example.name.infunction=Hinweis\: Umschliessen Sie den Namen mit "". solution.example.name.infunction=Hinweis\: Umschliessen Sie den Namen mit "".
solution.example.whiteSpace=Hinweis\: Das Argument darf keine Leerzeichen enthalten.
solution.example.node.infunction=Hinweis\: Schliessen Sie die Kursbaustein-Identifikation mittels "" ein, z.B. {0}("12345"). solution.example.node.infunction=Hinweis\: Schliessen Sie die Kursbaustein-Identifikation mittels "" ein, z.B. {0}("12345").
solution.provideone.areaname=Hinweis\: Geben Sie genau einen Lernbereich an. Zus\u00E4tzlich muss der Lernbereich im Gruppenmanagement bereits existieren. solution.provideone.areaname=Hinweis\: Geben Sie genau einen Lernbereich an. Zus\u00E4tzlich muss der Lernbereich im Gruppenmanagement bereits existieren.
solution.provideone.date=Hinweis\: Genau ein Zeitpunkt f\u00FCr die "{0}"-Funktion wird ben\u00F6tigt. Das Format ist "dd.mm.YYYY HH\:mm". solution.provideone.date=Hinweis\: Genau ein Zeitpunkt f\u00FCr die "{0}"-Funktion wird ben\u00F6tigt. Das Format ist "dd.mm.YYYY HH\:mm".
......
...@@ -92,6 +92,7 @@ solution.error.undefvariable=Advice\: Check the possible argument at position {0 ...@@ -92,6 +92,7 @@ solution.error.undefvariable=Advice\: Check the possible argument at position {0
solution.example.date.infunction=Example\: {0}("13.10.2005 18\:25") solution.example.date.infunction=Example\: {0}("13.10.2005 18\:25")
solution.example.institutionalname.infunction=Advice\: Enclose the institutional name with double quotes (" "). solution.example.institutionalname.infunction=Advice\: Enclose the institutional name with double quotes (" ").
solution.example.name.infunction=Advice\: Enclose the name with double quotes (" "). solution.example.name.infunction=Advice\: Enclose the name with double quotes (" ").
solution.example.whiteSpace=Advice\: The argument must not contain whitespace.
solution.example.node.infunction=Advice\: Enclose the course element's identification in double quotes, i.e. {0}("12345"). solution.example.node.infunction=Advice\: Enclose the course element's identification in double quotes, i.e. {0}("12345").
solution.provideone.areaname=Advice\: Provide exactly one learning area. Furthermore, this area must exist within your group management. solution.provideone.areaname=Advice\: Provide exactly one learning area. Furthermore, this area must exist within your group management.
solution.provideone.date=Advice\: Provide exactly one point in time for the "{0}" function. The format is "dd.mm.YYYY HH\:mm". solution.provideone.date=Advice\: Provide exactly one point in time for the "{0}" function. The format is "dd.mm.YYYY HH\:mm".
......
...@@ -126,6 +126,19 @@ public class ConditionInterpreter { ...@@ -126,6 +126,19 @@ public class ConditionInterpreter {
env.addFunction(eaf.name, eaf); env.addFunction(eaf.name, eaf);
eaf = new EvalAttributeFunction(userCourseEnv, EvalAttributeFunction.FUNCTION_TYPE_ATTRIBUTE_STARTS_WITH); eaf = new EvalAttributeFunction(userCourseEnv, EvalAttributeFunction.FUNCTION_TYPE_ATTRIBUTE_STARTS_WITH);
env.addFunction(eaf.name, eaf); env.addFunction(eaf.name, eaf);
EvalUserPropertyFunction eupf;
eupf = new EvalUserPropertyFunction(userCourseEnv, EvalUserPropertyFunction.FUNCTION_TYPE_HAS_NOT_PROPERTY);
env.addFunction(EvalUserPropertyFunction.FUNCTION_NAME_HAS_NOT_PROPERTY, eupf);
eupf = new EvalUserPropertyFunction(userCourseEnv, EvalUserPropertyFunction.FUNCTION_TYPE_HAS_PROPERTY);
env.addFunction(EvalUserPropertyFunction.FUNCTION_NAME_HAS_PROPERTY, eupf);
eupf = new EvalUserPropertyFunction(userCourseEnv, EvalUserPropertyFunction.FUNCTION_TYPE_IS_IN_PROPERTY);
env.addFunction(EvalUserPropertyFunction.FUNCTION_NAME_IS_IN_PROPERTY, eupf);
eupf = new EvalUserPropertyFunction(userCourseEnv, EvalUserPropertyFunction.FUNCTION_TYPE_IS_NOT_IN_PROPERTY);
env.addFunction(EvalUserPropertyFunction.FUNCTION_NAME_IS_NOT_IN_PROPERTY, eupf);
eupf = new EvalUserPropertyFunction(userCourseEnv, EvalUserPropertyFunction.FUNCTION_TYPE_PROPERTY_ENDS_WITH);
env.addFunction(EvalUserPropertyFunction.FUNCTION_NAME_PROPERTY_ENDS_WITH, eupf);
eupf = new EvalUserPropertyFunction(userCourseEnv, EvalUserPropertyFunction.FUNCTION_TYPE_PROPERTY_STARTS_WITH);
env.addFunction(EvalUserPropertyFunction.FUNCTION_NAME_PROPERTY_STARTS_WITH, eupf);
env.addFunction(GetUserPropertyFunction.name, new GetUserPropertyFunction(userCourseEnv)); env.addFunction(GetUserPropertyFunction.name, new GetUserPropertyFunction(userCourseEnv));
env.addFunction(GetUserCourseDBFunction.name, new GetUserCourseDBFunction(userCourseEnv)); env.addFunction(GetUserCourseDBFunction.name, new GetUserCourseDBFunction(userCourseEnv));
env.addFunction(HasLanguageFunction.name, new HasLanguageFunction(userCourseEnv)); env.addFunction(HasLanguageFunction.name, new HasLanguageFunction(userCourseEnv));
......
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.course.condition.interpreter;
import org.olat.core.id.Identity;
import org.olat.core.id.User;
import org.olat.core.logging.OLATRuntimeException;
import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing;
import org.olat.core.util.StringHelper;
import org.olat.course.editor.CourseEditorEnv;
import org.olat.course.run.userview.UserCourseEnvironment;
/**
* Class to collect the different possible condition functions on the value of a userproperty
*
* @author dfurrer, dirk.furrer@frentix.com, http://www.frentix.com
*/
public class EvalUserPropertyFunction extends AbstractFunction {
private static final OLog log = Tracing.createLoggerFor(EvalUserPropertyFunction.class);
// user must have exactly this expression in one of the values of given property
public static final int FUNCTION_TYPE_HAS_PROPERTY = 0;
public static final String FUNCTION_NAME_HAS_PROPERTY = "hasUserProperty";
// one of the values of given property must start with the given expression
public static final int FUNCTION_TYPE_PROPERTY_STARTS_WITH = 1;
public static final String FUNCTION_NAME_PROPERTY_STARTS_WITH = "userPropertyStartswith";
// one of the values of given property must end with the given expression
public static final int FUNCTION_TYPE_PROPERTY_ENDS_WITH = 2;
public static final String FUNCTION_NAME_PROPERTY_ENDS_WITH = "userPropertyEndswith";
// given expression must be part of one of the values of given property
public static final int FUNCTION_TYPE_IS_IN_PROPERTY = 3;
public static final String FUNCTION_NAME_IS_IN_PROPERTY = "isInUserProperty";
// neither of the values of given property may contain the given expression
public static final int FUNCTION_TYPE_IS_NOT_IN_PROPERTY = 4;
public static final String FUNCTION_NAME_IS_NOT_IN_PROPERTY = "isNotInUserProperty";
// neither of the values of given property may match the given expression
public static final int FUNCTION_TYPE_HAS_NOT_PROPERTY = 5;
public static final String FUNCTION_NAME_HAS_NOT_PROPERTY = "hasNotUserProperty";
private final int functionType;
/**
* @param userCourseEnv
* @param functionType the type of function (use defined constants)
*/
public EvalUserPropertyFunction(UserCourseEnvironment userCourseEnv, int functionType) {
super(userCourseEnv);
this.functionType = functionType;
if (functionType < 0 | functionType > 5){
throw new OLATRuntimeException("This function type index is undefined: " + functionType, null);
}
}
/**
* Searches the searchValue in the corresponding userValue with the intended method
* function
*
* @param searchValue
* The expression to search for.
* @param userValue
* The property value(s)
* @return true if found, false otherwise
*/
private boolean checkPropertyValue(String searchValue, String userValue) {
switch (functionType) {
case FUNCTION_TYPE_HAS_PROPERTY:
if (userValue.equals(searchValue)) return true;
break;
case FUNCTION_TYPE_HAS_NOT_PROPERTY:
if (!userValue.equals(searchValue)) return true;
break;
case FUNCTION_TYPE_PROPERTY_STARTS_WITH:
if ((userValue.startsWith(searchValue))) return true;
break;
case FUNCTION_TYPE_PROPERTY_ENDS_WITH:
if (userValue.endsWith(searchValue)) return true;
break;
case FUNCTION_TYPE_IS_IN_PROPERTY:
if (userValue.indexOf(searchValue) > -1) return true;
break;
case FUNCTION_TYPE_IS_NOT_IN_PROPERTY:
if (userValue.indexOf(searchValue) == -1) return true;
break;
default:
return false;
}
return false;
}
/**
* @see com.neemsoft.jmep.FunctionCB#call(java.lang.Object[])
*/
public Object call(Object[] inStack) {
/*
* argument check
*/
if (inStack.length > 2) {
String name = getFunctionName(functionType);
return handleException( new ArgumentParseException(ArgumentParseException.NEEDS_FEWER_ARGUMENTS, name, "", "error.fewerargs",
"solution.providetwo.attrvalue"));
} else if (inStack.length < 2) {
String name = getFunctionName(functionType);
return handleException( new ArgumentParseException(ArgumentParseException.NEEDS_MORE_ARGUMENTS, name, "",
"error.moreargs", "solution.providetwo.attrvalue"));
}
/*
* argument type check
*/
if (!(inStack[0] instanceof String)) {
String name = getFunctionName(functionType);
return handleException( new ArgumentParseException(ArgumentParseException.WRONG_ARGUMENT_FORMAT, name, "",
"error.argtype.attributename", "solution.example.name.infunction"));
}
if (!(inStack[1] instanceof String)){
String name = getFunctionName(functionType);
return handleException( new ArgumentParseException(ArgumentParseException.WRONG_ARGUMENT_FORMAT, name, "",
"error.argtype.attribvalue", "solution.example.name.infunction"));
}else {
String propValue = (String) inStack[1];
if(!StringHelper.containsNonWhitespace(propValue)){
String name = getFunctionName(functionType);
return handleException( new ArgumentParseException(ArgumentParseException.WRONG_ARGUMENT_FORMAT, name, "",
"error.argtype.attribvalue", "solution.example.whiteSpace"));
}
}
/*
* check reference integrity
*/
CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
if (cev != null) {
// return a valid value to continue with condition evaluation test
return defaultValue();
}
/*
* the real function evaluation which is used during run time
*/
String propName = (String) inStack[0];
String searchValue = (String) inStack[1];
Identity ident = getUserCourseEnv().getIdentityEnvironment().getIdentity();
if(ident == null) {
return defaultValue();
}
User user = ident.getUser();
String userValue = user.getPropertyOrIdentityEnvAttribute(propName, null);
boolean match = false;
boolean debug = log.isDebug();
if (debug) {
log.debug("value : " + userValue);
log.debug("searchValue: " + searchValue);
log.debug("fT : " + functionType);
}
if (StringHelper.containsNonWhitespace(userValue)) {
match = checkPropertyValue(searchValue, userValue);
}
if (debug) {
log.debug("identity '" + ident.getName() + "' tested on properties '" + propName + "' to have value '" +
searchValue + "' user's value was '" + userValue + "', match=" + match);
}
return match ? ConditionInterpreter.INT_TRUE : ConditionInterpreter.INT_FALSE;
}
protected Object defaultValue() {
return ConditionInterpreter.INT_FALSE;
}
private String getFunctionName(int type){
switch (type) {
case FUNCTION_TYPE_HAS_PROPERTY:
return FUNCTION_NAME_HAS_PROPERTY;
case FUNCTION_TYPE_HAS_NOT_PROPERTY:
return FUNCTION_NAME_HAS_NOT_PROPERTY;
case FUNCTION_TYPE_PROPERTY_STARTS_WITH:
return FUNCTION_NAME_PROPERTY_STARTS_WITH;
case FUNCTION_TYPE_PROPERTY_ENDS_WITH:
return FUNCTION_NAME_PROPERTY_ENDS_WITH;
case FUNCTION_TYPE_IS_IN_PROPERTY:
return FUNCTION_NAME_IS_IN_PROPERTY;
case FUNCTION_TYPE_IS_NOT_IN_PROPERTY:
return FUNCTION_NAME_IS_NOT_IN_PROPERTY;
default:
return "unknown EvalUserPropertyFunction";
}
}
}
...@@ -65,6 +65,272 @@ public class ConditionTest extends OlatTestCase { ...@@ -65,6 +65,272 @@ public class ConditionTest extends OlatTestCase {
Assert.assertFalse(result); Assert.assertFalse(result);
} }
@Test
public void testTrueFalse(){
UserCourseEnvironment uce = getUserDemoCourseEnvironment();
ConditionInterpreter interpreter = new ConditionInterpreter(uce);
String condition = "true";
boolean result = interpreter.evaluateCondition(condition);
Assert.assertTrue(result);
condition = "TRUE";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(result);
condition = "false";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(result);
condition = "FALSE";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(result);
}
@Test
public void testHasPropertyFunction() throws Exception {
UserCourseEnvironment uce = getUserDemoCourseEnvironment();
ConditionInterpreter interpreter = new ConditionInterpreter(uce);
String condition = "hasUserProperty(\"firstName\", \"firstcondition\")";
boolean result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "hasUserProperty(\"firstName\", \"\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasUserProperty(\"firstName\", \"firstcondition \")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasUserProperty(\"firstName\", \" firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasUserProperty(\"firstName\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasUserProperty(\"firstName\", \"firstcondition\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasUserProperty(\"firstName\", \"someThing\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasUserProperty(\"firstName\", \"firstconditiongugus\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasUserProperty(\"firstName\", \"gugusfirstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasUserProperty(\"lastName\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
}
@Test
public void testHasNotPropertyFunction() throws Exception {
UserCourseEnvironment uce = getUserDemoCourseEnvironment();
ConditionInterpreter interpreter = new ConditionInterpreter(uce);
String condition = "hasNotUserProperty(\"firstName\", \"firstcondition\")";
boolean result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasNotUserProperty(\"firstName\", \"\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasNotUserProperty(\"firstName\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasNotUserProperty(\"firstName\", \"firstcondition\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "hasNotUserProperty(\"firstName\", \"someThing\")";
result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "hasNotUserProperty(\"firstName\", \"firstconditiongugus\")";
result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "hasNotUserProperty(\"firstName\", \"gugusfirstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "hasNotUserProperty(\"lastName\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
}
@Test
public void testUserPropertyStartswithFunction() throws Exception {
UserCourseEnvironment uce = getUserDemoCourseEnvironment();
ConditionInterpreter interpreter = new ConditionInterpreter(uce);
String condition = "userPropertyStartswith(\"firstName\", \"firs\")";
boolean result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "userPropertyStartswith(\"firstName\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "userPropertyStartswith(\"firstName\", \"\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyStartswith(\"firstName\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyStartswith(\"firstName\", \"firstcondition\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyStartswith(\"firstName\", \"someThing\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyStartswith(\"firstName\", \"firstconditiongugus\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyStartswith(\"firstName\", \"gugusfirstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyStartswith(\"lastName\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
}
@Test
public void testUserPropertyEndswithFunction() throws Exception {
UserCourseEnvironment uce = getUserDemoCourseEnvironment();
ConditionInterpreter interpreter = new ConditionInterpreter(uce);
String condition = "userPropertyEndswith(\"firstName\", \"ondition\")";
boolean result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "userPropertyEndswith(\"firstName\", \"\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyEndswith(\"firstName\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyEndswith(\"firstName\", \"firstcondition\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyEndswith(\"firstName\", \"someThing\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyEndswith(\"firstName\", \"firstconditiongugus\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyEndswith(\"firstName\", \"gugusfirstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "userPropertyEndswith(\"lastName\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
}
@Test
public void testIsInUserPropertyFunction() throws Exception {
UserCourseEnvironment uce = getUserDemoCourseEnvironment();
ConditionInterpreter interpreter = new ConditionInterpreter(uce);
String condition = "isInUserProperty(\"firstName\", \"firstcondition\")";
boolean result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "isInUserProperty(\"firstName\", \"stcondit\")";
result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "isInUserProperty(\"firstName\", \"\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "isInUserProperty(\"firstName\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "isInUserProperty(\"firstName\", \"firstcondition\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "isInUserProperty(\"firstName\", \"someThing\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "isInUserProperty(\"firstName\", \"firstconditiongugus\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "isInUserProperty(\"firstName\", \"gugusfirstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "isInUserProperty(\"lastName\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
}
@Test
public void testIsNotInUserPropertyFunction() throws Exception {
UserCourseEnvironment uce = getUserDemoCourseEnvironment();
ConditionInterpreter interpreter = new ConditionInterpreter(uce);
String condition = "isNotInUserProperty(\"firstName\", \"stcondit\")";
boolean result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "isNotInUserProperty(\"firstName\", \"\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "isNotInUserProperty(\"firstName\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "isNotInUserProperty(\"firstName\", \"firstcondition\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertFalse(condition, result);
condition = "isNotInUserProperty(\"firstName\", \"someThing\")";
result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "isNotInUserProperty(\"firstName\", \"firstconditiongugus\")";
result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "isNotInUserProperty(\"firstName\", \"gugusfirstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
condition = "isNotInUserProperty(\"lastName\", \"firstcondition\")";
result = interpreter.evaluateCondition(condition);
Assert.assertTrue(condition, result);
}
@Test @Test
public void syntaxProposal() throws Exception { public void syntaxProposal() throws Exception {
UserCourseEnvironment uce = getUserDemoCourseEnvironment(); UserCourseEnvironment uce = getUserDemoCourseEnvironment();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment