Return-Path: Delivered-To: apmail-myfaces-commits-archive@www.apache.org Received: (qmail 91018 invoked from network); 2 May 2010 09:28:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 May 2010 09:28:03 -0000 Received: (qmail 60353 invoked by uid 500); 2 May 2010 09:28:02 -0000 Delivered-To: apmail-myfaces-commits-archive@myfaces.apache.org Received: (qmail 60238 invoked by uid 500); 2 May 2010 09:28:02 -0000 Mailing-List: contact commits-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list commits@myfaces.apache.org Received: (qmail 60231 invoked by uid 99); 2 May 2010 09:28:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 May 2010 09:28:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 May 2010 09:27:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5543123889E7; Sun, 2 May 2010 09:27:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r940176 [2/2] - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/config/ core/src/main/java/org/apache/myfaces/tobago/internal/component/ core/src/main/java/org/apache/myfaces/tobago/util/ core/src/test/java/org/apache... Date: Sun, 02 May 2010 09:27:06 -0000 To: commits@myfaces.apache.org From: bommel@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100502092707.5543123889E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockHttpServletRequest.java URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockHttpServletRequest.java?rev=940176&r1=940175&r2=940176&view=diff ============================================================================== --- myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockHttpServletRequest.java (original) +++ myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockHttpServletRequest.java Sun May 2 09:27:03 2010 @@ -196,7 +196,7 @@ public class MockHttpServletRequest impl } public String getParameter(String name) { - String values[] = (String[]) parameters.get(name); + String[] values = (String[]) parameters.get(name); if (values != null) { return (values[0]); } else { @@ -283,7 +283,7 @@ public class MockHttpServletRequest impl // ----------------------------------------------------------- business methods - public void addParameter(String name, String values[]) { + public void addParameter(String name, String[] values) { parameters.put(name, values); } Modified: myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockJspWriter.java URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockJspWriter.java?rev=940176&r1=940175&r2=940176&view=diff ============================================================================== --- myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockJspWriter.java (original) +++ myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockJspWriter.java Sun May 2 09:27:03 2010 @@ -58,7 +58,7 @@ public class MockJspWriter extends JspWr out.print(d); } - public void print(char s[]) { + public void print(char[] s) { out.print(s); } @@ -98,7 +98,7 @@ public class MockJspWriter extends JspWr out.println(x); } - public void println(char x[]) { + public void println(char[] x) { out.println(x); } @@ -114,7 +114,7 @@ public class MockJspWriter extends JspWr out.write(c); } - public void write(char cbuf[]) throws IOException { + public void write(char[] cbuf) throws IOException { out.write(cbuf); } @@ -122,7 +122,7 @@ public class MockJspWriter extends JspWr out.write(str); } - public void write(char cbuf[], int off, int len) throws IOException { + public void write(char[] cbuf, int off, int len) throws IOException { out.write(cbuf, off, len); } Modified: myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockPageContext.java URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockPageContext.java?rev=940176&r1=940175&r2=940176&view=diff ============================================================================== --- myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockPageContext.java (original) +++ myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockPageContext.java Sun May 2 09:27:03 2010 @@ -37,10 +37,10 @@ import java.util.Map; public class MockPageContext extends PageContext { - ServletRequest request = null; - JspWriter out = new MockJspWriter(new PrintWriter(System.out)); - ServletContext servletContext = new MockServletContext(); - Map attributes = new HashMap(); + private ServletRequest request = null; + private JspWriter out = new MockJspWriter(new PrintWriter(System.out)); + private ServletContext servletContext = new MockServletContext(); + private Map attributes = new HashMap(); public MockPageContext() { @@ -67,8 +67,9 @@ public class MockPageContext extends Pag case PageContext.REQUEST_SCOPE: return getRequest().getAttribute(name); // other not supported + default: + return null; } - return null; } public Enumeration getAttributeNamesInScope(int i) { @@ -120,7 +121,8 @@ public class MockPageContext extends Pag public void include(String s) throws ServletException, IOException { } - public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String s, boolean b, int i, boolean b1) throws IOException, IllegalStateException, IllegalArgumentException { + public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String s, boolean b, int i, + boolean b1) throws IOException, IllegalStateException, IllegalArgumentException { } public void release() { @@ -142,12 +144,12 @@ public class MockPageContext extends Pag case PageContext.REQUEST_SCOPE: getRequest().setAttribute(s, o); break; - // other not supported + default: + // other not supported } } - public void include(String reference, boolean b) throws ServletException, - IOException { + public void include(String reference, boolean b) throws ServletException, IOException { } public ExpressionEvaluator getExpressionEvaluator() { @@ -159,6 +161,6 @@ public class MockPageContext extends Pag } public ELContext getELContext() { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } } Modified: myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericTestBase.java URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericTestBase.java?rev=940176&r1=940175&r2=940176&view=diff ============================================================================== --- myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericTestBase.java (original) +++ myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericTestBase.java Sun May 2 09:27:03 2010 @@ -56,9 +56,9 @@ import java.util.HashMap; public abstract class GenericTestBase extends TestCase { private static final Logger LOG = LoggerFactory.getLogger(GenericTestBase.class); - protected Tld[] tlds; - protected String[] tldPaths; - private Application application; + private Tld[] tlds; + private String[] tldPaths; + private Application application; private MockFacesContext facesContext; public GenericTestBase(String name) { @@ -145,35 +145,43 @@ public abstract class GenericTestBase ex NoSuchMethodException, InvocationTargetException, ClassNotFoundException { PropertyDescriptor propertyDescriptor = PropertyUtils.getPropertyDescriptor(tagObject, name); - assertNotNull("setter '" + name + "' of class " + tagObject.getClass().getName() + " has " + - "property descriptor.", propertyDescriptor); + assertNotNull("setter '" + name + "' of class " + tagObject.getClass().getName() + " has " + + "property descriptor.", propertyDescriptor); //assertNotNull("setter '" + name + "' of class " + tagObject.getClass().getName() + " exists.", // propertyDescriptor.getWriteMethod()); } + public void setTlds(Tld[] tlds) { + this.tlds = tlds; + } + + public void setTldPaths(String[] tldPaths) { + this.tldPaths = tldPaths; + } + private void checkRelease(javax.servlet.jsp.tagext.Tag tag) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException, SAXException { tag.setPageContext(new MockPageContext()); - HashMap initialValues = new HashMap(); - PropertyDescriptor descriptors[] = + HashMap initialValues = new HashMap(); + PropertyDescriptor[] descriptors = PropertyUtils.getPropertyDescriptors(tag); // store initial values - for (int i = 0; i < descriptors.length; i++) { - if (isTagProperty(descriptors[i])) { - String name = descriptors[i].getName(); + for (PropertyDescriptor descriptor : descriptors) { + if (isTagProperty(descriptor)) { + String name = descriptor.getName(); Object value = PropertyUtils.getSimpleProperty(tag, name); initialValues.put(name, value); } } // set new values - for (int i = 0; i < descriptors.length; i++) { - if (isTagProperty(descriptors[i])) { - String name = descriptors[i].getName(); - Class propertyType = descriptors[i].getPropertyType(); + for (PropertyDescriptor descriptor : descriptors) { + if (isTagProperty(descriptor)) { + String name = descriptor.getName(); + Class propertyType = descriptor.getPropertyType(); Object value = null; if (propertyType == String.class) { value = new String("bla"); @@ -192,11 +200,13 @@ public abstract class GenericTestBase ex tag.release(); // check released values - for (int i = 0; i < descriptors.length; i++) { - if (isTagProperty(descriptors[i])) { - String name = descriptors[i].getName(); + for (PropertyDescriptor descriptor : descriptors) { + if (isTagProperty(descriptor)) { + String name = descriptor.getName(); // XXX: who releases id? - if (name.equals("id")) continue; + if (name.equals("id")) { + continue; + } try { Object newValue = PropertyUtils.getSimpleProperty(tag, name); Object oldValue = initialValues.get(name); @@ -231,7 +241,8 @@ public abstract class GenericTestBase ex private static class Resolver implements EntityResolver { public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { - InputSource inputSource = new InputSource(GenericTestBase.class.getResourceAsStream("/web-jsptaglibrary_1_2.dtd")); + InputSource inputSource = + new InputSource(GenericTestBase.class.getResourceAsStream("/web-jsptaglibrary_1_2.dtd")); inputSource.setSystemId(systemId); return inputSource; }