Author: andrei_exadel
Date: 2007-12-22 06:56:40 -0500 (Sat, 22 Dec 2007)
New Revision: 4971
Added:
trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockELContext.java
trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockPageContext.java
trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockValueExpression.java
Log:
add jsp mockups
Added: trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockELContext.java
===================================================================
--- trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockELContext.java
(rev 0)
+++ trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockELContext.java 2007-12-22
11:56:40 UTC (rev 4971)
@@ -0,0 +1,48 @@
+/*
+ * ELContextMock.java Date created: 14.12.2007
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.ajax4jsf.tests;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.FunctionMapper;
+import javax.el.VariableMapper;
+
+/**
+ * TODO Class description goes here.
+ * @author Andrey Markavtsov
+ *
+ */
+public class MockELContext extends ELContext {
+
+ /* (non-Javadoc)
+ * @see javax.el.ELContext#getELResolver()
+ */
+ @Override
+ public ELResolver getELResolver() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELContext#getFunctionMapper()
+ */
+ @Override
+ public FunctionMapper getFunctionMapper() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELContext#getVariableMapper()
+ */
+ @Override
+ public VariableMapper getVariableMapper() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Added: trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockPageContext.java
===================================================================
--- trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockPageContext.java
(rev 0)
+++ trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockPageContext.java 2007-12-22
11:56:40 UTC (rev 4971)
@@ -0,0 +1,297 @@
+/*
+ * PageContextMock.java Date created: 14.12.2007
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.ajax4jsf.tests;
+
+import java.io.IOException;
+import java.util.Enumeration;
+
+import javax.el.ELContext;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.el.ExpressionEvaluator;
+import javax.servlet.jsp.el.VariableResolver;
+
+/**
+ * TODO Class description goes here.
+ * @author Andrey Markavtsov
+ *
+ */
+public class MockPageContext extends PageContext {
+
+
+ private ELContext ELContext;
+
+
+
+ /**
+ * TODO Description goes here.
+ */
+ public MockPageContext() {
+ super();
+ ELContext = new MockELContext();
+ // TODO Auto-generated constructor stub
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#forward(java.lang.String)
+ */
+ @Override
+ public void forward(String relativeUrlPath) throws ServletException,
+ IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#getException()
+ */
+ @Override
+ public Exception getException() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#getPage()
+ */
+ @Override
+ public Object getPage() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#getRequest()
+ */
+ @Override
+ public ServletRequest getRequest() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#getResponse()
+ */
+ @Override
+ public ServletResponse getResponse() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#getServletConfig()
+ */
+ @Override
+ public ServletConfig getServletConfig() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#getServletContext()
+ */
+ @Override
+ public ServletContext getServletContext() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#getSession()
+ */
+ @Override
+ public HttpSession getSession() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#handlePageException(java.lang.Exception)
+ */
+ @Override
+ public void handlePageException(Exception e) throws ServletException,
+ IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#handlePageException(java.lang.Throwable)
+ */
+ @Override
+ public void handlePageException(Throwable t) throws ServletException,
+ IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#include(java.lang.String)
+ */
+ @Override
+ public void include(String relativeUrlPath) throws ServletException,
+ IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#include(java.lang.String, boolean)
+ */
+ @Override
+ public void include(String relativeUrlPath, boolean flush)
+ throws ServletException, IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#initialize(javax.servlet.Servlet,
javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.lang.String, boolean,
int, boolean)
+ */
+ @Override
+ public void initialize(Servlet servlet, ServletRequest request,
+ ServletResponse response, String errorPageURL,
+ boolean needsSession, int bufferSize, boolean autoFlush)
+ throws IOException, IllegalStateException, IllegalArgumentException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.PageContext#release()
+ */
+ @Override
+ public void release() {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#findAttribute(java.lang.String)
+ */
+ @Override
+ public Object findAttribute(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#getAttribute(java.lang.String)
+ */
+ @Override
+ public Object getAttribute(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#getAttribute(java.lang.String, int)
+ */
+ @Override
+ public Object getAttribute(String name, int scope) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#getAttributeNamesInScope(int)
+ */
+ @Override
+ public Enumeration<String> getAttributeNamesInScope(int scope) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#getAttributesScope(java.lang.String)
+ */
+ @Override
+ public int getAttributesScope(String name) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#getELContext()
+ */
+ @Override
+ public ELContext getELContext() {
+ // TODO Auto-generated method stub
+ return this.ELContext;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#getExpressionEvaluator()
+ */
+ @Override
+ public ExpressionEvaluator getExpressionEvaluator() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#getOut()
+ */
+ @Override
+ public JspWriter getOut() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#getVariableResolver()
+ */
+ @Override
+ public VariableResolver getVariableResolver() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#removeAttribute(java.lang.String)
+ */
+ @Override
+ public void removeAttribute(String name) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#removeAttribute(java.lang.String, int)
+ */
+ @Override
+ public void removeAttribute(String name, int scope) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#setAttribute(java.lang.String,
java.lang.Object)
+ */
+ @Override
+ public void setAttribute(String name, Object value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspContext#setAttribute(java.lang.String, java.lang.Object,
int)
+ */
+ @Override
+ public void setAttribute(String name, Object value, int scope) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockValueExpression.java
===================================================================
--- trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockValueExpression.java
(rev 0)
+++
trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockValueExpression.java 2007-12-22
11:56:40 UTC (rev 4971)
@@ -0,0 +1,110 @@
+/*
+ * ValueExpressionMock.java Date created: 14.12.2007
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.ajax4jsf.tests;
+
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+
+/**
+ * TODO Class description goes here.
+ * @author Andrey Markavtsov
+ *
+ */
+public class MockValueExpression extends ValueExpression {
+
+ /** Object to returned by getValue method */
+ private Object o;
+
+ /**
+ * TODO Description goes here.
+ */
+ public MockValueExpression(Object o) {
+ this.o = o;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ValueExpression#getExpectedType()
+ */
+ @Override
+ public Class<?> getExpectedType() {
+ // TODO Auto-generated method stub
+ return Object.class;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ValueExpression#getType(javax.el.ELContext)
+ */
+ @Override
+ public Class<?> getType(ELContext context) {
+ // TODO Auto-generated method stub
+ return Object.class;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ValueExpression#getValue(javax.el.ELContext)
+ */
+ @Override
+ public Object getValue(ELContext context) {
+ // TODO Auto-generated method stub
+ return o;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ValueExpression#isReadOnly(javax.el.ELContext)
+ */
+ @Override
+ public boolean isReadOnly(ELContext context) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ValueExpression#setValue(javax.el.ELContext, java.lang.Object)
+ */
+ @Override
+ public void setValue(ELContext context, Object value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.Expression#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.Expression#getExpressionString()
+ */
+ @Override
+ public String getExpressionString() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.Expression#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.Expression#isLiteralText()
+ */
+ @Override
+ public boolean isLiteralText() {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+}