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 [9/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/adfi...
Date Tue, 25 Jul 2006 04:42:46 GMT
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/xhtml/PageNavigationPathRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/xhtml/PageNavigationPathRenderer.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/xhtml/PageNavigationPathRenderer.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/xhtml/PageNavigationPathRenderer.java Mon Jul 24 21:42:41 2006
@@ -1,59 +1,59 @@
-/*
- * Copyright  2000-2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.adfinternal.ui.laf.base.xhtml;
-
-import org.apache.myfaces.adf.component.UIXHierarchy;
-import org.apache.myfaces.adf.component.UIXPage;
-
-import org.apache.myfaces.adfinternal.ui.RenderingContext;
-import org.apache.myfaces.adfinternal.ui.UINode;
-
-/**
- * Renders the breadcrumbs for a page component
- * <p>
- * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/ui/laf/base/xhtml/PageNavigationPathRenderer.java#0 $) $Date: 10-nov-2005.18:54:07 $
- * @author The Oracle ADF Faces Team
- */
-public class PageNavigationPathRenderer extends BreadCrumbsRenderer
-{
-
-
-  protected UIXHierarchy getHierarchyBase(
-    RenderingContext context, 
-    UINode           node
-  )
-  {    
-    UINode pageNode = context.getParentContext().getAncestorNode(0);
-    return (UIXPage) pageNode.getUIComponent();   
-  }
-
-  protected UINode getStamp(
-    RenderingContext context,
-    UINode           node
-    )
-  {
-    UINode pageNode = context.getParentContext().getAncestorNode(0);     
-    return getNamedChild(context, pageNode, NODE_STAMP_CHILD);
-  }
-  
-  protected Object getFocusPath(
-    UIXHierarchy    component
-    )
-  {
-    return ((UIXPage)component).getFocusRowKey();    
-  }
-
+/*
+ * Copyright  2000-2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.adfinternal.ui.laf.base.xhtml;
+
+import org.apache.myfaces.adf.component.UIXHierarchy;
+import org.apache.myfaces.adf.component.UIXPage;
+
+import org.apache.myfaces.adfinternal.ui.RenderingContext;
+import org.apache.myfaces.adfinternal.ui.UINode;
+
+/**
+ * Renders the breadcrumbs for a page component
+ * <p>
+ * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/ui/laf/base/xhtml/PageNavigationPathRenderer.java#0 $) $Date: 10-nov-2005.18:54:07 $
+ * @author The Oracle ADF Faces Team
+ */
+public class PageNavigationPathRenderer extends BreadCrumbsRenderer
+{
+
+
+  protected UIXHierarchy getHierarchyBase(
+    RenderingContext context, 
+    UINode           node
+  )
+  {    
+    UINode pageNode = context.getParentContext().getAncestorNode(0);
+    return (UIXPage) pageNode.getUIComponent();   
+  }
+
+  protected UINode getStamp(
+    RenderingContext context,
+    UINode           node
+    )
+  {
+    UINode pageNode = context.getParentContext().getAncestorNode(0);     
+    return getNamedChild(context, pageNode, NODE_STAMP_CHILD);
+  }
+  
+  protected Object getFocusPath(
+    UIXHierarchy    component
+    )
+  {
+    return ((UIXPage)component).getFocusRowKey();    
+  }
+
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/xhtml/PageNavigationPathRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/util/SubKeyMap.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/util/SubKeyMap.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/util/SubKeyMap.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/util/SubKeyMap.java Mon Jul 24 21:42:41 2006
@@ -13,287 +13,287 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.util;
-
-import java.util.AbstractMap;
-import java.util.AbstractSet;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-import org.apache.myfaces.adf.logging.ADFLogger;
-
-/**
- * Map that wraps another to provide an isolated namespace using
- * a prefix.  This is especially handy for storing properties on
- * the session in a structured manner without putting them into
- * a true "Map" - because storing in a Map breaks session failover.
- * (Session failover won't trigger on mutations of contained objects.)
- * <p>
- * Note that there is a potential design flaw;  if you create a SubKeyMap
- * for "mypackage.foo" and for "mypackage.foo.bar", all the keys in the
- * latter will actually show up in the former (prefixed by ".bar").  This
- * "flaw" is actually relied on by PageFlowScopeMap (since it provides
- * a handy way to clear out all descendents), so don't "fix" it!
- */
-final public class SubKeyMap extends AbstractMap
-{
-  public SubKeyMap(Map base, String prefix)
-  {
-    if (base == null)
-      throw new NullPointerException();
-    if (prefix == null)
-      throw new NullPointerException();
-
-    // Optimize the scenario where we're wrapping another SubKeyMap
-    if (base instanceof SubKeyMap)
-    {
-      _base = ((SubKeyMap) base)._base;
-      _prefix = ((SubKeyMap) base)._prefix + prefix;
-    }
-    else
-    {
-      _base = base;
-      _prefix = prefix;
-    }
-  }
-
-  public boolean isEmpty()
-  {
-    return entrySet().isEmpty();
-  }
-
-  public Object get(Object key)
-  {
-    key = _getBaseKey(key);
-    return _base.get(key);
-  }
-
-  public Object put(Object key, Object value)
-  {
-    key = _getBaseKey(key);
-    return _base.put(key, value);
-  }
-
-
-  public Object remove(Object key)
-  {
-    key = _getBaseKey(key);
-    _LOG.finest("Removing {0}", key);
-    return _base.remove(key);
-  }
-
-  public boolean containsKey(Object key)
-  {
-    if (!(key instanceof String))
-      return false;
-
-    return _base.containsKey(_getBaseKey(key));
-  }
-
-  public Set entrySet()
-  {
-    if (_entrySet == null)
-      _entrySet = new Entries(_base.entrySet());
-    return _entrySet;
-  }
-
-  private String _getBaseKey(Object key)
-  {
-    if (key == null)
-      throw new NullPointerException();
-    // Yes, I want a ClassCastException if it's not a String
-    return _prefix + ((String) key);
-  }
-
-  private String _getSubKey(Object key)
-  {
-    if (key == null)
-      return null;
-
-    if (!(key instanceof String))
-      return null;
-
-    String keyStr = (String) key;
-    if (!keyStr.startsWith(_prefix))
-      return null;
-
-    return keyStr.substring(_prefix.length());
-  }
-
-
-  private List _gatherKeys()
-  {
-    List list = new ArrayList();
-    Iterator keys = _base.keySet().iterator();
-    while (keys.hasNext())
-    {
-      Object key = keys.next();
-      if ((key instanceof String) && ((String) key).startsWith(_prefix))
-        list.add(key);
-    }
-
-    return list;
-  }
-
-  //
-  // Set implementation for SubkeyMap.entrySet()
-  //
-  private class Entries extends AbstractSet
-  {
-    public Entries(Set baseSet)
-    {
-      _baseSet = baseSet;
-    }
-
-    public Iterator iterator()
-    {
-      // Sadly, if you just try to use a filtering approach
-      // on the iterator, you'll get concurrent modification
-      // exceptions.  Consequently, gather the keys in a list
-      // and iterator over that.
-      List keyList = _gatherKeys();
-      return new EntryIterator(keyList.iterator());
-    }
-
-    public int size()
-    {
-      int size = 0;
-      Iterator keys = _base.keySet().iterator();
-      while (keys.hasNext())
-      {
-
-        Object key = keys.next();
-        if ((key instanceof String) && ((String) key).startsWith(_prefix))
-          size++;
-      }
-
-      return size;
-    }
-
-    public boolean isEmpty()
-    {
-      Iterator keys = _base.keySet().iterator();
-      while (keys.hasNext())
-      {
-        Object key = keys.next();
-        // Short-circuit:  the default implementation would always
-        // need to iterate to find the total size.
-        if ((key instanceof String) && ((String) key).startsWith(_prefix))
-          return false;
-      }
-
-      return true;
-    }
-
-    public void clear()
-    {
-      Iterator keys = _base.keySet().iterator();
-      while (keys.hasNext())
-      {
-        Object key = keys.next();
-        if ((key instanceof String) && ((String) key).startsWith(_prefix))
-        {
-          _LOG.finest("Clearing out {0}", key);
-          keys.remove();
-        }
-      }
-    }
-
-    private Set _baseSet;
-  }
-
-  private class EntryIterator implements Iterator
-  {
-    public EntryIterator(Iterator iterator)
-    {
-      _iterator = iterator;
-    }
-
-    public boolean hasNext()
-    {
-      return _iterator.hasNext();
-    }
-
-    public Object next()
-    {
-      String baseKey = (String) _iterator.next();
-      _currentKey = baseKey;
-      return new Entry(baseKey);
-    }
-
-    public void remove()
-    {
-      if (_currentKey == null)
-        throw new IllegalStateException();
-
-      _base.remove(_currentKey);
-
-      _currentKey = null;
-    }
-
-    private Iterator  _iterator;
-    private String    _currentKey;
-  }
-
-  private class Entry implements Map.Entry
-  {
-    public Entry(String baseKey)
-    {
-      _baseKey = baseKey;
-    }
-
-    public Object getKey()
-    {
-      if (_key == null)
-        _key = _baseKey.substring(_prefix.length());
-      return _key;
-    }
-
-    public Object getValue()
-    {
-      return _base.get(_baseKey);
-    }
-
-    public Object setValue(Object value)
-    {
-      return _base.put(_baseKey, value);
-    }
-
-    public boolean equals(Object o)
-    {
-      if (!(o instanceof Map.Entry))
-        return false;
-      Map.Entry e = (Map.Entry)o;
-      return _equals(getKey(), e.getKey()) &&
-      _equals(getValue(), e.getValue());
-    }
-
-    public int hashCode()
-    {
-      Object key = getKey();
-      Object value = getValue();
-      return ((key   == null)   ? 0 :   key.hashCode()) ^
-      ((value == null)   ? 0 : value.hashCode());
-    }
-
-    private String    _baseKey;
-    private Object    _key;
-  }
-
-  static private boolean _equals(Object a, Object b)
-  {
-    if (a == null)
-      return b == null;
-    return a.equals(b);
-  }
-
-  private final Map    _base;
-  private final String _prefix;
-  private Set          _entrySet;
-
-  static private final ADFLogger _LOG = ADFLogger.createADFLogger(SubKeyMap.class);
-}
+package org.apache.myfaces.adfinternal.util;
+
+import java.util.AbstractMap;
+import java.util.AbstractSet;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+import org.apache.myfaces.adf.logging.ADFLogger;
+
+/**
+ * Map that wraps another to provide an isolated namespace using
+ * a prefix.  This is especially handy for storing properties on
+ * the session in a structured manner without putting them into
+ * a true "Map" - because storing in a Map breaks session failover.
+ * (Session failover won't trigger on mutations of contained objects.)
+ * <p>
+ * Note that there is a potential design flaw;  if you create a SubKeyMap
+ * for "mypackage.foo" and for "mypackage.foo.bar", all the keys in the
+ * latter will actually show up in the former (prefixed by ".bar").  This
+ * "flaw" is actually relied on by PageFlowScopeMap (since it provides
+ * a handy way to clear out all descendents), so don't "fix" it!
+ */
+final public class SubKeyMap extends AbstractMap
+{
+  public SubKeyMap(Map base, String prefix)
+  {
+    if (base == null)
+      throw new NullPointerException();
+    if (prefix == null)
+      throw new NullPointerException();
+
+    // Optimize the scenario where we're wrapping another SubKeyMap
+    if (base instanceof SubKeyMap)
+    {
+      _base = ((SubKeyMap) base)._base;
+      _prefix = ((SubKeyMap) base)._prefix + prefix;
+    }
+    else
+    {
+      _base = base;
+      _prefix = prefix;
+    }
+  }
+
+  public boolean isEmpty()
+  {
+    return entrySet().isEmpty();
+  }
+
+  public Object get(Object key)
+  {
+    key = _getBaseKey(key);
+    return _base.get(key);
+  }
+
+  public Object put(Object key, Object value)
+  {
+    key = _getBaseKey(key);
+    return _base.put(key, value);
+  }
+
+
+  public Object remove(Object key)
+  {
+    key = _getBaseKey(key);
+    _LOG.finest("Removing {0}", key);
+    return _base.remove(key);
+  }
+
+  public boolean containsKey(Object key)
+  {
+    if (!(key instanceof String))
+      return false;
+
+    return _base.containsKey(_getBaseKey(key));
+  }
+
+  public Set entrySet()
+  {
+    if (_entrySet == null)
+      _entrySet = new Entries(_base.entrySet());
+    return _entrySet;
+  }
+
+  private String _getBaseKey(Object key)
+  {
+    if (key == null)
+      throw new NullPointerException();
+    // Yes, I want a ClassCastException if it's not a String
+    return _prefix + ((String) key);
+  }
+
+  private String _getSubKey(Object key)
+  {
+    if (key == null)
+      return null;
+
+    if (!(key instanceof String))
+      return null;
+
+    String keyStr = (String) key;
+    if (!keyStr.startsWith(_prefix))
+      return null;
+
+    return keyStr.substring(_prefix.length());
+  }
+
+
+  private List _gatherKeys()
+  {
+    List list = new ArrayList();
+    Iterator keys = _base.keySet().iterator();
+    while (keys.hasNext())
+    {
+      Object key = keys.next();
+      if ((key instanceof String) && ((String) key).startsWith(_prefix))
+        list.add(key);
+    }
+
+    return list;
+  }
+
+  //
+  // Set implementation for SubkeyMap.entrySet()
+  //
+  private class Entries extends AbstractSet
+  {
+    public Entries(Set baseSet)
+    {
+      _baseSet = baseSet;
+    }
+
+    public Iterator iterator()
+    {
+      // Sadly, if you just try to use a filtering approach
+      // on the iterator, you'll get concurrent modification
+      // exceptions.  Consequently, gather the keys in a list
+      // and iterator over that.
+      List keyList = _gatherKeys();
+      return new EntryIterator(keyList.iterator());
+    }
+
+    public int size()
+    {
+      int size = 0;
+      Iterator keys = _base.keySet().iterator();
+      while (keys.hasNext())
+      {
+
+        Object key = keys.next();
+        if ((key instanceof String) && ((String) key).startsWith(_prefix))
+          size++;
+      }
+
+      return size;
+    }
+
+    public boolean isEmpty()
+    {
+      Iterator keys = _base.keySet().iterator();
+      while (keys.hasNext())
+      {
+        Object key = keys.next();
+        // Short-circuit:  the default implementation would always
+        // need to iterate to find the total size.
+        if ((key instanceof String) && ((String) key).startsWith(_prefix))
+          return false;
+      }
+
+      return true;
+    }
+
+    public void clear()
+    {
+      Iterator keys = _base.keySet().iterator();
+      while (keys.hasNext())
+      {
+        Object key = keys.next();
+        if ((key instanceof String) && ((String) key).startsWith(_prefix))
+        {
+          _LOG.finest("Clearing out {0}", key);
+          keys.remove();
+        }
+      }
+    }
+
+    private Set _baseSet;
+  }
+
+  private class EntryIterator implements Iterator
+  {
+    public EntryIterator(Iterator iterator)
+    {
+      _iterator = iterator;
+    }
+
+    public boolean hasNext()
+    {
+      return _iterator.hasNext();
+    }
+
+    public Object next()
+    {
+      String baseKey = (String) _iterator.next();
+      _currentKey = baseKey;
+      return new Entry(baseKey);
+    }
+
+    public void remove()
+    {
+      if (_currentKey == null)
+        throw new IllegalStateException();
+
+      _base.remove(_currentKey);
+
+      _currentKey = null;
+    }
+
+    private Iterator  _iterator;
+    private String    _currentKey;
+  }
+
+  private class Entry implements Map.Entry
+  {
+    public Entry(String baseKey)
+    {
+      _baseKey = baseKey;
+    }
+
+    public Object getKey()
+    {
+      if (_key == null)
+        _key = _baseKey.substring(_prefix.length());
+      return _key;
+    }
+
+    public Object getValue()
+    {
+      return _base.get(_baseKey);
+    }
+
+    public Object setValue(Object value)
+    {
+      return _base.put(_baseKey, value);
+    }
+
+    public boolean equals(Object o)
+    {
+      if (!(o instanceof Map.Entry))
+        return false;
+      Map.Entry e = (Map.Entry)o;
+      return _equals(getKey(), e.getKey()) &&
+      _equals(getValue(), e.getValue());
+    }
+
+    public int hashCode()
+    {
+      Object key = getKey();
+      Object value = getValue();
+      return ((key   == null)   ? 0 :   key.hashCode()) ^
+      ((value == null)   ? 0 : value.hashCode());
+    }
+
+    private String    _baseKey;
+    private Object    _key;
+  }
+
+  static private boolean _equals(Object a, Object b)
+  {
+    if (a == null)
+      return b == null;
+    return a.equals(b);
+  }
+
+  private final Map    _base;
+  private final String _prefix;
+  private Set          _entrySet;
+
+  static private final ADFLogger _LOG = ADFLogger.createADFLogger(SubKeyMap.class);
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/util/SubKeyMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/util/TokenCache.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/util/TokenCache.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/util/TokenCache.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/util/TokenCache.java Mon Jul 24 21:42:41 2006
@@ -1,17 +1,17 @@
-/*
- * Copyright  2004-2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+/*
+ * Copyright  2004-2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.myfaces.adfinternal.util;
 

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/util/TokenCache.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/DispatchServletResponse.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/DispatchServletResponse.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/DispatchServletResponse.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/DispatchServletResponse.java Mon Jul 24 21:42:41 2006
@@ -1,81 +1,81 @@
-/*
- * Copyright  2004-2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.adfinternal.webapp;
-
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-
-public class DispatchServletResponse extends HttpServletResponseWrapper
-{
-  public DispatchServletResponse(
-    HttpServletResponse delegate,
-    HttpServletRequest  request)
-  {
-    super(delegate);
-    _request = request;
-  }
-
-  public void setContentType(
-    String contentTypeAndCharset)
-  {
-    Matcher matcher = _CONTENT_TYPE_PATTERN.matcher(contentTypeAndCharset);
-    if (matcher.matches())
-    {
-      String contentType = matcher.group(1);
-      String charset = (matcher.groupCount() > 1) ? matcher.group(2) : null; 
-      
-      // capture the content type on the request
-      _request.setAttribute(_CONTENT_TYPE_KEY, contentType);
-
-      // TODO: use Agent APIs when available
-      if ("application/xhtml+xml".equals(contentType))
-      {
-        String userAgent = _request.getHeader("User-agent");
-        if (userAgent.indexOf("compatible; MSIE") != -1)
-        {
-          // IE must serve XHTML as text/html
-          contentTypeAndCharset = "text/html";
-
-          if (charset != null)
-            contentTypeAndCharset += ";charset=" + charset;
-        }
-      }
-    }
-
-    super.setContentType(contentTypeAndCharset);
-  }
-  
-  static public String getContentType(
-    FacesContext context)
-  {
-    Map requestMap = context.getExternalContext().getRequestMap();
-    return (String) requestMap.get(_CONTENT_TYPE_KEY);
-  }
-  
-  private final HttpServletRequest _request;
- 
-  static private final String _CONTENT_TYPE_KEY = 
-                                  "org.apache.myfaces.adfinternal.CONTENT_TYPE";
-                                  
-  static private final Pattern _CONTENT_TYPE_PATTERN = 
-                                  Pattern.compile("([^;]+)(?:;charset=(.*))?");
+/*
+ * Copyright  2004-2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.adfinternal.webapp;
+
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+
+public class DispatchServletResponse extends HttpServletResponseWrapper
+{
+  public DispatchServletResponse(
+    HttpServletResponse delegate,
+    HttpServletRequest  request)
+  {
+    super(delegate);
+    _request = request;
+  }
+
+  public void setContentType(
+    String contentTypeAndCharset)
+  {
+    Matcher matcher = _CONTENT_TYPE_PATTERN.matcher(contentTypeAndCharset);
+    if (matcher.matches())
+    {
+      String contentType = matcher.group(1);
+      String charset = (matcher.groupCount() > 1) ? matcher.group(2) : null; 
+      
+      // capture the content type on the request
+      _request.setAttribute(_CONTENT_TYPE_KEY, contentType);
+
+      // TODO: use Agent APIs when available
+      if ("application/xhtml+xml".equals(contentType))
+      {
+        String userAgent = _request.getHeader("User-agent");
+        if (userAgent.indexOf("compatible; MSIE") != -1)
+        {
+          // IE must serve XHTML as text/html
+          contentTypeAndCharset = "text/html";
+
+          if (charset != null)
+            contentTypeAndCharset += ";charset=" + charset;
+        }
+      }
+    }
+
+    super.setContentType(contentTypeAndCharset);
+  }
+  
+  static public String getContentType(
+    FacesContext context)
+  {
+    Map requestMap = context.getExternalContext().getRequestMap();
+    return (String) requestMap.get(_CONTENT_TYPE_KEY);
+  }
+  
+  private final HttpServletRequest _request;
+ 
+  static private final String _CONTENT_TYPE_KEY = 
+                                  "org.apache.myfaces.adfinternal.CONTENT_TYPE";
+                                  
+  static private final Pattern _CONTENT_TYPE_PATTERN = 
+                                  Pattern.compile("([^;]+)(?:;charset=(.*))?");
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/DispatchServletResponse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/XMLValidityTestCase.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/XMLValidityTestCase.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/XMLValidityTestCase.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/XMLValidityTestCase.java Mon Jul 24 21:42:41 2006
@@ -13,120 +13,120 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.w3c.dom.Document;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import junit.framework.TestCase;
-
-public abstract class XMLValidityTestCase extends TestCase
-{
-  public XMLValidityTestCase(
-    String testName)
-  {
-    super(testName);
-  }
-
-  protected void executeValidityTest(
-     URL    schemaSource,
-     String publicId,
-     URL    xmlSource) throws Throwable
-  {
-    // Fail fast on null URLs, since they mean we'll be failing
-    // soon enough, but far more cryptically.
-    if ((publicId != null) && (schemaSource == null))
-      throw new NullPointerException("No source for schema/DTD");
-
-    if (xmlSource == null)
-      throw new NullPointerException("No source for XML document");
-
-    ER er = new ER();
-    er.registerPublicId(publicId, schemaSource);
-
-    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-    factory.setNamespaceAware(false);
-    factory.setValidating(true);
-
-    DocumentBuilder docBuilder = factory.newDocumentBuilder();
-    // Make sure this test is relevant...
-    assertTrue(docBuilder.isValidating());
-
-    docBuilder.setEntityResolver(er);
-    docBuilder.setErrorHandler(new Errors());
-    docBuilder.parse(new InputSource(xmlSource.openStream()));
-  }
-  
-  static public class ER implements EntityResolver
-  {
-    public ER()
-    {
-      _publicIDs = new HashMap();
-      _systemIDs = new HashMap();
-    }
-
-    public void registerPublicId(String publicId, URL url)
-    {
-      _publicIDs.put(publicId, url);
-    }
-
-    public void registerSystemId(String systemId, URL url)
-    {
-      _systemIDs.put(systemId, url);
-    }
-
-    public InputSource resolveEntity(String publicId, String systemId)
-      throws SAXException, IOException
-    {
-      URL url = (publicId == null) ? null : (URL) _publicIDs.get(publicId);
-      if (url == null)
-        url = (URL) _systemIDs.get(systemId);
-
-      if (url == null)
-        return null;
-
-      return new InputSource(url.openStream());
-    }
-
-    private Map _publicIDs;
-    private Map _systemIDs;
-  }
-
-  static public class Errors implements ErrorHandler
-  {
-    public void error(SAXParseException exception) 
-    {
-      fatalError(exception);
-    }
-     
-    public void fatalError(SAXParseException exception) 
-    {
-      String message = "Parser error: " + exception.getMessage();
-      message += ", line " + exception.getLineNumber();
-      message += ", column " + exception.getColumnNumber();
-      fail(message);
-    }
-
-    public void warning(SAXParseException exception) 
-    {
-      fatalError(exception);
-    }
-  }
-}
+package org.apache.myfaces.adfinternal;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.w3c.dom.Document;
+
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import junit.framework.TestCase;
+
+public abstract class XMLValidityTestCase extends TestCase
+{
+  public XMLValidityTestCase(
+    String testName)
+  {
+    super(testName);
+  }
+
+  protected void executeValidityTest(
+     URL    schemaSource,
+     String publicId,
+     URL    xmlSource) throws Throwable
+  {
+    // Fail fast on null URLs, since they mean we'll be failing
+    // soon enough, but far more cryptically.
+    if ((publicId != null) && (schemaSource == null))
+      throw new NullPointerException("No source for schema/DTD");
+
+    if (xmlSource == null)
+      throw new NullPointerException("No source for XML document");
+
+    ER er = new ER();
+    er.registerPublicId(publicId, schemaSource);
+
+    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+    factory.setNamespaceAware(false);
+    factory.setValidating(true);
+
+    DocumentBuilder docBuilder = factory.newDocumentBuilder();
+    // Make sure this test is relevant...
+    assertTrue(docBuilder.isValidating());
+
+    docBuilder.setEntityResolver(er);
+    docBuilder.setErrorHandler(new Errors());
+    docBuilder.parse(new InputSource(xmlSource.openStream()));
+  }
+  
+  static public class ER implements EntityResolver
+  {
+    public ER()
+    {
+      _publicIDs = new HashMap();
+      _systemIDs = new HashMap();
+    }
+
+    public void registerPublicId(String publicId, URL url)
+    {
+      _publicIDs.put(publicId, url);
+    }
+
+    public void registerSystemId(String systemId, URL url)
+    {
+      _systemIDs.put(systemId, url);
+    }
+
+    public InputSource resolveEntity(String publicId, String systemId)
+      throws SAXException, IOException
+    {
+      URL url = (publicId == null) ? null : (URL) _publicIDs.get(publicId);
+      if (url == null)
+        url = (URL) _systemIDs.get(systemId);
+
+      if (url == null)
+        return null;
+
+      return new InputSource(url.openStream());
+    }
+
+    private Map _publicIDs;
+    private Map _systemIDs;
+  }
+
+  static public class Errors implements ErrorHandler
+  {
+    public void error(SAXParseException exception) 
+    {
+      fatalError(exception);
+    }
+     
+    public void fatalError(SAXParseException exception) 
+    {
+      String message = "Parser error: " + exception.getMessage();
+      message += ", line " + exception.getLineNumber();
+      message += ", column " + exception.getColumnNumber();
+      fail(message);
+    }
+
+    public void warning(SAXParseException exception) 
+    {
+      fatalError(exception);
+    }
+  }
+}

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/application/NullViewHandler.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/application/NullViewHandler.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/application/NullViewHandler.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/application/NullViewHandler.java Mon Jul 24 21:42:41 2006
@@ -13,54 +13,54 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.application;
-
-import java.io.IOException;
-import java.util.Locale;
-import javax.faces.FacesException;
-import javax.faces.application.ViewHandler;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
-public class NullViewHandler extends ViewHandler
-{
-  public Locale calculateLocale(FacesContext context)
-  {
-    return null;
-  }
-
-  public String calculateRenderKitId(FacesContext context)
-  {
-    return null;
-  }
-  
-  public UIViewRoot createView(FacesContext context, String viewId)
-  {
-    return null;
-  }
-
-  public String getActionURL(FacesContext context, String viewId)
-  {
-    return viewId;
-  }
-
-  public String getResourceURL(FacesContext context, String path)
-  {
-    return path;
-  }
-
-
-  public void renderView(FacesContext context, UIViewRoot viewToRender)
-        throws IOException, FacesException
-  {
-  }
-
-  public UIViewRoot restoreView(FacesContext context, String viewId)
-  {
-    return null;
-  }
-
-  public void writeState(FacesContext context) throws IOException
-  {
-  }
-}
+package org.apache.myfaces.adfinternal.application;
+
+import java.io.IOException;
+import java.util.Locale;
+import javax.faces.FacesException;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+public class NullViewHandler extends ViewHandler
+{
+  public Locale calculateLocale(FacesContext context)
+  {
+    return null;
+  }
+
+  public String calculateRenderKitId(FacesContext context)
+  {
+    return null;
+  }
+  
+  public UIViewRoot createView(FacesContext context, String viewId)
+  {
+    return null;
+  }
+
+  public String getActionURL(FacesContext context, String viewId)
+  {
+    return viewId;
+  }
+
+  public String getResourceURL(FacesContext context, String path)
+  {
+    return path;
+  }
+
+
+  public void renderView(FacesContext context, UIViewRoot viewToRender)
+        throws IOException, FacesException
+  {
+  }
+
+  public UIViewRoot restoreView(FacesContext context, String viewId)
+  {
+    return null;
+  }
+
+  public void writeState(FacesContext context) throws IOException
+  {
+  }
+}

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/application/TestInternalView.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/application/TestInternalView.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/application/TestInternalView.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/application/TestInternalView.java Mon Jul 24 21:42:41 2006
@@ -13,45 +13,45 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.application;
-
-import java.io.IOException;
-
-import javax.faces.FacesException;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
-import org.apache.myfaces.adf.render.InternalView;
-
-
-public class TestInternalView extends InternalView
-{
-  public TestInternalView()
-  {
-  }
-
-  public UIViewRoot createView(FacesContext context, String viewId)
-  {
-    ViewHandlerImplTest.__internalViewCalled = "create";
-    return null;
-  }
-
-  /**
-   * Restores the UIViewRoot;  return null if no view should be returned.
-   */
-  public UIViewRoot restoreView(FacesContext context, String viewId)
-  {
-    ViewHandlerImplTest.__internalViewCalled = "restore";
-    return null;
-  }
-  
-  /**
-   * Renders the view.
-   */
-  public void renderView(
-    FacesContext context, 
-    UIViewRoot   viewToRender) throws IOException, FacesException
-  {
-    ViewHandlerImplTest.__internalViewCalled = "render";
-  }
-}
+package org.apache.myfaces.adfinternal.application;
+
+import java.io.IOException;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.adf.render.InternalView;
+
+
+public class TestInternalView extends InternalView
+{
+  public TestInternalView()
+  {
+  }
+
+  public UIViewRoot createView(FacesContext context, String viewId)
+  {
+    ViewHandlerImplTest.__internalViewCalled = "create";
+    return null;
+  }
+
+  /**
+   * Restores the UIViewRoot;  return null if no view should be returned.
+   */
+  public UIViewRoot restoreView(FacesContext context, String viewId)
+  {
+    ViewHandlerImplTest.__internalViewCalled = "restore";
+    return null;
+  }
+  
+  /**
+   * Renders the view.
+   */
+  public void renderView(
+    FacesContext context, 
+    UIViewRoot   viewToRender) throws IOException, FacesException
+  {
+    ViewHandlerImplTest.__internalViewCalled = "render";
+  }
+}

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/application/ViewHandlerImplTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/application/ViewHandlerImplTest.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/application/ViewHandlerImplTest.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/application/ViewHandlerImplTest.java Mon Jul 24 21:42:41 2006
@@ -13,23 +13,23 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.application;
-
+package org.apache.myfaces.adfinternal.application;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
-
-import javax.faces.component.UIViewRoot;
-import javax.faces.render.RenderKitFactory;
-
+
+import javax.faces.component.UIViewRoot;
+import javax.faces.render.RenderKitFactory;
+
 import org.apache.myfaces.adfbuild.test.FacesTestCase;
-import org.apache.myfaces.adfinternal.renderkit.RenderKitBootstrap;
-
-public class ViewHandlerImplTest extends FacesTestCase
-{
-  public ViewHandlerImplTest(
-    String testName)
-  {
-    super(testName);
+import org.apache.myfaces.adfinternal.renderkit.RenderKitBootstrap;
+
+public class ViewHandlerImplTest extends FacesTestCase
+{
+  public ViewHandlerImplTest(
+    String testName)
+  {
+    super(testName);
   }
   
   public void setUp()
@@ -45,34 +45,34 @@
   public static Test suite()
   {
     return new TestSuite(ViewHandlerImplTest.class);
-  }
-
-  public void testInternalView() throws Throwable
-  {
-    ViewHandlerImpl vh = new ViewHandlerImpl(new NullViewHandler());
-    RenderKitBootstrap.setFactories(null);
-    try
-    {
-      UIViewRoot viewRoot = new UIViewRoot();
-      viewRoot.setViewId("/testURL");
-      viewRoot.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
-      facesContext.setViewRoot(viewRoot);
-      vh.renderView(facesContext, viewRoot);
-      assertEquals("render", __internalViewCalled);
-
-      vh.restoreView(facesContext, "/testURL");
-      assertEquals("restore", __internalViewCalled);
-
-      vh.createView(facesContext, "/testURL");
-      assertEquals("create", __internalViewCalled);
-    }
-    finally 
-    {
-      __internalViewCalled = null;
-      RenderKitBootstrap.clearFactories();
-      facesContext.release();
-    }
-  }
-  
-  static String __internalViewCalled = null;
-}
+  }
+
+  public void testInternalView() throws Throwable
+  {
+    ViewHandlerImpl vh = new ViewHandlerImpl(new NullViewHandler());
+    RenderKitBootstrap.setFactories(null);
+    try
+    {
+      UIViewRoot viewRoot = new UIViewRoot();
+      viewRoot.setViewId("/testURL");
+      viewRoot.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
+      facesContext.setViewRoot(viewRoot);
+      vh.renderView(facesContext, viewRoot);
+      assertEquals("render", __internalViewCalled);
+
+      vh.restoreView(facesContext, "/testURL");
+      assertEquals("restore", __internalViewCalled);
+
+      vh.createView(facesContext, "/testURL");
+      assertEquals("create", __internalViewCalled);
+    }
+    finally 
+    {
+      __internalViewCalled = null;
+      RenderKitBootstrap.clearFactories();
+      facesContext.release();
+    }
+  }
+  
+  static String __internalViewCalled = null;
+}

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/context/AdfFacesContextTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/context/AdfFacesContextTest.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/context/AdfFacesContextTest.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/context/AdfFacesContextTest.java Mon Jul 24 21:42:41 2006
@@ -13,51 +13,51 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.context;
-
-import junit.framework.TestCase;
-
-import org.apache.myfaces.adf.context.AdfFacesContext;
-
-public class AdfFacesContextTest extends TestCase
-{
-  public AdfFacesContextTest(
-    String testName)
-  {
-    super(testName);
-  }
-
-  public void testPageResolver()
-  {
-    AdfFacesContext context = _createContext();
-    try
-    {
-      assertTrue(context.getPageResolver() instanceof TestPageResolver);
-    }
-    finally
-    {
-      context.release();
-    }
-  }
-
-  public void testPageFlowScopeProvider()
-  {
-    AdfFacesContext context = _createContext();
-    try
-    {
-      assertTrue(context.getPageFlowScopeProvider()
-                   instanceof TestPageFlowScopeProvider);
-    }
-    finally
-    {
-      context.release();
-    }
-  }
-
-  private AdfFacesContext _createContext()
-  {
-    // =-=AEW Would be better to create it with a mock context so we
-    // can test parsing
-    return (new AdfFacesContextFactoryImpl()).createContext(null, null);
-  }
-}
+package org.apache.myfaces.adfinternal.context;
+
+import junit.framework.TestCase;
+
+import org.apache.myfaces.adf.context.AdfFacesContext;
+
+public class AdfFacesContextTest extends TestCase
+{
+  public AdfFacesContextTest(
+    String testName)
+  {
+    super(testName);
+  }
+
+  public void testPageResolver()
+  {
+    AdfFacesContext context = _createContext();
+    try
+    {
+      assertTrue(context.getPageResolver() instanceof TestPageResolver);
+    }
+    finally
+    {
+      context.release();
+    }
+  }
+
+  public void testPageFlowScopeProvider()
+  {
+    AdfFacesContext context = _createContext();
+    try
+    {
+      assertTrue(context.getPageFlowScopeProvider()
+                   instanceof TestPageFlowScopeProvider);
+    }
+    finally
+    {
+      context.release();
+    }
+  }
+
+  private AdfFacesContext _createContext()
+  {
+    // =-=AEW Would be better to create it with a mock context so we
+    // can test parsing
+    return (new AdfFacesContextFactoryImpl()).createContext(null, null);
+  }
+}

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/context/TestPageFlowScopeProvider.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/context/TestPageFlowScopeProvider.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/context/TestPageFlowScopeProvider.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/context/TestPageFlowScopeProvider.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.context;
-
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-
-import org.apache.myfaces.adf.context.PageFlowScopeProvider;
-
-public class TestPageFlowScopeProvider extends PageFlowScopeProvider
-{
-  public Map getPageFlowScope(FacesContext context)
-  {
-    return null;
-  }
-
-  public Map pushPageFlowScope(
-    FacesContext context,
-    boolean copyParent)
-  {
-    return null;
-  }
-
-  public Map popPageFlowScope(FacesContext context, boolean discardScope)
-  {
-    return null;
-  }
-
-
-  public String encodeCurrentPageFlowScopeURL(
-     FacesContext context,
-     String url)
-  {
-    return url + "?pfs=me";
-  }
-}
+package org.apache.myfaces.adfinternal.context;
+
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.adf.context.PageFlowScopeProvider;
+
+public class TestPageFlowScopeProvider extends PageFlowScopeProvider
+{
+  public Map getPageFlowScope(FacesContext context)
+  {
+    return null;
+  }
+
+  public Map pushPageFlowScope(
+    FacesContext context,
+    boolean copyParent)
+  {
+    return null;
+  }
+
+  public Map popPageFlowScope(FacesContext context, boolean discardScope)
+  {
+    return null;
+  }
+
+
+  public String encodeCurrentPageFlowScopeURL(
+     FacesContext context,
+     String url)
+  {
+    return url + "?pfs=me";
+  }
+}

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/context/TestPageResolver.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/context/TestPageResolver.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/context/TestPageResolver.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/context/TestPageResolver.java Mon Jul 24 21:42:41 2006
@@ -13,23 +13,23 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.context;
-
-import org.apache.myfaces.adf.context.PageResolver;
-
-/**
- * A default implementation of the page resolver that returns the view ID
- * as the physical page name.
- */
-public class TestPageResolver extends PageResolver
-{
-  public String getPhysicalURI(String viewId)
-  {
-    return viewId;
-  }
-
-  public String encodeActionURI(String actionURI)
-  {
-    return actionURI;
-  }
-}
+package org.apache.myfaces.adfinternal.context;
+
+import org.apache.myfaces.adf.context.PageResolver;
+
+/**
+ * A default implementation of the page resolver that returns the view ID
+ * as the physical page name.
+ */
+public class TestPageResolver extends PageResolver
+{
+  public String getPhysicalURI(String viewId)
+  {
+    return viewId;
+  }
+
+  public String encodeActionURI(String actionURI)
+  {
+    return actionURI;
+  }
+}

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/el/TokenizerTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/el/TokenizerTest.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/el/TokenizerTest.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/el/TokenizerTest.java Mon Jul 24 21:42:41 2006
@@ -1,144 +1,144 @@
-/*
- * Copyright 2004,2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.adfinternal.el;
-
-import junit.textui.TestRunner;
-import org.apache.myfaces.adfinternal.el.Tokenizer.Token;
-import junit.framework.TestCase;
-
-/**
- * Unit tests for Tokenizer
- *
- * @author Arjuna Wijeyekoon
- */
-public class TokenizerTest extends TestCase
-{
-  public TokenizerTest(String testName)
-  {
-    super(testName);
-  }
-
-  public void testNonExpression()
-  {
-    String exp = "this isn't an {expression}";
-    Tokenizer tok = new Tokenizer(exp);
-    _testToken(tok, Tokenizer.TEXT_TYPE, exp);
-    assertFalse(tok.hasNext());
-  }
-
-  public void testSimpleExpression()
-  {
-    Tokenizer tok = new Tokenizer("#{1+2.4}");
-    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
-    _testToken(tok, Tokenizer.NUMBER_TYPE, "1");
-    _testToken(tok, Tokenizer.OPER_TYPE, "+");
-    _testToken(tok, Tokenizer.NUMBER_TYPE, "2.4");
-    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
-    assertFalse(tok.hasNext());
-  }
-
-  public void testSimpleVarExpression()
-  {
-    Tokenizer tok = new Tokenizer("#{row+x.y.z}");
-    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
-    _testToken(tok, Tokenizer.VAR_TYPE, "row");
-    _testToken(tok, Tokenizer.OPER_TYPE, "+");
-    _testToken(tok, Tokenizer.VAR_TYPE, "x.y.z");
-    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
-    assertFalse(tok.hasNext());
-  }
-
-  public void testWhiteSpaceExpression()
-  {
-    Tokenizer tok = new Tokenizer("#{ row  + x.y.z   }");
-    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
-    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
-    _testToken(tok, Tokenizer.VAR_TYPE, "row");
-    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, "  ");
-    _testToken(tok, Tokenizer.OPER_TYPE, "+");
-    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
-    _testToken(tok, Tokenizer.VAR_TYPE, "x.y.z");
-    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, "   ");
-    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
-    assertFalse(tok.hasNext());
-  }
-
-  public void testQuotedExpression()
-  {
-    Tokenizer tok = new Tokenizer("#{'pre\"post'}#{\"pre'post\"}");
-    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
-    _testToken(tok, Tokenizer.QUOTED_TYPE, "'pre\"post'");
-    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
-    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
-    _testToken(tok, Tokenizer.QUOTED_TYPE, "\"pre'post\"");
-    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
-    assertFalse(tok.hasNext());
-  }
-
-  public void testQuotedExpression2()
-  {
-    Tokenizer tok = new Tokenizer("#{'pre\\'post'}#{\"pre\\\"post\"}");
-    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
-    _testToken(tok, Tokenizer.QUOTED_TYPE, "'pre\\'post'");
-    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
-    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
-    _testToken(tok, Tokenizer.QUOTED_TYPE, "\"pre\\\"post\"");
-    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
-    assertFalse(tok.hasNext());
-  }
-  
-  public void testComplexExpression()
-  {
-    Tokenizer tok = 
-      new Tokenizer("Found #{row.files} #{row.files > 1 ? 'files' : 'file'}");
-
-    _testToken(tok, Tokenizer.TEXT_TYPE, "Found ");
-    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
-    _testToken(tok, Tokenizer.VAR_TYPE, "row.files");
-    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
-
-    _testToken(tok, Tokenizer.TEXT_TYPE, " ");
-
-    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
-    _testToken(tok, Tokenizer.VAR_TYPE, "row.files");
-    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
-    _testToken(tok, Tokenizer.OPER_TYPE, ">");
-    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
-    _testToken(tok, Tokenizer.NUMBER_TYPE, "1");
-    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
-    _testToken(tok, Tokenizer.OPER_TYPE, "?");
-    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
-    _testToken(tok, Tokenizer.QUOTED_TYPE, "'files'");
-    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
-    _testToken(tok, Tokenizer.OPER_TYPE, ":");
-    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
-    _testToken(tok, Tokenizer.QUOTED_TYPE, "'file'");
-    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
-    assertFalse(tok.hasNext());
-  }
-  
-  public static void main(String[] args)
-  {
-    TestRunner.run(TokenizerTest.class);
-  }
-  
-  private void _testToken(Tokenizer tokens, int expectedType, String expected)
-  {
-    Token tok = (Token) tokens.next();
-    assertEquals("correct token type", expectedType, tok.type);
-    assertEquals("correct token text", expected, tok.getText());
-  }
+/*
+ * Copyright 2004,2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.adfinternal.el;
+
+import junit.textui.TestRunner;
+import org.apache.myfaces.adfinternal.el.Tokenizer.Token;
+import junit.framework.TestCase;
+
+/**
+ * Unit tests for Tokenizer
+ *
+ * @author Arjuna Wijeyekoon
+ */
+public class TokenizerTest extends TestCase
+{
+  public TokenizerTest(String testName)
+  {
+    super(testName);
+  }
+
+  public void testNonExpression()
+  {
+    String exp = "this isn't an {expression}";
+    Tokenizer tok = new Tokenizer(exp);
+    _testToken(tok, Tokenizer.TEXT_TYPE, exp);
+    assertFalse(tok.hasNext());
+  }
+
+  public void testSimpleExpression()
+  {
+    Tokenizer tok = new Tokenizer("#{1+2.4}");
+    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
+    _testToken(tok, Tokenizer.NUMBER_TYPE, "1");
+    _testToken(tok, Tokenizer.OPER_TYPE, "+");
+    _testToken(tok, Tokenizer.NUMBER_TYPE, "2.4");
+    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
+    assertFalse(tok.hasNext());
+  }
+
+  public void testSimpleVarExpression()
+  {
+    Tokenizer tok = new Tokenizer("#{row+x.y.z}");
+    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
+    _testToken(tok, Tokenizer.VAR_TYPE, "row");
+    _testToken(tok, Tokenizer.OPER_TYPE, "+");
+    _testToken(tok, Tokenizer.VAR_TYPE, "x.y.z");
+    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
+    assertFalse(tok.hasNext());
+  }
+
+  public void testWhiteSpaceExpression()
+  {
+    Tokenizer tok = new Tokenizer("#{ row  + x.y.z   }");
+    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
+    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
+    _testToken(tok, Tokenizer.VAR_TYPE, "row");
+    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, "  ");
+    _testToken(tok, Tokenizer.OPER_TYPE, "+");
+    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
+    _testToken(tok, Tokenizer.VAR_TYPE, "x.y.z");
+    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, "   ");
+    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
+    assertFalse(tok.hasNext());
+  }
+
+  public void testQuotedExpression()
+  {
+    Tokenizer tok = new Tokenizer("#{'pre\"post'}#{\"pre'post\"}");
+    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
+    _testToken(tok, Tokenizer.QUOTED_TYPE, "'pre\"post'");
+    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
+    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
+    _testToken(tok, Tokenizer.QUOTED_TYPE, "\"pre'post\"");
+    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
+    assertFalse(tok.hasNext());
+  }
+
+  public void testQuotedExpression2()
+  {
+    Tokenizer tok = new Tokenizer("#{'pre\\'post'}#{\"pre\\\"post\"}");
+    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
+    _testToken(tok, Tokenizer.QUOTED_TYPE, "'pre\\'post'");
+    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
+    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
+    _testToken(tok, Tokenizer.QUOTED_TYPE, "\"pre\\\"post\"");
+    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
+    assertFalse(tok.hasNext());
+  }
+  
+  public void testComplexExpression()
+  {
+    Tokenizer tok = 
+      new Tokenizer("Found #{row.files} #{row.files > 1 ? 'files' : 'file'}");
+
+    _testToken(tok, Tokenizer.TEXT_TYPE, "Found ");
+    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
+    _testToken(tok, Tokenizer.VAR_TYPE, "row.files");
+    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
+
+    _testToken(tok, Tokenizer.TEXT_TYPE, " ");
+
+    _testToken(tok, Tokenizer.EXP_START_TYPE, "#{");
+    _testToken(tok, Tokenizer.VAR_TYPE, "row.files");
+    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
+    _testToken(tok, Tokenizer.OPER_TYPE, ">");
+    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
+    _testToken(tok, Tokenizer.NUMBER_TYPE, "1");
+    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
+    _testToken(tok, Tokenizer.OPER_TYPE, "?");
+    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
+    _testToken(tok, Tokenizer.QUOTED_TYPE, "'files'");
+    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
+    _testToken(tok, Tokenizer.OPER_TYPE, ":");
+    _testToken(tok, Tokenizer.WHITE_SPACE_TYPE, " ");
+    _testToken(tok, Tokenizer.QUOTED_TYPE, "'file'");
+    _testToken(tok, Tokenizer.EXP_END_TYPE, "}");
+    assertFalse(tok.hasNext());
+  }
+  
+  public static void main(String[] args)
+  {
+    TestRunner.run(TokenizerTest.class);
+  }
+  
+  private void _testToken(Tokenizer tokens, int expectedType, String expected)
+  {
+    Token tok = (Token) tokens.next();
+    assertEquals("correct token type", expectedType, tok.type);
+    assertEquals("correct token text", expected, tok.getText());
+  }
 }

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/metadata/RegionMetadataTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/metadata/RegionMetadataTest.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/metadata/RegionMetadataTest.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/metadata/RegionMetadataTest.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.metadata;
-
-import java.io.IOException;
-
-import java.net.URL;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.faces.context.FacesContext;
-
+package org.apache.myfaces.adfinternal.metadata;
+
+import java.io.IOException;
+
+import java.net.URL;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
-
-import junit.textui.TestRunner;
-
+
+import junit.textui.TestRunner;
+
 import org.apache.myfaces.adfbuild.test.FacesTestCase;
-import org.apache.myfaces.adfinternal.metadata.RegionMetadata.AttributeMetaData;
-import org.apache.myfaces.adfinternal.metadata.RegionMetadata.ComponentMetaData;
+import org.apache.myfaces.adfinternal.metadata.RegionMetadata.AttributeMetaData;
+import org.apache.myfaces.adfinternal.metadata.RegionMetadata.ComponentMetaData;
 
-/**
- * Test for parsing region-metadata.xml
- * @author Arjuna Wijeyekoon
- */
-public class RegionMetadataTest extends FacesTestCase
-{
-  public RegionMetadataTest(
-    String testName)
-  {
-    super(testName);
+/**
+ * Test for parsing region-metadata.xml
+ * @author Arjuna Wijeyekoon
+ */
+public class RegionMetadataTest extends FacesTestCase
+{
+  public RegionMetadataTest(
+    String testName)
+  {
+    super(testName);
   }
   
   public void setUp()
@@ -60,88 +60,88 @@
   public static Test suite()
   {
     return new TestSuite(RegionMetadataTest.class);
-  }
-
-  // test loading the region-metadata from the classpath:
-  public void testParsingRegionMetadataFromClassLoader()
-  {
-    Thread t = Thread.currentThread();
-    ClassLoader loader = t.getContextClassLoader();
-    try
-    {
-      t.setContextClassLoader(new RegionClassLoader(loader));
-  
-  
-      _testRegionMetadata(facesContext);
-  
-    }
-    finally
-    {
-      t.setContextClassLoader(loader);
-    }
-  }
-
-  private void _testRegionMetadata(FacesContext context)
-  {
-    RegionMetadata rmd = RegionMetadata.getRegionMetadata(context);
-
-    ComponentMetaData comp = 
-      (ComponentMetaData) rmd.getRegionConfig("org.apache.myfaces.adf.view.test.TestRegion1");
-    assertEquals("/regions/testRegion1.jspx", comp.getJspUIDef());
-    List attrs = comp.getAttributes();
-    assertEquals(2, attrs.size());
-
-    AttributeMetaData attr = (AttributeMetaData) attrs.get(0);
-    assertEquals("stock", attr.getAttrName());
-    assertEquals(Integer.class, attr.getAttrClass());
-    assertTrue(attr.isRequired());
-    assertNull(attr.getDefaultValue());
-
-    attr = (AttributeMetaData) attrs.get(1);
-    assertEquals("desc", attr.getAttrName());
-    assertEquals(String.class, attr.getAttrClass());
-    assertFalse(attr.isRequired());
-    assertEquals("Test", attr.getDefaultValue());
-
-    comp = (ComponentMetaData) rmd.getRegionConfig("org.apache.myfaces.adf.view.test.TestRegion2");
-    assertEquals("/regions/testRegion2.jspx", comp.getJspUIDef());
-    attrs = comp.getAttributes();
-    assertEquals(0, attrs.size());
-
-    comp = (ComponentMetaData) rmd.getRegionConfig("org.apache.myfaces.adf.view.test.TestRegion3");
-    assertEquals("/regions/testRegion3.jspx", comp.getJspUIDef());
-    attrs = comp.getAttributes();
-    assertEquals(0, attrs.size());
-  }
-
-  public static void main(String[] args)
-  {
-    TestRunner.run(RegionMetadataTest.class);
-  }
-
-  static private class RegionClassLoader extends ClassLoader
-  {
-    public RegionClassLoader(
-      ClassLoader parent)
-    {
-      super(parent);
-    }
-    
-    public Enumeration findResources(String name) throws IOException
-    {
-      if (RegionMetadata.__CONFIG_FILE_OTHER == name)
-      {
-        URL url = this.getClass().getResource(_TEST_FILE);
-        assertNotNull("resource does not exist:"+_TEST_FILE, url);
-        URL url2 = this.getClass().getResource(_TEST_FILE2);
-        assertNotNull("resource does not exist:"+_TEST_FILE2, url2);
-        Object[] resources = new Object[] {url, url2};
-        return Collections.enumeration(Arrays.asList(resources));
-      }
-      return super.findResources(name);
-    }
-  }
-
-  private static final String _TEST_FILE = "region-metadata-test.xml";
-  private static final String _TEST_FILE2 = "region-metadata-test2.xml";
-}
+  }
+
+  // test loading the region-metadata from the classpath:
+  public void testParsingRegionMetadataFromClassLoader()
+  {
+    Thread t = Thread.currentThread();
+    ClassLoader loader = t.getContextClassLoader();
+    try
+    {
+      t.setContextClassLoader(new RegionClassLoader(loader));
+  
+  
+      _testRegionMetadata(facesContext);
+  
+    }
+    finally
+    {
+      t.setContextClassLoader(loader);
+    }
+  }
+
+  private void _testRegionMetadata(FacesContext context)
+  {
+    RegionMetadata rmd = RegionMetadata.getRegionMetadata(context);
+
+    ComponentMetaData comp = 
+      (ComponentMetaData) rmd.getRegionConfig("org.apache.myfaces.adf.view.test.TestRegion1");
+    assertEquals("/regions/testRegion1.jspx", comp.getJspUIDef());
+    List attrs = comp.getAttributes();
+    assertEquals(2, attrs.size());
+
+    AttributeMetaData attr = (AttributeMetaData) attrs.get(0);
+    assertEquals("stock", attr.getAttrName());
+    assertEquals(Integer.class, attr.getAttrClass());
+    assertTrue(attr.isRequired());
+    assertNull(attr.getDefaultValue());
+
+    attr = (AttributeMetaData) attrs.get(1);
+    assertEquals("desc", attr.getAttrName());
+    assertEquals(String.class, attr.getAttrClass());
+    assertFalse(attr.isRequired());
+    assertEquals("Test", attr.getDefaultValue());
+
+    comp = (ComponentMetaData) rmd.getRegionConfig("org.apache.myfaces.adf.view.test.TestRegion2");
+    assertEquals("/regions/testRegion2.jspx", comp.getJspUIDef());
+    attrs = comp.getAttributes();
+    assertEquals(0, attrs.size());
+
+    comp = (ComponentMetaData) rmd.getRegionConfig("org.apache.myfaces.adf.view.test.TestRegion3");
+    assertEquals("/regions/testRegion3.jspx", comp.getJspUIDef());
+    attrs = comp.getAttributes();
+    assertEquals(0, attrs.size());
+  }
+
+  public static void main(String[] args)
+  {
+    TestRunner.run(RegionMetadataTest.class);
+  }
+
+  static private class RegionClassLoader extends ClassLoader
+  {
+    public RegionClassLoader(
+      ClassLoader parent)
+    {
+      super(parent);
+    }
+    
+    public Enumeration findResources(String name) throws IOException
+    {
+      if (RegionMetadata.__CONFIG_FILE_OTHER == name)
+      {
+        URL url = this.getClass().getResource(_TEST_FILE);
+        assertNotNull("resource does not exist:"+_TEST_FILE, url);
+        URL url2 = this.getClass().getResource(_TEST_FILE2);
+        assertNotNull("resource does not exist:"+_TEST_FILE2, url2);
+        Object[] resources = new Object[] {url, url2};
+        return Collections.enumeration(Arrays.asList(resources));
+      }
+      return super.findResources(name);
+    }
+  }
+
+  private static final String _TEST_FILE = "region-metadata-test.xml";
+  private static final String _TEST_FILE2 = "region-metadata-test2.xml";
+}

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/BasicHtmlRenderKit.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/BasicHtmlRenderKit.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/BasicHtmlRenderKit.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/BasicHtmlRenderKit.java Mon Jul 24 21:42:41 2006
@@ -13,100 +13,100 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import java.io.OutputStream;
-import java.io.Writer;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UICommand;
-import javax.faces.component.UIGraphic;
-import javax.faces.component.UIInput;
-import javax.faces.component.UIMessage;
-import javax.faces.component.UIMessages;
-import javax.faces.component.UIOutput;
-import javax.faces.component.UIPanel;
-import javax.faces.component.UISelectBoolean;
-import javax.faces.component.UISelectMany;
-import javax.faces.component.UISelectOne;
-
-import javax.faces.context.FacesContext;
-
-import javax.faces.render.Renderer;
-import javax.faces.render.ResponseStateManager;
-import javax.faces.context.ResponseStream;
-import javax.faces.context.ResponseWriter;
-
-public class BasicHtmlRenderKit extends RenderKitBase
-{
-  public BasicHtmlRenderKit()
-  {
+package org.apache.myfaces.adfinternal.renderkit;
+
+import java.io.OutputStream;
+import java.io.Writer;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UICommand;
+import javax.faces.component.UIGraphic;
+import javax.faces.component.UIInput;
+import javax.faces.component.UIMessage;
+import javax.faces.component.UIMessages;
+import javax.faces.component.UIOutput;
+import javax.faces.component.UIPanel;
+import javax.faces.component.UISelectBoolean;
+import javax.faces.component.UISelectMany;
+import javax.faces.component.UISelectOne;
+
+import javax.faces.context.FacesContext;
+
+import javax.faces.render.Renderer;
+import javax.faces.render.ResponseStateManager;
+import javax.faces.context.ResponseStream;
+import javax.faces.context.ResponseWriter;
+
+public class BasicHtmlRenderKit extends RenderKitBase
+{
+  public BasicHtmlRenderKit()
+  {
     /* These are used only for CoreRenderKitPerf
-    addRenderer("javax.faces.Output",
-                "javax.faces.Text",
-                "com.sun.faces.renderkit.html_basic.TextRenderer");
-    addRenderer("javax.faces.Input",
-                "javax.faces.Text",
-                "com.sun.faces.renderkit.html_basic.TextRenderer");
-    addRenderer("javax.faces.Data",
-                "javax.faces.Table",
-                "com.sun.faces.renderkit.html_basic.TableRenderer");
-    addRenderer("javax.faces.SelectOne",
-                "javax.faces.Menu",
-                "com.sun.faces.renderkit.html_basic.MenuRenderer");
-    addRenderer("javax.faces.SelectOne",
-                "javax.faces.Radio",
-                "com.sun.faces.renderkit.html_basic.RadioRenderer");
+    addRenderer("javax.faces.Output",
+                "javax.faces.Text",
+                "com.sun.faces.renderkit.html_basic.TextRenderer");
+    addRenderer("javax.faces.Input",
+                "javax.faces.Text",
+                "com.sun.faces.renderkit.html_basic.TextRenderer");
+    addRenderer("javax.faces.Data",
+                "javax.faces.Table",
+                "com.sun.faces.renderkit.html_basic.TableRenderer");
+    addRenderer("javax.faces.SelectOne",
+                "javax.faces.Menu",
+                "com.sun.faces.renderkit.html_basic.MenuRenderer");
+    addRenderer("javax.faces.SelectOne",
+                "javax.faces.Radio",
+                "com.sun.faces.renderkit.html_basic.RadioRenderer");
     */
-    Renderer n = new Renderer()
-    {
-      public void decode(FacesContext context, UIComponent component)
-      {
-      }
-
-      public void encodeBegin(FacesContext context, UIComponent component)
-      {
-      }
-      public void encodeChildren(FacesContext context, UIComponent component)
-      {
-      }
-      public void encodeEnd(FacesContext context, UIComponent component)
-      {
-      }
-    };
-
-    addRenderer(UICommand.COMPONENT_FAMILY,       "javax.faces.Button", n);
-    addRenderer(UIPanel.COMPONENT_FAMILY,         "javax.faces.Grid", n);
-    addRenderer(UIPanel.COMPONENT_FAMILY,         "javax.faces.Group", n);
-    addRenderer(UIInput.COMPONENT_FAMILY,         "javax.faces.Hidden", n);
-    addRenderer(UIInput.COMPONENT_FAMILY,         "javax.faces.Secret", n);
-    addRenderer(UIInput.COMPONENT_FAMILY,         "javax.faces.Textarea", n);
-    addRenderer(UIGraphic.COMPONENT_FAMILY,       "javax.faces.Image", n);
-    addRenderer(UIMessage.COMPONENT_FAMILY,       "javax.faces.Message", n);
-    addRenderer(UIMessages.COMPONENT_FAMILY,      "javax.faces.Messages", n);
-    addRenderer(UIOutput.COMPONENT_FAMILY ,       "javax.faces.Format", n);
-    addRenderer(UIOutput.COMPONENT_FAMILY ,       "javax.faces.Label", n);
-    addRenderer(UIOutput.COMPONENT_FAMILY ,       "javax.faces.Link", n);
-    addRenderer(UISelectBoolean.COMPONENT_FAMILY, "javax.faces.Checkbox", n);
-    addRenderer(UISelectOne.COMPONENT_FAMILY,     "javax.faces.Listbox", n);
-    addRenderer(UISelectMany.COMPONENT_FAMILY,    "javax.faces.Listbox", n);
-    addRenderer(UISelectMany.COMPONENT_FAMILY,    "javax.faces.Menu", n);
-    addRenderer(UISelectMany.COMPONENT_FAMILY,    "javax.faces.Checkbox", n);
-
-  }
-
-  public ResponseStateManager getResponseStateManager()
-  {
-    return null;
-  }
-
-  public ResponseStream createResponseStream(OutputStream out)
-  {
-    return null;
-  }
-
-  public ResponseWriter createResponseWriter(Writer out, String contentType, String encoding)
-  {
-    return null;
-  }
-}
+    Renderer n = new Renderer()
+    {
+      public void decode(FacesContext context, UIComponent component)
+      {
+      }
+
+      public void encodeBegin(FacesContext context, UIComponent component)
+      {
+      }
+      public void encodeChildren(FacesContext context, UIComponent component)
+      {
+      }
+      public void encodeEnd(FacesContext context, UIComponent component)
+      {
+      }
+    };
+
+    addRenderer(UICommand.COMPONENT_FAMILY,       "javax.faces.Button", n);
+    addRenderer(UIPanel.COMPONENT_FAMILY,         "javax.faces.Grid", n);
+    addRenderer(UIPanel.COMPONENT_FAMILY,         "javax.faces.Group", n);
+    addRenderer(UIInput.COMPONENT_FAMILY,         "javax.faces.Hidden", n);
+    addRenderer(UIInput.COMPONENT_FAMILY,         "javax.faces.Secret", n);
+    addRenderer(UIInput.COMPONENT_FAMILY,         "javax.faces.Textarea", n);
+    addRenderer(UIGraphic.COMPONENT_FAMILY,       "javax.faces.Image", n);
+    addRenderer(UIMessage.COMPONENT_FAMILY,       "javax.faces.Message", n);
+    addRenderer(UIMessages.COMPONENT_FAMILY,      "javax.faces.Messages", n);
+    addRenderer(UIOutput.COMPONENT_FAMILY ,       "javax.faces.Format", n);
+    addRenderer(UIOutput.COMPONENT_FAMILY ,       "javax.faces.Label", n);
+    addRenderer(UIOutput.COMPONENT_FAMILY ,       "javax.faces.Link", n);
+    addRenderer(UISelectBoolean.COMPONENT_FAMILY, "javax.faces.Checkbox", n);
+    addRenderer(UISelectOne.COMPONENT_FAMILY,     "javax.faces.Listbox", n);
+    addRenderer(UISelectMany.COMPONENT_FAMILY,    "javax.faces.Listbox", n);
+    addRenderer(UISelectMany.COMPONENT_FAMILY,    "javax.faces.Menu", n);
+    addRenderer(UISelectMany.COMPONENT_FAMILY,    "javax.faces.Checkbox", n);
+
+  }
+
+  public ResponseStateManager getResponseStateManager()
+  {
+    return null;
+  }
+
+  public ResponseStream createResponseStream(OutputStream out)
+  {
+    return null;
+  }
+
+  public ResponseWriter createResponseWriter(Writer out, String contentType, String encoding)
+  {
+    return null;
+  }
+}

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



Mime
View raw message