Java Code Examples for org.springframework.expression.spel.standard.SpelExpressionParser

The following examples show how to use org.springframework.expression.spel.standard.SpelExpressionParser. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Test
public void testParsingSimpleTemplateExpression04() throws Exception {
	SpelExpressionParser parser = new SpelExpressionParser();
	Expression expr = parser.parseExpression("${'hello'} world", DEFAULT_TEMPLATE_PARSER_CONTEXT);
	Object o = expr.getValue();
	assertEquals("hello world", o.toString());

	expr = parser.parseExpression("", DEFAULT_TEMPLATE_PARSER_CONTEXT);
	o = expr.getValue();
	assertEquals("", o.toString());

	expr = parser.parseExpression("abc", DEFAULT_TEMPLATE_PARSER_CONTEXT);
	o = expr.getValue();
	assertEquals("abc", o.toString());

	expr = parser.parseExpression("abc", DEFAULT_TEMPLATE_PARSER_CONTEXT);
	o = expr.getValue((Object)null);
	assertEquals("abc", o.toString());
}
 
Example 2
Source Project: spring-analysis-note   Source File: SpelDocumentationTests.java    License: MIT License 6 votes vote down vote up
@Test
public void testLiterals() throws Exception {
	ExpressionParser parser = new SpelExpressionParser();

	String helloWorld = (String) parser.parseExpression("'Hello World'").getValue(); // evals to "Hello World"
	assertEquals("Hello World",helloWorld);

	double avogadrosNumber  = (Double) parser.parseExpression("6.0221415E+23").getValue();
	assertEquals(6.0221415E+23, avogadrosNumber, 0);

	int maxValue = (Integer) parser.parseExpression("0x7FFFFFFF").getValue();  // evals to 2147483647
	assertEquals(Integer.MAX_VALUE,maxValue);

	boolean trueValue = (Boolean) parser.parseExpression("true").getValue();
	assertTrue(trueValue);

	Object nullValue = parser.parseExpression("null").getValue();
	assertNull(nullValue);
}
 
Example 3
Source Project: java-technology-stack   Source File: MethodInvocationTests.java    License: MIT License 6 votes vote down vote up
/**
 * Check on first usage (when the cachedExecutor in MethodReference is null) that the exception is not wrapped.
 */
@Test
public void testMethodThrowingException_SPR6941() {
	// Test method on inventor: throwException()
	// On 1 it will throw an IllegalArgumentException
	// On 2 it will throw a RuntimeException
	// On 3 it will exit normally
	// In each case it increments the Inventor field 'counter' when invoked

	SpelExpressionParser parser = new SpelExpressionParser();
	Expression expr = parser.parseExpression("throwException(#bar)");

	context.setVariable("bar", 2);
	try {
		expr.getValue(context);
		fail();
	}
	catch (Exception ex) {
		if (ex instanceof SpelEvaluationException) {
			fail("Should not be a SpelEvaluationException: " + ex);
		}
		// normal
	}
}
 
Example 4
Source Project: java-technology-stack   Source File: SpelReproTests.java    License: MIT License 6 votes vote down vote up
@Test
public void SPR9735() {
	Item item = new Item();
	item.setName("parent");

	Item item1 = new Item();
	item1.setName("child1");

	Item item2 = new Item();
	item2.setName("child2");

	item.add(item1);
	item.add(item2);

	ExpressionParser parser = new SpelExpressionParser();
	EvaluationContext context = new StandardEvaluationContext();
	Expression exp = parser.parseExpression("#item[0].name");
	context.setVariable("item", item);

	assertEquals("child1", exp.getValue(context));
}
 
Example 5
Source Project: spring-analysis-note   Source File: IndexingTests.java    License: MIT License 6 votes vote down vote up
@Test
public void setGenericPropertyContainingListAutogrow() {
	List<Integer> property = new ArrayList<>();
	this.property = property;
	SpelExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
	Expression expression = parser.parseExpression("property");
	assertEquals("@org.springframework.expression.spel.IndexingTests$FieldAnnotation java.util.ArrayList<?>", expression.getValueTypeDescriptor(this).toString());
	assertEquals(property, expression.getValue(this));
	expression = parser.parseExpression("property[0]");
	try {
		expression.setValue(this, "4");
	}
	catch (EvaluationException ex) {
		assertTrue(ex.getMessage().startsWith("EL1053E"));
	}
}
 
Example 6
Source Project: spring-analysis-note   Source File: IndexingTests.java    License: MIT License 6 votes vote down vote up
@Test
public void indexIntoGenericPropertyContainingGrowingList() {
	List<String> property = new ArrayList<>();
	this.property = property;
	SpelParserConfiguration configuration = new SpelParserConfiguration(true, true);
	SpelExpressionParser parser = new SpelExpressionParser(configuration);
	Expression expression = parser.parseExpression("property");
	assertEquals("@org.springframework.expression.spel.IndexingTests$FieldAnnotation java.util.ArrayList<?>", expression.getValueTypeDescriptor(this).toString());
	assertEquals(property, expression.getValue(this));
	expression = parser.parseExpression("property[0]");
	try {
		assertEquals("bar", expression.getValue(this));
	}
	catch (EvaluationException ex) {
		assertTrue(ex.getMessage().startsWith("EL1053E"));
	}
}
 
Example 7
Source Project: spring-analysis-note   Source File: IndexingTests.java    License: MIT License 6 votes vote down vote up
@Test
public void indexIntoGenericPropertyContainingGrowingList2() {
	List<String> property2 = new ArrayList<>();
	this.property2 = property2;
	SpelParserConfiguration configuration = new SpelParserConfiguration(true, true);
	SpelExpressionParser parser = new SpelExpressionParser(configuration);
	Expression expression = parser.parseExpression("property2");
	assertEquals("java.util.ArrayList<?>", expression.getValueTypeDescriptor(this).toString());
	assertEquals(property2, expression.getValue(this));
	expression = parser.parseExpression("property2[0]");
	try {
		assertEquals("bar", expression.getValue(this));
	}
	catch (EvaluationException ex) {
		assertTrue(ex.getMessage().startsWith("EL1053E"));
	}
}
 
Example 8
Source Project: java-technology-stack   Source File: SpelReproTests.java    License: MIT License 6 votes vote down vote up
@Test
public void SPR10452() {
	SpelParserConfiguration configuration = new SpelParserConfiguration(false, false);
	ExpressionParser parser = new SpelExpressionParser(configuration);

	StandardEvaluationContext context = new StandardEvaluationContext();
	Expression spel = parser.parseExpression("#enumType.values()");

	context.setVariable("enumType", ABC.class);
	Object result = spel.getValue(context);
	assertNotNull(result);
	assertTrue(result.getClass().isArray());
	assertEquals(ABC.A, Array.get(result, 0));
	assertEquals(ABC.B, Array.get(result, 1));
	assertEquals(ABC.C, Array.get(result, 2));

	context.setVariable("enumType", XYZ.class);
	result = spel.getValue(context);
	assertNotNull(result);
	assertTrue(result.getClass().isArray());
	assertEquals(XYZ.X, Array.get(result, 0));
	assertEquals(XYZ.Y, Array.get(result, 1));
	assertEquals(XYZ.Z, Array.get(result, 2));
}
 
Example 9
Source Project: spring-analysis-note   Source File: ScenariosForSpringSecurity.java    License: MIT License 6 votes vote down vote up
@Test
	public void testScenario04_ControllingWhichMethodsRun() throws Exception {
		SpelExpressionParser parser = new SpelExpressionParser();
		StandardEvaluationContext ctx = new StandardEvaluationContext();

		ctx.setRootObject(new Supervisor("Ben")); // so non-qualified references 'hasRole()' 'hasIpAddress()' are invoked against it);

		ctx.addMethodResolver(new MyMethodResolver()); // NEEDS TO OVERRIDE THE REFLECTION ONE - SHOW REORDERING MECHANISM
		// Might be better with a as a variable although it would work as a property too...
		// Variable references using a '#'
//		SpelExpression expr = parser.parseExpression("(hasRole('SUPERVISOR') or (#a <  1.042)) and hasIpAddress('10.10.0.0/16')");
		Expression expr = parser.parseRaw("(hasRole(3) or (#a <  1.042)) and hasIpAddress('10.10.0.0/16')");

		Boolean value = null;

		ctx.setVariable("a",1.0d); // referenced as #a in the expression
		value = expr.getValue(ctx,Boolean.class);
		assertTrue(value);

//			ctx.setRootObject(new Manager("Luke"));
//			ctx.setVariable("a",1.043d);
//			value = (Boolean)expr.getValue(ctx,Boolean.class);
//			assertFalse(value);
	}
 
Example 10
Source Project: java-technology-stack   Source File: SpelExceptionTests.java    License: MIT License 6 votes vote down vote up
@Test
@SuppressWarnings("serial")
public void spelExpressionMapWithVariables() {
	ExpressionParser parser = new SpelExpressionParser();
	Expression spelExpression = parser.parseExpression("#aMap['one'] eq 1");
	StandardEvaluationContext ctx = new StandardEvaluationContext();
	ctx.setVariables(new HashMap<String, Object>() {
		{
			put("aMap", new HashMap<String, Integer>() {
				{
					put("one", 1);
					put("two", 2);
					put("three", 3);
				}
			});

		}
	});
	boolean result = spelExpression.getValue(ctx, Boolean.class);
	assertTrue(result);

}
 
Example 11
Source Project: spring-analysis-note   Source File: EvaluationTests.java    License: MIT License 6 votes vote down vote up
@Test
public void testCreateListsOnAttemptToIndexNull01() throws EvaluationException, ParseException {
	ExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
	Expression e = parser.parseExpression("list[0]");
	TestClass testClass = new TestClass();

	Object o = e.getValue(new StandardEvaluationContext(testClass));
	assertEquals("", o);
	o = parser.parseExpression("list[3]").getValue(new StandardEvaluationContext(testClass));
	assertEquals("", o);
	assertEquals(4, testClass.list.size());

	try {
		o = parser.parseExpression("list2[3]").getValue(new StandardEvaluationContext(testClass));
		fail();
	}
	catch (EvaluationException ee) {
		ee.printStackTrace();
		// success!
	}

	o = parser.parseExpression("foo[3]").getValue(new StandardEvaluationContext(testClass));
	assertEquals("", o);
	assertEquals(4, testClass.getFoo().size());
}
 
Example 12
@Test
public void testParsingSimpleTemplateExpression04() throws Exception {
	SpelExpressionParser parser = new SpelExpressionParser();
	Expression expr = parser.parseExpression("${'hello'} world", DEFAULT_TEMPLATE_PARSER_CONTEXT);
	Object o = expr.getValue();
	assertEquals("hello world", o.toString());

	expr = parser.parseExpression("", DEFAULT_TEMPLATE_PARSER_CONTEXT);
	o = expr.getValue();
	assertEquals("", o.toString());

	expr = parser.parseExpression("abc", DEFAULT_TEMPLATE_PARSER_CONTEXT);
	o = expr.getValue();
	assertEquals("abc", o.toString());

	expr = parser.parseExpression("abc", DEFAULT_TEMPLATE_PARSER_CONTEXT);
	o = expr.getValue((Object)null);
	assertEquals("abc", o.toString());
}
 
Example 13
Source Project: spring-analysis-note   Source File: EvaluationTests.java    License: MIT License 6 votes vote down vote up
@Test
public void incdecTogether() {
	Spr9751 helper = new Spr9751();
	StandardEvaluationContext ctx = new StandardEvaluationContext(helper);
	ExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
	Expression e;

	// index1 is 2 at the start - the 'intArray[#root.index1++]' should not be evaluated twice!
	// intArray[2] is 3
	e = parser.parseExpression("intArray[#root.index1++]++");
	e.getValue(ctx, Integer.class);
	assertEquals(3, helper.index1);
	assertEquals(4, helper.intArray[2]);

	// index1 is 3 intArray[3] is 4
	e =  parser.parseExpression("intArray[#root.index1++]--");
	assertEquals(4, e.getValue(ctx, Integer.class).intValue());
	assertEquals(4, helper.index1);
	assertEquals(3, helper.intArray[3]);

	// index1 is 4, intArray[3] is 3
	e =  parser.parseExpression("intArray[--#root.index1]++");
	assertEquals(3, e.getValue(ctx, Integer.class).intValue());
	assertEquals(3, helper.index1);
	assertEquals(4, helper.intArray[3]);
}
 
Example 14
Source Project: spring-analysis-note   Source File: MapAccessTests.java    License: MIT License 6 votes vote down vote up
@Test
public void testGetValuePerformance() throws Exception {
	Assume.group(TestGroup.PERFORMANCE);
	Map<String, String> map = new HashMap<>();
	map.put("key", "value");
	EvaluationContext context = new StandardEvaluationContext(map);

	ExpressionParser spelExpressionParser = new SpelExpressionParser();
	Expression expr = spelExpressionParser.parseExpression("#root['key']");

	StopWatch s = new StopWatch();
	s.start();
	for (int i = 0; i < 10000; i++) {
		expr.getValue(context);
	}
	s.stop();
	assertThat(s.getTotalTimeMillis(), lessThan(200L));
}
 
Example 15
Source Project: java-technology-stack   Source File: SpelReproTests.java    License: MIT License 6 votes vote down vote up
/**
 * We add property accessors in the order:
 * First, Second, Third, Fourth.
 * They are not utilized in this order; preventing a priority or order of operations
 * in evaluation of SPEL expressions for a given context.
 */
@Test
public void propertyAccessorOrder_SPR8211() {
	ExpressionParser expressionParser = new SpelExpressionParser();
	StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new ContextObject());

	evaluationContext.addPropertyAccessor(new TestPropertyAccessor("firstContext"));
	evaluationContext.addPropertyAccessor(new TestPropertyAccessor("secondContext"));
	evaluationContext.addPropertyAccessor(new TestPropertyAccessor("thirdContext"));
	evaluationContext.addPropertyAccessor(new TestPropertyAccessor("fourthContext"));

	assertEquals("first", expressionParser.parseExpression("shouldBeFirst").getValue(evaluationContext));
	assertEquals("second", expressionParser.parseExpression("shouldBeSecond").getValue(evaluationContext));
	assertEquals("third", expressionParser.parseExpression("shouldBeThird").getValue(evaluationContext));
	assertEquals("fourth", expressionParser.parseExpression("shouldBeFourth").getValue(evaluationContext));
}
 
Example 16
/**
 * Scenario: using the standard infrastructure and running simple expression evaluation.
 */
@Test
public void testScenario_UsingStandardInfrastructure() {
	try {
		// Create a parser
		SpelExpressionParser parser = new SpelExpressionParser();
		// Parse an expression
		Expression expr = parser.parseRaw("new String('hello world')");
		// Evaluate it using a 'standard' context
		Object value = expr.getValue();
		// They are reusable
		value = expr.getValue();

		assertEquals("hello world", value);
		assertEquals(String.class, value.getClass());
	}
	catch (EvaluationException | ParseException ex) {
		ex.printStackTrace();
		fail("Unexpected Exception: " + ex.getMessage());
	}
}
 
Example 17
Source Project: java-technology-stack   Source File: SpelReproTests.java    License: MIT License 6 votes vote down vote up
/**
 * Test the ability to subclass the ReflectiveMethodResolver and change how it
 * determines the set of methods for a type.
 */
@Test
public void customStaticFunctions_SPR9038() {
	ExpressionParser parser = new SpelExpressionParser();
	StandardEvaluationContext context = new StandardEvaluationContext();
	List<MethodResolver> methodResolvers = new ArrayList<>();
	methodResolvers.add(new ReflectiveMethodResolver() {
		@Override
		protected Method[] getMethods(Class<?> type) {
			try {
				return new Method[] {Integer.class.getDeclaredMethod("parseInt", String.class, Integer.TYPE)};
			}
			catch (NoSuchMethodException ex) {
				return new Method[0];
			}
		}
	});

	context.setMethodResolvers(methodResolvers);
	Expression expression = parser.parseExpression("parseInt('-FF', 16)");

	Integer result = expression.getValue(context, "", Integer.class);
	assertEquals(-255, result.intValue());
}
 
Example 18
Source Project: vividus   Source File: ConfigurationResolver.java    License: Apache License 2.0 5 votes vote down vote up
private static void resolveSpelExpressions(Properties properties, boolean ignoreValuesWithPropertyPlaceholders)
{
    Optional<Set<String>> propertyPlaceholders = ignoreValuesWithPropertyPlaceholders
            ? Optional.of(properties.stringPropertyNames().stream()
                    .map(n -> PLACEHOLDER_PREFIX + n + PLACEHOLDER_SUFFIX)
                    .collect(Collectors.toSet()))
            : Optional.empty();

    SpelExpressionParser spelExpressionParser = new SpelExpressionParser();
    for (Entry<Object, Object> entry : properties.entrySet())
    {
        String value = (String) entry.getValue();
        if (propertyPlaceholders.stream().flatMap(Set::stream).noneMatch(value::contains))
        {
            try
            {
                entry.setValue(
                        spelExpressionParser.parseExpression(value, ParserContext.TEMPLATE_EXPRESSION).getValue());
            }
            catch (Exception e)
            {
                throw new IllegalStateException("Exception during evaluation of expression " + value
                        + " for property '" + entry.getKey() + "'", e);
            }
        }
    }
}
 
Example 19
Source Project: java-technology-stack   Source File: SpelReproTests.java    License: MIT License 5 votes vote down vote up
@Test
public void SPR9486_subtractFloatWithDouble() {
	Number expectedNumber = 10.21f - 10.2;
	ExpressionParser parser = new SpelExpressionParser();
	StandardEvaluationContext context = new StandardEvaluationContext();
	Expression expression = parser.parseExpression("10.21f - 10.2");
	Number result = expression.getValue(context, null, Number.class);
	assertEquals(expectedNumber, result);
}
 
Example 20
Source Project: spring-analysis-note   Source File: SpelReproTests.java    License: MIT License 5 votes vote down vote up
@Test
public void projectionTypeDescriptors_1() {
	StandardEvaluationContext context = new StandardEvaluationContext(new C());
	SpelExpressionParser parser = new SpelExpressionParser();
	String el1 = "ls.![#this.equals('abc')]";
	SpelExpression exp = parser.parseRaw(el1);
	List<?> value = (List<?>) exp.getValue(context);
	// value is list containing [true,false]
	assertEquals(Boolean.class, value.get(0).getClass());
	TypeDescriptor evaluated = exp.getValueTypeDescriptor(context);
	assertEquals(null, evaluated.getElementTypeDescriptor());
}
 
Example 21
Source Project: java-technology-stack   Source File: SpelReproTests.java    License: MIT License 5 votes vote down vote up
@Test
public void SPR13055_maps() {
	EvaluationContext context = new StandardEvaluationContext();
	ExpressionParser parser = new SpelExpressionParser();

	Expression ex = parser.parseExpression("{'a':'y','b':'n'}.![value=='y'?key:null]");
	assertEquals("[a, null]", ex.getValue(context).toString());

	ex = parser.parseExpression("{2:4,3:6}.![T(java.lang.Math).abs(#this.key) + 5]");
	assertEquals("[7, 8]", ex.getValue(context).toString());

	ex = parser.parseExpression("{2:4,3:6}.![T(java.lang.Math).abs(#this.value) + 5]");
	assertEquals("[9, 11]", ex.getValue(context).toString());
}
 
Example 22
@Test
public void testParsingSimpleTemplateExpression02() throws Exception {
	SpelExpressionParser parser = new SpelExpressionParser();
	Expression expr = parser.parseExpression("hello ${'to'} you", DEFAULT_TEMPLATE_PARSER_CONTEXT);
	Object o = expr.getValue();
	assertEquals("hello to you", o.toString());
}
 
Example 23
Source Project: spring-analysis-note   Source File: SpelReproTests.java    License: MIT License 5 votes vote down vote up
@Test
public void SPR9486_floatGreaterThanDouble() {
	Boolean expectedResult = -10.21f > -10.2;
	ExpressionParser parser = new SpelExpressionParser();
	StandardEvaluationContext context = new StandardEvaluationContext();
	Expression expression = parser.parseExpression("-10.21f > -10.2");
	Boolean result = expression.getValue(context, null, Boolean.class);
	assertEquals(expectedResult, result);
}
 
Example 24
@Test
public void testParsingSimpleTemplateExpression02() throws Exception {
	SpelExpressionParser parser = new SpelExpressionParser();
	Expression expr = parser.parseExpression("hello ${'to'} you", DEFAULT_TEMPLATE_PARSER_CONTEXT);
	Object o = expr.getValue();
	assertEquals("hello to you", o.toString());
}
 
Example 25
Source Project: spring-analysis-note   Source File: SpelReproTests.java    License: MIT License 5 votes vote down vote up
@Test
public void greaterThanWithNulls_SPR7840() {
	List<D> list = new ArrayList<>();
	list.add(new D("aaa"));
	list.add(new D("bbb"));
	list.add(new D(null));
	list.add(new D("ccc"));
	list.add(new D(null));
	list.add(new D("zzz"));

	StandardEvaluationContext context = new StandardEvaluationContext(list);
	SpelExpressionParser parser = new SpelExpressionParser();

	String el1 = "#root.?[a < 'hhh']";
	SpelExpression exp = parser.parseRaw(el1);
	Object value = exp.getValue(context);
	assertEquals("[D(aaa), D(bbb), D(null), D(ccc), D(null)]", value.toString());

	String el2 = "#root.?[a > 'hhh']";
	SpelExpression exp2 = parser.parseRaw(el2);
	Object value2 = exp2.getValue(context);
	assertEquals("[D(zzz)]", value2.toString());

	// trim out the nulls first
	String el3 = "#root.?[a!=null].?[a < 'hhh']";
	SpelExpression exp3 = parser.parseRaw(el3);
	Object value3 = exp3.getValue(context);
	assertEquals("[D(aaa), D(bbb), D(ccc)]", value3.toString());
}
 
Example 26
Source Project: spring-analysis-note   Source File: SpelReproTests.java    License: MIT License 5 votes vote down vote up
private void checkTemplateParsingError(String expression, ParserContext context, String expectedMessage) {
	SpelExpressionParser parser = new SpelExpressionParser();
	try {
		parser.parseExpression(expression, context);
		fail("Should have failed with message: " + expectedMessage);
	}
	catch (Exception ex) {
		String message = ex.getMessage();
		if (ex instanceof ExpressionException) {
			message = ((ExpressionException) ex).getSimpleMessage();
		}
		if (!message.equals(expectedMessage)) {
			ex.printStackTrace();
		}
		assertThat(expectedMessage, equalTo(message));
	}
}
 
Example 27
Source Project: java-technology-stack   Source File: IndexingTests.java    License: MIT License 5 votes vote down vote up
@Test
public void setPropertyContainingList() {
	List<Integer> property = new ArrayList<>();
	property.add(3);
	this.parameterizedList = property;
	SpelExpressionParser parser = new SpelExpressionParser();
	Expression expression = parser.parseExpression("parameterizedList");
	assertEquals("java.util.ArrayList<java.lang.Integer>", expression.getValueTypeDescriptor(this).toString());
	assertEquals(property, expression.getValue(this));
	expression = parser.parseExpression("parameterizedList[0]");
	assertEquals(3, expression.getValue(this));
	expression.setValue(this, "4");
	assertEquals(4, expression.getValue(this));
}
 
Example 28
Source Project: java-technology-stack   Source File: SpelReproTests.java    License: MIT License 5 votes vote down vote up
@Test
public void SPR10091_primitiveTestValue() {
	ExpressionParser parser = new SpelExpressionParser();
	StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
	Object value = parser.parseExpression("primitiveProperty").getValue(evaluationContext);
	assertNotNull(value);
}
 
Example 29
Source Project: java-technology-stack   Source File: SpelReproTests.java    License: MIT License 5 votes vote down vote up
@Test
public void SPR9486_floatModulusDouble() {
	Number expectedResult = 10.21f % 10.2;
	ExpressionParser parser = new SpelExpressionParser();
	StandardEvaluationContext context = new StandardEvaluationContext();
	Expression expression = parser.parseExpression("10.21f % 10.2");
	Number result = expression.getValue(context, null, Number.class);
	assertEquals(expectedResult, result);
}
 
Example 30
Source Project: java-technology-stack   Source File: SpelReproTests.java    License: MIT License 5 votes vote down vote up
@Test
public void reservedWordProperties_SPR9862() {
	StandardEvaluationContext context = new StandardEvaluationContext();
	SpelExpressionParser parser = new SpelExpressionParser();
	SpelExpression expression = parser.parseRaw("T(org.springframework.expression.spel.testresources.le.div.mod.reserved.Reserver).CONST");
	Object value = expression.getValue(context);
	assertEquals(value, Reserver.CONST);
}