incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r425276 [11/12] - in /incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src: main/java/org/apache/myfaces/adfinternal/agent/ main/java/org/apache/myfaces/adfinternal/agent/parse/ main/java/org/apache/myfaces/adf...
Date Tue, 25 Jul 2006 04:42:46 GMT
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/FastRenderer2.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/FastRenderer2.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/FastRenderer2.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/FastRenderer2.java Mon Jul 24 21:42:41 2006
@@ -13,272 +13,272 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import java.io.IOException;
-import javax.faces.render.Renderer;
-import javax.faces.component.UIComponent;
-import javax.faces.component.ValueHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.convert.Converter;
-import javax.faces.el.ValueBinding;
-
-import org.apache.myfaces.adf.bean.FacesBean;
-import org.apache.myfaces.adf.bean.PropertyKey;
-import org.apache.myfaces.adf.component.UIXComponent;
-import org.apache.myfaces.adf.component.core.output.CoreOutputText;
-import org.apache.myfaces.adf.context.AdfFacesContext;
-
-import org.apache.myfaces.adfinternal.convert.ConverterUtils;
-
-public class FastRenderer2 extends Renderer
-{
-  public FastRenderer2()
-  {
-    FacesBean.Type type = CoreOutputText.TYPE;
-    _shortDescKey = type.findKey("shortDesc");
-    _styleClassKey = type.findKey("styleClass");
-    _inlineStyleKey = type.findKey("inlineStyle");
-    _onclickKey = type.findKey("onclick");
-    _ondblclickKey = type.findKey("ondblclick");
-    _onkeydownKey = type.findKey("onkeydown");
-    _onkeyupKey = type.findKey("onkeyup");
-    _onkeypressKey = type.findKey("onkeypress");
-    _onmousedownKey = type.findKey("onmousedown");
-    _onmousemoveKey = type.findKey("onmousemove");
-    _onmouseoutKey = type.findKey("onmouseout");
-    _onmouseoverKey = type.findKey("onmouseover");
-    _onmouseupKey = type.findKey("onmouseup");
-    _truncateAtKey = type.findKey("truncateAt");
-    _escapeKey = type.findKey("escape");
-    _descriptionKey = type.findKey("description");
-    _converterKey = type.findKey("converter");
-    _valueKey = type.findKey("value");
-  }
-
-  public void encodeBegin(FacesContext context,
-                          UIComponent comp) throws IOException
-  {
-    AdfFacesContext.getCurrentInstance();
-    FacesBean bean = ((UIXComponent) comp).getFacesBean();
-    if (getEscape(bean))
-    {
-      ResponseWriter rw = context.getResponseWriter();
-      rw.startElement("span", comp);
-      
-      rw.writeAttribute("id", comp.getId(), "id");
-      rw.writeAttribute("title", getShortDesc(bean), "shortDesc");
-      rw.writeAttribute("class", getStyleClass(bean), "styleClass");
-      rw.writeAttribute("style", getInlineStyle(bean), "inlineStyle");
-      rw.writeAttribute("onclick", getOnclick(bean),  null);
-      rw.writeAttribute("ondblclick", getOndblclick(bean),  null);
-      rw.writeAttribute("onkeydown", getOnkeydown(bean),  null);
-      rw.writeAttribute("onkeyup", getOnkeyup(bean),  null);
-      rw.writeAttribute("onkeypress", getOnkeypress(bean),  null);
-      rw.writeAttribute("onmousedown", getOnmousedown(bean),  null);
-      rw.writeAttribute("onmousemove", getOnmousemove(bean),  null);
-      rw.writeAttribute("onmouseout", getOnmouseout(bean),  null);
-      rw.writeAttribute("onmouseover", getOnmouseover(bean),  null);
-      rw.writeAttribute("onmouseup", getOnmouseup(bean),  null);
-    }
-  }
-
-  public void encodeEnd(FacesContext context,
-                        UIComponent comp) throws IOException
-  {
-    AdfFacesContext.getCurrentInstance();
-    ResponseWriter rw = context.getResponseWriter();
-    FacesBean bean = ((UIXComponent) comp).getFacesBean();
-    Object value = getConvertedValue(context, comp, bean);
-
-    if (getEscape(bean))
-    {
-      if (value != null)
-      {
-        int truncateAt = getTruncateAt(bean);
-        if (truncateAt > 0)
-        {
-          String valueStr = value.toString();
-          if (truncateAt < 13)
-            truncateAt = 13;
-          if (valueStr.length() > truncateAt)
-            value = valueStr.substring(0, truncateAt);
-        }
-        
-        rw.writeText(value, "value");
-      }
-
-      Object description = getDescription(bean);
-      if (description != null)
-      {
-        rw.startElement("span", null);
-        rw.writeAttribute("class", "magicClass", null);
-        rw.writeText(description, "description");
-        rw.endElement("span");
-      }
-
-      rw.endElement("span");
-    }
-    else
-    {
-      if (value != null)
-        rw.write(value.toString());
-    }
-  }
-
-  protected Object getConvertedValue(
-    FacesContext context,
-    UIComponent  component,
-    FacesBean    bean)
-  {
-    Object value = getValue(bean);
-    if (value == null)
-      return null;
-
-    Converter converter = getConverter(bean);
-    if ((converter == null) && !(value instanceof String))
-    {
-      converter = getConverterByType(context, bean);
-    }
-
-    if (converter != null)
-    {
-      return converter.getAsString(context, component, value);
-    }
-
-    return value;
-  }
-
-  protected Converter getConverterByType(
-    FacesContext context,
-    FacesBean    bean)
-  {
-    ValueBinding binding = bean.getValueBinding(_valueKey);
-    if (binding == null)
-      return null;
-
-    Class type = binding.getType(context);
-    return ConverterUtils.createConverter(context, type);
-  }
-
-  protected boolean getEscape(FacesBean bean)
-  {
-    Object o = bean.getProperty(_escapeKey);
-    if (o == null)
-      o = _escapeKey.getDefault();
-    assert(o != null);
-    return !Boolean.FALSE.equals(o);
-  }
-
-  protected Object getShortDesc(FacesBean bean)
-  {
-    return bean.getProperty(_shortDescKey);
-  }
-
-  protected Object getStyleClass(FacesBean bean)
-  {
-    return bean.getProperty(_styleClassKey);
-  }
-
-  protected Object getInlineStyle(FacesBean bean)
-  {
-    return bean.getProperty(_inlineStyleKey);
-  }
-
-  protected Object getOnclick(FacesBean bean)
-  {
-    return bean.getProperty(_onclickKey);
-  }
-
-  protected Object getOndblclick(FacesBean bean)
-  {
-    return bean.getProperty(_ondblclickKey);
-  }
-
-  protected Object getOnkeydown(FacesBean bean)
-  {
-    return bean.getProperty(_onkeydownKey);
-  }
-
-  protected Object getOnkeyup(FacesBean bean)
-  {
-    return bean.getProperty(_onkeyupKey);
-  }
-
-  protected Object getOnkeypress(FacesBean bean)
-  {
-    return bean.getProperty(_onkeypressKey);
-  }
-
-  protected Object getOnmousedown(FacesBean bean)
-  {
-    return bean.getProperty(_onmousedownKey);
-  }
-
-  protected Object getOnmousemove(FacesBean bean)
-  {
-    return bean.getProperty(_onmousemoveKey);
-  }
-
-  protected Object getOnmouseout(FacesBean bean)
-  {
-    return bean.getProperty(_onmouseoutKey);
-  }
-
-  protected Object getOnmouseover(FacesBean bean)
-  {
-    return bean.getProperty(_onmouseoverKey);
-  }
-
-  protected Object getOnmouseup(FacesBean bean)
-  {
-    return bean.getProperty(_onmouseupKey);
-  }
-
-  protected int getTruncateAt(FacesBean bean)
-  {
-    Object o = bean.getProperty(_truncateAtKey);
-    if (o == null)
-      o = _truncateAtKey.getDefault();
-    
-    assert(o != null);
-    return ((Number) o).intValue();
-  }
-
-  protected Object getDescription(FacesBean bean)
-  {
-    return bean.getProperty(_descriptionKey);
-  }
-
-  protected Object getValue(FacesBean bean)
-  {
-    return bean.getProperty(_valueKey);
-  }
-
-
-  protected Converter getConverter(FacesBean bean)
-  {
-    return (Converter) bean.getProperty(_converterKey);
-  }
-
-
-  private PropertyKey _shortDescKey;
-  private PropertyKey _styleClassKey;
-  private PropertyKey _inlineStyleKey;
-  private PropertyKey _onclickKey;
-  private PropertyKey _ondblclickKey;
-  private PropertyKey _onkeydownKey;
-  private PropertyKey _onkeyupKey;
-  private PropertyKey _onkeypressKey;
-  private PropertyKey _onmousedownKey;
-  private PropertyKey _onmousemoveKey;
-  private PropertyKey _onmouseoutKey;
-  private PropertyKey _onmouseoverKey;
-  private PropertyKey _onmouseupKey;
-  private PropertyKey _truncateAtKey;
-  private PropertyKey _escapeKey;
-  private PropertyKey _descriptionKey;
-  private PropertyKey _valueKey;
-  private PropertyKey _converterKey;
+package org.apache.myfaces.adfinternal.renderkit;
+
+import java.io.IOException;
+import javax.faces.render.Renderer;
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.convert.Converter;
+import javax.faces.el.ValueBinding;
+
+import org.apache.myfaces.adf.bean.FacesBean;
+import org.apache.myfaces.adf.bean.PropertyKey;
+import org.apache.myfaces.adf.component.UIXComponent;
+import org.apache.myfaces.adf.component.core.output.CoreOutputText;
+import org.apache.myfaces.adf.context.AdfFacesContext;
+
+import org.apache.myfaces.adfinternal.convert.ConverterUtils;
+
+public class FastRenderer2 extends Renderer
+{
+  public FastRenderer2()
+  {
+    FacesBean.Type type = CoreOutputText.TYPE;
+    _shortDescKey = type.findKey("shortDesc");
+    _styleClassKey = type.findKey("styleClass");
+    _inlineStyleKey = type.findKey("inlineStyle");
+    _onclickKey = type.findKey("onclick");
+    _ondblclickKey = type.findKey("ondblclick");
+    _onkeydownKey = type.findKey("onkeydown");
+    _onkeyupKey = type.findKey("onkeyup");
+    _onkeypressKey = type.findKey("onkeypress");
+    _onmousedownKey = type.findKey("onmousedown");
+    _onmousemoveKey = type.findKey("onmousemove");
+    _onmouseoutKey = type.findKey("onmouseout");
+    _onmouseoverKey = type.findKey("onmouseover");
+    _onmouseupKey = type.findKey("onmouseup");
+    _truncateAtKey = type.findKey("truncateAt");
+    _escapeKey = type.findKey("escape");
+    _descriptionKey = type.findKey("description");
+    _converterKey = type.findKey("converter");
+    _valueKey = type.findKey("value");
+  }
+
+  public void encodeBegin(FacesContext context,
+                          UIComponent comp) throws IOException
+  {
+    AdfFacesContext.getCurrentInstance();
+    FacesBean bean = ((UIXComponent) comp).getFacesBean();
+    if (getEscape(bean))
+    {
+      ResponseWriter rw = context.getResponseWriter();
+      rw.startElement("span", comp);
+      
+      rw.writeAttribute("id", comp.getId(), "id");
+      rw.writeAttribute("title", getShortDesc(bean), "shortDesc");
+      rw.writeAttribute("class", getStyleClass(bean), "styleClass");
+      rw.writeAttribute("style", getInlineStyle(bean), "inlineStyle");
+      rw.writeAttribute("onclick", getOnclick(bean),  null);
+      rw.writeAttribute("ondblclick", getOndblclick(bean),  null);
+      rw.writeAttribute("onkeydown", getOnkeydown(bean),  null);
+      rw.writeAttribute("onkeyup", getOnkeyup(bean),  null);
+      rw.writeAttribute("onkeypress", getOnkeypress(bean),  null);
+      rw.writeAttribute("onmousedown", getOnmousedown(bean),  null);
+      rw.writeAttribute("onmousemove", getOnmousemove(bean),  null);
+      rw.writeAttribute("onmouseout", getOnmouseout(bean),  null);
+      rw.writeAttribute("onmouseover", getOnmouseover(bean),  null);
+      rw.writeAttribute("onmouseup", getOnmouseup(bean),  null);
+    }
+  }
+
+  public void encodeEnd(FacesContext context,
+                        UIComponent comp) throws IOException
+  {
+    AdfFacesContext.getCurrentInstance();
+    ResponseWriter rw = context.getResponseWriter();
+    FacesBean bean = ((UIXComponent) comp).getFacesBean();
+    Object value = getConvertedValue(context, comp, bean);
+
+    if (getEscape(bean))
+    {
+      if (value != null)
+      {
+        int truncateAt = getTruncateAt(bean);
+        if (truncateAt > 0)
+        {
+          String valueStr = value.toString();
+          if (truncateAt < 13)
+            truncateAt = 13;
+          if (valueStr.length() > truncateAt)
+            value = valueStr.substring(0, truncateAt);
+        }
+        
+        rw.writeText(value, "value");
+      }
+
+      Object description = getDescription(bean);
+      if (description != null)
+      {
+        rw.startElement("span", null);
+        rw.writeAttribute("class", "magicClass", null);
+        rw.writeText(description, "description");
+        rw.endElement("span");
+      }
+
+      rw.endElement("span");
+    }
+    else
+    {
+      if (value != null)
+        rw.write(value.toString());
+    }
+  }
+
+  protected Object getConvertedValue(
+    FacesContext context,
+    UIComponent  component,
+    FacesBean    bean)
+  {
+    Object value = getValue(bean);
+    if (value == null)
+      return null;
+
+    Converter converter = getConverter(bean);
+    if ((converter == null) && !(value instanceof String))
+    {
+      converter = getConverterByType(context, bean);
+    }
+
+    if (converter != null)
+    {
+      return converter.getAsString(context, component, value);
+    }
+
+    return value;
+  }
+
+  protected Converter getConverterByType(
+    FacesContext context,
+    FacesBean    bean)
+  {
+    ValueBinding binding = bean.getValueBinding(_valueKey);
+    if (binding == null)
+      return null;
+
+    Class type = binding.getType(context);
+    return ConverterUtils.createConverter(context, type);
+  }
+
+  protected boolean getEscape(FacesBean bean)
+  {
+    Object o = bean.getProperty(_escapeKey);
+    if (o == null)
+      o = _escapeKey.getDefault();
+    assert(o != null);
+    return !Boolean.FALSE.equals(o);
+  }
+
+  protected Object getShortDesc(FacesBean bean)
+  {
+    return bean.getProperty(_shortDescKey);
+  }
+
+  protected Object getStyleClass(FacesBean bean)
+  {
+    return bean.getProperty(_styleClassKey);
+  }
+
+  protected Object getInlineStyle(FacesBean bean)
+  {
+    return bean.getProperty(_inlineStyleKey);
+  }
+
+  protected Object getOnclick(FacesBean bean)
+  {
+    return bean.getProperty(_onclickKey);
+  }
+
+  protected Object getOndblclick(FacesBean bean)
+  {
+    return bean.getProperty(_ondblclickKey);
+  }
+
+  protected Object getOnkeydown(FacesBean bean)
+  {
+    return bean.getProperty(_onkeydownKey);
+  }
+
+  protected Object getOnkeyup(FacesBean bean)
+  {
+    return bean.getProperty(_onkeyupKey);
+  }
+
+  protected Object getOnkeypress(FacesBean bean)
+  {
+    return bean.getProperty(_onkeypressKey);
+  }
+
+  protected Object getOnmousedown(FacesBean bean)
+  {
+    return bean.getProperty(_onmousedownKey);
+  }
+
+  protected Object getOnmousemove(FacesBean bean)
+  {
+    return bean.getProperty(_onmousemoveKey);
+  }
+
+  protected Object getOnmouseout(FacesBean bean)
+  {
+    return bean.getProperty(_onmouseoutKey);
+  }
+
+  protected Object getOnmouseover(FacesBean bean)
+  {
+    return bean.getProperty(_onmouseoverKey);
+  }
+
+  protected Object getOnmouseup(FacesBean bean)
+  {
+    return bean.getProperty(_onmouseupKey);
+  }
+
+  protected int getTruncateAt(FacesBean bean)
+  {
+    Object o = bean.getProperty(_truncateAtKey);
+    if (o == null)
+      o = _truncateAtKey.getDefault();
+    
+    assert(o != null);
+    return ((Number) o).intValue();
+  }
+
+  protected Object getDescription(FacesBean bean)
+  {
+    return bean.getProperty(_descriptionKey);
+  }
+
+  protected Object getValue(FacesBean bean)
+  {
+    return bean.getProperty(_valueKey);
+  }
+
+
+  protected Converter getConverter(FacesBean bean)
+  {
+    return (Converter) bean.getProperty(_converterKey);
+  }
+
+
+  private PropertyKey _shortDescKey;
+  private PropertyKey _styleClassKey;
+  private PropertyKey _inlineStyleKey;
+  private PropertyKey _onclickKey;
+  private PropertyKey _ondblclickKey;
+  private PropertyKey _onkeydownKey;
+  private PropertyKey _onkeyupKey;
+  private PropertyKey _onkeypressKey;
+  private PropertyKey _onmousedownKey;
+  private PropertyKey _onmousemoveKey;
+  private PropertyKey _onmouseoutKey;
+  private PropertyKey _onmouseoverKey;
+  private PropertyKey _onmouseupKey;
+  private PropertyKey _truncateAtKey;
+  private PropertyKey _escapeKey;
+  private PropertyKey _descriptionKey;
+  private PropertyKey _valueKey;
+  private PropertyKey _converterKey;
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/FastRenderer2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/GatherContent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/GatherContent.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/GatherContent.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/GatherContent.java Mon Jul 24 21:42:41 2006
@@ -13,121 +13,121 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import java.io.IOException;
-import java.io.Writer;
-
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-
-import org.apache.myfaces.adfinternal.io.ResponseWriterDecorator;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.TestResult;
-import junit.framework.Test;
-
-import org.apache.myfaces.adfinternal.renderkit.core.xhtml.HiddenLabelUtils;
-
-public class GatherContent extends UIComponentBase
-{
-  public GatherContent(Writer writer,
-                       UIComponent child,
-                       TestResult result,
-                       Test       test,
-                       boolean    lenient)
-  {
-    _writer = writer;
-    _result = result;
-    _child  = child;
-    _test   = test;
-    _lenient = lenient;
-    getChildren().add(child);
-  }
-
-  public String getFamily()
-  {
-    return "org.apache.myfaces.adftest.GatherContent";
-  }
-
-  public void encodeBegin(FacesContext context)
-  {
-    _savedWriter = context.getResponseWriter();
-    if (_lenient)
-      context.setResponseWriter(_savedWriter.cloneWithWriter(_writer));
-    else
-      context.setResponseWriter(
-        new CheckUIComponent(_savedWriter.cloneWithWriter(_writer)));
-  }
-
-  
-  public void encodeEnd(FacesContext context)
-  {
-    context.setResponseWriter(_savedWriter);
-    AdfRenderingContext arc = AdfRenderingContext.getCurrentInstance();
-
-    // Our hidden label utility code makes sure it never writes out
-    // the same label twice consecutively - but between batches of
-    // gathered content, that's a bad thing
-    HiddenLabelUtils.rememberLabel(arc, "forgetTheLabel");
-  }
-
-  private class CheckUIComponent extends ResponseWriterDecorator
-  {
-    public CheckUIComponent(ResponseWriter out)
-    {
-      super(out);
-    }
-
-    public void startElement(String name,
-                             UIComponent component) throws IOException
-    {
-      // Look for root elements that do not have the right associated
-      // UIComponent.  However, ignore <script> elements, since
-      // those are often output as a dependency that isn't
-      // directly attached to this component.
-      // =-=AEW Is that right?  Aren't these latent bugs?
-      int depth = _depth++;
-      if (depth == 0)
-      {
-        if (!"script".equals(name) && (!"link".equals(name)))
-        {
-          if (component == null)
-          {
-            AssertionFailedError failure = new AssertionFailedError(
-              "No UIComponent was passed to startElement(\"" + name +
-              "\",...)");
-            _result.addError(_test, failure);
-          }
-          else if (component != _child)
-          {
-            AssertionFailedError failure = new AssertionFailedError(
-              "The wrong UIComponent was passed to startElement(\"" + name +
-              "\",...)");
-            _result.addError(_test, failure);
-          }
-        }
-      }
-
-      super.startElement(name, component);
-    }
-
-    public void endElement(String name) throws IOException
-    {
-      super.endElement(name);
-
-      _depth--;
-    }
-
-    private int _depth = 0;
-  }
-
-  private UIComponent _child;
-  private TestResult _result;
-  private Test       _test;
-  private boolean    _lenient;
-  private Writer _writer;
-  private ResponseWriter _savedWriter;
-}
+package org.apache.myfaces.adfinternal.renderkit;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+
+import org.apache.myfaces.adfinternal.io.ResponseWriterDecorator;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestResult;
+import junit.framework.Test;
+
+import org.apache.myfaces.adfinternal.renderkit.core.xhtml.HiddenLabelUtils;
+
+public class GatherContent extends UIComponentBase
+{
+  public GatherContent(Writer writer,
+                       UIComponent child,
+                       TestResult result,
+                       Test       test,
+                       boolean    lenient)
+  {
+    _writer = writer;
+    _result = result;
+    _child  = child;
+    _test   = test;
+    _lenient = lenient;
+    getChildren().add(child);
+  }
+
+  public String getFamily()
+  {
+    return "org.apache.myfaces.adftest.GatherContent";
+  }
+
+  public void encodeBegin(FacesContext context)
+  {
+    _savedWriter = context.getResponseWriter();
+    if (_lenient)
+      context.setResponseWriter(_savedWriter.cloneWithWriter(_writer));
+    else
+      context.setResponseWriter(
+        new CheckUIComponent(_savedWriter.cloneWithWriter(_writer)));
+  }
+
+  
+  public void encodeEnd(FacesContext context)
+  {
+    context.setResponseWriter(_savedWriter);
+    AdfRenderingContext arc = AdfRenderingContext.getCurrentInstance();
+
+    // Our hidden label utility code makes sure it never writes out
+    // the same label twice consecutively - but between batches of
+    // gathered content, that's a bad thing
+    HiddenLabelUtils.rememberLabel(arc, "forgetTheLabel");
+  }
+
+  private class CheckUIComponent extends ResponseWriterDecorator
+  {
+    public CheckUIComponent(ResponseWriter out)
+    {
+      super(out);
+    }
+
+    public void startElement(String name,
+                             UIComponent component) throws IOException
+    {
+      // Look for root elements that do not have the right associated
+      // UIComponent.  However, ignore <script> elements, since
+      // those are often output as a dependency that isn't
+      // directly attached to this component.
+      // =-=AEW Is that right?  Aren't these latent bugs?
+      int depth = _depth++;
+      if (depth == 0)
+      {
+        if (!"script".equals(name) && (!"link".equals(name)))
+        {
+          if (component == null)
+          {
+            AssertionFailedError failure = new AssertionFailedError(
+              "No UIComponent was passed to startElement(\"" + name +
+              "\",...)");
+            _result.addError(_test, failure);
+          }
+          else if (component != _child)
+          {
+            AssertionFailedError failure = new AssertionFailedError(
+              "The wrong UIComponent was passed to startElement(\"" + name +
+              "\",...)");
+            _result.addError(_test, failure);
+          }
+        }
+      }
+
+      super.startElement(name, component);
+    }
+
+    public void endElement(String name) throws IOException
+    {
+      super.endElement(name);
+
+      _depth--;
+    }
+
+    private int _depth = 0;
+  }
+
+  private UIComponent _child;
+  private TestResult _result;
+  private Test       _test;
+  private boolean    _lenient;
+  private Writer _writer;
+  private ResponseWriter _savedWriter;
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/GatherContent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MAdfFacesContext.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MAdfFacesContext.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MAdfFacesContext.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MAdfFacesContext.java Mon Jul 24 21:42:41 2006
@@ -13,218 +13,218 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import java.util.Map;
-import java.util.TimeZone;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
+package org.apache.myfaces.adfinternal.renderkit;
+
+import java.util.Map;
+import java.util.TimeZone;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 
-import org.apache.myfaces.adf.change.ChangeManager;
-import org.apache.myfaces.adf.config.RegionManager;
-import org.apache.myfaces.adf.context.AdfFacesContext;
-import org.apache.myfaces.adf.context.Agent;
-import org.apache.myfaces.adf.context.PageResolver;
-import org.apache.myfaces.adf.context.PageFlowScopeProvider;
-import org.apache.myfaces.adf.context.DialogService;
-
-import org.apache.myfaces.adf.webapp.UploadedFileProcessor;
-
-import org.apache.myfaces.adfinternal.context.PageFlowScopeProviderImpl;
-import org.apache.myfaces.adfinternal.context.PageResolverDefaultImpl;
-
-public class MAdfFacesContext extends AdfFacesContext
-{
-  public MAdfFacesContext()
-  {
-    attach();
-  }
-
-  // Support setting the agent so we can create one AdfFacesContext
-  // and mutate it
-
-  public void setAgent(Agent agent)
-  {
-    _agent = agent;
-  }
-
-  public Agent getAgent()
-  {
-    return _agent;
-  }
-
-  public PageResolver getPageResolver()
-  {
-    return PageResolverDefaultImpl.sharedInstance();
-  }
-
-  public PageFlowScopeProvider getPageFlowScopeProvider()
-  {
-    return PageFlowScopeProviderImpl.sharedInstance();
-  }
-
-
-  public DialogService getDialogService()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public Map getPageFlowScope()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public void returnFromDialog(Object returnValue, Map returnParam)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public void launchDialog(UIViewRoot dialogRoot, Map dialogParameters, UIComponent source, boolean useWindow, Map windowProperties)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public boolean isPostback()
-  {
-    return false;
+import org.apache.myfaces.adf.change.ChangeManager;
+import org.apache.myfaces.adf.config.RegionManager;
+import org.apache.myfaces.adf.context.AdfFacesContext;
+import org.apache.myfaces.adf.context.Agent;
+import org.apache.myfaces.adf.context.PageResolver;
+import org.apache.myfaces.adf.context.PageFlowScopeProvider;
+import org.apache.myfaces.adf.context.DialogService;
+
+import org.apache.myfaces.adf.webapp.UploadedFileProcessor;
+
+import org.apache.myfaces.adfinternal.context.PageFlowScopeProviderImpl;
+import org.apache.myfaces.adfinternal.context.PageResolverDefaultImpl;
+
+public class MAdfFacesContext extends AdfFacesContext
+{
+  public MAdfFacesContext()
+  {
+    attach();
+  }
+
+  // Support setting the agent so we can create one AdfFacesContext
+  // and mutate it
+
+  public void setAgent(Agent agent)
+  {
+    _agent = agent;
+  }
+
+  public Agent getAgent()
+  {
+    return _agent;
+  }
+
+  public PageResolver getPageResolver()
+  {
+    return PageResolverDefaultImpl.sharedInstance();
+  }
+
+  public PageFlowScopeProvider getPageFlowScopeProvider()
+  {
+    return PageFlowScopeProviderImpl.sharedInstance();
+  }
+
+
+  public DialogService getDialogService()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public Map getPageFlowScope()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public void returnFromDialog(Object returnValue, Map returnParam)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public void launchDialog(UIViewRoot dialogRoot, Map dialogParameters, UIComponent source, boolean useWindow, Map windowProperties)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public boolean isPostback()
+  {
+    return false;
   }
   
   public boolean isPartialRequest(FacesContext context)
   {
     return false;
   }
-
-  public boolean isDebugOutput()
-  {
-    return false;
-  }
-
-  public boolean isClientValidationDisabled()
-  {
-    return false;
-  }
-
-  public String getOutputMode()
-  {
-    return null;
-  }
-
-  public void setSkinFamily(String skin)
-  {
-    _skin = skin;
-  }
-
-  public String getSkinFamily()
-  {
-    return _skin;
-  }
-
-  public String getAccessibilityMode()
-  {
-    return _accMode;
-  }
-
-  public void setAccessibilityMode(String accMode)
-  {
-    _accMode = accMode;
-  }
-
-  public boolean isRightToLeft()
-  {
-    return _rtl;
-  }
-
-  public void setRightToLeft(boolean rtl)
-  {
-    _rtl = rtl;
-  }
-
-  public char getNumberGroupingSeparator()
-  {
-    return ',';
-  }
-
-  public char getDecimalSeparator()
-  {
-    return '.';
-  }
-
-  public String getCurrencyCode()
-  {
-    return null;
-  }
-
-  public int getTwoDigitYearStart()
-  {
-    return 1950;
-  }
-
-  public String getOracleHelpServletUrl()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public Map getHelpTopic()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public Map getHelpSystem()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public TimeZone getTimeZone()
-  {
-    return _FIXED_TIME_ZONE;
-  }
-
-  public void addPartialTarget(UIComponent newTarget)
-  {
-    // throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public void addPartialTriggerListeners(UIComponent listener, String[] trigger)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public void partialUpdateNotify(UIComponent updated)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public UploadedFileProcessor getUploadedFileProcessor()
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public Map getColorPalette()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public Map getFormatter()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public ChangeManager getChangeManager()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public RegionManager getRegionManager()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  private String _skin;
-  private String _accMode;
-  private Agent _agent;
-  private boolean _rtl = false;
-  static private TimeZone _FIXED_TIME_ZONE =
+
+  public boolean isDebugOutput()
+  {
+    return false;
+  }
+
+  public boolean isClientValidationDisabled()
+  {
+    return false;
+  }
+
+  public String getOutputMode()
+  {
+    return null;
+  }
+
+  public void setSkinFamily(String skin)
+  {
+    _skin = skin;
+  }
+
+  public String getSkinFamily()
+  {
+    return _skin;
+  }
+
+  public String getAccessibilityMode()
+  {
+    return _accMode;
+  }
+
+  public void setAccessibilityMode(String accMode)
+  {
+    _accMode = accMode;
+  }
+
+  public boolean isRightToLeft()
+  {
+    return _rtl;
+  }
+
+  public void setRightToLeft(boolean rtl)
+  {
+    _rtl = rtl;
+  }
+
+  public char getNumberGroupingSeparator()
+  {
+    return ',';
+  }
+
+  public char getDecimalSeparator()
+  {
+    return '.';
+  }
+
+  public String getCurrencyCode()
+  {
+    return null;
+  }
+
+  public int getTwoDigitYearStart()
+  {
+    return 1950;
+  }
+
+  public String getOracleHelpServletUrl()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public Map getHelpTopic()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public Map getHelpSystem()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public TimeZone getTimeZone()
+  {
+    return _FIXED_TIME_ZONE;
+  }
+
+  public void addPartialTarget(UIComponent newTarget)
+  {
+    // throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public void addPartialTriggerListeners(UIComponent listener, String[] trigger)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public void partialUpdateNotify(UIComponent updated)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public UploadedFileProcessor getUploadedFileProcessor()
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public Map getColorPalette()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public Map getFormatter()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public ChangeManager getChangeManager()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public RegionManager getRegionManager()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  private String _skin;
+  private String _accMode;
+  private Agent _agent;
+  private boolean _rtl = false;
+  static private TimeZone _FIXED_TIME_ZONE =
     TimeZone.getTimeZone("America/Los_Angeles");
   
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MAdfFacesContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MApplication.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MApplication.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MApplication.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MApplication.java Mon Jul 24 21:42:41 2006
@@ -13,295 +13,295 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import javax.faces.FacesException;
-import javax.faces.application.Application;
-import javax.faces.application.NavigationHandler;
-import javax.faces.application.StateManager;
-import javax.faces.application.ViewHandler;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.el.MethodBinding;
-import javax.faces.el.PropertyResolver;
-import javax.faces.el.ValueBinding;
-import javax.faces.el.VariableResolver;
-import javax.faces.event.ActionListener;
-import javax.faces.validator.Validator;
-
-import org.apache.myfaces.adf.logging.ADFLogger;
-import org.apache.myfaces.adf.bean.util.StateUtils;
-
-public class MApplication extends Application 
-{
-  static public MApplication sharedInstance()
-  {
-    return _INSTANCE;
-  }
-  
-  private MApplication()
-  {
-  }
-
-  public ActionListener getActionListener()
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public void setActionListener(ActionListener listener)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public Locale getDefaultLocale()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public void setDefaultLocale(Locale locale)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public String getDefaultRenderKitId()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public void setDefaultRenderKitId(String renderKitId)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public String getMessageBundle()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public void setMessageBundle(String bundle)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public NavigationHandler getNavigationHandler()
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public void setNavigationHandler(NavigationHandler handler)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public PropertyResolver getPropertyResolver()
-  {
-    return _propertyResolver;
-  }
-
-  public void setPropertyResolver(PropertyResolver resolver)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public VariableResolver getVariableResolver()
-  {
-    return _variableResolver;
-  }
-
-  public void setVariableResolver(VariableResolver resolver)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public ViewHandler getViewHandler()
-  {
-    return _viewHandler;
-  }
-
-  public void setViewHandler(ViewHandler viewHandler)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public StateManager getStateManager()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public void setStateManager(StateManager stateManager)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public void addComponent(String type, String className)
-  {
-    _components.put(type, className);
-  }
-
-  public UIComponent createComponent(String type) throws FacesException
-  {
-    String s = (String) _components.get(type);
-    if (s == null)
-      throw new IllegalArgumentException("No component for type " + type);
-    try
-    {
-      Class c = Class.forName(s);
-      return (UIComponent) c.newInstance();
-    }
-    catch (Exception e)
-    {
-      throw (FacesException)
-        (new FacesException("Could not create component of type " +
-                            type + " with class " + s).initCause(e));
-    }
-  }
-
-  public UIComponent createComponent(ValueBinding binding, FacesContext context, String type)
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public Iterator getComponentTypes()
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public void addConverter(String id, String className)
-  {
-    _converterIdMap.put(id,className);
-  }
-
-  public void addConverter(Class type, String className)
-  {
-    _converterIdMap.put(type,className);
-  }
-
-  public Converter createConverter(String className)
-  {
-    //copy the RI code
-    Converter converter = null;
-    try
-    {
-      converter = (Converter) _mapLookUp(className, _converterIdMap);
-      return converter;
-    }
-    catch (Exception e)
-    {
-      _LOG.log(e.getMessage());
-      throw new FacesException(e.getMessage());
-    }
-    
-  }
-  
-  private Object _mapLookUp(Object key, Map map) throws InstantiationException,
-      IllegalAccessException, ClassNotFoundException
-  {
-    Object result;
-    Object value;
-    Class klass;
-    value = map.get(key);
-    if (value == null)
-      return null;
-    if (value instanceof String)
-    {      
-      klass = Class.forName((String)value);
-      map.put(key, klass);
-    }
-    else
-      klass = (Class) value;
-    result = klass.newInstance();
-    return result;
-  }
-
-  public Converter createConverter(Class type)
-  {
-    Converter converter = null;
-    try
-    {
-      converter = (Converter) _mapLookUp(type, _converterTypeMap);
-      if (converter != null)
-        return converter;
-    }
-    catch (Exception e)
-    {
-      _LOG.log(e.getMessage());
-    }
-    Class[] interfaces = type.getInterfaces();
-    for (int i = 0; i < interfaces.length; i++)
-    {
-      converter = createConverter(interfaces[i]);
-      if (converter != null)
-        return converter;
-    }
-    Class superclass = type.getSuperclass();
-    if (superclass != null)
-    {
-      converter = createConverter(superclass);
-      if (superclass != null)
-        return converter;
-    }
-    return converter;
-  }
-
-  public Iterator getConverterIds()
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public Iterator getConverterTypes()
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public MethodBinding createMethodBinding(String expr, Class[] paramTypes)
-  {
-    return null;
-  }
-
-  public Iterator getSupportedLocales()
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public void setSupportedLocales(Collection locales)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public void addValidator(String id, String className)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public Validator createValidator(String validatorId)
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public Iterator getValidatorIds()
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public ValueBinding createValueBinding(String expression)
-  {
-    if (!expression.startsWith("#{") ||
-        !expression.endsWith("}"))
-      throw new UnsupportedOperationException("Haven't implemented that much yet!");
-    return new MValueBinding(expression);
-  }
-
-  private Map _components = new HashMap();
-  private ViewHandler _viewHandler = new MViewHandler();
-  private VariableResolver _variableResolver = new MVariableResolver();
-  private PropertyResolver _propertyResolver = new MPropertyResolver();
-  static private MApplication _INSTANCE = new MApplication();
-  private Map _converterIdMap = new HashMap();
-  private Map _converterTypeMap = new HashMap();
-  static private final ADFLogger _LOG = ADFLogger.createADFLogger(StateUtils.class);
-}
+package org.apache.myfaces.adfinternal.renderkit;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.application.NavigationHandler;
+import javax.faces.application.StateManager;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.PropertyResolver;
+import javax.faces.el.ValueBinding;
+import javax.faces.el.VariableResolver;
+import javax.faces.event.ActionListener;
+import javax.faces.validator.Validator;
+
+import org.apache.myfaces.adf.logging.ADFLogger;
+import org.apache.myfaces.adf.bean.util.StateUtils;
+
+public class MApplication extends Application 
+{
+  static public MApplication sharedInstance()
+  {
+    return _INSTANCE;
+  }
+  
+  private MApplication()
+  {
+  }
+
+  public ActionListener getActionListener()
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public void setActionListener(ActionListener listener)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public Locale getDefaultLocale()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public void setDefaultLocale(Locale locale)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public String getDefaultRenderKitId()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public void setDefaultRenderKitId(String renderKitId)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public String getMessageBundle()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public void setMessageBundle(String bundle)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public NavigationHandler getNavigationHandler()
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public void setNavigationHandler(NavigationHandler handler)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public PropertyResolver getPropertyResolver()
+  {
+    return _propertyResolver;
+  }
+
+  public void setPropertyResolver(PropertyResolver resolver)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public VariableResolver getVariableResolver()
+  {
+    return _variableResolver;
+  }
+
+  public void setVariableResolver(VariableResolver resolver)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public ViewHandler getViewHandler()
+  {
+    return _viewHandler;
+  }
+
+  public void setViewHandler(ViewHandler viewHandler)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public StateManager getStateManager()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public void setStateManager(StateManager stateManager)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public void addComponent(String type, String className)
+  {
+    _components.put(type, className);
+  }
+
+  public UIComponent createComponent(String type) throws FacesException
+  {
+    String s = (String) _components.get(type);
+    if (s == null)
+      throw new IllegalArgumentException("No component for type " + type);
+    try
+    {
+      Class c = Class.forName(s);
+      return (UIComponent) c.newInstance();
+    }
+    catch (Exception e)
+    {
+      throw (FacesException)
+        (new FacesException("Could not create component of type " +
+                            type + " with class " + s).initCause(e));
+    }
+  }
+
+  public UIComponent createComponent(ValueBinding binding, FacesContext context, String type)
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public Iterator getComponentTypes()
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public void addConverter(String id, String className)
+  {
+    _converterIdMap.put(id,className);
+  }
+
+  public void addConverter(Class type, String className)
+  {
+    _converterIdMap.put(type,className);
+  }
+
+  public Converter createConverter(String className)
+  {
+    //copy the RI code
+    Converter converter = null;
+    try
+    {
+      converter = (Converter) _mapLookUp(className, _converterIdMap);
+      return converter;
+    }
+    catch (Exception e)
+    {
+      _LOG.log(e.getMessage());
+      throw new FacesException(e.getMessage());
+    }
+    
+  }
+  
+  private Object _mapLookUp(Object key, Map map) throws InstantiationException,
+      IllegalAccessException, ClassNotFoundException
+  {
+    Object result;
+    Object value;
+    Class klass;
+    value = map.get(key);
+    if (value == null)
+      return null;
+    if (value instanceof String)
+    {      
+      klass = Class.forName((String)value);
+      map.put(key, klass);
+    }
+    else
+      klass = (Class) value;
+    result = klass.newInstance();
+    return result;
+  }
+
+  public Converter createConverter(Class type)
+  {
+    Converter converter = null;
+    try
+    {
+      converter = (Converter) _mapLookUp(type, _converterTypeMap);
+      if (converter != null)
+        return converter;
+    }
+    catch (Exception e)
+    {
+      _LOG.log(e.getMessage());
+    }
+    Class[] interfaces = type.getInterfaces();
+    for (int i = 0; i < interfaces.length; i++)
+    {
+      converter = createConverter(interfaces[i]);
+      if (converter != null)
+        return converter;
+    }
+    Class superclass = type.getSuperclass();
+    if (superclass != null)
+    {
+      converter = createConverter(superclass);
+      if (superclass != null)
+        return converter;
+    }
+    return converter;
+  }
+
+  public Iterator getConverterIds()
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public Iterator getConverterTypes()
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public MethodBinding createMethodBinding(String expr, Class[] paramTypes)
+  {
+    return null;
+  }
+
+  public Iterator getSupportedLocales()
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public void setSupportedLocales(Collection locales)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public void addValidator(String id, String className)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public Validator createValidator(String validatorId)
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public Iterator getValidatorIds()
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public ValueBinding createValueBinding(String expression)
+  {
+    if (!expression.startsWith("#{") ||
+        !expression.endsWith("}"))
+      throw new UnsupportedOperationException("Haven't implemented that much yet!");
+    return new MValueBinding(expression);
+  }
+
+  private Map _components = new HashMap();
+  private ViewHandler _viewHandler = new MViewHandler();
+  private VariableResolver _variableResolver = new MVariableResolver();
+  private PropertyResolver _propertyResolver = new MPropertyResolver();
+  static private MApplication _INSTANCE = new MApplication();
+  private Map _converterIdMap = new HashMap();
+  private Map _converterTypeMap = new HashMap();
+  static private final ADFLogger _LOG = ADFLogger.createADFLogger(StateUtils.class);
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MApplication.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MPropertyResolver.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MPropertyResolver.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MPropertyResolver.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MPropertyResolver.java Mon Jul 24 21:42:41 2006
@@ -13,86 +13,86 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import java.beans.BeanInfo;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-import javax.faces.el.PropertyNotFoundException;
-import javax.faces.el.PropertyResolver;
-
-public class MPropertyResolver extends PropertyResolver
-{
-  public Object getValue(Object o , Object key)
-  {
-    if (o == null)
-      return null;
-      
-    if (o instanceof Map)
-      return ((Map) o).get(key);
-    
-    if (key == null)
-      return null;
-      
-    String propertyName = key.toString();
-    try
-    {
-      BeanInfo info = Introspector.getBeanInfo(o.getClass());
-      PropertyDescriptor[] properties = info.getPropertyDescriptors();
-      for (int i = 0; i < properties.length; i++)
-      {
-        if (propertyName.equals(properties[i].getName()))
-        {
-          Method m = properties[i].getReadMethod();
-          return m.invoke(o);
-        }
-      }
-    }
-    catch (Exception e)
-    {
-      throw new PropertyNotFoundException(e);
-    }
-    
-    throw new PropertyNotFoundException("Couldn't find getter for " + propertyName);
-  }
-
-  public Object getValue(Object o , int index )
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public void setValue(Object o , Object key, Object value)
-  {
-    throw new UnsupportedOperationException("Should not be called when rendering");
-  }
-
-  public void setValue(Object o , int index , Object value )
-  {
-    throw new UnsupportedOperationException("Should not be called when rendering");
-  }
-
-  public boolean isReadOnly(Object o , Object key )
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public boolean isReadOnly(Object o , int index )
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public Class getType(Object o , Object key)
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public Class getType(Object o , int index )
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-}
+package org.apache.myfaces.adfinternal.renderkit;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.PropertyNotFoundException;
+import javax.faces.el.PropertyResolver;
+
+public class MPropertyResolver extends PropertyResolver
+{
+  public Object getValue(Object o , Object key)
+  {
+    if (o == null)
+      return null;
+      
+    if (o instanceof Map)
+      return ((Map) o).get(key);
+    
+    if (key == null)
+      return null;
+      
+    String propertyName = key.toString();
+    try
+    {
+      BeanInfo info = Introspector.getBeanInfo(o.getClass());
+      PropertyDescriptor[] properties = info.getPropertyDescriptors();
+      for (int i = 0; i < properties.length; i++)
+      {
+        if (propertyName.equals(properties[i].getName()))
+        {
+          Method m = properties[i].getReadMethod();
+          return m.invoke(o);
+        }
+      }
+    }
+    catch (Exception e)
+    {
+      throw new PropertyNotFoundException(e);
+    }
+    
+    throw new PropertyNotFoundException("Couldn't find getter for " + propertyName);
+  }
+
+  public Object getValue(Object o , int index )
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public void setValue(Object o , Object key, Object value)
+  {
+    throw new UnsupportedOperationException("Should not be called when rendering");
+  }
+
+  public void setValue(Object o , int index , Object value )
+  {
+    throw new UnsupportedOperationException("Should not be called when rendering");
+  }
+
+  public boolean isReadOnly(Object o , Object key )
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public boolean isReadOnly(Object o , int index )
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public Class getType(Object o , Object key)
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public Class getType(Object o , int index )
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MPropertyResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MRenderKitFactory.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MRenderKitFactory.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MRenderKitFactory.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MRenderKitFactory.java Mon Jul 24 21:42:41 2006
@@ -13,38 +13,38 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-import javax.faces.render.RenderKit;
-import javax.faces.render.RenderKitFactory;
-
-public class MRenderKitFactory extends RenderKitFactory
-{
-  public MRenderKitFactory()
-  {
-  }
-
-  public void addRenderKit(String renderKitId,
-                           RenderKit renderKit)
-  {
-    _kits.put(renderKitId, renderKit);
-  }
-
-  public RenderKit getRenderKit(FacesContext context, 
-                                String renderKitId)
-  {
-    return (RenderKit) _kits.get(renderKitId);
-  }
-  
-  public Iterator getRenderKitIds()
-  {
-    return _kits.keySet().iterator();
-  }
-
-  private Map _kits = new HashMap();
-}
+package org.apache.myfaces.adfinternal.renderkit;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.render.RenderKit;
+import javax.faces.render.RenderKitFactory;
+
+public class MRenderKitFactory extends RenderKitFactory
+{
+  public MRenderKitFactory()
+  {
+  }
+
+  public void addRenderKit(String renderKitId,
+                           RenderKit renderKit)
+  {
+    _kits.put(renderKitId, renderKit);
+  }
+
+  public RenderKit getRenderKit(FacesContext context, 
+                                String renderKitId)
+  {
+    return (RenderKit) _kits.get(renderKitId);
+  }
+  
+  public Iterator getRenderKitIds()
+  {
+    return _kits.keySet().iterator();
+  }
+
+  private Map _kits = new HashMap();
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MRenderKitFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MValueBinding.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MValueBinding.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MValueBinding.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MValueBinding.java Mon Jul 24 21:42:41 2006
@@ -13,72 +13,72 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import javax.faces.context.FacesContext;
-import javax.faces.el.PropertyResolver;
-import javax.faces.el.ValueBinding;
-import javax.faces.el.VariableResolver;
-
-public class MValueBinding extends ValueBinding
-{
-  public MValueBinding(String expression)
-  {
-    _expression = expression.substring(2, expression.length() - 1);
-  }
-
-  public Object getValue(FacesContext context)
-  {
-    String varName;
-    int period = _expression.indexOf('.');
-    if (period < 0)
-      varName = _expression;
-    else
-      varName = _expression.substring(0, period);
-
-    VariableResolver vr = context.getApplication().getVariableResolver();
-    Object var =  vr.resolveVariable(context, varName);
-    if (period < 0)
-      return var;
-    return _resolveProperty(context, var, _expression.substring(period + 1));
-  }
-
-  private Object _resolveProperty(FacesContext context, Object var, String expr)
-  {    
-    String propertyName;
-    int period = expr.indexOf('.');
-    if (period < 0)
-      propertyName = expr;
-    else
-      propertyName = expr.substring(0, period);
-
-    PropertyResolver pr = context.getApplication().getPropertyResolver();
-    var =  pr.getValue(var, propertyName);
-    
-    if (period < 0)
-      return var;
-    return _resolveProperty(context, var, expr.substring(period + 1));
-  }
-  
-  public void setValue(FacesContext context, Object value)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");    
-  }
-
-  public boolean isReadOnly(FacesContext context)
-  {
-    return true;
-  }
-
-  public Class getType(FacesContext context)
-  {
-    return Object.class;
-  }
-
-  public String getExpressionString()
-  {
-    return "#{" + _expression + "}";
-  }
-  
-  private final String _expression;
-}
+package org.apache.myfaces.adfinternal.renderkit;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.PropertyResolver;
+import javax.faces.el.ValueBinding;
+import javax.faces.el.VariableResolver;
+
+public class MValueBinding extends ValueBinding
+{
+  public MValueBinding(String expression)
+  {
+    _expression = expression.substring(2, expression.length() - 1);
+  }
+
+  public Object getValue(FacesContext context)
+  {
+    String varName;
+    int period = _expression.indexOf('.');
+    if (period < 0)
+      varName = _expression;
+    else
+      varName = _expression.substring(0, period);
+
+    VariableResolver vr = context.getApplication().getVariableResolver();
+    Object var =  vr.resolveVariable(context, varName);
+    if (period < 0)
+      return var;
+    return _resolveProperty(context, var, _expression.substring(period + 1));
+  }
+
+  private Object _resolveProperty(FacesContext context, Object var, String expr)
+  {    
+    String propertyName;
+    int period = expr.indexOf('.');
+    if (period < 0)
+      propertyName = expr;
+    else
+      propertyName = expr.substring(0, period);
+
+    PropertyResolver pr = context.getApplication().getPropertyResolver();
+    var =  pr.getValue(var, propertyName);
+    
+    if (period < 0)
+      return var;
+    return _resolveProperty(context, var, expr.substring(period + 1));
+  }
+  
+  public void setValue(FacesContext context, Object value)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");    
+  }
+
+  public boolean isReadOnly(FacesContext context)
+  {
+    return true;
+  }
+
+  public Class getType(FacesContext context)
+  {
+    return Object.class;
+  }
+
+  public String getExpressionString()
+  {
+    return "#{" + _expression + "}";
+  }
+  
+  private final String _expression;
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MValueBinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MViewHandler.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MViewHandler.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MViewHandler.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MViewHandler.java Mon Jul 24 21:42:41 2006
@@ -13,57 +13,57 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-import java.io.IOException;
-import java.util.Locale;
-import javax.faces.application.ViewHandler;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
-public class MViewHandler extends ViewHandler 
-{
-  public MViewHandler()
-  {
-  }
-
-  public Locale calculateLocale(FacesContext context)
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public String calculateRenderKitId(FacesContext context)
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
- }
-
-  public UIViewRoot createView(FacesContext context, String viewId)
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public String getActionURL(FacesContext context, String viewId)
-  {
-    return "action-url:" + viewId;
-  }
-
-  public String getResourceURL(FacesContext context, String viewId)
-  {
-    return "resource-url:" + viewId;
-  }
-
-  public void renderView(FacesContext context, UIViewRoot root)
-  {
-    throw new UnsupportedOperationException("Not implemented yet");
-  }
-
-  public UIViewRoot restoreView(FacesContext context, String root)
-  {
-    throw new UnsupportedOperationException("Should not be called during rendering");
-  }
-
-  public void writeState(FacesContext context) throws IOException 
-  {
-    context.getResponseWriter().startElement("VIEW-STATE", null);
-    context.getResponseWriter().endElement("VIEW-STATE");  
-  }
+package org.apache.myfaces.adfinternal.renderkit;
+import java.io.IOException;
+import java.util.Locale;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+public class MViewHandler extends ViewHandler 
+{
+  public MViewHandler()
+  {
+  }
+
+  public Locale calculateLocale(FacesContext context)
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public String calculateRenderKitId(FacesContext context)
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+ }
+
+  public UIViewRoot createView(FacesContext context, String viewId)
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public String getActionURL(FacesContext context, String viewId)
+  {
+    return "action-url:" + viewId;
+  }
+
+  public String getResourceURL(FacesContext context, String viewId)
+  {
+    return "resource-url:" + viewId;
+  }
+
+  public void renderView(FacesContext context, UIViewRoot root)
+  {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public UIViewRoot restoreView(FacesContext context, String root)
+  {
+    throw new UnsupportedOperationException("Should not be called during rendering");
+  }
+
+  public void writeState(FacesContext context) throws IOException 
+  {
+    context.getResponseWriter().startElement("VIEW-STATE", null);
+    context.getResponseWriter().endElement("VIEW-STATE");  
+  }
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/MViewHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/NullWriter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/NullWriter.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/NullWriter.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/NullWriter.java Mon Jul 24 21:42:41 2006
@@ -13,37 +13,37 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import java.io.Writer;
-
-public class NullWriter extends Writer
-{
-  public void write(char[] buffer)
-  {
-  }
-
-  public void write(char[] buffer, int off, int len)
-  {
-  }
-
-  public void write(String str)
-  {
-  }
-
-  public void write(int c)
-  {
-  }
-
-  public void write(String str, int off, int len)
-  {
-  }
-
-  public void close()
-  {
-  }
-
-  public void flush()
-  {
-  }
+package org.apache.myfaces.adfinternal.renderkit;
+
+import java.io.Writer;
+
+public class NullWriter extends Writer
+{
+  public void write(char[] buffer)
+  {
+  }
+
+  public void write(char[] buffer, int off, int len)
+  {
+  }
+
+  public void write(String str)
+  {
+  }
+
+  public void write(int c)
+  {
+  }
+
+  public void write(String str, int off, int len)
+  {
+  }
+
+  public void close()
+  {
+  }
+
+  public void flush()
+  {
+  }
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/NullWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitPerfTestCase.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitPerfTestCase.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitPerfTestCase.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitPerfTestCase.java Mon Jul 24 21:42:41 2006
@@ -13,201 +13,201 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import junit.framework.TestCase;
-
-import org.xml.sax.SAXException;
-
-import java.io.IOException;
-
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-import javax.faces.component.UIViewRoot;
-import javax.faces.render.RenderKit;
-
-import org.apache.myfaces.adf.component.core.CoreDocument;
-import org.apache.myfaces.adf.component.core.CoreForm;
-import org.apache.myfaces.adf.render.ExtendedRenderKitService;
-import org.apache.myfaces.adf.util.Service;
-
-import org.apache.myfaces.adfinternal.io.XhtmlResponseWriter;
-
-
-
-public class RenderKitPerfTestCase extends TestCase
-{
-  public RenderKitPerfTestCase() throws IOException, SAXException
-  {
-  }
-
-  public RenderKitPerfTestCase(String testName) throws IOException, SAXException
-  {
-    super(testName);
-  }
-
-
-
-  protected void renderRoot(UIViewRoot root) throws IOException
-  {
-    _facesContext.setViewRoot(root);
-  
-    ExtendedRenderKitService service =
-      _getExtendedRenderKitService(_facesContext);
-    if (service != null)
-      service.encodeBegin(_facesContext);
-
-    try
-    {
-      RenderUtils.encodeRecursive(_facesContext, root);
-      if (service != null)
-        service.encodeEnd(_facesContext);
-    }
-    finally
-    {
-      if (service != null)
-        service.encodeFinally(_facesContext);
-    }
-
-    _facesContext.setViewRoot(null);
-  }
-   
-  protected UIViewRoot createTestTree(UIComponent compToTest, String testName)
-    throws IOException
-  {
-    return createTestTree(compToTest, testName, 25000);
-  }
-
-  protected String getRenderKitId()
-  {
-    return "org.apache.myfaces.adf.core";
-  }
-
-  protected UIViewRoot createTestTree(
-               UIComponent compToTest, String testName, int count)
-    throws IOException
-  {
-    if (_fileWriter != null)
-    {
-      _fileWriter.write("\nRunning test " + testName + "\n");
-      _fileWriter.write("----------------------------------\n");
-    }
-    UIViewRoot root = RenderKitBootstrap.createUIViewRoot(_facesContext);
-    root.setRenderKitId(getRenderKitId());
-
-    CoreDocument doc = new CoreDocument();
-    doc.setId("docId");
-    root.getChildren().add(doc);
-    CoreForm form = new CoreForm();
-    form.setId("formId");
-    doc.getChildren().add(form);
-
-    PerfComp perfer = new PerfComp(count, testName);
-    form.getChildren().add(perfer);
-    perfer.getChildren().add(compToTest);
-
-    return root;
-  }
-
-  protected void setUp() throws IOException
-  {
-    RenderKitBootstrap.clearFactories();
-    RenderKitBootstrap.setFactories(_bootstrap.getFacesConfigInfo());
-
-    //    _fileWriter = new java.io.BufferedWriter(new java.io.FileWriter("test.out", true));
-    //    _fileWriter = new java.io.BufferedWriter(new java.io.FileWriter("c:\\tmp\\test.out", true));
-
-    //    
-    _facesContext = new MFacesContext(false);
-    ResponseWriter writer = new XhtmlResponseWriter(
-      _fileWriter == null ? new NullWriter() : _fileWriter,
-      XhtmlResponseWriter.XHTML_CONTENT_TYPE,
-      "UTF-8");
-
-    _facesContext.setResponseWriter(writer);
-
-    _adfFacesContext = new MAdfFacesContext();
-    _adfFacesContext.setSkinFamily("minimal");
-    _adfFacesContext.setAgent(RenderKitBootstrap.getGeckoAgent());
-  }
-  
-  protected void tearDown() throws IOException
-  {
-    MFacesContext.clearContext();
-    _adfFacesContext.release();
-    if (_fileWriter != null)
-      _fileWriter.close();
-
-    RenderKitBootstrap.clearFactories();
-  }
-  
-
-  private ExtendedRenderKitService _getExtendedRenderKitService(
-    FacesContext context)
-  {
-    RenderKit rk = context.getRenderKit();
-    if (rk == null)
-      throw new NullPointerException("No renderkit");
-
-    return Service.getService(rk, ExtendedRenderKitService.class);
-  }
-
-
-
-  static private class PerfComp extends UIComponentBase
-  {
-    public PerfComp(int count, String name)
-    {
-      _count = count;
-      _name  = name;
-      setRendererType(null);
-    }
-
-    public String getFamily()
-    {
-      return "org.apache.myfaces.adftest.PerfComp";
-    }
-
-    public boolean getRendersChildren()
-    {
-      return true;
-    }
-
-    public void encodeChildren(FacesContext context) throws IOException
-    {
-      long start = System.currentTimeMillis();
-      UIComponent child = (UIComponent) getChildren().get(0);
-      for (int i = 0; i < _count; i++)
-      {
-        RenderUtils.encodeRecursive(context, child);
-      }
-      long count = System.currentTimeMillis() - start;
-      System.out.println("Test: " + _name + ", " + count + " ms");
-    }
-
-    private int _count;
-    private String _name;
-  }
-
-  private java.io.Writer     _fileWriter;
-  private MFacesContext _facesContext;
-  private MAdfFacesContext _adfFacesContext;
-
-  static private RenderKitBootstrap _bootstrap;
-
-
-  static
-  {
-    try
-    {
-      _bootstrap = new RenderKitBootstrap();
-      _bootstrap.init();
-    }
-    catch (Throwable t)
-    {
-      t.printStackTrace();
-    }
-  }
-}
+package org.apache.myfaces.adfinternal.renderkit;
+
+import junit.framework.TestCase;
+
+import org.xml.sax.SAXException;
+
+import java.io.IOException;
+
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.component.UIViewRoot;
+import javax.faces.render.RenderKit;
+
+import org.apache.myfaces.adf.component.core.CoreDocument;
+import org.apache.myfaces.adf.component.core.CoreForm;
+import org.apache.myfaces.adf.render.ExtendedRenderKitService;
+import org.apache.myfaces.adf.util.Service;
+
+import org.apache.myfaces.adfinternal.io.XhtmlResponseWriter;
+
+
+
+public class RenderKitPerfTestCase extends TestCase
+{
+  public RenderKitPerfTestCase() throws IOException, SAXException
+  {
+  }
+
+  public RenderKitPerfTestCase(String testName) throws IOException, SAXException
+  {
+    super(testName);
+  }
+
+
+
+  protected void renderRoot(UIViewRoot root) throws IOException
+  {
+    _facesContext.setViewRoot(root);
+  
+    ExtendedRenderKitService service =
+      _getExtendedRenderKitService(_facesContext);
+    if (service != null)
+      service.encodeBegin(_facesContext);
+
+    try
+    {
+      RenderUtils.encodeRecursive(_facesContext, root);
+      if (service != null)
+        service.encodeEnd(_facesContext);
+    }
+    finally
+    {
+      if (service != null)
+        service.encodeFinally(_facesContext);
+    }
+
+    _facesContext.setViewRoot(null);
+  }
+   
+  protected UIViewRoot createTestTree(UIComponent compToTest, String testName)
+    throws IOException
+  {
+    return createTestTree(compToTest, testName, 25000);
+  }
+
+  protected String getRenderKitId()
+  {
+    return "org.apache.myfaces.adf.core";
+  }
+
+  protected UIViewRoot createTestTree(
+               UIComponent compToTest, String testName, int count)
+    throws IOException
+  {
+    if (_fileWriter != null)
+    {
+      _fileWriter.write("\nRunning test " + testName + "\n");
+      _fileWriter.write("----------------------------------\n");
+    }
+    UIViewRoot root = RenderKitBootstrap.createUIViewRoot(_facesContext);
+    root.setRenderKitId(getRenderKitId());
+
+    CoreDocument doc = new CoreDocument();
+    doc.setId("docId");
+    root.getChildren().add(doc);
+    CoreForm form = new CoreForm();
+    form.setId("formId");
+    doc.getChildren().add(form);
+
+    PerfComp perfer = new PerfComp(count, testName);
+    form.getChildren().add(perfer);
+    perfer.getChildren().add(compToTest);
+
+    return root;
+  }
+
+  protected void setUp() throws IOException
+  {
+    RenderKitBootstrap.clearFactories();
+    RenderKitBootstrap.setFactories(_bootstrap.getFacesConfigInfo());
+
+    //    _fileWriter = new java.io.BufferedWriter(new java.io.FileWriter("test.out", true));
+    //    _fileWriter = new java.io.BufferedWriter(new java.io.FileWriter("c:\\tmp\\test.out", true));
+
+    //    
+    _facesContext = new MFacesContext(false);
+    ResponseWriter writer = new XhtmlResponseWriter(
+      _fileWriter == null ? new NullWriter() : _fileWriter,
+      XhtmlResponseWriter.XHTML_CONTENT_TYPE,
+      "UTF-8");
+
+    _facesContext.setResponseWriter(writer);
+
+    _adfFacesContext = new MAdfFacesContext();
+    _adfFacesContext.setSkinFamily("minimal");
+    _adfFacesContext.setAgent(RenderKitBootstrap.getGeckoAgent());
+  }
+  
+  protected void tearDown() throws IOException
+  {
+    MFacesContext.clearContext();
+    _adfFacesContext.release();
+    if (_fileWriter != null)
+      _fileWriter.close();
+
+    RenderKitBootstrap.clearFactories();
+  }
+  
+
+  private ExtendedRenderKitService _getExtendedRenderKitService(
+    FacesContext context)
+  {
+    RenderKit rk = context.getRenderKit();
+    if (rk == null)
+      throw new NullPointerException("No renderkit");
+
+    return Service.getService(rk, ExtendedRenderKitService.class);
+  }
+
+
+
+  static private class PerfComp extends UIComponentBase
+  {
+    public PerfComp(int count, String name)
+    {
+      _count = count;
+      _name  = name;
+      setRendererType(null);
+    }
+
+    public String getFamily()
+    {
+      return "org.apache.myfaces.adftest.PerfComp";
+    }
+
+    public boolean getRendersChildren()
+    {
+      return true;
+    }
+
+    public void encodeChildren(FacesContext context) throws IOException
+    {
+      long start = System.currentTimeMillis();
+      UIComponent child = (UIComponent) getChildren().get(0);
+      for (int i = 0; i < _count; i++)
+      {
+        RenderUtils.encodeRecursive(context, child);
+      }
+      long count = System.currentTimeMillis() - start;
+      System.out.println("Test: " + _name + ", " + count + " ms");
+    }
+
+    private int _count;
+    private String _name;
+  }
+
+  private java.io.Writer     _fileWriter;
+  private MFacesContext _facesContext;
+  private MAdfFacesContext _adfFacesContext;
+
+  static private RenderKitBootstrap _bootstrap;
+
+
+  static
+  {
+    try
+    {
+      _bootstrap = new RenderKitBootstrap();
+      _bootstrap.init();
+    }
+    catch (Throwable t)
+    {
+      t.printStackTrace();
+    }
+  }
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitPerfTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message