Author: alexsmirnov
Date: 2010-06-25 15:17:12 -0400 (Fri, 25 Jun 2010)
New Revision: 17675
Added:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/TypedTemplateStatement.java
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ELParser.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserImpl.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELVisitor.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/TypesFactory.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/TypesFactoryImpl.java
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/ELParserTest.java
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/TypesFactoryTest.java
Log:
Fix el-parser tests
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ELParser.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ELParser.java 2010-06-25
17:04:48 UTC (rev 17674)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ELParser.java 2010-06-25
19:17:12 UTC (rev 17675)
@@ -4,11 +4,11 @@
import org.richfaces.cdk.templatecompiler.builder.model.Variables;
import org.richfaces.cdk.templatecompiler.el.ELType;
import org.richfaces.cdk.templatecompiler.el.ParsingException;
-import org.richfaces.cdk.templatecompiler.statements.TemplateStatement;
+import org.richfaces.cdk.templatecompiler.statements.TypedTemplateStatement;
public interface ELParser {
- TemplateStatement parse(String expression, Variables variables, ELType expectedType)
throws ParsingException;
+ TypedTemplateStatement parse(String expression, Variables variables, ELType
expectedType) throws ParsingException;
ELType getType(Class<?> targetClass);
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserImpl.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserImpl.java 2010-06-25
17:04:48 UTC (rev 17674)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserImpl.java 2010-06-25
19:17:12 UTC (rev 17675)
@@ -8,7 +8,7 @@
import org.richfaces.cdk.templatecompiler.ELParser;
import org.richfaces.cdk.templatecompiler.builder.model.Variables;
import org.richfaces.cdk.templatecompiler.el.types.TypesFactory;
-import org.richfaces.cdk.templatecompiler.statements.TemplateStatement;
+import org.richfaces.cdk.templatecompiler.statements.TypedTemplateStatement;
import com.google.inject.Inject;
@@ -33,7 +33,7 @@
* @see org.richfaces.cdk.templatecompiler.ELParser#parse(java.lang.String,
org.richfaces.cdk.templatecompiler.builder.model.Variables,
org.richfaces.cdk.templatecompiler.el.ELType)
*/
@Override
- public TemplateStatement parse(String expression, Variables variables, ELType
expectedType) throws ParsingException {
+ public TypedTemplateStatement parse(String expression, Variables variables, ELType
expectedType) throws ParsingException {
ELVisitor visitor = new ELVisitor(log,typesFactory,utils);
visitor.parse(expression, variables, expectedType);
return visitor;
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELVisitor.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELVisitor.java 2010-06-25
17:04:48 UTC (rev 17674)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELVisitor.java 2010-06-25
19:17:12 UTC (rev 17675)
@@ -21,8 +21,8 @@
package org.richfaces.cdk.templatecompiler.el;
-import static org.richfaces.cdk.templatecompiler.el.HelperMethod.TO_STRING_CONVERSION;
-import static org.richfaces.cdk.util.JavaUtils.getEscapedString;
+import static org.richfaces.cdk.templatecompiler.el.HelperMethod.*;
+import static org.richfaces.cdk.util.JavaUtils.*;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Type;
@@ -39,13 +39,13 @@
import org.richfaces.cdk.templatecompiler.builder.model.Variables;
import org.richfaces.cdk.templatecompiler.el.node.ITreeNode;
import org.richfaces.cdk.templatecompiler.el.types.TypesFactory;
-import org.richfaces.cdk.templatecompiler.statements.TemplateStatement;
+import org.richfaces.cdk.templatecompiler.statements.TypedTemplateStatement;
/**
* Entry point for parsing EL expressions. @see parse() method.
*
* @author amarkhel
*/
-public final class ELVisitor implements TemplateStatement {
+public final class ELVisitor implements TypedTemplateStatement {
private String parsedExpression = null;
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/TypesFactory.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/TypesFactory.java 2010-06-25
17:04:48 UTC (rev 17674)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/TypesFactory.java 2010-06-25
19:17:12 UTC (rev 17675)
@@ -32,8 +32,8 @@
ELType OBJECT_TYPE = new PlainClassType(Object.class);
ELType STRING_TYPE = new PlainClassType(String.class);
- ELType BOOLEAN_TYPE = new PlainClassType(Boolean.class);
- ELType DOUBLE_TYPE = new PlainClassType(Double.class);
+ ELType BOOLEAN_TYPE = new PlainClassType(Boolean.TYPE);
+ ELType DOUBLE_TYPE = new PlainClassType(Double.TYPE);
ELType INTEGER_TYPE = new PlainClassType(Integer.class);
ELType INT_TYPE = new PlainClassType(Integer.TYPE);
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/TypesFactoryImpl.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/TypesFactoryImpl.java 2010-06-25
17:04:48 UTC (rev 17674)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/TypesFactoryImpl.java 2010-06-25
19:17:12 UTC (rev 17675)
@@ -40,6 +40,7 @@
import javax.faces.render.Renderer;
import javax.faces.validator.Validator;
+import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.templatecompiler.el.ELType;
import org.richfaces.cdk.util.ArrayUtils;
@@ -110,7 +111,7 @@
private final Map<String, ELType> refferencedTypesCache = new
ConcurrentHashMap<String, ELType>();
@Inject
- public TypesFactoryImpl(Logger log, ClassLoader classLoader) {
+ public TypesFactoryImpl(Logger log, CdkClassLoader classLoader) {
this.log = log;
this.classLoader = classLoader;
}
Added:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/TypedTemplateStatement.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/TypedTemplateStatement.java
(rev 0)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/TypedTemplateStatement.java 2010-06-25
19:17:12 UTC (rev 17675)
@@ -0,0 +1,37 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.templatecompiler.statements;
+
+import org.richfaces.cdk.templatecompiler.el.ELType;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface TypedTemplateStatement extends TemplateStatement {
+
+ ELType getExpressionType();
+
+}
Property changes on:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/TypedTemplateStatement.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/ELParserTest.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/ELParserTest.java 2010-06-25
17:04:48 UTC (rev 17674)
+++
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/ELParserTest.java 2010-06-25
19:17:12 UTC (rev 17675)
@@ -22,17 +22,17 @@
package org.richfaces.cdk.templatecompiler.parser.el.test;
import static org.junit.Assert.*;
+import static org.easymock.EasyMock.*;
import static org.richfaces.cdk.templatecompiler.el.HelperMethod.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.junit.After;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.As;
+import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.CdkTestBase;
import org.richfaces.cdk.CdkTestRunner;
import org.richfaces.cdk.Logger;
@@ -41,13 +41,12 @@
import org.richfaces.cdk.templatecompiler.ELParser;
import org.richfaces.cdk.templatecompiler.builder.model.Variables;
import org.richfaces.cdk.templatecompiler.el.ELParserImpl;
-import org.richfaces.cdk.templatecompiler.el.ELVisitor;
+import org.richfaces.cdk.templatecompiler.el.ELType;
import org.richfaces.cdk.templatecompiler.el.HelperMethod;
import org.richfaces.cdk.templatecompiler.el.ParsingException;
-import org.richfaces.cdk.templatecompiler.el.ELType;
import org.richfaces.cdk.templatecompiler.el.types.TypesFactory;
import org.richfaces.cdk.templatecompiler.el.types.TypesFactoryImpl;
-import org.richfaces.cdk.templatecompiler.statements.TemplateStatement;
+import org.richfaces.cdk.templatecompiler.statements.TypedTemplateStatement;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
@@ -62,7 +61,7 @@
private ELParser parser;
@Mock
- Logger log;
+ private Logger log;
@Inject
@As(TypesFactoryImpl.class)
@@ -74,30 +73,34 @@
@Override
public void configure(Binder binder) {
super.configure(binder);
- binder.bind(ClassLoader.class).toInstance(createClassLoader());
+ binder.bind(CdkClassLoader.class).toInstance(createClassLoader());
}
- private TemplateStatement parseExpression(String expression) throws ParsingException
{
+ private TypedTemplateStatement parseExpression(String expression) throws
ParsingException {
return parseExpression(expression, Object.class);
}
- private TemplateStatement parseAndCheck(String expression, String expected,
HelperMethod... requiredMethods)
+ private TypedTemplateStatement parseExpression(String expression, String expected,
HelperMethod... requiredMethods)
throws ParsingException {
- return parseAndCheck(expression, Object.class, expected, requiredMethods);
+ return parseExpression(expression, Object.class, expected, requiredMethods);
}
- private TemplateStatement parseAndCheck(String expression, Class<?> returnType,
String expected,
+ private TypedTemplateStatement parseExpression(String expression, String expected,
Class<?> expectedType,
+ HelperMethod... requiredMethods) throws ParsingException {
+ return parseExpression(expression, Object.class, expected, expectedType,
requiredMethods);
+ }
+
+ private TypedTemplateStatement parseExpression(String expression, Class<?>
returnType, String expected,
Class<?> expectedType, HelperMethod... requiredMethods) throws
ParsingException {
- TemplateStatement statement = parseAndCheck(expression, returnType, expected,
requiredMethods);
- ELVisitor visitor = (ELVisitor) statement;
- assertEquals(expectedType, visitor.getExpressionType().getRawType());
+ TypedTemplateStatement statement = parseExpression(expression, returnType,
expected, requiredMethods);
+ assertEquals(expectedType, statement.getExpressionType().getRawType());
return statement;
}
- private TemplateStatement parseAndCheck(String expression, Class<?> returnType,
String expected,
+ private TypedTemplateStatement parseExpression(String expression, Class<?>
returnType, String expected,
HelperMethod... requiredMethods) throws ParsingException {
controller.replay();
- TemplateStatement parseExpression = parseExpression(expression, returnType);
+ TypedTemplateStatement parseExpression = parseExpression(expression,
returnType);
controller.verify();
assertEquals(expected, parseExpression.getCode());
for (HelperMethod helperMethod : requiredMethods) {
@@ -111,7 +114,7 @@
return parseExpression;
}
- private TemplateStatement parseExpression(String expression, Class<?>
returnType) throws ParsingException {
+ private TypedTemplateStatement parseExpression(String expression, Class<?>
returnType) throws ParsingException {
final Map<String, ELType> contextMap = new HashMap<String,
ELType>();
Variables variables = new Variables() {
@@ -149,259 +152,234 @@
@Test
public void testAnd() throws Exception {
- parseAndCheck("#{test and otherTest}", "(test &&
otherTest)");
+ parseExpression("#{test and otherTest}", "(test &&
otherTest)");
}
@Test
public void testAnd1() throws Exception {
- parseAndCheck("#{otherTest && test}", "(otherTest
&& test)");
+ parseExpression("#{otherTest && test}", "(otherTest
&& test)");
// assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
}
@Test
public void testAnd2() throws Exception {
- parseAndCheck("#{action and otherTest}",
"(convertToBoolean(action) && otherTest)", TO_BOOLEAN_CONVERSION);
+ parseExpression("#{action and otherTest}",
"(convertToBoolean(action) && otherTest)", TO_BOOLEAN_CONVERSION);
}
@Test
public void testAnd3() throws Exception {
- parseAndCheck("#{test && action}", "(test &&
convertToBoolean(action))", TO_BOOLEAN_CONVERSION);
+ parseExpression("#{test && action}", "(test &&
convertToBoolean(action))", TO_BOOLEAN_CONVERSION);
// assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
}
@Test
public void testBooleanReturnType() throws Exception {
- parseAndCheck("#{clientId}", Boolean.TYPE,
"convertToBoolean(clientId)",Boolean.TYPE, TO_BOOLEAN_CONVERSION);
+ parseExpression("#{clientId}", Boolean.TYPE,
"convertToBoolean(clientId)", Boolean.TYPE, TO_BOOLEAN_CONVERSION);
}
@Test
public void testBooleanReturnType1() throws Exception {
- parseAndCheck("#{test}", Boolean.TYPE, "test",
Boolean.TYPE);
+ parseExpression("#{test}", Boolean.TYPE, "test",
Boolean.TYPE);
}
@Test
public void testChoice() throws Exception {
- parseAndCheck("#{test ? 2 : 3}",Object.class,"(test ? 2 :
3)",Integer.TYPE);
+ parseExpression("#{test ? 2 : 3}", Object.class, "(test ? 2 :
3)", Integer.TYPE);
}
@Test
public void testChoice1() throws Exception {
- parseAndCheck("#{test ? null :
'string'}",Object.class,"(test ? null : \"string\")",
String.class);
+ parseExpression("#{test ? null : 'string'}", Object.class,
"(test ? null : \"string\")", String.class);
}
- @Test
- public void testChoice2() throws Exception {
- parseAndCheck("#{action ? null :
'string'}",Object.class,"(convertToBoolean(action) ? null :
\"string\")", TO_BOOLEAN_CONVERSION);
+ @Test
+ public void testChoice2() throws Exception {
+ parseExpression("#{action ? null : 'string'}", Object.class,
"(convertToBoolean(action) ? null : \"string\")",
+ TO_BOOLEAN_CONVERSION);
}
@Test
public void testDiv() throws Exception {
- parseAndCheck("#{1/2}",Object.class,"(1 / 2)",Integer.TYPE);
+ parseExpression("#{1/2}", "(1 / 2)", Integer.TYPE);
}
@Test
public void testEmpty() throws Exception {
- parseAndCheck("#{empty
action.array}",Object.class,"isEmpty(action.getArray())",
Boolean.TYPE,EMPTINESS_CHECK);
+ parseExpression("#{empty action.array}",
"isEmpty(action.getArray())", Boolean.TYPE, EMPTINESS_CHECK);
}
@Test
public void testEmptyString() throws Exception {
- parseAndCheck("",Object.class,"\"\"",
String.class);
+ parseExpression("", "\"\"", String.class);
}
@Test
public void testEquals() throws Exception {
- parseExpression("#{1 eq 2}");
- assertEquals("(1 == 2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertFalse(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ parseExpression("#{1 eq 2}", "(1 == 2)", Boolean.TYPE);
+ }
- parseExpression("#{3 == 2}");
- assertEquals("(3 == 2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertFalse(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testEquals1() throws Exception {
+ parseExpression("#{3 == 2}", "(3 == 2)", Boolean.TYPE);
+ }
- parseExpression("#{action == 2}");
- assertEquals("isEqual(action,2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testEquals2() throws Exception {
+ parseExpression("#{action == 2}", "isEqual(action,2)",
Boolean.TYPE, EQUALS_CHECK);
+ }
- parseExpression("#{2 eq action}");
- assertEquals("isEqual(2,action)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testEquals3() throws Exception {
+ parseExpression("#{2 eq action}", "isEqual(2,action)",
Boolean.TYPE, EQUALS_CHECK);
+ }
- parseExpression("#{action == clientId}");
- assertEquals("isEqual(action,clientId)",
visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testEquals4() throws Exception {
+ parseExpression("#{action == clientId}",
"isEqual(action,clientId)", Boolean.TYPE, EQUALS_CHECK);
+ }
- parseExpression("#{action eq clientId}");
- assertEquals("isEqual(action,clientId)",
visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testEquals5() throws Exception {
+ parseExpression("#{action eq clientId}",
"isEqual(action,clientId)", Boolean.TYPE, EQUALS_CHECK);
+ }
- parseExpression("#{action eq null}");
- assertEquals("(action == null)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertFalse(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testEquals6() throws Exception {
+ parseExpression("#{action eq null}", "(action == null)",
Boolean.TYPE);
+ }
- parseExpression("#{2 == null}");
- assertEquals("isEqual(2,null)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testEquals7() throws Exception {
+ parseExpression("#{2 == null}", "isEqual(2,null)",
Boolean.TYPE, EQUALS_CHECK);
}
@Test
public void testFalse() throws Exception {
- parseExpression("#{false}");
- assertEquals("false", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{false}", "false", Boolean.TYPE);
}
@Test
public void testFloat() throws Exception {
- parseExpression("#{5.0}");
- assertEquals("Double.valueOf(5.0)", visitor.getParsedExpression());
- assertEquals(Double.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{5.0}", "Double.valueOf(5.0)",
Double.TYPE);
+ }
- parseExpression("#{5.012e+34}");
- assertEquals("Double.valueOf(5.012e+34)",
visitor.getParsedExpression());
- assertEquals(Double.TYPE, visitor.getExpressionType().getRawType());
+ @Test
+ public void testFloat1() throws Exception {
+ parseExpression("#{5.012e+34}", "Double.valueOf(5.012e+34)",
Double.TYPE);
}
@Test
public void testFunction() throws Exception {
- parseExpression("#{super:getType()}");
- assertEquals("super.getType()", visitor.getParsedExpression());
- ELType variableType = visitor.getExpressionType();
+ parseExpression("#{super:getType()}", "super.getType()");
}
@Test
public void testGreatThen() throws Exception {
- parseExpression("#{1 gt 2}");
- assertEquals("(1 > 2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{1 gt 2}", "(1 > 2)", Boolean.TYPE);
+ }
- parseExpression("#{3 > 2}");
- assertEquals("(3 > 2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ @Test
+ public void testGreatThen1() throws Exception {
+ parseExpression("#{3 > 2}", "(3 > 2)", Boolean.TYPE);
}
@Test
public void testGreatThenEquals() throws Exception {
- parseExpression("#{1 ge 2}");
- assertEquals("(1 >= 2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{1 ge 2}", "(1 >= 2)", Boolean.TYPE);
+ }
- parseExpression("#{3 >= 2}");
- assertEquals("(3 >= 2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ @Test
+ public void testGreatThenEquals1() throws Exception {
+ parseExpression("#{3 >= 2}", "(3 >= 2)",
Boolean.TYPE);
}
@Test
public void testIdentifier() throws Exception {
- parseExpression("#{clientId}");
- assertEquals("clientId", visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{clientId}", "clientId", String.class);
}
@Test
public void testInteger() throws Exception {
- parseExpression("#{152}");
- assertEquals("152", visitor.getParsedExpression());
- assertEquals(Integer.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{152}", "152", Integer.TYPE);
}
@Test
public void testLessThen() throws Exception {
- parseExpression("#{1 lt 2}");
- assertEquals("(1 < 2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{1 lt 2}", "(1 < 2)", Boolean.TYPE);
+ }
- parseExpression("#{3 < 2}");
- assertEquals("(3 < 2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ @Test
+ public void testLessThen1() throws Exception {
+
+ parseExpression("#{3 < 2}", "(3 < 2)", Boolean.TYPE);
}
@Test
public void testLessThenEquals() throws Exception {
- parseExpression("#{1 le 2}");
- assertEquals("(1 <= 2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{1 le 2}", "(1 <= 2)", Boolean.TYPE);
+ }
- parseExpression("#{3 <= 2}");
- assertEquals("(3 <= 2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ @Test
+ public void testLessThenEquals1() throws Exception {
+
+ parseExpression("#{3 <= 2}", "(3 <= 2)",
Boolean.TYPE);
}
@Test
public void testLiteral() throws Exception {
- parseExpression("clientId");
- assertEquals("\"clientId\"", visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ parseExpression("clientId", "\"clientId\"",
String.class);
}
@Test
public void testLiteralWithDeferred() throws Exception {
- parseExpression("#{1}#{2}");
- assertEquals("convertToString(1) + convertToString(2)",
visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{1}#{2}", "convertToString(1) +
convertToString(2)", String.class,
+ HelperMethod.TO_STRING_CONVERSION);
+ }
- parseExpression("abs #{getType()}");
- assertEquals("\"abs \" + convertToString(this.getType())",
visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ @Test
+ public void testLiteralWithDeferred1() throws Exception {
+ parseExpression("abs #{getType()}", "\"abs \" +
convertToString(this.getType())", String.class,
+ TO_STRING_CONVERSION);
}
@Test
public void testLiteralWithDeferred2() throws Exception {
- parseExpression("#{getType()} abs ");
- assertEquals("convertToString(this.getType()) + \" abs \"",
visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{getType()} abs ",
"convertToString(this.getType()) + \" abs \"", String.class,
+ TO_STRING_CONVERSION);
}
@Test
public void testMethod() throws Exception {
- parseExpression("#{action.readOnly}");
- assertEquals("action.isReadOnly()", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.readOnly}", "action.isReadOnly()",
Boolean.TYPE);
}
@Test
public void testMethodReturnArray() throws Exception {
- parseExpression("#{action.array}");
- assertEquals("action.getArray()", visitor.getParsedExpression());
- assertEquals(UIComponent[].class, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.array}", "action.getArray()",
UIComponent[].class);
}
@Test
public void testMethodReturnArrayElement() throws Exception {
- parseExpression("#{action.array[0]}");
- assertEquals("action.getArray()[0]", visitor.getParsedExpression());
- assertEquals(UIComponent.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.array[0]}", "action.getArray()[0]",
UIComponent.class);
}
@Test
public void testMethodReturnList() throws Exception {
- parseExpression("#{action.components}");
- assertEquals("action.getComponents()", visitor.getParsedExpression());
- ELType variableType = visitor.getExpressionType();
+ TypedTemplateStatement statement =
+ parseExpression("#{action.components}",
"action.getComponents()", List.class);
+ ELType variableType = statement.getExpressionType();
assertEquals(List.class, variableType.getRawType());
assertEquals(UIComponent.class, variableType.getContainerType().getRawType());
}
@Test
public void testMethodReturnListElement() throws Exception {
- parseExpression("#{action.components[0]}");
- assertEquals("action.getComponents().get(0)",
visitor.getParsedExpression());
- assertEquals(UIComponent.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.components[0]}",
"action.getComponents().get(0)", UIComponent.class);
}
@Test
public void testMethodReturnListElement2() throws Exception {
- parseExpression("#{action.components[0].rendered}");
- assertEquals("action.getComponents().get(0).isRendered()",
visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.components[0].rendered}",
"action.getComponents().get(0).isRendered()", Boolean.TYPE);
}
// @Test
@@ -411,289 +389,273 @@
@Test
public void testMethodReturnMap() throws Exception {
- parseExpression("#{action.facets}");
- assertEquals("action.getFacets()", visitor.getParsedExpression());
- ELType variableType = visitor.getExpressionType();
+ TypedTemplateStatement statement = parseExpression("#{action.facets}",
"action.getFacets()", Map.class);
+ ELType variableType = statement.getExpressionType();
assertEquals(Map.class, variableType.getRawType());
assertEquals(UIComponent.class, variableType.getContainerType().getRawType());
+ }
- parseExpression("#{action.rawMap}");
- assertEquals("action.getRawMap()", visitor.getParsedExpression());
+ @Test
+ public void testMethodReturnMap1() throws Exception {
+ parseExpression("#{action.rawMap}", "action.getRawMap()",
Map.class);
}
@Test
public void testMethodReturnMapElement() throws Exception {
- parseExpression("#{action.getFacet('header')}");
- assertEquals("action.getFacet(\"header\")",
visitor.getParsedExpression());
- assertEquals(UIComponent.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.getFacet('header')}",
"action.getFacet(\"header\")", UIComponent.class);
+ }
- parseExpression("#{action.facets['header']}");
- assertEquals("action.getFacets().get(\"header\")",
visitor.getParsedExpression());
- assertEquals(UIComponent.class, visitor.getExpressionType().getRawType());
+ @Test
+ public void testMethodReturnMapElement1() throws Exception {
- parseExpression("#{action.rawMap['something']}");
- assertEquals("action.getRawMap().get(\"something\")",
visitor.getParsedExpression());
- assertEquals(Object.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.facets['header']}",
"action.getFacets().get(\"header\")", UIComponent.class);
}
@Test
public void testMethodReturnMapElement2() throws Exception {
- parseExpression("#{action.facets.toString()}");
- assertEquals("action.getFacets().toString()",
visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+
+ parseExpression("#{action.rawMap['something']}",
"action.getRawMap().get(\"something\")", Object.class);
}
@Test
public void testMethodReturnMapElement3() throws Exception {
+ parseExpression("#{action.facets.toString()}",
"action.getFacets().toString()", String.class);
+ }
+
+ @Test
+ public void testMethodReturnMapElement4() throws Exception {
// assertEquals("action.getFacet(\"header\").isRendered()",
//
resolveExpression("#{action.getFacet('header').rendered}"));
- parseExpression("#{action.facets['header'].rendered}");
-
assertEquals("action.getFacets().get(\"header\").isRendered()",
visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.facets['header'].rendered}",
"action.getFacets().get(\"header\").isRendered()",
+ Boolean.TYPE);
}
@Test
public void testMethodWithParam() throws Exception {
- parseExpression("#{getType(action.array[0].rendered, action.readOnly,
true)}");
-
assertEquals("this.getType(action.getArray()[0].isRendered(),action.isReadOnly(),true)",
- visitor.getParsedExpression());
+ parseExpression("#{getType(action.array[0].rendered, action.readOnly,
true)}",
+
"this.getType(action.getArray()[0].isRendered(),action.isReadOnly(),true)");
+ }
- ELType variableType = visitor.getExpressionType();
+ @Test
+ public void testMethodWithParam1() throws Exception {
+ parseExpression("#{action.count(123)}", "action.count(123)",
Integer.class);
+ }
- parseExpression("#{action.count(123)}");
- assertEquals("action.count(123)", visitor.getParsedExpression());
- assertEquals(Integer.class, visitor.getExpressionType().getRawType());
+ @Test
+ public void testMethodWithParam2() throws Exception {
- parseExpression("#{action.count(clientId)}");
- assertEquals("action.count(clientId)", visitor.getParsedExpression());
- assertEquals(Object.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.count(clientId)}",
"action.count(clientId)", Object.class);
}
@Test
public void testMinus() throws Exception {
- parseExpression("#{1-2}");
- assertEquals("(1 - 2)", visitor.getParsedExpression());
- assertEquals(Integer.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{1-2}", "(1 - 2)", Integer.TYPE);
}
@Test
public void testMod() throws Exception {
- parseExpression("#{1%2}");
- assertEquals("(1 % 2)", visitor.getParsedExpression());
- assertEquals(Integer.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{1%2}", "(1 % 2)", Integer.TYPE);
}
@Test
public void testMult() throws Exception {
- parseExpression("#{1*2}");
- assertEquals("(1 * 2)", visitor.getParsedExpression());
- assertEquals(Integer.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{1*2}", "(1 * 2)", Integer.TYPE);
}
@Test
public void testNegative() throws Exception {
- parseExpression("#{-5}");
- assertEquals("-5", visitor.getParsedExpression());
- assertEquals(Integer.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{-5}", "-5", Integer.TYPE);
}
@Test
public void testNegativeFloat() throws Exception {
- parseExpression("#{-5.0}");
- assertEquals("-Double.valueOf(5.0)", visitor.getParsedExpression());
- assertEquals(Double.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{-5.0}", "-Double.valueOf(5.0)",
Double.TYPE);
}
@Test
public void testNestedMethod() throws Exception {
- parseExpression("#{action.testBean2.string}");
- assertEquals("action.getTestBean2().getString()",
visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.testBean2.string}",
"action.getTestBean2().getString()", String.class);
}
@Test
public void testNonExistingMethod() throws Exception {
- parseExpression("#{action.doSomething(clientId, 123)}");
- assertEquals("action.doSomething(clientId,123)",
visitor.getParsedExpression());
- assertEquals(Object.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.doSomething(clientId, 123)}",
"action.doSomething(clientId,123)", Object.class);
}
@Test
public void testNot() throws Exception {
- parseExpression("#{not test}");
- assertEquals("(!test)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{not test}", "(!test)", Boolean.TYPE);
+ }
- parseExpression("#{!otherTest}");
- assertEquals("(!otherTest)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ @Test
+ public void testNot1() throws Exception {
+ parseExpression("#{!otherTest}", "(!otherTest)",
Boolean.TYPE);
+ }
- parseExpression("#{!action}");
- assertEquals("(!convertToBoolean(action))",
visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(TO_BOOLEAN_CONVERSION));
+ @Test
+ public void testNot2() throws Exception {
+
+ parseExpression("#{!action}", "(!convertToBoolean(action))",
Boolean.TYPE, TO_BOOLEAN_CONVERSION);
}
@Test
public void testNotEqual() throws Exception {
- parseExpression("#{1 ne 3}");
- assertEquals("(1 != 3)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertFalse(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ parseExpression("#{1 ne 3}", "(1 != 3)", Boolean.TYPE);
+ }
- parseExpression("#{2 != 3}");
- assertEquals("(2 != 3)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertFalse(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testNotEqual1() throws Exception {
- parseExpression("#{action != 2}");
- assertEquals("!isEqual(action,2)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ parseExpression("#{2 != 3}", "(2 != 3)", Boolean.TYPE);
+ }
- parseExpression("#{2 ne action}");
- assertEquals("!isEqual(2,action)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testNotEqual2() throws Exception {
- parseExpression("#{action != clientId}");
- assertEquals("!isEqual(action,clientId)",
visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ parseExpression("#{action != 2}", "!isEqual(action,2)",
Boolean.TYPE, EQUALS_CHECK);
+ }
- parseExpression("#{action ne clientId}");
- assertEquals("!isEqual(action,clientId)",
visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testNotEqual3() throws Exception {
- parseExpression("#{action ne null}");
- assertEquals("(action != null)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertFalse(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ parseExpression("#{2 ne action}", "!isEqual(2,action)",
Boolean.TYPE, EQUALS_CHECK);
+ }
- parseExpression("#{2 != null}");
- assertEquals("!isEqual(2,null)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(EQUALS_CHECK));
+ @Test
+ public void testNotEqual4() throws Exception {
+
+ parseExpression("#{action != clientId}",
"!isEqual(action,clientId)", Boolean.TYPE, EQUALS_CHECK);
}
@Test
+ public void testNotEqual5() throws Exception {
+
+ parseExpression("#{action ne clientId}",
"!isEqual(action,clientId)", Boolean.TYPE, EQUALS_CHECK);
+ }
+
+ @Test
+ public void testNotEqual6() throws Exception {
+
+ parseExpression("#{action ne null}", "(action != null)",
Boolean.TYPE);
+ }
+
+ @Test
+ public void testNotEqual7() throws Exception {
+
+ parseExpression("#{2 != null}", "!isEqual(2,null)",
Boolean.TYPE, EQUALS_CHECK);
+ }
+
+ @Test
public void testNull() throws Exception {
- parseExpression("#{null}");
- assertEquals("null", visitor.getParsedExpression());
- assertTrue(visitor.getExpressionType().isNullType());
+ TypedTemplateStatement statement = parseExpression("#{null}",
"null");
+ assertTrue(statement.getExpressionType().isNullType());
}
@Test
public void testOr() throws Exception {
- parseExpression("#{test or otherTest}");
- assertEquals("(test || otherTest)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{test or otherTest}", "(test ||
otherTest)", Boolean.TYPE);
+ }
- parseExpression("#{otherTest || test}");
- assertEquals("(otherTest || test)", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ @Test
+ public void testOr1() throws Exception {
+ parseExpression("#{otherTest || test}", "(otherTest ||
test)", Boolean.TYPE);
+ }
- parseExpression("#{action or otherTest}");
- assertTrue(visitor.getUsedHelperMethods().contains(TO_BOOLEAN_CONVERSION));
- assertEquals("(convertToBoolean(action) || otherTest)",
visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ @Test
+ public void testOr2() throws Exception {
- parseExpression("#{test || action}");
- assertTrue(visitor.getUsedHelperMethods().contains(TO_BOOLEAN_CONVERSION));
- assertEquals("(test || convertToBoolean(action))",
visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{action or otherTest}",
"(convertToBoolean(action) || otherTest)", Boolean.TYPE,
+ TO_BOOLEAN_CONVERSION);
}
@Test
+ public void testOr3() throws Exception {
+
+ parseExpression("#{test || action}", "(test ||
convertToBoolean(action))", Boolean.TYPE, TO_BOOLEAN_CONVERSION);
+ }
+
+ @Test
public void testPlus() throws Exception {
// TODO: tests involving double values
- parseExpression("#{1+2}");
- assertEquals("(1 + 2)", visitor.getParsedExpression());
- assertEquals(Integer.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{1+2}", "(1 + 2)", Integer.TYPE);
}
@Test
public void testString() throws Exception {
- parseExpression("#{\"nabc\"}");
- assertEquals("\"nabc\"", visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{\"nabc\"}",
"\"nabc\"", String.class);
+ }
- parseExpression("#{'nabc'}");
- assertEquals("\"nabc\"", visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ @Test
+ public void testString1() throws Exception {
- parseExpression("#{'\tabc'}");
- assertEquals("\"\\tabc\"", visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{'nabc'}", "\"nabc\"",
String.class);
+ }
- parseExpression("#{'/nabc'}");
- assertEquals("\"/nabc\"", visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ @Test
+ public void testString2() throws Exception {
- parseExpression("#{'na\"bc'}");
- assertEquals("\"na\\\"bc\"",
visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{'\tabc'}", "\"\\tabc\"",
String.class);
+ }
- parseExpression("#{'na\\\\bc'}");
- assertEquals("\"na\\\\bc\"", visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
+ @Test
+ public void testString3() throws Exception {
+
+ parseExpression("#{'/nabc'}", "\"/nabc\"",
String.class);
}
@Test
- public void testStringReturnType() throws Exception {
- parseExpression("#{clientId}", String.class);
+ public void testString4() throws Exception {
- assertEquals("clientId", visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
- assertFalse(visitor.getUsedHelperMethods().contains(TO_STRING_CONVERSION));
+ parseExpression("#{'na\"bc'}",
"\"na\\\"bc\"", String.class);
+ }
- parseExpression("#{test}", String.class);
+ @Test
+ public void testString5() throws Exception {
- assertEquals("convertToString(test)", visitor.getParsedExpression());
- assertEquals(String.class, visitor.getExpressionType().getRawType());
- assertTrue(visitor.getUsedHelperMethods().contains(TO_STRING_CONVERSION));
+ parseExpression("#{'na\\\\bc'}",
"\"na\\\\bc\"", String.class);
}
@Test
+ public void testStringReturnType() throws Exception {
+ parseExpression("#{clientId}", String.class, "clientId",
String.class);
+ }
+
+ @Test
+ public void testStringReturnType1() throws Exception {
+
+ parseExpression("#{test}", String.class,
"convertToString(test)", String.class, TO_STRING_CONVERSION);
+ }
+
+ @Test
public void testThisFunction() throws Exception {
- parseExpression("#{getType()}");
- assertEquals("this.getType()", visitor.getParsedExpression());
- ELType variableType = visitor.getExpressionType();
+ parseExpression("#{getType()}", "this.getType()");
+ }
- parseExpression("#{this.getType()}");
- assertEquals("this.getType()", visitor.getParsedExpression());
+ @Test
+ public void testThisFunction1() throws Exception {
+
+ parseExpression("#{this.getType()}", "this.getType()");
}
@Test
public void testTrue() throws Exception {
- parseExpression("#{true}");
- assertEquals("true", visitor.getParsedExpression());
- assertEquals(Boolean.TYPE, visitor.getExpressionType().getRawType());
+ parseExpression("#{true}", "true", Boolean.TYPE);
}
@Test
public void testVariableFunction() throws Exception {
- parseExpression("#{objectVar.getType()}");
- assertEquals("objectVar.getType()", visitor.getParsedExpression());
- ELType variableType = visitor.getExpressionType();
+ parseExpression("#{objectVar.getType()}",
"objectVar.getType()");
}
- @Test
+ @Test(/*expected = ParsingException.class*/)
public void testWrongExpression() throws Exception {
- try {
- parseExpression("#{bean.property}");
- fail("Parsing Exception is not thrown");
- } catch (ParsingException pe) {
- // TODO - check message
- // ignore exception
- }
+ log.warn((CharSequence) anyObject());
+ expectLastCall();
+ parseExpression("#{bean.property}","bean.getProperty()");
}
@Test
public void testWrongExpression2() throws Exception {
- parseExpression("#{action.property}");
- assertEquals("action.getProperty()", visitor.getParsedExpression());
- assertEquals(Object.class, visitor.getExpressionType().getRawType());
+ parseExpression("#{action.property}", "action.getProperty()",
Object.class);
}
}
Modified:
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/TypesFactoryTest.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/TypesFactoryTest.java 2010-06-25
17:04:48 UTC (rev 17674)
+++
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/TypesFactoryTest.java 2010-06-25
19:17:12 UTC (rev 17675)
@@ -34,6 +34,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.CdkTestBase;
import org.richfaces.cdk.CdkTestRunner;
import org.richfaces.cdk.templatecompiler.el.ELType;
@@ -55,7 +56,7 @@
@Override
public void configure(Binder binder) {
super.configure(binder);
- binder.bind(ClassLoader.class).toInstance(createClassLoader());
+ binder.bind(CdkClassLoader.class).toInstance(createClassLoader());
}
private static final class ParameterizedTypesHolder {