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 [12/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/TestScript.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/TestScript.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/TestScript.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/TestScript.java Mon Jul 24 21:42:41 2006
@@ -13,318 +13,318 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import java.io.StringWriter;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.myfaces.adf.component.UIXCollection;
-import org.apache.myfaces.adf.model.SortCriterion;
-import org.apache.myfaces.adfinternal.ui.UIConstants;
-
-import org.apache.myfaces.adf.context.Agent;
-
-public class TestScript
-{
-  public TestScript()
-  {
-    _agentTypes.add(Agent.TYPE_DESKTOP);
-    _agentTypes.add(Agent.TYPE_PDA);
-  }
-
-  public boolean isSupportedAgentType(Object agentType)
-  {
-    return _agentTypes.contains(agentType);
-  }
-
-  public void removeAgentType(Object agentType)
-  {
-    _agentTypes.remove(agentType);
-  }
-
-  public void setDefinition(ComponentDefinition cd)
-  {
-    _definition = cd;
-    if (cd.getAttributes().get("id") == null)
-      cd.getAttributes().put("id", "mainId");
-  }
-
-  public ComponentDefinition getDefinition()
-  {
-    return _definition;
-  }
-
-  public List getTests()
-  {
-    return _tests;
-  }
-
-  static abstract public class Test
-  {
-    abstract public void apply(FacesContext context, UIComponent component);
-    abstract public boolean shouldMatchBase();
-    public StringWriter getOutput()
-    {
-      return _output;
-    }
-
-    private StringWriter _output = new StringWriter();
-  }
-
-  
-  static public class MessageTest extends Test
-  {
-    public MessageTest(String severity, String summary, String detail,
-                       String clientId)
-    {
-      FacesMessage.Severity sev = FacesMessage.SEVERITY_INFO;
-
-      if (severity != null)
-      {
-        if ("ERROR".equals(severity))
-          sev = FacesMessage.SEVERITY_ERROR;
-        else if ("WARN".equals(severity) || "WARNING".equals(severity))
-          sev = FacesMessage.SEVERITY_WARN;
-        else if ("FATAL".equals(severity))
-          sev = FacesMessage.SEVERITY_FATAL;
-      }
-      
-      _messages.put(clientId, new FacesMessage(sev, summary, detail));
-    }
-
-    public void apply(FacesContext context, UIComponent component)
-    {
-      // first, cleanup any messages left over from a previous test
-      // ((MFacesContext) context).clearMessages();
-
-      // Add any messages needed to run this suite of tests
-      Iterator messageIds = _messages.keySet().iterator();
-      while (messageIds.hasNext())
-      {
-        String id = (String) messageIds.next();
-        FacesMessage fm = (FacesMessage) _messages.get(id);
-        context.addMessage(id, fm);
-      }
-    }
-
-    public boolean shouldMatchBase()
-    {
-      return true;
-    }
-
-    public String toString()
-    {
-      StringBuffer sb = new StringBuffer(100);
-      sb.append(" MessageTest[ ");
-
-      boolean gotFirst = false;
-      Iterator messageIds = _messages.keySet().iterator();
-      while (messageIds.hasNext())
-      {
-        String id = (String) messageIds.next();
-        FacesMessage fm = (FacesMessage) _messages.get(id);
-
+package org.apache.myfaces.adfinternal.renderkit;
+
+import java.io.StringWriter;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.myfaces.adf.component.UIXCollection;
+import org.apache.myfaces.adf.model.SortCriterion;
+import org.apache.myfaces.adfinternal.ui.UIConstants;
+
+import org.apache.myfaces.adf.context.Agent;
+
+public class TestScript
+{
+  public TestScript()
+  {
+    _agentTypes.add(Agent.TYPE_DESKTOP);
+    _agentTypes.add(Agent.TYPE_PDA);
+  }
+
+  public boolean isSupportedAgentType(Object agentType)
+  {
+    return _agentTypes.contains(agentType);
+  }
+
+  public void removeAgentType(Object agentType)
+  {
+    _agentTypes.remove(agentType);
+  }
+
+  public void setDefinition(ComponentDefinition cd)
+  {
+    _definition = cd;
+    if (cd.getAttributes().get("id") == null)
+      cd.getAttributes().put("id", "mainId");
+  }
+
+  public ComponentDefinition getDefinition()
+  {
+    return _definition;
+  }
+
+  public List getTests()
+  {
+    return _tests;
+  }
+
+  static abstract public class Test
+  {
+    abstract public void apply(FacesContext context, UIComponent component);
+    abstract public boolean shouldMatchBase();
+    public StringWriter getOutput()
+    {
+      return _output;
+    }
+
+    private StringWriter _output = new StringWriter();
+  }
+
+  
+  static public class MessageTest extends Test
+  {
+    public MessageTest(String severity, String summary, String detail,
+                       String clientId)
+    {
+      FacesMessage.Severity sev = FacesMessage.SEVERITY_INFO;
+
+      if (severity != null)
+      {
+        if ("ERROR".equals(severity))
+          sev = FacesMessage.SEVERITY_ERROR;
+        else if ("WARN".equals(severity) || "WARNING".equals(severity))
+          sev = FacesMessage.SEVERITY_WARN;
+        else if ("FATAL".equals(severity))
+          sev = FacesMessage.SEVERITY_FATAL;
+      }
+      
+      _messages.put(clientId, new FacesMessage(sev, summary, detail));
+    }
+
+    public void apply(FacesContext context, UIComponent component)
+    {
+      // first, cleanup any messages left over from a previous test
+      // ((MFacesContext) context).clearMessages();
+
+      // Add any messages needed to run this suite of tests
+      Iterator messageIds = _messages.keySet().iterator();
+      while (messageIds.hasNext())
+      {
+        String id = (String) messageIds.next();
+        FacesMessage fm = (FacesMessage) _messages.get(id);
+        context.addMessage(id, fm);
+      }
+    }
+
+    public boolean shouldMatchBase()
+    {
+      return true;
+    }
+
+    public String toString()
+    {
+      StringBuffer sb = new StringBuffer(100);
+      sb.append(" MessageTest[ ");
+
+      boolean gotFirst = false;
+      Iterator messageIds = _messages.keySet().iterator();
+      while (messageIds.hasNext())
+      {
+        String id = (String) messageIds.next();
+        FacesMessage fm = (FacesMessage) _messages.get(id);
+
         // Severity toString() implementation is different in the
         // RI and MyFaces;  in the RI it's "name ordinal",
         // and in MyFaces it's just "name".  And in the RI,
         // the names are uppercase, whereas they're mixed case
         // in MyFaces.
-        String sevStr = fm.getSeverity().toString().toUpperCase();
-        int space = sevStr.indexOf(" ");
-        if (!gotFirst)
-          gotFirst = true;
-        else
-          sb.append(", ");
-        sb.append("id:" + id + ",");
+        String sevStr = fm.getSeverity().toString().toUpperCase();
+        int space = sevStr.indexOf(" ");
+        if (!gotFirst)
+          gotFirst = true;
+        else
+          sb.append(", ");
+        sb.append("id:" + id + ",");
         if (space < 0)
           sb.append(sevStr);
         else
-          sb.append(sevStr.substring(0,space));
-      }
-
-      sb.append(" ]");
-      return sb.toString();
-    }
-
-    private Map _messages = new LinkedHashMap();
-  }
-
-  static public class AttributeTest extends Test
-  {
-    public AttributeTest(String name, Object value, boolean matchesBase)
-    {
-      this(name, value, matchesBase, null, null);
-    }
-    
-    public AttributeTest(String name, 
-                        Object value, 
-                        boolean matchesBase, 
-                        Test    delegateTest)
-    {
-      this(name, value, matchesBase, delegateTest, null);
-    }
-
-    public AttributeTest(String name,
-                         Object value,
-                         boolean matchesBase,
-                         Test    delegateTest,
-                         String  componentId)
-    {
-      _name = name;
-      _value = value;
-      _testComponentId = componentId;
-      
-      if (delegateTest != null)
-      {
-        matchesBase = (matchesBase && delegateTest.shouldMatchBase());
-        addDelegate(delegateTest);
-      }
-
-      _matchesBase = matchesBase;
-    }
-
-    public void addDelegate(Test delegateTest)
-    {
-      _delegateTests.add(delegateTest);
-    }
-
-    public void apply(FacesContext context, UIComponent component)
-    {
-      Iterator tests = _delegateTests.iterator();
-      
-      if (_testComponentId != null)
-        component = component.findComponent(_testComponentId); 
-      
-      while (tests.hasNext())
-      {
-        Test test = (Test) tests.next();
-        test.apply(context, component);
-      }
-      
-      Object value = _value;
-      
-         
-      // Hack to test table sort. This is a custom attribute not renderer or component attribute
-      if ("tableSortCriteria".equals(_name))
-      {
-        UIXCollection tableModel = (UIXCollection)  component;
-        List sortCriteriaList = new ArrayList();
-        String sortCriterion = (String) _value;
-        Boolean isAscending  = 
-           new Boolean(sortCriterion.substring(sortCriterion.indexOf(" ")).trim());
-        sortCriteriaList.add(new SortCriterion(
-              sortCriterion.substring(0,sortCriterion.indexOf(" ")), 
-              isAscending.booleanValue()));
-        tableModel.setSortCriteria(sortCriteriaList);
-      }
-      else
-      {      
-      if ((value instanceof String) &&
-          ComponentDefinition.isValueExpression(value.toString()))
-      {
-        ValueBinding binding = context.getApplication().
-          createValueBinding(value.toString());
-        component.setValueBinding(_name, binding);
-      }
-      else
-      {
-        if (value == null)
-          value = "test-" + _name;
-
-        component.getAttributes().put(_name, value);
-      }
-      }
-    }
-
-    public boolean shouldMatchBase()
-    {
-      return _matchesBase;
-    }
-    
-    public String getName()
-    {
-      return _name;
-    }
-    
-    public Object getValue()
-    {
-      return _value;
-    }
-    
-    public String toString()
-    {
-      String valStr;
-      if (_value instanceof Object[])
-      {
-        boolean gotFirst = false;
-        StringBuffer sb = new StringBuffer(1000);
-        sb.append("[");
-        for (int i = 0; i < ((Object[])_value).length; i++)
-        {
-          Object curr = ((Object[])_value)[i];
-
-          if (gotFirst)
-          {
-            sb.append(",");
-          }
-          else
-          {
-            gotFirst = true;
-          }
-          sb.append(curr);
-        }
-        sb.append("]");
-        valStr = sb.toString();
-      }
-      else if (_value != null)
-      {
-        valStr = _value.toString();
-      }
-      else
-        valStr = "null";
-
-
-      if (_delegateTests.isEmpty())
-      {
-        return "AttributeTest[" + _name + "," + valStr + "]";
-      }
-      else
-      {
-        StringBuffer buffer = new StringBuffer();
-        buffer.append("AttributeTest[" + _name + "," + valStr);
-        Iterator tests = _delegateTests.iterator();
-        while (tests.hasNext())
-        {
-          buffer.append(',');
-          buffer.append(tests.next());
-        }
-
-        buffer.append("]");
-        return buffer.toString();
-      }
-    }
-
-    private String _name;
-    private Object _value;
-    private String _testComponentId;
-    private boolean _matchesBase;
-    private List    _delegateTests = new ArrayList();
-  }
-
-  private Set  _agentTypes = new HashSet();
-  private List _tests = new ArrayList();
-  private ComponentDefinition _definition;
-  
-}
+          sb.append(sevStr.substring(0,space));
+      }
+
+      sb.append(" ]");
+      return sb.toString();
+    }
+
+    private Map _messages = new LinkedHashMap();
+  }
+
+  static public class AttributeTest extends Test
+  {
+    public AttributeTest(String name, Object value, boolean matchesBase)
+    {
+      this(name, value, matchesBase, null, null);
+    }
+    
+    public AttributeTest(String name, 
+                        Object value, 
+                        boolean matchesBase, 
+                        Test    delegateTest)
+    {
+      this(name, value, matchesBase, delegateTest, null);
+    }
+
+    public AttributeTest(String name,
+                         Object value,
+                         boolean matchesBase,
+                         Test    delegateTest,
+                         String  componentId)
+    {
+      _name = name;
+      _value = value;
+      _testComponentId = componentId;
+      
+      if (delegateTest != null)
+      {
+        matchesBase = (matchesBase && delegateTest.shouldMatchBase());
+        addDelegate(delegateTest);
+      }
+
+      _matchesBase = matchesBase;
+    }
+
+    public void addDelegate(Test delegateTest)
+    {
+      _delegateTests.add(delegateTest);
+    }
+
+    public void apply(FacesContext context, UIComponent component)
+    {
+      Iterator tests = _delegateTests.iterator();
+      
+      if (_testComponentId != null)
+        component = component.findComponent(_testComponentId); 
+      
+      while (tests.hasNext())
+      {
+        Test test = (Test) tests.next();
+        test.apply(context, component);
+      }
+      
+      Object value = _value;
+      
+         
+      // Hack to test table sort. This is a custom attribute not renderer or component attribute
+      if ("tableSortCriteria".equals(_name))
+      {
+        UIXCollection tableModel = (UIXCollection)  component;
+        List sortCriteriaList = new ArrayList();
+        String sortCriterion = (String) _value;
+        Boolean isAscending  = 
+           new Boolean(sortCriterion.substring(sortCriterion.indexOf(" ")).trim());
+        sortCriteriaList.add(new SortCriterion(
+              sortCriterion.substring(0,sortCriterion.indexOf(" ")), 
+              isAscending.booleanValue()));
+        tableModel.setSortCriteria(sortCriteriaList);
+      }
+      else
+      {      
+      if ((value instanceof String) &&
+          ComponentDefinition.isValueExpression(value.toString()))
+      {
+        ValueBinding binding = context.getApplication().
+          createValueBinding(value.toString());
+        component.setValueBinding(_name, binding);
+      }
+      else
+      {
+        if (value == null)
+          value = "test-" + _name;
+
+        component.getAttributes().put(_name, value);
+      }
+      }
+    }
+
+    public boolean shouldMatchBase()
+    {
+      return _matchesBase;
+    }
+    
+    public String getName()
+    {
+      return _name;
+    }
+    
+    public Object getValue()
+    {
+      return _value;
+    }
+    
+    public String toString()
+    {
+      String valStr;
+      if (_value instanceof Object[])
+      {
+        boolean gotFirst = false;
+        StringBuffer sb = new StringBuffer(1000);
+        sb.append("[");
+        for (int i = 0; i < ((Object[])_value).length; i++)
+        {
+          Object curr = ((Object[])_value)[i];
+
+          if (gotFirst)
+          {
+            sb.append(",");
+          }
+          else
+          {
+            gotFirst = true;
+          }
+          sb.append(curr);
+        }
+        sb.append("]");
+        valStr = sb.toString();
+      }
+      else if (_value != null)
+      {
+        valStr = _value.toString();
+      }
+      else
+        valStr = "null";
+
+
+      if (_delegateTests.isEmpty())
+      {
+        return "AttributeTest[" + _name + "," + valStr + "]";
+      }
+      else
+      {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("AttributeTest[" + _name + "," + valStr);
+        Iterator tests = _delegateTests.iterator();
+        while (tests.hasNext())
+        {
+          buffer.append(',');
+          buffer.append(tests.next());
+        }
+
+        buffer.append("]");
+        return buffer.toString();
+      }
+    }
+
+    private String _name;
+    private Object _value;
+    private String _testComponentId;
+    private boolean _matchesBase;
+    private List    _delegateTests = new ArrayList();
+  }
+
+  private Set  _agentTypes = new HashSet();
+  private List _tests = new ArrayList();
+  private ComponentDefinition _definition;
+  
+}

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/TestScriptParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/TestScriptParser.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/TestScriptParser.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/TestScriptParser.java Mon Jul 24 21:42:41 2006
@@ -13,601 +13,601 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.apache.myfaces.adfinternal.share.expl.Coercions;
-import org.apache.myfaces.adfinternal.share.xml.BaseNodeParser;
-import org.apache.myfaces.adfinternal.share.xml.NodeParser;
-import org.apache.myfaces.adfinternal.share.xml.ParseContext;
-import org.apache.myfaces.adfinternal.share.xml.TreeBuilder;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-class TestScriptParser extends BaseNodeParser
-{
-  static public TestScript getTestScript(File file, FacesConfigInfo info)
-    throws IOException, SAXException
-  {
-    TestScript script = new TestScript();
-    TreeBuilder builder = new TreeBuilder();
-    InputStream inputStream = new FileInputStream(file);
-
-    try
-    {
-      InputSource source = new InputSource(inputStream);
-      source.setSystemId(file.getAbsolutePath());
-      builder.parse(source, new TestScriptParser(script, info));
-    }
-    finally
-    {
-      inputStream.close();
-    }
-
-    return script;
-  }
-
-  static public final String NAMESPACE = "http://myfaces.apache.org/adf/view/faces";
-
-  public TestScriptParser(TestScript script, FacesConfigInfo info)
-  {
-    _script = script;
-    _info   = info;
-  }
-
-  public void startElement(
-    ParseContext context,
-    String       namespaceURI,
-    String       localName,
-    Attributes   attrs) throws SAXParseException
-  {
-    String agentNotSupported = attrs.getValue("agentNotSupported");
-    if (agentNotSupported != null)
-    {
-      StringTokenizer tokens = new StringTokenizer(agentNotSupported);
-      while (tokens.hasMoreTokens())
-      {
-        _script.removeAgentType(tokens.nextToken());
-      }
-    }
-  }
-
-  public NodeParser createTestParser(
-    FacesConfigInfo.ComponentInfo componentInfo,
-    String                        localName,
-    String componentId )
-  {
-    if ("attribute-test".equals(localName))
-      return new AttributeTestParser(componentInfo, componentId);
-    if ("enum-test".equals(localName))
-      return new EnumTestParser(componentInfo);
-    if ("boolean-test".equals(localName))
-      return new BooleanTestParser(componentInfo);
-    if ("js-test".equals(localName))
-      return new JavascriptTestParser(componentInfo);
-    if ("message".equals(localName))
-      return new MessageParser(componentInfo);
-    return null;
-  }
-
-  public NodeParser startChildElement(
-    ParseContext context,
-    String       namespaceURI,
-    String       localName,
-    Attributes   attrs) throws SAXParseException
-  {
-    if ("base-component".equals(localName))
-      return new ComponentDefinitionParser(_info);
-
-    return createTestParser(_componentInfo, localName, null);
-  }
-
-  public void addCompletedChild(
-    ParseContext context,
-    String       namespaceURI,
-    String       localName,
-    Object       child) throws SAXParseException
-  {
-    if (child instanceof TestScript.Test)
-    {
-      _script.getTests().add(child);
-    }
-    else if (child instanceof List)
-    {
-      Iterator iter = ((List) child).iterator();
-      while (iter.hasNext())
-      {
-        _script.getTests().add(iter.next());
-      }
-    }
-    else if (child instanceof ComponentDefinition)
-    {
-      ComponentDefinition definition = (ComponentDefinition) child;
-      _componentInfo = definition.getComponentInfo();
-      _script.setDefinition((ComponentDefinition) child);
-    }
-  }
-
-
-  private class ComponentDefinitionParser extends BaseNodeParser
-  {
-    public ComponentDefinitionParser(FacesConfigInfo info)
-    {
-      this(null, info);
-    }
-
-    public ComponentDefinitionParser(
-       ComponentDefinition parent, FacesConfigInfo info)
-    {
-      _parent = parent;
-      _info   = info;
-    }
-
-
-    public void startElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Attributes   attrs) throws SAXParseException
-    {
-      _type = attrs.getValue(NAMESPACE, "type");
-      if (_type == null)
-        logError(context, "af:type attribute not on component", null);
-      String facet = attrs.getValue(NAMESPACE, "facet");
-      _definition = new ComponentDefinition(_type, _info);
-      for (int i = 0; i < attrs.getLength(); i++)
-      {
-        if ("".equals(attrs.getURI(i)))
-        {
-          String name = attrs.getLocalName(i);
-          String valueStr = attrs.getValue(i);
-          _definition.getAttributes().put(name, valueStr);
-        }
-      }
-
-      if (_parent != null)
-      {
-        if (facet != null)
-          _parent.getFacets().put(facet, _definition);
-        else
-          _parent.getChildren().add(_definition);
-      }
-
-      _definition.setUsesUpload(
-         "true".equals(attrs.getValue(NAMESPACE, "usesUpload")));
-    }
-
-    public NodeParser startChildElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Attributes   attrs) throws SAXParseException
-    {
-      if ("component".equals(localName))
-      {
-        return new ComponentDefinitionParser(_definition, _info);
-      }
-      int i=0;
-
-      String id = (String) _definition.getAttributes().get("id");
-      
-      if (id == null)
-       {
-         logError(context,
-                 "The id attribute has not been set for the component \"" + _info.getComponentInfo(_type).componentType +"\"",
-                 null);
-      return null;
-    }
-      else
-       {
-          return createTestParser(_info.getComponentInfo(_type), localName, id);
-       }
-    }
-
-    public void addCompletedChild(
-    ParseContext context,
-    String       namespaceURI,
-    String       localName,
-    Object       child) throws SAXParseException
-  {
-    if (child instanceof TestScript.Test)
-    {
-      _script.getTests().add(child);
-    }
-  }
-
-
-    public Object endElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName) throws SAXParseException
-    {
-      return _definition;
-    }
-
-    private ComponentDefinition _definition;
-    private ComponentDefinition _parent;
-    private FacesConfigInfo     _info;
-    private String              _type;
-  }
-
-
-  private class AttributeTestParser extends BaseNodeParser
-  {
-    public AttributeTestParser(FacesConfigInfo.ComponentInfo componentInfo, String componentId)
-    {
-      _componentInfo = componentInfo;
-      _componentId = componentId;
-    }
-
-    public void startElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Attributes   attrs) throws SAXParseException
-    {
-      boolean matchesBase = "true".equals(attrs.getValue("matchesBase"));
-
-      String name = getRequiredAttribute(context, attrs, "name");
-      String valueStr = attrs.getValue("value");
-
-      FacesConfigInfo.PropertyInfo property = _componentInfo.getPropertyInfo(name);
-      final Object value;
-      if (!ComponentDefinition.isValueExpression(valueStr) &&
-          (property != null) && (property.type != null))
-        value = Coercions.coerce(null, valueStr, property.type);
-      else
-        value = valueStr;
-
-      _test = new TestScript.AttributeTest(name,
-                                           value,
-                                           matchesBase,
-                                           null, 
-                                           _componentId);
-    }
-
-    public NodeParser startChildElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Attributes   attrs) throws SAXParseException
-    {
-      if ("attribute-test".equals(localName))
-        return new AttributeTestParser(_componentInfo, _componentId);
-      return null;
-    }
-
-    public void addCompletedChild(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Object       child) throws SAXParseException
-    {
-      if (child instanceof TestScript.Test)
-      {
-        _test.addDelegate((TestScript.Test) child);
-      }
-    }
-
-    public Object endElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName) throws SAXParseException
-    {
-      return _test;
-    }
-
-    private TestScript.AttributeTest        _test;
-    private FacesConfigInfo.ComponentInfo   _componentInfo;
-    private String  _componentId;
-  }
-
-
-  private class EnumTestParser extends BaseNodeParser
-  {
-    public EnumTestParser(FacesConfigInfo.ComponentInfo info)
-    {
-      _componentInfo = info;
-    }
-
-
-    public void startElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Attributes   attrs) throws SAXParseException
-    {
-      _name = attrs.getValue("name");
-      _propertyInfo = _componentInfo.getPropertyInfo(_name);
-      if (_propertyInfo == null)
-        logError(context,
-                 "Couldn't find property info for \"" + _name +"\"",
-                 null);
-      else if (_propertyInfo.enumValues == null)
-        logError(context,
-                 "Property \"" + _name +"\" is not an enumeration",
-                 null);
-
-      _defaultValue = attrs.getValue("default");
-      if (_defaultValue == null)
-      {
-        _defaultValue = _propertyInfo.defaultValue;
-        /* No default presumably means that null is legit, and that
-           none of the values should "match base"
-        if (defaultValue == null)
-          logError(context, "Property \"" + _name + "\" does not have a " +
-            "default value",
-            null);
-        */
-      }
-    }
-
-    public NodeParser startChildElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Attributes   attrs) throws SAXParseException
-    {
-      return createTestParser(_componentInfo, localName, null);
-    }
-
-    public void addCompletedChild(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Object       child) throws SAXParseException
-    {
-      if (child instanceof TestScript.Test)
-      {
-        _childTests.add(child);
-      }
-      else if (child instanceof List)
-      {
-        _childTests.addAll((List) child);
-      }
-    }
-
-    public Object endElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName) throws SAXParseException
-    {
-      ArrayList allTests = new ArrayList();
-
-      Iterator values = _propertyInfo.enumValues.iterator();
-      while (values.hasNext())
-      {
-        Object value = values.next();
-        boolean isDefault = value.equals(_defaultValue);
-        allTests.add(new TestScript.AttributeTest(_name,
-                                                  value,
-                                                  isDefault));
-        Iterator childTests = _childTests.iterator();
-        while (childTests.hasNext())
-        {
-          TestScript.Test childTest = (TestScript.Test) childTests.next();
-          allTests.add(new TestScript.AttributeTest(_name,
-                                                    value,
-                                                    isDefault,
-                                                    childTest));
-        }
-      }
-
-      return allTests;
-    }
-
-    private FacesConfigInfo.ComponentInfo   _componentInfo;
-    private FacesConfigInfo.PropertyInfo    _propertyInfo;
-    private String _name;
-    private Object _defaultValue;
-    private List _childTests = new ArrayList();
-  }
-
-  private class JavascriptTestParser extends BaseNodeParser
-  {
-    public JavascriptTestParser(FacesConfigInfo.ComponentInfo info)
-    {
-      _componentInfo = info;
-    }
-
-
-    public void startElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Attributes   attrs) throws SAXParseException
-    {
-      Iterator properties = _componentInfo.properties.keySet().iterator();
-      while (properties.hasNext())
-      {
-        String name = (String) properties.next();
-        if (name.startsWith("on"))
-        {
-          _tests.add(new TestScript.AttributeTest(name, null, false));
-        }
-      }
-    }
-
-    public Object endElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName) throws SAXParseException
-    {
-      return _tests;
-    }
-
-    private FacesConfigInfo.ComponentInfo   _componentInfo;
-    private List _tests = new ArrayList();
-  }
-
-  private class BooleanTestParser extends BaseNodeParser
-  {
-    public BooleanTestParser(FacesConfigInfo.ComponentInfo info)
-    {
-      _componentInfo = info;
-    }
-
-
-    public void startElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Attributes   attrs) throws SAXParseException
-    {
-      _name = attrs.getValue("name");
-      FacesConfigInfo.PropertyInfo property = _componentInfo.getPropertyInfo(_name);
-      if (property == null)
-        logError(context,
-                 "Couldn't find property info for \"" + _name +"\"",
-                 null);
-      else if (property.type != Boolean.TYPE)
-        logError(context,
-                 "Property \"" + _name +"\" is not a boolean type",
-                 null);
-
-      String defaultStr = attrs.getValue("default");
-      if (defaultStr != null)
-      {
-        _defaultValue = "true".equals(defaultStr);
-      }
-      else
-      {
-        _defaultValue = Boolean.TRUE.equals(property.defaultValue);
-      }
-
-      // For some reason, people keep thinking that "matchesBase" is on
-      //
-      String matchesBase = attrs.getValue("matchesBase");
-      if (matchesBase != null)
-        logError(context,
-                 "\"matchesBase\" is not an attribute of &lt;boolean-test&gt;",
-                 null);
-
-    }
-
-    public NodeParser startChildElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Attributes   attrs) throws SAXParseException
-    {
-      return createTestParser(_componentInfo, localName, null);
-    }
-
-    public void addCompletedChild(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Object       child) throws SAXParseException
-    {
-      if (child instanceof TestScript.Test)
-      {
-        _childTests.add(child);
-      }
-      else if (child instanceof List)
-      {
-        _childTests.addAll((List) child);
-      }
-    }
-
-
-    public Object endElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName) throws SAXParseException
-    {
-      _addTests(false);
-      _addTests(true);
-      return _tests;
-    }
-
-    private void _addTests(boolean value)
-    {
-      boolean matchesBase = (value == _defaultValue);
-      Boolean valueObj    = value ? Boolean.TRUE : Boolean.FALSE;
-      _tests.add(new TestScript.AttributeTest(_name, valueObj, matchesBase));
-      Iterator iter = _childTests.iterator();
-      while (iter.hasNext())
-      {
-        TestScript.Test test = (TestScript.Test) iter.next();
-        // Don't bother testing and re-testing that an attribute
-        // matches the base in all sorts of combos;  keep it simple!
-        if (matchesBase)
-          _tests.add(test);
-        else
-          _tests.add(new TestScript.AttributeTest(_name,
-                                                  valueObj,
-                                                  false,
-                                                  test));
-      }
-    }
-
-    private String _name;
-    private boolean _defaultValue;
-    private FacesConfigInfo.ComponentInfo   _componentInfo;
-    private List _tests = new ArrayList();
-    private List _childTests = new ArrayList();
-  }
-
-  private class MessageParser extends BaseNodeParser
-  {
-    public MessageParser(FacesConfigInfo.ComponentInfo info)
-    {
-      _componentInfo = info;
-    }
-
-    public void startElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName,
-      Attributes   attrs) throws SAXParseException
-    {
-      String summary = attrs.getValue("summary");
-      String detail = attrs.getValue("detail");
-      String clientId = attrs.getValue("clientId");
-
-        // If a summary or detail is set, add a message
-        String severity = attrs.getValue("severity");
-        if (severity == null)
-          severity = "INFO";
-        else
-          severity = severity.toUpperCase();
-
-        if (summary == null)
-          summary = severity + " message summary";
-        if (detail == null)
-          detail = severity + " message detail";
-
-      _test = new TestScript.MessageTest(severity, summary, detail,
-                                         clientId);
-      }
-
-
-    public Object endElement(
-      ParseContext context,
-      String       namespaceURI,
-      String       localName) throws SAXParseException
-    {
-      return _test;
-    }
-
-    private FacesConfigInfo.ComponentInfo   _componentInfo;
-    private TestScript.Test _test;
-  }
-
-  private FacesConfigInfo _info;
-  private TestScript      _script;
-  private FacesConfigInfo.ComponentInfo   _componentInfo;
-}
+package org.apache.myfaces.adfinternal.renderkit;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.apache.myfaces.adfinternal.share.expl.Coercions;
+import org.apache.myfaces.adfinternal.share.xml.BaseNodeParser;
+import org.apache.myfaces.adfinternal.share.xml.NodeParser;
+import org.apache.myfaces.adfinternal.share.xml.ParseContext;
+import org.apache.myfaces.adfinternal.share.xml.TreeBuilder;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+class TestScriptParser extends BaseNodeParser
+{
+  static public TestScript getTestScript(File file, FacesConfigInfo info)
+    throws IOException, SAXException
+  {
+    TestScript script = new TestScript();
+    TreeBuilder builder = new TreeBuilder();
+    InputStream inputStream = new FileInputStream(file);
+
+    try
+    {
+      InputSource source = new InputSource(inputStream);
+      source.setSystemId(file.getAbsolutePath());
+      builder.parse(source, new TestScriptParser(script, info));
+    }
+    finally
+    {
+      inputStream.close();
+    }
+
+    return script;
+  }
+
+  static public final String NAMESPACE = "http://myfaces.apache.org/adf/view/faces";
+
+  public TestScriptParser(TestScript script, FacesConfigInfo info)
+  {
+    _script = script;
+    _info   = info;
+  }
+
+  public void startElement(
+    ParseContext context,
+    String       namespaceURI,
+    String       localName,
+    Attributes   attrs) throws SAXParseException
+  {
+    String agentNotSupported = attrs.getValue("agentNotSupported");
+    if (agentNotSupported != null)
+    {
+      StringTokenizer tokens = new StringTokenizer(agentNotSupported);
+      while (tokens.hasMoreTokens())
+      {
+        _script.removeAgentType(tokens.nextToken());
+      }
+    }
+  }
+
+  public NodeParser createTestParser(
+    FacesConfigInfo.ComponentInfo componentInfo,
+    String                        localName,
+    String componentId )
+  {
+    if ("attribute-test".equals(localName))
+      return new AttributeTestParser(componentInfo, componentId);
+    if ("enum-test".equals(localName))
+      return new EnumTestParser(componentInfo);
+    if ("boolean-test".equals(localName))
+      return new BooleanTestParser(componentInfo);
+    if ("js-test".equals(localName))
+      return new JavascriptTestParser(componentInfo);
+    if ("message".equals(localName))
+      return new MessageParser(componentInfo);
+    return null;
+  }
+
+  public NodeParser startChildElement(
+    ParseContext context,
+    String       namespaceURI,
+    String       localName,
+    Attributes   attrs) throws SAXParseException
+  {
+    if ("base-component".equals(localName))
+      return new ComponentDefinitionParser(_info);
+
+    return createTestParser(_componentInfo, localName, null);
+  }
+
+  public void addCompletedChild(
+    ParseContext context,
+    String       namespaceURI,
+    String       localName,
+    Object       child) throws SAXParseException
+  {
+    if (child instanceof TestScript.Test)
+    {
+      _script.getTests().add(child);
+    }
+    else if (child instanceof List)
+    {
+      Iterator iter = ((List) child).iterator();
+      while (iter.hasNext())
+      {
+        _script.getTests().add(iter.next());
+      }
+    }
+    else if (child instanceof ComponentDefinition)
+    {
+      ComponentDefinition definition = (ComponentDefinition) child;
+      _componentInfo = definition.getComponentInfo();
+      _script.setDefinition((ComponentDefinition) child);
+    }
+  }
+
+
+  private class ComponentDefinitionParser extends BaseNodeParser
+  {
+    public ComponentDefinitionParser(FacesConfigInfo info)
+    {
+      this(null, info);
+    }
+
+    public ComponentDefinitionParser(
+       ComponentDefinition parent, FacesConfigInfo info)
+    {
+      _parent = parent;
+      _info   = info;
+    }
+
+
+    public void startElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Attributes   attrs) throws SAXParseException
+    {
+      _type = attrs.getValue(NAMESPACE, "type");
+      if (_type == null)
+        logError(context, "af:type attribute not on component", null);
+      String facet = attrs.getValue(NAMESPACE, "facet");
+      _definition = new ComponentDefinition(_type, _info);
+      for (int i = 0; i < attrs.getLength(); i++)
+      {
+        if ("".equals(attrs.getURI(i)))
+        {
+          String name = attrs.getLocalName(i);
+          String valueStr = attrs.getValue(i);
+          _definition.getAttributes().put(name, valueStr);
+        }
+      }
+
+      if (_parent != null)
+      {
+        if (facet != null)
+          _parent.getFacets().put(facet, _definition);
+        else
+          _parent.getChildren().add(_definition);
+      }
+
+      _definition.setUsesUpload(
+         "true".equals(attrs.getValue(NAMESPACE, "usesUpload")));
+    }
+
+    public NodeParser startChildElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Attributes   attrs) throws SAXParseException
+    {
+      if ("component".equals(localName))
+      {
+        return new ComponentDefinitionParser(_definition, _info);
+      }
+      int i=0;
+
+      String id = (String) _definition.getAttributes().get("id");
+      
+      if (id == null)
+       {
+         logError(context,
+                 "The id attribute has not been set for the component \"" + _info.getComponentInfo(_type).componentType +"\"",
+                 null);
+      return null;
+    }
+      else
+       {
+          return createTestParser(_info.getComponentInfo(_type), localName, id);
+       }
+    }
+
+    public void addCompletedChild(
+    ParseContext context,
+    String       namespaceURI,
+    String       localName,
+    Object       child) throws SAXParseException
+  {
+    if (child instanceof TestScript.Test)
+    {
+      _script.getTests().add(child);
+    }
+  }
+
+
+    public Object endElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName) throws SAXParseException
+    {
+      return _definition;
+    }
+
+    private ComponentDefinition _definition;
+    private ComponentDefinition _parent;
+    private FacesConfigInfo     _info;
+    private String              _type;
+  }
+
+
+  private class AttributeTestParser extends BaseNodeParser
+  {
+    public AttributeTestParser(FacesConfigInfo.ComponentInfo componentInfo, String componentId)
+    {
+      _componentInfo = componentInfo;
+      _componentId = componentId;
+    }
+
+    public void startElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Attributes   attrs) throws SAXParseException
+    {
+      boolean matchesBase = "true".equals(attrs.getValue("matchesBase"));
+
+      String name = getRequiredAttribute(context, attrs, "name");
+      String valueStr = attrs.getValue("value");
+
+      FacesConfigInfo.PropertyInfo property = _componentInfo.getPropertyInfo(name);
+      final Object value;
+      if (!ComponentDefinition.isValueExpression(valueStr) &&
+          (property != null) && (property.type != null))
+        value = Coercions.coerce(null, valueStr, property.type);
+      else
+        value = valueStr;
+
+      _test = new TestScript.AttributeTest(name,
+                                           value,
+                                           matchesBase,
+                                           null, 
+                                           _componentId);
+    }
+
+    public NodeParser startChildElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Attributes   attrs) throws SAXParseException
+    {
+      if ("attribute-test".equals(localName))
+        return new AttributeTestParser(_componentInfo, _componentId);
+      return null;
+    }
+
+    public void addCompletedChild(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Object       child) throws SAXParseException
+    {
+      if (child instanceof TestScript.Test)
+      {
+        _test.addDelegate((TestScript.Test) child);
+      }
+    }
+
+    public Object endElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName) throws SAXParseException
+    {
+      return _test;
+    }
+
+    private TestScript.AttributeTest        _test;
+    private FacesConfigInfo.ComponentInfo   _componentInfo;
+    private String  _componentId;
+  }
+
+
+  private class EnumTestParser extends BaseNodeParser
+  {
+    public EnumTestParser(FacesConfigInfo.ComponentInfo info)
+    {
+      _componentInfo = info;
+    }
+
+
+    public void startElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Attributes   attrs) throws SAXParseException
+    {
+      _name = attrs.getValue("name");
+      _propertyInfo = _componentInfo.getPropertyInfo(_name);
+      if (_propertyInfo == null)
+        logError(context,
+                 "Couldn't find property info for \"" + _name +"\"",
+                 null);
+      else if (_propertyInfo.enumValues == null)
+        logError(context,
+                 "Property \"" + _name +"\" is not an enumeration",
+                 null);
+
+      _defaultValue = attrs.getValue("default");
+      if (_defaultValue == null)
+      {
+        _defaultValue = _propertyInfo.defaultValue;
+        /* No default presumably means that null is legit, and that
+           none of the values should "match base"
+        if (defaultValue == null)
+          logError(context, "Property \"" + _name + "\" does not have a " +
+            "default value",
+            null);
+        */
+      }
+    }
+
+    public NodeParser startChildElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Attributes   attrs) throws SAXParseException
+    {
+      return createTestParser(_componentInfo, localName, null);
+    }
+
+    public void addCompletedChild(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Object       child) throws SAXParseException
+    {
+      if (child instanceof TestScript.Test)
+      {
+        _childTests.add(child);
+      }
+      else if (child instanceof List)
+      {
+        _childTests.addAll((List) child);
+      }
+    }
+
+    public Object endElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName) throws SAXParseException
+    {
+      ArrayList allTests = new ArrayList();
+
+      Iterator values = _propertyInfo.enumValues.iterator();
+      while (values.hasNext())
+      {
+        Object value = values.next();
+        boolean isDefault = value.equals(_defaultValue);
+        allTests.add(new TestScript.AttributeTest(_name,
+                                                  value,
+                                                  isDefault));
+        Iterator childTests = _childTests.iterator();
+        while (childTests.hasNext())
+        {
+          TestScript.Test childTest = (TestScript.Test) childTests.next();
+          allTests.add(new TestScript.AttributeTest(_name,
+                                                    value,
+                                                    isDefault,
+                                                    childTest));
+        }
+      }
+
+      return allTests;
+    }
+
+    private FacesConfigInfo.ComponentInfo   _componentInfo;
+    private FacesConfigInfo.PropertyInfo    _propertyInfo;
+    private String _name;
+    private Object _defaultValue;
+    private List _childTests = new ArrayList();
+  }
+
+  private class JavascriptTestParser extends BaseNodeParser
+  {
+    public JavascriptTestParser(FacesConfigInfo.ComponentInfo info)
+    {
+      _componentInfo = info;
+    }
+
+
+    public void startElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Attributes   attrs) throws SAXParseException
+    {
+      Iterator properties = _componentInfo.properties.keySet().iterator();
+      while (properties.hasNext())
+      {
+        String name = (String) properties.next();
+        if (name.startsWith("on"))
+        {
+          _tests.add(new TestScript.AttributeTest(name, null, false));
+        }
+      }
+    }
+
+    public Object endElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName) throws SAXParseException
+    {
+      return _tests;
+    }
+
+    private FacesConfigInfo.ComponentInfo   _componentInfo;
+    private List _tests = new ArrayList();
+  }
+
+  private class BooleanTestParser extends BaseNodeParser
+  {
+    public BooleanTestParser(FacesConfigInfo.ComponentInfo info)
+    {
+      _componentInfo = info;
+    }
+
+
+    public void startElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Attributes   attrs) throws SAXParseException
+    {
+      _name = attrs.getValue("name");
+      FacesConfigInfo.PropertyInfo property = _componentInfo.getPropertyInfo(_name);
+      if (property == null)
+        logError(context,
+                 "Couldn't find property info for \"" + _name +"\"",
+                 null);
+      else if (property.type != Boolean.TYPE)
+        logError(context,
+                 "Property \"" + _name +"\" is not a boolean type",
+                 null);
+
+      String defaultStr = attrs.getValue("default");
+      if (defaultStr != null)
+      {
+        _defaultValue = "true".equals(defaultStr);
+      }
+      else
+      {
+        _defaultValue = Boolean.TRUE.equals(property.defaultValue);
+      }
+
+      // For some reason, people keep thinking that "matchesBase" is on
+      //
+      String matchesBase = attrs.getValue("matchesBase");
+      if (matchesBase != null)
+        logError(context,
+                 "\"matchesBase\" is not an attribute of &lt;boolean-test&gt;",
+                 null);
+
+    }
+
+    public NodeParser startChildElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Attributes   attrs) throws SAXParseException
+    {
+      return createTestParser(_componentInfo, localName, null);
+    }
+
+    public void addCompletedChild(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Object       child) throws SAXParseException
+    {
+      if (child instanceof TestScript.Test)
+      {
+        _childTests.add(child);
+      }
+      else if (child instanceof List)
+      {
+        _childTests.addAll((List) child);
+      }
+    }
+
+
+    public Object endElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName) throws SAXParseException
+    {
+      _addTests(false);
+      _addTests(true);
+      return _tests;
+    }
+
+    private void _addTests(boolean value)
+    {
+      boolean matchesBase = (value == _defaultValue);
+      Boolean valueObj    = value ? Boolean.TRUE : Boolean.FALSE;
+      _tests.add(new TestScript.AttributeTest(_name, valueObj, matchesBase));
+      Iterator iter = _childTests.iterator();
+      while (iter.hasNext())
+      {
+        TestScript.Test test = (TestScript.Test) iter.next();
+        // Don't bother testing and re-testing that an attribute
+        // matches the base in all sorts of combos;  keep it simple!
+        if (matchesBase)
+          _tests.add(test);
+        else
+          _tests.add(new TestScript.AttributeTest(_name,
+                                                  valueObj,
+                                                  false,
+                                                  test));
+      }
+    }
+
+    private String _name;
+    private boolean _defaultValue;
+    private FacesConfigInfo.ComponentInfo   _componentInfo;
+    private List _tests = new ArrayList();
+    private List _childTests = new ArrayList();
+  }
+
+  private class MessageParser extends BaseNodeParser
+  {
+    public MessageParser(FacesConfigInfo.ComponentInfo info)
+    {
+      _componentInfo = info;
+    }
+
+    public void startElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName,
+      Attributes   attrs) throws SAXParseException
+    {
+      String summary = attrs.getValue("summary");
+      String detail = attrs.getValue("detail");
+      String clientId = attrs.getValue("clientId");
+
+        // If a summary or detail is set, add a message
+        String severity = attrs.getValue("severity");
+        if (severity == null)
+          severity = "INFO";
+        else
+          severity = severity.toUpperCase();
+
+        if (summary == null)
+          summary = severity + " message summary";
+        if (detail == null)
+          detail = severity + " message detail";
+
+      _test = new TestScript.MessageTest(severity, summary, detail,
+                                         clientId);
+      }
+
+
+    public Object endElement(
+      ParseContext context,
+      String       namespaceURI,
+      String       localName) throws SAXParseException
+    {
+      return _test;
+    }
+
+    private FacesConfigInfo.ComponentInfo   _componentInfo;
+    private TestScript.Test _test;
+  }
+
+  private FacesConfigInfo _info;
+  private TestScript      _script;
+  private FacesConfigInfo.ComponentInfo   _componentInfo;
+}

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/testData/Person.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/testData/Person.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/testData/Person.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/testData/Person.java Mon Jul 24 21:42:41 2006
@@ -13,27 +13,27 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.renderkit.testData;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Person
-  {
-     public Person(String name)
-     {
-       _name = name;
-     }
-     
-     public String getName()
-     {
-       return _name;
-     }
-     
-     public List getKids()
-     {
-       return _kids;
-     }
-     
-     private final String _name;
-     private final List _kids = new ArrayList();
+package org.apache.myfaces.adfinternal.renderkit.testData;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Person
+  {
+     public Person(String name)
+     {
+       _name = name;
+     }
+     
+     public String getName()
+     {
+       return _name;
+     }
+     
+     public List getKids()
+     {
+       return _kids;
+     }
+     
+     private final String _name;
+     private final List _kids = new ArrayList();
  }

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

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/taglib/TLDTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/taglib/TLDTest.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/taglib/TLDTest.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/adfinternal/taglib/TLDTest.java Mon Jul 24 21:42:41 2006
@@ -13,39 +13,39 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.taglib;
-
-import java.net.URL;
-
-import org.apache.myfaces.adfinternal.XMLValidityTestCase;
-
-public class TLDTest extends XMLValidityTestCase
-{
-  public TLDTest(
-    String testName)
-  {
-    super(testName);
-  }
-
-  public void testAdfFacesCoreValidity() throws Throwable
-  {
-    URL dtdSource = getClass().getResource("/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd");
-    String publicID = 
-      "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
-    URL tldSource = getClass().getResource("/META-INF/af.tld");
-    executeValidityTest(dtdSource,
-                        publicID,
-                        tldSource);
-  }
-
-  public void testAdfFacesHtmlValidity() throws Throwable
-  {
-    URL dtdSource = getClass().getResource("/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd");
-    String publicID = 
-      "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
-    URL tldSource = getClass().getResource("/META-INF/afh.tld");
-    executeValidityTest(dtdSource,
-                        publicID,
-                        tldSource);
-  }
-}
+package org.apache.myfaces.adfinternal.taglib;
+
+import java.net.URL;
+
+import org.apache.myfaces.adfinternal.XMLValidityTestCase;
+
+public class TLDTest extends XMLValidityTestCase
+{
+  public TLDTest(
+    String testName)
+  {
+    super(testName);
+  }
+
+  public void testAdfFacesCoreValidity() throws Throwable
+  {
+    URL dtdSource = getClass().getResource("/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd");
+    String publicID = 
+      "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
+    URL tldSource = getClass().getResource("/META-INF/af.tld");
+    executeValidityTest(dtdSource,
+                        publicID,
+                        tldSource);
+  }
+
+  public void testAdfFacesHtmlValidity() throws Throwable
+  {
+    URL dtdSource = getClass().getResource("/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd");
+    String publicID = 
+      "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
+    URL tldSource = getClass().getResource("/META-INF/afh.tld");
+    executeValidityTest(dtdSource,
+                        publicID,
+                        tldSource);
+  }
+}

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



Mime
View raw message