Class StringValueEscapingTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.broadleafcommerce.admin.web.rulebuilder.StringValueEscapingTest
- All Implemented Interfaces:
junit.framework.Test
public class StringValueEscapingTest
extends junit.framework.TestCase
Tests that single string values are escaped when translated to MVEL, so they cannot break out of their string
literal, and that they are restored when the MVEL is translated back for the rule builder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidsetUp()voidThe proof of concept from the report, and splitting a value over two rules with a trailing backslash, must produce a string comparison that MVEL evaluates without running any code.voidvoidThe value shown in the rule builder must be the value that was enteredvoidMethods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, tearDown, toString
-
Constructor Details
-
StringValueEscapingTest
public StringValueEscapingTest()
-
-
Method Details
-
setUp
protected void setUp()- Overrides:
setUpin classjunit.framework.TestCase
-
testQuotesAndBackslashesAreEscaped
public void testQuotesAndBackslashesAreEscaped() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException- Throws:
org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
-
testValuesWithoutQuotesOrBackslashesAreUnchanged
public void testValuesWithoutQuotesOrBackslashesAreUnchanged() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException- Throws:
org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
-
testInjectedCodeIsNotExecuted
public void testInjectedCodeIsNotExecuted() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationExceptionThe proof of concept from the report, and splitting a value over two rules with a trailing backslash, must produce a string comparison that MVEL evaluates without running any code.- Throws:
org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
-
testValuesAreRestoredForTheRuleBuilder
public void testValuesAreRestoredForTheRuleBuilder() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationExceptionThe value shown in the rule builder must be the value that was entered- Throws:
org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
-