From: <fg...@us...> - 2008-12-11 16:28:26
|
Revision: 950 http://openutils.svn.sourceforge.net/openutils/?rev=950&view=rev Author: fgiust Date: 2008-12-11 16:28:22 +0000 (Thu, 11 Dec 2008) Log Message: ----------- basic documentation Modified Paths: -------------- trunk/openutils-elfunctions/pom.xml trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld Added Paths: ----------- trunk/openutils-elfunctions/src/site/ trunk/openutils-elfunctions/src/site/apt/ trunk/openutils-elfunctions/src/site/apt/index.apt trunk/openutils-elfunctions/src/site/changes/ trunk/openutils-elfunctions/src/site/changes/changes.xml trunk/openutils-elfunctions/src/site/site.xml Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2008-12-11 16:15:12 UTC (rev 949) +++ trunk/openutils-elfunctions/pom.xml 2008-12-11 16:28:22 UTC (rev 950) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils</artifactId> @@ -29,4 +30,12 @@ </exclusions> </dependency> </dependencies> -</project> + <reporting> + <plugins> + <plugin> + <groupId>net.sourceforge.maven-taglib</groupId> + <artifactId>maven-taglib-plugin</artifactId> + </plugin> + </plugins> + </reporting> +</project> \ No newline at end of file Modified: trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java =================================================================== --- trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2008-12-11 16:15:12 UTC (rev 949) +++ trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2008-12-11 16:28:22 UTC (rev 950) @@ -15,7 +15,6 @@ */ package net.sourceforge.openutils.elfunctions; -import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; @@ -27,12 +26,6 @@ public class ElStringUtils { - public static String escapeXml(String value) - { - String esc = StringEscapeUtils.escapeXml(value); - return StringUtils.replace(esc, "'", "'"); - } - /** * The space character. * @return the space character Modified: trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld =================================================================== --- trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld 2008-12-11 16:15:12 UTC (rev 949) +++ trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld 2008-12-11 16:28:22 UTC (rev 950) @@ -30,11 +30,6 @@ <name>randomAlphanumeric</name> <function-class>org.apache.commons.lang.RandomStringUtils</function-class> <function-signature>java.lang.String randomAlphanumeric(int)</function-signature> - </function> - <function> - <name>escapeXml</name> - <function-class>net.sourceforge.openutils.elfunctions.ElStringUtils</function-class> - <function-signature>java.lang.String escapeXml(java.lang.String)</function-signature> </function> <function> <description>Unescapes a String</description> Added: trunk/openutils-elfunctions/src/site/apt/index.apt =================================================================== --- trunk/openutils-elfunctions/src/site/apt/index.apt (rev 0) +++ trunk/openutils-elfunctions/src/site/apt/index.apt 2008-12-11 16:28:22 UTC (rev 950) @@ -0,0 +1,19 @@ + -------------------------- + openutils-elfunctions + -------------------------- + Fabrizio Giustina + -------------------------- + +About openutils-elfunctions + + Openutils-elfunctions is a set of EL functions that can be used in jsp pages, mainly related to string manipulation. + +Usage + + The tld uri you have to declare in your jsps is "http://openutils.sf.net/openutils-stringutils". + + Look at the {{{tlddoc/index.html}taglibdoc documentation}} for details on the available functions. + +Released versions + + Check it at {{{http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-elfunctions}http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-elfunctions}} Property changes on: trunk/openutils-elfunctions/src/site/apt/index.apt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-elfunctions/src/site/changes/changes.xml =================================================================== --- trunk/openutils-elfunctions/src/site/changes/changes.xml (rev 0) +++ trunk/openutils-elfunctions/src/site/changes/changes.xml 2008-12-11 16:28:22 UTC (rev 950) @@ -0,0 +1,15 @@ +<?xml version="1.0"?> + <!-- + "type" attribute can be: add, remove, update or fix. +--> +<document> + <properties> + <title>Changes</title> + <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> + </properties> + <body> + <release version="1.0" date="2008-12-11" description=""> + <action type="add" dev="fgiust">first release</action> + </release> + </body> +</document> \ No newline at end of file Property changes on: trunk/openutils-elfunctions/src/site/changes/changes.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-elfunctions/src/site/site.xml =================================================================== --- trunk/openutils-elfunctions/src/site/site.xml (rev 0) +++ trunk/openutils-elfunctions/src/site/site.xml 2008-12-11 16:28:22 UTC (rev 950) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="Openutils mgnlmedia"> + <publishDate position="navigation-bottom" format="yyyy-MM-dd" /> + <version position="navigation-bottom" /> + <bannerRight> + <name>Openutils</name> + <src>http://openutils.sourceforge.net/images/openutils-logo.png + </src> + <href>http://openutils.sourceforge.net</href> + </bannerRight> + <bannerLeft> + <name>Sourceforge</name> + <src>http://sourceforge.net/sflogo.php?group_id=150467&amp;type=2</src> + <href>http://www.sourceforge.net/projects/openutils</href> + </bannerLeft> + <body> + <head> + <link rel="icon" href="images/favicon.ico" /> + </head> + <breadcrumbs> + <item name="openutils" href="http://openutils.sourceforge.net/" /> + <item name="openutils-elfunctions" href="http://openutils.sourceforge.net/openutils-elfunctions" /> + </breadcrumbs> + <menu name="openutils mgnlmedia"> + <item name="About" href="index.html"></item> + </menu> + <menu ref="modules" inherit="bottom" /> + <menu ref="reports" inherit="bottom" /> + </body> + <skin> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-maven-skin</artifactId> + <version>1.1</version> + </skin> +</project> Property changes on: trunk/openutils-elfunctions/src/site/site.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-09-05 19:02:07
|
Revision: 1417 http://openutils.svn.sourceforge.net/openutils/?rev=1417&view=rev Author: fgiust Date: 2009-09-05 19:01:58 +0000 (Sat, 05 Sep 2009) Log Message: ----------- cleaned up Modified Paths: -------------- trunk/openutils-elfunctions/pom.xml Added Paths: ----------- trunk/openutils-elfunctions/src/main/assembly/ trunk/openutils-elfunctions/src/main/assembly/assembly-bundle.xml trunk/openutils-elfunctions/src/main/bundle/ trunk/openutils-elfunctions/src/main/bundle/LICENSE.txt trunk/openutils-elfunctions/src/main/bundle/README.txt Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2009-09-05 19:00:19 UTC (rev 1416) +++ trunk/openutils-elfunctions/pom.xml 2009-09-05 19:01:58 UTC (rev 1417) @@ -10,6 +10,39 @@ <artifactId>openutils-elfunctions</artifactId> <name>openutils-elfunctions</name> <version>1.1-SNAPSHOT</version> + <description>A useful set of EL functions that can be used in jsps.</description> + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + </license> + </licenses> + <url>http://lab.openmindonline.it/lab/products/elfunctions.html</url> + <issueManagement> + <system>jira</system> + <url>http://lab.openmindonline.it/jira/browse/ELFUNCTIONS</url> + </issueManagement> + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>bundle</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + <configuration> + <descriptors> + <descriptor>${basedir}/src/main/assembly/assembly-bundle.xml</descriptor> + </descriptors> + </configuration> + </plugin> + </plugins> + </build> <dependencies> <dependency> <groupId>commons-lang</groupId> Added: trunk/openutils-elfunctions/src/main/assembly/assembly-bundle.xml =================================================================== --- trunk/openutils-elfunctions/src/main/assembly/assembly-bundle.xml (rev 0) +++ trunk/openutils-elfunctions/src/main/assembly/assembly-bundle.xml 2009-09-05 19:01:58 UTC (rev 1417) @@ -0,0 +1,33 @@ +<assembly> + <id>bundle</id> + <formats> + <format>zip</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <filtered>true</filtered> + <outputDirectory>/</outputDirectory> + <lineEnding>crlf</lineEnding> + <directory>${basedir}/src/main/bundle</directory> + <includes> + <include>*</include> + </includes> + </fileSet> + <fileSet> + <directory>src/main/java/</directory> + <outputDirectory>/sources/</outputDirectory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + </fileSets> + <dependencySets> + <dependencySet> + <outputDirectory>bin</outputDirectory> + <includes> + <include>net.sourceforge.openutils:*</include> + </includes> + </dependencySet> + </dependencySets> +</assembly> \ No newline at end of file Property changes on: trunk/openutils-elfunctions/src/main/assembly/assembly-bundle.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-elfunctions/src/main/bundle/LICENSE.txt =================================================================== --- trunk/openutils-elfunctions/src/main/bundle/LICENSE.txt (rev 0) +++ trunk/openutils-elfunctions/src/main/bundle/LICENSE.txt 2009-09-05 19:01:58 UTC (rev 1417) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. Property changes on: trunk/openutils-elfunctions/src/main/bundle/LICENSE.txt ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-elfunctions/src/main/bundle/README.txt =================================================================== --- trunk/openutils-elfunctions/src/main/bundle/README.txt (rev 0) +++ trunk/openutils-elfunctions/src/main/bundle/README.txt 2009-09-05 19:01:58 UTC (rev 1417) @@ -0,0 +1,53 @@ +=========================================================== + +${pom.name} ${pom.version} +by ${pom.organization.name} + +=========================================================== + +${pom.description} + +More information about this project can be found at: +${pom.url} + +Change log and known issues can be found at: +${pom.issueManagement.url} + +Source is available from the subversion repository at: +${pom.scm.url} + +========================================= + USAGE +========================================= + +The preferred way to add ${pom.name} to your project is using maven. +You can declare the following dependency in your pom.xml: + + <dependency> + <groupId>${pom.groupId}</groupId> + <artifactId>${pom.artifactId}</artifactId> + <version>${pom.version}</version> + </dependency> + +Alternatively, you can add the ${pom.artifactId} plus the required dependencies +manually to the classpath of your application. + + +========================================= + LICENSE +========================================= + +Copyright Openmind http://www.openmindonline.it + +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. + Property changes on: trunk/openutils-elfunctions/src/main/bundle/README.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-01-17 15:45:19
|
Revision: 1656 http://openutils.svn.sourceforge.net/openutils/?rev=1656&view=rev Author: fgiust Date: 2010-01-17 15:45:08 +0000 (Sun, 17 Jan 2010) Log Message: ----------- unit test with servletunit Modified Paths: -------------- trunk/openutils-elfunctions/pom.xml Added Paths: ----------- trunk/openutils-elfunctions/src/test/ trunk/openutils-elfunctions/src/test/java/ trunk/openutils-elfunctions/src/test/java/net/ trunk/openutils-elfunctions/src/test/java/net/sourceforge/ trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/ trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/ trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspEmbeddedTest.java trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspTestngEmbeddedTest.java trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java trunk/openutils-elfunctions/src/test/resources/ trunk/openutils-elfunctions/src/test/resources/WEB-INF/ trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml trunk/openutils-elfunctions/src/test/resources/jsps/ trunk/openutils-elfunctions/src/test/resources/jsps/capitaliseAllWords.jsp trunk/openutils-elfunctions/src/test/resources/log4j.dtd trunk/openutils-elfunctions/src/test/resources/log4j.xml Property Changed: ---------------- trunk/openutils-elfunctions/ Property changes on: trunk/openutils-elfunctions ___________________________________________________________________ Modified: svn:ignore - .settings target .checkstyle .classpath .project + .settings target .checkstyle .classpath .project temp-testng-customsuite.xml Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2010-01-17 11:46:45 UTC (rev 1655) +++ trunk/openutils-elfunctions/pom.xml 2010-01-17 15:45:08 UTC (rev 1656) @@ -69,6 +69,36 @@ <scope>test</scope> </dependency> <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-testing4web</artifactId> + <version>1.0</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging-api</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jsp-api</artifactId> + <version>2.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <version>1.5.6</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <classifier>jdk15</classifier> @@ -82,4 +112,39 @@ </exclusions> </dependency> </dependencies> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>httpunit</groupId> + <artifactId>httpunit</artifactId> + <version>1.7</version> + <exclusions> + <exclusion> + <groupId>xerces</groupId> + <artifactId>xmlParserAPIs</artifactId> + </exclusion> + <exclusion> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + </exclusion> + <exclusion> + <groupId>nekohtml</groupId> + <artifactId>nekohtml</artifactId> + </exclusion> + <exclusion> + <groupId>rhino</groupId> + <artifactId>js</artifactId> + </exclusion> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </dependencyManagement> </project> \ No newline at end of file Added: trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspEmbeddedTest.java =================================================================== --- trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspEmbeddedTest.java (rev 0) +++ trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspEmbeddedTest.java 2010-01-17 15:45:08 UTC (rev 1656) @@ -0,0 +1,75 @@ +package net.sourceforge.openutils.elfunctions; + +import java.io.File; +import java.net.URL; +import java.net.URLDecoder; +import java.util.Hashtable; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.meterware.httpunit.HttpUnitOptions; +import com.meterware.servletunit.ServletRunner; + + +/** + * Base TestCase class for jsp tests. + * @author fgiust + */ +public abstract class BaseJspEmbeddedTest +{ + + /** + * Context mapped to the test application. + */ + public static final String CONTEXT = "/context"; + + /** + * Logger. + */ + protected Logger log = LoggerFactory.getLogger(getClass()); + + /** + * HttpUnit ServletRunner. + */ + protected ServletRunner runner; + + protected String getJspUrl(String jsp) + { + return "http://localhost" + CONTEXT + "/jsps/" + jsp; + } + + /** + * @see junit.framework.TestCase#setUp() + */ + public void setUp() throws Exception + { + // need to pass a web.xml file to setup servletunit working directory + ClassLoader classLoader = getClass().getClassLoader(); + URL webXmlUrl = classLoader.getResource("WEB-INF/web.xml"); + String path = URLDecoder.decode(webXmlUrl.getFile(), "UTF-8"); + + HttpUnitOptions.setDefaultCharacterSet("utf-8"); + System.setProperty("file.encoding", "utf-8"); + + // start servletRunner + runner = new ServletRunner(new File(path), CONTEXT); + + Hashtable<String, String> params = new Hashtable<String, String>(); + params.put("javaEncoding", "utf-8"); + runner.registerServlet("*.jsp", "org.apache.jasper.servlet.JspServlet", params); + + log.debug("ServletRunner setup OK"); + + } + + /** + * @see junit.framework.TestCase#tearDown() + */ + public void tearDown() throws Exception + { + // shutdown servlet engine + runner.shutDown(); + } + +} \ No newline at end of file Property changes on: trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspEmbeddedTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspTestngEmbeddedTest.java =================================================================== --- trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspTestngEmbeddedTest.java (rev 0) +++ trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspTestngEmbeddedTest.java 2010-01-17 15:45:08 UTC (rev 1656) @@ -0,0 +1,34 @@ +package net.sourceforge.openutils.elfunctions; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; + + +/** + * @author fgiust + * @version $Id$ + */ +public abstract class BaseJspTestngEmbeddedTest extends BaseJspEmbeddedTest +{ + + /** + * {@inheritDoc} + */ + @Override + @BeforeClass + public void setUp() throws Exception + { + super.setUp(); + } + + /** + * {@inheritDoc} + */ + @Override + @AfterClass + public void tearDown() throws Exception + { + super.tearDown(); + } + +} Property changes on: trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspTestngEmbeddedTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java =================================================================== --- trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java (rev 0) +++ trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java 2010-01-17 15:45:08 UTC (rev 1656) @@ -0,0 +1,40 @@ +package net.sourceforge.openutils.elfunctions; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + + +/** + * @author fgiust + * @version $Id$ + */ +public class JspTest extends BaseJspTestngEmbeddedTest +{ + + /** + * Checks for the expected values in columns. + * @param jspName jsp name, with full path + * @throws Exception any exception thrown during test. + */ + @Test + public void capitaliseAllWordsTest() throws Exception + { + + WebRequest request = new GetMethodWebRequest(getJspUrl("capitaliseAllWords.jsp")); + + WebResponse response = runner.getResponse(request); + + if (log.isDebugEnabled()) + { + log.debug("RESPONSE: " + response.getText()); + } + + String responseText = response.getText(); + + Assert.assertEquals(responseText, "Test One Two"); + } +} Property changes on: trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml =================================================================== --- trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml (rev 0) +++ trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml 2010-01-17 15:45:08 UTC (rev 1656) @@ -0,0 +1,12 @@ +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> + <description>Base web.xml for tests</description> + <mime-mapping> + <extension>jsp</extension> + <mime-type>text/html</mime-type> + </mime-mapping> + <taglib> + <taglib-uri>http://openutils.sf.net/openutils-stringutils</taglib-uri> + <taglib-location>/../classes/META-INF/stringutils.tld</taglib-location> + </taglib> +</web-app> \ No newline at end of file Property changes on: trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-elfunctions/src/test/resources/jsps/capitaliseAllWords.jsp =================================================================== --- trunk/openutils-elfunctions/src/test/resources/jsps/capitaliseAllWords.jsp (rev 0) +++ trunk/openutils-elfunctions/src/test/resources/jsps/capitaliseAllWords.jsp 2010-01-17 15:45:08 UTC (rev 1656) @@ -0,0 +1,3 @@ +<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:su="http://openutils.sf.net/openutils-stringutils"> + <jsp:text>${su:capitaliseAllWords("test one two")}</jsp:text> +</jsp:root> \ No newline at end of file Property changes on: trunk/openutils-elfunctions/src/test/resources/jsps/capitaliseAllWords.jsp ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/openutils-elfunctions/src/test/resources/log4j.dtd =================================================================== --- trunk/openutils-elfunctions/src/test/resources/log4j.dtd (rev 0) +++ trunk/openutils-elfunctions/src/test/resources/log4j.dtd 2010-01-17 15:45:08 UTC (rev 1656) @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<!-- Authors: Chris Taylor, Ceki Gulcu. --> + +<!-- Version: 1.2 --> + +<!-- A configuration element consists of optional renderer +elements,appender elements, categories and an optional root +element. --> + +<!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?, + categoryFactory?)> + +<!-- The "threshold" attribute takes a level value such that all --> +<!-- logging statements with a level equal or below this value are --> +<!-- disabled. --> + +<!-- Setting the "debug" enable the printing of internal log4j logging --> +<!-- statements. --> + +<!-- By default, debug attribute is "null", meaning that we not do touch --> +<!-- internal log4j logging settings. The "null" value for the threshold --> +<!-- attribute can be misleading. The threshold field of a repository --> +<!-- cannot be set to null. The "null" value for the threshold attribute --> +<!-- simply means don't touch the threshold field, the threshold field --> +<!-- keeps its old value. --> + +<!ATTLIST log4j:configuration + xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" + threshold (all|debug|info|warn|error|fatal|off|null) "null" + debug (true|false|null) "null" +> + +<!-- renderer elements allow the user to customize the conversion of --> +<!-- message objects to String. --> + +<!ELEMENT renderer EMPTY> +<!ATTLIST renderer + renderedClass CDATA #REQUIRED + renderingClass CDATA #REQUIRED +> + +<!-- Appenders must have a name and a class. --> +<!-- Appenders may contain an error handler, a layout, optional parameters --> +<!-- and filters. They may also reference (or include) other appenders. --> +<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)> +<!ATTLIST appender + name ID #REQUIRED + class CDATA #REQUIRED +> + +<!ELEMENT layout (param*)> +<!ATTLIST layout + class CDATA #REQUIRED +> + +<!ELEMENT filter (param*)> +<!ATTLIST filter + class CDATA #REQUIRED +> + +<!-- ErrorHandlers can be of any class. They can admit any number of --> +<!-- parameters. --> + +<!ELEMENT errorHandler (param*, root-ref?, logger-ref*, appender-ref?)> +<!ATTLIST errorHandler + class CDATA #REQUIRED +> + +<!ELEMENT root-ref EMPTY> + +<!ELEMENT logger-ref EMPTY> +<!ATTLIST logger-ref + ref IDREF #REQUIRED +> + +<!ELEMENT param EMPTY> +<!ATTLIST param + name CDATA #REQUIRED + value CDATA #REQUIRED +> + + +<!-- The priority class is org.apache.log4j.Level by default --> +<!ELEMENT priority (param*)> +<!ATTLIST priority + class CDATA #IMPLIED + value CDATA #REQUIRED +> + +<!-- The level class is org.apache.log4j.Level by default --> +<!ELEMENT level (param*)> +<!ATTLIST level + class CDATA #IMPLIED + value CDATA #REQUIRED +> + + +<!-- If no level element is specified, then the configurator MUST not --> +<!-- touch the level of the named category. --> +<!ELEMENT category (param*,(priority|level)?,appender-ref*)> +<!ATTLIST category + class CDATA #IMPLIED + name CDATA #REQUIRED + additivity (true|false) "true" +> + +<!-- If no level element is specified, then the configurator MUST not --> +<!-- touch the level of the named logger. --> +<!ELEMENT logger (level?,appender-ref*)> +<!ATTLIST logger + name ID #REQUIRED + additivity (true|false) "true" +> + + +<!ELEMENT categoryFactory (param*)> +<!ATTLIST categoryFactory + class CDATA #REQUIRED> + +<!ELEMENT appender-ref EMPTY> +<!ATTLIST appender-ref + ref IDREF #REQUIRED +> + +<!-- If no priority element is specified, then the configurator MUST not --> +<!-- touch the priority of root. --> +<!-- The root category always exists and cannot be subclassed. --> +<!ELEMENT root (param*, (priority|level)?, appender-ref*)> + + +<!-- ==================================================================== --> +<!-- A logging event --> +<!-- ==================================================================== --> +<!ELEMENT log4j:eventSet (log4j:event*)> +<!ATTLIST log4j:eventSet + xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" + version (1.1|1.2) "1.2" + includesLocationInfo (true|false) "true" +> + + + +<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, + log4j:locationInfo?) > + +<!-- The timestamp format is application dependent. --> +<!ATTLIST log4j:event + logger CDATA #REQUIRED + level CDATA #REQUIRED + thread CDATA #REQUIRED + timestamp CDATA #REQUIRED +> + +<!ELEMENT log4j:message (#PCDATA)> +<!ELEMENT log4j:NDC (#PCDATA)> + +<!ELEMENT log4j:throwable (#PCDATA)> + +<!ELEMENT log4j:locationInfo EMPTY> +<!ATTLIST log4j:locationInfo + class CDATA #REQUIRED + method CDATA #REQUIRED + file CDATA #REQUIRED + line CDATA #REQUIRED +> Property changes on: trunk/openutils-elfunctions/src/test/resources/log4j.dtd ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/openutils-elfunctions/src/test/resources/log4j.xml =================================================================== --- trunk/openutils-elfunctions/src/test/resources/log4j.xml (rev 0) +++ trunk/openutils-elfunctions/src/test/resources/log4j.xml 2010-01-17 15:45:08 UTC (rev 1656) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> +<log4j:configuration> + <!-- log4j test configuration --> + <appender name="test-appender" class="org.apache.log4j.ConsoleAppender"> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%-5p %c.%M(%C{1}.java:%L) %m%n" /> + </layout> + </appender> + <category name="org"> + <priority value="WARN" /> + </category> + <category name="com"> + <priority value="WARN" /> + </category> + <category name="net"> + <priority value="WARN" /> + </category> + <category name="info"> + <priority value="WARN" /> + </category> + <category name="it"> + <priority value="WARN" /> + </category> + <root> + <priority value="debug" /> + <appender-ref ref="test-appender" /> + </root> +</log4j:configuration> \ No newline at end of file Property changes on: trunk/openutils-elfunctions/src/test/resources/log4j.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-01-18 14:12:05
|
Revision: 1667 http://openutils.svn.sourceforge.net/openutils/?rev=1667&view=rev Author: fgiust Date: 2010-01-18 14:08:33 +0000 (Mon, 18 Jan 2010) Log Message: ----------- reworked test framework Modified Paths: -------------- trunk/openutils-elfunctions/pom.xml trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java Added Paths: ----------- trunk/openutils-elfunctions/src/test/resources/jsps/capitaliseAllWords.txt Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2010-01-18 13:46:35 UTC (rev 1666) +++ trunk/openutils-elfunctions/pom.xml 2010-01-18 14:08:33 UTC (rev 1667) @@ -123,6 +123,12 @@ <scope>test</scope> </dependency> <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.4</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <classifier>jdk15</classifier> Modified: trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java =================================================================== --- trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java 2010-01-18 13:46:35 UTC (rev 1666) +++ trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java 2010-01-18 14:08:33 UTC (rev 1667) @@ -18,6 +18,10 @@ package net.sourceforge.openutils.elfunctions; +import java.io.InputStream; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; import org.testng.Assert; import org.testng.annotations.Test; @@ -33,12 +37,10 @@ public class JspTest extends BaseJspTestngEmbeddedTest { - @Test - public void capitaliseAllWordsTest() throws Exception + protected void checkJspWithExpectedTxt(String jspname) throws Exception { + WebRequest request = new GetMethodWebRequest(getJspUrl(jspname)); - WebRequest request = new GetMethodWebRequest(getJspUrl("capitaliseAllWords.jsp")); - WebResponse response = runner.getResponse(request); if (log.isDebugEnabled()) @@ -48,6 +50,18 @@ String responseText = response.getText(); - Assert.assertEquals(responseText, "Test One Two"); + String expectedFileName = StringUtils.replace(jspname, ".jsp", ".txt"); + + InputStream stream = getClass().getResourceAsStream("/jsps/" + expectedFileName); + String expected = IOUtils.toString(stream); + IOUtils.closeQuietly(stream); + + Assert.assertEquals(responseText, expected); } + + @Test + public void capitaliseAllWordsTest() throws Exception + { + checkJspWithExpectedTxt("capitaliseAllWords.jsp"); + } } Added: trunk/openutils-elfunctions/src/test/resources/jsps/capitaliseAllWords.txt =================================================================== --- trunk/openutils-elfunctions/src/test/resources/jsps/capitaliseAllWords.txt (rev 0) +++ trunk/openutils-elfunctions/src/test/resources/jsps/capitaliseAllWords.txt 2010-01-18 14:08:33 UTC (rev 1667) @@ -0,0 +1 @@ +Test One Two \ No newline at end of file Property changes on: trunk/openutils-elfunctions/src/test/resources/jsps/capitaliseAllWords.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-01-18 17:19:55
|
Revision: 1676 http://openutils.svn.sourceforge.net/openutils/?rev=1676&view=rev Author: fgiust Date: 2010-01-18 17:19:39 +0000 (Mon, 18 Jan 2010) Log Message: ----------- updated testing4web dependency Modified Paths: -------------- trunk/openutils-elfunctions/pom.xml trunk/openutils-elfunctions/src/main/assembly/assembly-bundle.xml trunk/openutils-elfunctions/src/main/etc/header.txt trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/DateElUtils.java trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java Removed Paths: ------------- trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspEmbeddedTest.java trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspTestngEmbeddedTest.java Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2010-01-18 17:13:45 UTC (rev 1675) +++ trunk/openutils-elfunctions/pom.xml 2010-01-18 17:19:39 UTC (rev 1676) @@ -10,6 +10,7 @@ <artifactId>openutils-elfunctions</artifactId> <name>openutils-elfunctions</name> <version>1.0.2-SNAPSHOT</version> + <inceptionYear>2008</inceptionYear> <description>A useful set of EL functions that can be used in jsps.</description> <licenses> <license> @@ -51,7 +52,7 @@ <include>src/**/*.java</include> </includes> <properties> - <year>${project.inceptionYear} - 2010</year> + <year>${project.inceptionYear}-2010</year> <name>${project.name}</name> <description>${project.description}</description> <url>${project.url}</url> @@ -95,14 +96,8 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing4web</artifactId> - <version>1.0</version> + <version>1.1</version> <scope>test</scope> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging-api</artifactId> - </exclusion> - </exclusions> </dependency> <dependency> <groupId>javax.servlet</groupId> Modified: trunk/openutils-elfunctions/src/main/assembly/assembly-bundle.xml =================================================================== --- trunk/openutils-elfunctions/src/main/assembly/assembly-bundle.xml 2010-01-18 17:13:45 UTC (rev 1675) +++ trunk/openutils-elfunctions/src/main/assembly/assembly-bundle.xml 2010-01-18 17:19:39 UTC (rev 1676) @@ -15,10 +15,11 @@ </includes> </fileSet> <fileSet> - <directory>src/main/java/</directory> + <directory>.</directory> <outputDirectory>/sources/</outputDirectory> <includes> - <include>**/*</include> + <include>src/**/*</include> + <include>pom.xml</include> </includes> </fileSet> </fileSets> Modified: trunk/openutils-elfunctions/src/main/etc/header.txt =================================================================== --- trunk/openutils-elfunctions/src/main/etc/header.txt 2010-01-18 17:13:45 UTC (rev 1675) +++ trunk/openutils-elfunctions/src/main/etc/header.txt 2010-01-18 17:19:39 UTC (rev 1676) @@ -1,6 +1,6 @@ ${name} (${url}) -Copyright (C)${year}, Openmind S.r.l. http://www.openmindonline.it +Copyright(C) ${year}, Openmind S.r.l. http://www.openmindonline.it Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. Modified: trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/DateElUtils.java =================================================================== --- trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/DateElUtils.java 2010-01-18 17:13:45 UTC (rev 1675) +++ trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/DateElUtils.java 2010-01-18 17:19:39 UTC (rev 1676) @@ -1,7 +1,7 @@ /** * * openutils-elfunctions (http://www.openmindlab.com/lab/products/elfunctions.html) - * Copyright (C)null - 2010, Openmind S.r.l. http://www.openmindonline.it + * Copyright(C) 2008-2010, Openmind S.r.l. http://www.openmindonline.it * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Modified: trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java =================================================================== --- trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2010-01-18 17:13:45 UTC (rev 1675) +++ trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2010-01-18 17:19:39 UTC (rev 1676) @@ -1,7 +1,7 @@ /** * * openutils-elfunctions (http://www.openmindlab.com/lab/products/elfunctions.html) - * Copyright (C)null - 2010, Openmind S.r.l. http://www.openmindonline.it + * Copyright(C) 2008-2010, Openmind S.r.l. http://www.openmindonline.it * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Deleted: trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspEmbeddedTest.java =================================================================== --- trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspEmbeddedTest.java 2010-01-18 17:13:45 UTC (rev 1675) +++ trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspEmbeddedTest.java 2010-01-18 17:19:39 UTC (rev 1676) @@ -1,93 +0,0 @@ -/** - * - * openutils-elfunctions (http://www.openmindlab.com/lab/products/elfunctions.html) - * Copyright (C)null - 2010, Openmind S.r.l. http://www.openmindonline.it - * - * 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 net.sourceforge.openutils.elfunctions; - -import java.io.File; -import java.net.URL; -import java.net.URLDecoder; -import java.util.Hashtable; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.meterware.httpunit.HttpUnitOptions; -import com.meterware.servletunit.ServletRunner; - - -/** - * Base TestCase class for jsp tests. - * @author fgiust - */ -public abstract class BaseJspEmbeddedTest -{ - - /** - * Context mapped to the test application. - */ - public static final String CONTEXT = "/context"; - - /** - * Logger. - */ - protected Logger log = LoggerFactory.getLogger(getClass()); - - /** - * HttpUnit ServletRunner. - */ - protected ServletRunner runner; - - protected String getJspUrl(String jsp) - { - return "http://localhost" + CONTEXT + "/jsps/" + jsp; - } - - /** - * @see junit.framework.TestCase#setUp() - */ - public void setUp() throws Exception - { - // need to pass a web.xml file to setup servletunit working directory - ClassLoader classLoader = getClass().getClassLoader(); - URL webXmlUrl = classLoader.getResource("WEB-INF/web.xml"); - String path = URLDecoder.decode(webXmlUrl.getFile(), "UTF-8"); - - HttpUnitOptions.setDefaultCharacterSet("utf-8"); - System.setProperty("file.encoding", "utf-8"); - - // start servletRunner - runner = new ServletRunner(new File(path), CONTEXT); - - Hashtable<String, String> params = new Hashtable<String, String>(); - params.put("javaEncoding", "utf-8"); - runner.registerServlet("*.jsp", "org.apache.jasper.servlet.JspServlet", params); - - log.debug("ServletRunner setup OK"); - - } - - /** - * @see junit.framework.TestCase#tearDown() - */ - public void tearDown() throws Exception - { - // shutdown servlet engine - runner.shutDown(); - } - -} \ No newline at end of file Deleted: trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspTestngEmbeddedTest.java =================================================================== --- trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspTestngEmbeddedTest.java 2010-01-18 17:13:45 UTC (rev 1675) +++ trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/BaseJspTestngEmbeddedTest.java 2010-01-18 17:19:39 UTC (rev 1676) @@ -1,52 +0,0 @@ -/** - * - * openutils-elfunctions (http://www.openmindlab.com/lab/products/elfunctions.html) - * Copyright (C)null - 2010, Openmind S.r.l. http://www.openmindonline.it - * - * 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 net.sourceforge.openutils.elfunctions; - -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; - - -/** - * @author fgiust - * @version $Id$ - */ -public abstract class BaseJspTestngEmbeddedTest extends BaseJspEmbeddedTest -{ - - /** - * {@inheritDoc} - */ - @Override - @BeforeClass - public void setUp() throws Exception - { - super.setUp(); - } - - /** - * {@inheritDoc} - */ - @Override - @AfterClass - public void tearDown() throws Exception - { - super.tearDown(); - } - -} Modified: trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java =================================================================== --- trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java 2010-01-18 17:13:45 UTC (rev 1675) +++ trunk/openutils-elfunctions/src/test/java/net/sourceforge/openutils/elfunctions/JspTest.java 2010-01-18 17:19:39 UTC (rev 1676) @@ -1,7 +1,7 @@ /** * * openutils-elfunctions (http://www.openmindlab.com/lab/products/elfunctions.html) - * Copyright (C)null - 2010, Openmind S.r.l. http://www.openmindonline.it + * Copyright(C) 2008-2010, Openmind S.r.l. http://www.openmindonline.it * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,18 +18,11 @@ package net.sourceforge.openutils.elfunctions; -import java.io.InputStream; +import net.sourceforge.openutils.testing4web.BaseJspTestngEmbeddedTest; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; -import org.testng.Assert; import org.testng.annotations.Test; -import com.meterware.httpunit.GetMethodWebRequest; -import com.meterware.httpunit.WebRequest; -import com.meterware.httpunit.WebResponse; - /** * @author fgiust * @version $Id$ @@ -37,31 +30,9 @@ public class JspTest extends BaseJspTestngEmbeddedTest { - protected void checkJspWithExpectedTxt(String jspname) throws Exception - { - WebRequest request = new GetMethodWebRequest(getJspUrl(jspname)); - - WebResponse response = runner.getResponse(request); - - if (log.isDebugEnabled()) - { - log.debug("RESPONSE: " + response.getText()); - } - - String responseText = response.getText(); - - String expectedFileName = StringUtils.replace(jspname, ".jsp", ".txt"); - - InputStream stream = getClass().getResourceAsStream("/jsps/" + expectedFileName); - String expected = IOUtils.toString(stream); - IOUtils.closeQuietly(stream); - - Assert.assertEquals(responseText, expected); - } - @Test public void capitaliseAllWordsTest() throws Exception { - checkJspWithExpectedTxt("capitaliseAllWords.jsp"); + checkGetWithExpectedTxt("capitaliseAllWords.jsp"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <me...@us...> - 2010-01-20 11:52:59
|
Revision: 1687 http://openutils.svn.sourceforge.net/openutils/?rev=1687&view=rev Author: memila Date: 2010-01-20 11:52:50 +0000 (Wed, 20 Jan 2010) Log Message: ----------- aggionta dependencys for testing to work Modified Paths: -------------- trunk/openutils-elfunctions/pom.xml trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml Added Paths: ----------- trunk/openutils-elfunctions/src/test/resources/WEB-INF/c.tld Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2010-01-20 10:58:03 UTC (rev 1686) +++ trunk/openutils-elfunctions/pom.xml 2010-01-20 11:52:50 UTC (rev 1687) @@ -136,6 +136,18 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>httpunit</groupId> + <artifactId>httpunit</artifactId> + <version>1.7</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + <version>1.1.2</version> + <scope>test</scope> + </dependency> </dependencies> <dependencyManagement> <dependencies> @@ -170,6 +182,11 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + <version>1.1.2</version> + </dependency> </dependencies> </dependencyManagement> </project> \ No newline at end of file Added: trunk/openutils-elfunctions/src/test/resources/WEB-INF/c.tld =================================================================== --- trunk/openutils-elfunctions/src/test/resources/WEB-INF/c.tld (rev 0) +++ trunk/openutils-elfunctions/src/test/resources/WEB-INF/c.tld 2010-01-20 11:52:50 UTC (rev 1687) @@ -0,0 +1,563 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<taglib xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" + version="2.0"> + + <description>JSTL 1.1 core library</description> + <display-name>JSTL core</display-name> + <tlib-version>1.1</tlib-version> + <short-name>c</short-name> + <uri>http://java.sun.com/jsp/jstl/core</uri> + + <validator> + <description> + Provides core validation features for JSTL tags. + </description> + <validator-class> + org.apache.taglibs.standard.tlv.JstlCoreTLV + </validator-class> + </validator> + + <tag> + <description> + Catches any Throwable that occurs in its body and optionally + exposes it. + </description> + <name>catch</name> + <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> +Name of the exported scoped variable for the +exception thrown from a nested action. The type of the +scoped variable is the type of the exception thrown. + </description> + <name>var</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + </tag> + + <tag> + <description> + Simple conditional tag that establishes a context for + mutually exclusive conditional operations, marked by + <when> and <otherwise> + </description> + <name>choose</name> + <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> + <body-content>JSP</body-content> + </tag> + + <tag> + <description> + Simple conditional tag, which evalutes its body if the + supplied condition is true and optionally exposes a Boolean + scripting variable representing the evaluation of this condition + </description> + <name>if</name> + <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> +The test condition that determines whether or +not the body content should be processed. + </description> + <name>test</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + <type>boolean</type> + </attribute> + <attribute> + <description> +Name of the exported scoped variable for the +resulting value of the test condition. The type +of the scoped variable is Boolean. + </description> + <name>var</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + <attribute> + <description> +Scope for var. + </description> + <name>scope</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + </tag> + + <tag> + <description> + Retrieves an absolute or relative URL and exposes its contents + to either the page, a String in 'var', or a Reader in 'varReader'. + </description> + <name>import</name> + <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> + <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> + <body-content>JSP</body-content> + <attribute> + <description> +The URL of the resource to import. + </description> + <name>url</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> +Name of the exported scoped variable for the +resource's content. The type of the scoped +variable is String. + </description> + <name>var</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + <attribute> + <description> +Scope for var. + </description> + <name>scope</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + <attribute> + <description> +Name of the exported scoped variable for the +resource's content. The type of the scoped +variable is Reader. + </description> + <name>varReader</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + <attribute> + <description> +Name of the context when accessing a relative +URL resource that belongs to a foreign +context. + </description> + <name>context</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> +Character encoding of the content at the input +resource. + </description> + <name>charEncoding</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <description> + The basic iteration tag, accepting many different + collection types and supporting subsetting and other + functionality + </description> + <name>forEach</name> + <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class> + <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> + <body-content>JSP</body-content> + <attribute> + <description> +Collection of items to iterate over. + </description> + <name>items</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>java.lang.Object</type> + </attribute> + <attribute> + <description> +If items specified: +Iteration begins at the item located at the +specified index. First item of the collection has +index 0. +If items not specified: +Iteration begins with index set at the value +specified. + </description> + <name>begin</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>int</type> + </attribute> + <attribute> + <description> +If items specified: +Iteration ends at the item located at the +specified index (inclusive). +If items not specified: +Iteration ends when index reaches the value +specified. + </description> + <name>end</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>int</type> + </attribute> + <attribute> + <description> +Iteration will only process every step items of +the collection, starting with the first one. + </description> + <name>step</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>int</type> + </attribute> + <attribute> + <description> +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. Its type depends +on the object of the underlying collection. + </description> + <name>var</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + <attribute> + <description> +Name of the exported scoped variable for the +status of the iteration. Object exported is of type +javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested +visibility. + </description> + <name>varStatus</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + </tag> + + <tag> + <description> + Iterates over tokens, separated by the supplied delimeters + </description> + <name>forTokens</name> + <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> +String of tokens to iterate over. + </description> + <name>items</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + <type>java.lang.String</type> + </attribute> + <attribute> + <description> +The set of delimiters (the characters that +separate the tokens in the string). + </description> + <name>delims</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + <type>java.lang.String</type> + </attribute> + <attribute> + <description> +Iteration begins at the token located at the +specified index. First token has index 0. + </description> + <name>begin</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>int</type> + </attribute> + <attribute> + <description> +Iteration ends at the token located at the +specified index (inclusive). + </description> + <name>end</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>int</type> + </attribute> + <attribute> + <description> +Iteration will only process every step tokens +of the string, starting with the first one. + </description> + <name>step</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>int</type> + </attribute> + <attribute> + <description> +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. + </description> + <name>var</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + <attribute> + <description> +Name of the exported scoped variable for the +status of the iteration. Object exported is of +type +javax.servlet.jsp.jstl.core.LoopTag +Status. This scoped variable has nested +visibility. + </description> + <name>varStatus</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + </tag> + + <tag> + <description> + Like <%= ... >, but for expressions. + </description> + <name>out</name> + <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> +Expression to be evaluated. + </description> + <name>value</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> +Default value if the resulting value is null. + </description> + <name>default</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> +Determines whether characters <,>,&,'," in the +resulting string should be converted to their +corresponding character entity codes. Default value is +true. + </description> + <name>escapeXml</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + + <tag> + <description> + Subtag of <choose> that follows <when> tags + and runs only if all of the prior conditions evaluated to + 'false' + </description> + <name>otherwise</name> + <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> + <body-content>JSP</body-content> + </tag> + + <tag> + <description> + Adds a parameter to a containing 'import' tag's URL. + </description> + <name>param</name> + <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> +Name of the query string parameter. + </description> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> +Value of the parameter. + </description> + <name>value</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <description> + Redirects to a new URL. + </description> + <name>redirect</name> + <tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> +The URL of the resource to redirect to. + </description> + <name>url</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> +Name of the context when redirecting to a relative URL +resource that belongs to a foreign context. + </description> + <name>context</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <description> + Removes a scoped variable (from a particular scope, if specified). + </description> + <name>remove</name> + <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> + <body-content>empty</body-content> + <attribute> + <description> +Name of the scoped variable to be removed. + </description> + <name>var</name> + <required>true</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + <attribute> + <description> +Scope for var. + </description> + <name>scope</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + </tag> + + <tag> + <description> + Sets the result of an expression evaluation in a 'scope' + </description> + <name>set</name> + <tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> +Name of the exported scoped variable to hold the value +specified in the action. The type of the scoped variable is +whatever type the value expression evaluates to. + </description> + <name>var</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + <attribute> + <description> +Expression to be evaluated. + </description> + <name>value</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> +Target object whose property will be set. Must evaluate to +a JavaBeans object with setter property property, or to a +java.util.Map object. + </description> + <name>target</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> +Name of the property to be set in the target object. + </description> + <name>property</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> +Scope for var. + </description> + <name>scope</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + </tag> + + <tag> + <description> + Creates a URL with optional query parameters. + </description> + <name>url</name> + <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> +Name of the exported scoped variable for the +processed url. The type of the scoped variable is +String. + </description> + <name>var</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + <attribute> + <description> +Scope for var. + </description> + <name>scope</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + </attribute> + <attribute> + <description> +URL to be processed. + </description> + <name>value</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> +Name of the context when specifying a relative URL +resource that belongs to a foreign context. + </description> + <name>context</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <description> + Subtag of <choose> that includes its body if its + condition evalutes to 'true' + </description> + <name>when</name> + <tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> +The test condition that determines whether or not the +body content should be processed. + </description> + <name>test</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + <type>boolean</type> + </attribute> + </tag> + +</taglib> Modified: trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml =================================================================== --- trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml 2010-01-20 10:58:03 UTC (rev 1686) +++ trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml 2010-01-20 11:52:50 UTC (rev 1687) @@ -9,4 +9,12 @@ <taglib-uri>http://openutils.sf.net/openutils-stringutils</taglib-uri> <taglib-location>/../classes/META-INF/stringutils.tld</taglib-location> </taglib> + <taglib> + <taglib-uri>dateutils</taglib-uri> + <taglib-location>/../classes/META-INF/dateutils.tld</taglib-location> + </taglib> + <taglib> + <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri> + <taglib-location>c.tld</taglib-location> + </taglib> </web-app> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-01-20 23:38:09
|
Revision: 1698 http://openutils.svn.sourceforge.net/openutils/?rev=1698&view=rev Author: fgiust Date: 2010-01-20 23:38:02 +0000 (Wed, 20 Jan 2010) Log Message: ----------- small jasper patch to avoid annoying logs Modified Paths: -------------- trunk/openutils-elfunctions/pom.xml trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml Added Paths: ----------- trunk/openutils-elfunctions/src/test/java/org/ trunk/openutils-elfunctions/src/test/java/org/apache/ trunk/openutils-elfunctions/src/test/java/org/apache/jasper/ trunk/openutils-elfunctions/src/test/java/org/apache/jasper/compiler/ trunk/openutils-elfunctions/src/test/java/org/apache/jasper/compiler/Compiler.java Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2010-01-20 20:28:33 UTC (rev 1697) +++ trunk/openutils-elfunctions/pom.xml 2010-01-20 23:38:02 UTC (rev 1698) @@ -23,6 +23,11 @@ <system>jira</system> <url>http://jira.openmindlab.com/browse/ELFUNCTIONS</url> </issueManagement> + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-elfunctions</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-elfunctions</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-elfunctions</url> + </scm> <build> <plugins> <plugin> Added: trunk/openutils-elfunctions/src/test/java/org/apache/jasper/compiler/Compiler.java =================================================================== --- trunk/openutils-elfunctions/src/test/java/org/apache/jasper/compiler/Compiler.java (rev 0) +++ trunk/openutils-elfunctions/src/test/java/org/apache/jasper/compiler/Compiler.java 2010-01-20 23:38:02 UTC (rev 1698) @@ -0,0 +1,562 @@ +// small patch to remove annoying system.err.println during unit tests +// see @fix annotation for change +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.jasper.compiler; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; +import java.net.URL; +import java.net.URLConnection; +import java.util.Iterator; +import java.util.List; + +import org.apache.jasper.JasperException; +import org.apache.jasper.JspCompilationContext; +import org.apache.jasper.Options; +import org.apache.jasper.servlet.JspServletWrapper; + + +/** + * Main JSP compiler class. This class uses Ant for compiling. + * @author Anil K. Vijendran + * @author Mandar Raje + * @author Pierre Delisle + * @author Kin-man Chung + * @author Remy Maucherat + * @author Mark Roth + */ +public abstract class Compiler +{ + + protected org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(Compiler.class); + + // ----------------------------------------------------------------- Static + + // Some javac are not thread safe; use a lock to serialize compilation, + static Object javacLock = new Object(); + + // ----------------------------------------------------- Instance Variables + + protected JspCompilationContext ctxt; + + protected ErrorDispatcher errDispatcher; + + protected PageInfo pageInfo; + + protected JspServletWrapper jsw; + + protected TagFileProcessor tfp; + + protected Options options; + + protected Node.Nodes pageNodes; + + // ------------------------------------------------------------ Constructor + + public void init(JspCompilationContext ctxt, JspServletWrapper jsw) + { + this.jsw = jsw; + this.ctxt = ctxt; + this.options = ctxt.getOptions(); + } + + // --------------------------------------------------------- Public Methods + + /** + * <p> + * Retrieves the parsed nodes of the JSP page, if they are available. May return null. Used in development mode for + * generating detailed error messages. http://issues.apache.org/bugzilla/show_bug.cgi?id=37062. + * </p> + */ + public Node.Nodes getPageNodes() + { + return this.pageNodes; + } + + /** + * Compile the jsp file into equivalent servlet in .java file + * @return a smap for the current JSP page, if one is generated, null otherwise + */ + protected String[] generateJava() throws Exception + { + + String[] smapStr = null; + + long t1, t2, t3, t4; + + t1 = t2 = t3 = t4 = 0; + + if (log.isDebugEnabled()) + { + t1 = System.currentTimeMillis(); + } + + // Setup page info area + pageInfo = new PageInfo(new BeanRepository(ctxt.getClassLoader(), errDispatcher), ctxt.getJspFile()); + + JspConfig jspConfig = options.getJspConfig(); + JspConfig.JspProperty jspProperty = jspConfig.findJspProperty(ctxt.getJspFile()); + + /* + * If the current uri is matched by a pattern specified in a jsp-property-group in web.xml, initialize pageInfo + * with those properties. + */ + pageInfo.setELIgnored(JspUtil.booleanValue(jspProperty.isELIgnored())); + pageInfo.setScriptingInvalid(JspUtil.booleanValue(jspProperty.isScriptingInvalid())); + if (jspProperty.getIncludePrelude() != null) + { + pageInfo.setIncludePrelude(jspProperty.getIncludePrelude()); + } + if (jspProperty.getIncludeCoda() != null) + { + pageInfo.setIncludeCoda(jspProperty.getIncludeCoda()); + } + + String javaFileName = ctxt.getServletJavaFileName(); + ServletWriter writer = null; + + try + { + // Setup the ServletWriter + String javaEncoding = ctxt.getOptions().getJavaEncoding(); + OutputStreamWriter osw = null; + + try + { + osw = new OutputStreamWriter(new FileOutputStream(javaFileName), javaEncoding); + } + catch (UnsupportedEncodingException ex) + { + errDispatcher.jspError("jsp.error.needAlternateJavaEncoding", javaEncoding); + } + + writer = new ServletWriter(new PrintWriter(osw)); + ctxt.setWriter(writer); + + // Reset the temporary variable counter for the generator. + JspUtil.resetTemporaryVariableName(); + + // Parse the file + ParserController parserCtl = new ParserController(ctxt, this); + pageNodes = parserCtl.parse(ctxt.getJspFile()); + + if (ctxt.isPrototypeMode()) + { + // generate prototype .java file for the tag file + Generator.generate(writer, this, pageNodes); + writer.close(); + writer = null; + return null; + } + + // Validate and process attributes + Validator.validate(this, pageNodes); + + if (log.isDebugEnabled()) + { + t2 = System.currentTimeMillis(); + } + + // Collect page info + Collector.collect(this, pageNodes); + + // Compile (if necessary) and load the tag files referenced in + // this compilation unit. + tfp = new TagFileProcessor(); + tfp.loadTagFiles(this, pageNodes); + + if (log.isDebugEnabled()) + { + t3 = System.currentTimeMillis(); + } + + // Determine which custom tag needs to declare which scripting vars + ScriptingVariabler.set(pageNodes, errDispatcher); + + // Optimizations by Tag Plugins + TagPluginManager tagPluginManager = options.getTagPluginManager(); + tagPluginManager.apply(pageNodes, errDispatcher, pageInfo); + + // Optimization: concatenate contiguous template texts. + TextOptimizer.concatenate(this, pageNodes); + + // Generate static function mapper codes. + ELFunctionMapper.map(this, pageNodes); + + // generate servlet .java file + Generator.generate(writer, this, pageNodes); + writer.close(); + writer = null; + + // The writer is only used during the compile, dereference + // it in the JspCompilationContext when done to allow it + // to be GC'd and save memory. + ctxt.setWriter(null); + + if (log.isDebugEnabled()) + { + t4 = System.currentTimeMillis(); + log.debug("Generated " + + javaFileName + + " total=" + + (t4 - t1) + + " generate=" + + (t4 - t3) + + " validate=" + + (t2 - t1)); + } + + } + catch (Exception e) + { + if (writer != null) + { + try + { + writer.close(); + writer = null; + } + catch (Exception e1) + { + // do nothing + } + } + // Remove the generated .java file + new File(javaFileName).delete(); + throw e; + } + finally + { + if (writer != null) + { + try + { + writer.close(); + } + catch (Exception e2) + { + // do nothing + } + } + } + + // JSR45 Support + if (!options.isSmapSuppressed()) + { + smapStr = SmapUtil.generateSmap(ctxt, pageNodes); + } + + // If any proto type .java and .class files was generated, + // the prototype .java may have been replaced by the current + // compilation (if the tag file is self referencing), but the + // .class file need to be removed, to make sure that javac would + // generate .class again from the new .java file just generated. + tfp.removeProtoTypeFiles(ctxt.getClassFileName()); + + return smapStr; + } + + /** + * Compile the servlet from .java file to .class file + */ + protected abstract void generateClass(String[] smap) throws FileNotFoundException, JasperException, Exception; + + /** + * Compile the jsp file from the current engine context + */ + public void compile() throws FileNotFoundException, JasperException, Exception + { + compile(true); + } + + /** + * Compile the jsp file from the current engine context. As an side- effect, tag files that are referenced by this + * page are also compiled. + * @param compileClass If true, generate both .java and .class file If false, generate only .java file + */ + public void compile(boolean compileClass) throws FileNotFoundException, JasperException, Exception + { + compile(compileClass, false); + } + + /** + * Compile the jsp file from the current engine context. As an side- effect, tag files that are referenced by this + * page are also compiled. + * @param compileClass If true, generate both .java and .class file If false, generate only .java file + * @param jspcMode true if invoked from JspC, false otherwise + */ + public void compile(boolean compileClass, boolean jspcMode) throws FileNotFoundException, JasperException, + Exception + { + if (errDispatcher == null) + { + this.errDispatcher = new ErrorDispatcher(jspcMode); + } + + try + { + String[] smap = generateJava(); + if (compileClass) + { + generateClass(smap); + } + } + finally + { + if (tfp != null) + { + tfp.removeProtoTypeFiles(null); + } + // Make sure these object which are only used during the + // generation and compilation of the JSP page get + // dereferenced so that they can be GC'd and reduce the + // memory footprint. + tfp = null; + errDispatcher = null; + pageInfo = null; + + // Only get rid of the pageNodes if in production. + // In development mode, they are used for detailed + // error messages. + // http://issues.apache.org/bugzilla/show_bug.cgi?id=37062 + if (!this.options.getDevelopment()) + { + pageNodes = null; + } + + if (ctxt.getWriter() != null) + { + ctxt.getWriter().close(); + ctxt.setWriter(null); + } + } + } + + /** + * This is a protected method intended to be overridden by subclasses of Compiler. This is used by the compile + * method to do all the compilation. + */ + public boolean isOutDated() + { + return isOutDated(true); + } + + /** + * Determine if a compilation is necessary by checking the time stamp of the JSP page with that of the corresponding + * .class or .java file. If the page has dependencies, the check is also extended to its dependeants, and so on. + * This method can by overidden by a subclasses of Compiler. + * @param checkClass If true, check against .class file, if false, check against .java file. + */ + public boolean isOutDated(boolean checkClass) + { + + String jsp = ctxt.getJspFile(); + + if (jsw != null && (ctxt.getOptions().getModificationTestInterval() > 0)) + { + + if (jsw.getLastModificationTest() + (ctxt.getOptions().getModificationTestInterval() * 1000) > System + .currentTimeMillis()) + { + return false; + } + else + { + jsw.setLastModificationTest(System.currentTimeMillis()); + } + } + + long jspRealLastModified = 0; + try + { + URL jspUrl = ctxt.getResource(jsp); + if (jspUrl == null) + { + ctxt.incrementRemoved(); + return false; + } + URLConnection uc = jspUrl.openConnection(); + jspRealLastModified = uc.getLastModified(); + uc.getInputStream().close(); + } + catch (Exception e) + { + // @fix printStackTrace commented out + // e.pri ntStackTrace(); + return true; + } + + long targetLastModified = 0; + File targetFile; + + if (checkClass) + { + targetFile = new File(ctxt.getClassFileName()); + } + else + { + targetFile = new File(ctxt.getServletJavaFileName()); + } + + if (!targetFile.exists()) + { + return true; + } + + targetLastModified = targetFile.lastModified(); + if (checkClass && jsw != null) + { + jsw.setServletClassLastModifiedTime(targetLastModified); + } + if (targetLastModified < jspRealLastModified) + { + if (log.isDebugEnabled()) + { + log.debug("Compiler: outdated: " + targetFile + " " + targetLastModified); + } + return true; + } + + // determine if source dependent files (e.g. includes using include + // directives) have been changed. + if (jsw == null) + { + return false; + } + + List depends = jsw.getDependants(); + if (depends == null) + { + return false; + } + + Iterator it = depends.iterator(); + while (it.hasNext()) + { + String include = (String) it.next(); + try + { + URL includeUrl = ctxt.getResource(include); + if (includeUrl == null) + { + return true; + } + + URLConnection includeUconn = includeUrl.openConnection(); + long includeLastModified = includeUconn.getLastModified(); + includeUconn.getInputStream().close(); + + if (includeLastModified > targetLastModified) + { + return true; + } + } + catch (Exception e) + { + // @fix printStackTrace commented out + // e.pri ntStackTrace(); + return true; + } + } + + return false; + + } + + /** + * Gets the error dispatcher. + */ + public ErrorDispatcher getErrorDispatcher() + { + return errDispatcher; + } + + /** + * Gets the info about the page under compilation + */ + public PageInfo getPageInfo() + { + return pageInfo; + } + + public JspCompilationContext getCompilationContext() + { + return ctxt; + } + + /** + * Remove generated files + */ + public void removeGeneratedFiles() + { + try + { + String classFileName = ctxt.getClassFileName(); + if (classFileName != null) + { + File classFile = new File(classFileName); + if (log.isDebugEnabled()) + log.debug("Deleting " + classFile); + classFile.delete(); + } + } + catch (Exception e) + { + // Remove as much as possible, ignore possible exceptions + } + try + { + String javaFileName = ctxt.getServletJavaFileName(); + if (javaFileName != null) + { + File javaFile = new File(javaFileName); + if (log.isDebugEnabled()) + log.debug("Deleting " + javaFile); + javaFile.delete(); + } + } + catch (Exception e) + { + // Remove as much as possible, ignore possible exceptions + } + } + + public void removeGeneratedClassFiles() + { + try + { + String classFileName = ctxt.getClassFileName(); + if (classFileName != null) + { + File classFile = new File(classFileName); + if (log.isDebugEnabled()) + log.debug("Deleting " + classFile); + classFile.delete(); + } + } + catch (Exception e) + { + // Remove as much as possible, ignore possible exceptions + } + } +} Property changes on: trunk/openutils-elfunctions/src/test/java/org/apache/jasper/compiler/Compiler.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml =================================================================== --- trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml 2010-01-20 20:28:33 UTC (rev 1697) +++ trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml 2010-01-20 23:38:02 UTC (rev 1698) @@ -13,8 +13,4 @@ <taglib-uri>dateutils</taglib-uri> <taglib-location>/../classes/META-INF/dateutils.tld</taglib-location> </taglib> - <taglib> - <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri> - <taglib-location>c.tld</taglib-location> - </taglib> </web-app> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-02-24 23:10:54
|
Revision: 2060 http://openutils.svn.sourceforge.net/openutils/?rev=2060&view=rev Author: fgiust Date: 2010-02-24 22:43:09 +0000 (Wed, 24 Feb 2010) Log Message: ----------- update openutils-testing4web Modified Paths: -------------- trunk/openutils-elfunctions/pom.xml trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml Removed Paths: ------------- trunk/openutils-elfunctions/src/test/java/org/apache/jasper/compiler/ trunk/openutils-elfunctions/src/test/resources/WEB-INF/c.tld Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2010-02-24 22:30:54 UTC (rev 2059) +++ trunk/openutils-elfunctions/pom.xml 2010-02-24 22:43:09 UTC (rev 2060) @@ -104,7 +104,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing4web</artifactId> - <version>1.1</version> + <version>1.2</version> <scope>test</scope> </dependency> <dependency> Deleted: trunk/openutils-elfunctions/src/test/resources/WEB-INF/c.tld =================================================================== --- trunk/openutils-elfunctions/src/test/resources/WEB-INF/c.tld 2010-02-24 22:30:54 UTC (rev 2059) +++ trunk/openutils-elfunctions/src/test/resources/WEB-INF/c.tld 2010-02-24 22:43:09 UTC (rev 2060) @@ -1,563 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> - -<taglib xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" - version="2.0"> - - <description>JSTL 1.1 core library</description> - <display-name>JSTL core</display-name> - <tlib-version>1.1</tlib-version> - <short-name>c</short-name> - <uri>http://java.sun.com/jsp/jstl/core</uri> - - <validator> - <description> - Provides core validation features for JSTL tags. - </description> - <validator-class> - org.apache.taglibs.standard.tlv.JstlCoreTLV - </validator-class> - </validator> - - <tag> - <description> - Catches any Throwable that occurs in its body and optionally - exposes it. - </description> - <name>catch</name> - <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> - <body-content>JSP</body-content> - <attribute> - <description> -Name of the exported scoped variable for the -exception thrown from a nested action. The type of the -scoped variable is the type of the exception thrown. - </description> - <name>var</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - </tag> - - <tag> - <description> - Simple conditional tag that establishes a context for - mutually exclusive conditional operations, marked by - <when> and <otherwise> - </description> - <name>choose</name> - <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> - <body-content>JSP</body-content> - </tag> - - <tag> - <description> - Simple conditional tag, which evalutes its body if the - supplied condition is true and optionally exposes a Boolean - scripting variable representing the evaluation of this condition - </description> - <name>if</name> - <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class> - <body-content>JSP</body-content> - <attribute> - <description> -The test condition that determines whether or -not the body content should be processed. - </description> - <name>test</name> - <required>true</required> - <rtexprvalue>true</rtexprvalue> - <type>boolean</type> - </attribute> - <attribute> - <description> -Name of the exported scoped variable for the -resulting value of the test condition. The type -of the scoped variable is Boolean. - </description> - <name>var</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - <attribute> - <description> -Scope for var. - </description> - <name>scope</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - </tag> - - <tag> - <description> - Retrieves an absolute or relative URL and exposes its contents - to either the page, a String in 'var', or a Reader in 'varReader'. - </description> - <name>import</name> - <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> - <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> - <body-content>JSP</body-content> - <attribute> - <description> -The URL of the resource to import. - </description> - <name>url</name> - <required>true</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - <attribute> - <description> -Name of the exported scoped variable for the -resource's content. The type of the scoped -variable is String. - </description> - <name>var</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - <attribute> - <description> -Scope for var. - </description> - <name>scope</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - <attribute> - <description> -Name of the exported scoped variable for the -resource's content. The type of the scoped -variable is Reader. - </description> - <name>varReader</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - <attribute> - <description> -Name of the context when accessing a relative -URL resource that belongs to a foreign -context. - </description> - <name>context</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - <attribute> - <description> -Character encoding of the content at the input -resource. - </description> - <name>charEncoding</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - </tag> - - <tag> - <description> - The basic iteration tag, accepting many different - collection types and supporting subsetting and other - functionality - </description> - <name>forEach</name> - <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class> - <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> - <body-content>JSP</body-content> - <attribute> - <description> -Collection of items to iterate over. - </description> - <name>items</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <type>java.lang.Object</type> - </attribute> - <attribute> - <description> -If items specified: -Iteration begins at the item located at the -specified index. First item of the collection has -index 0. -If items not specified: -Iteration begins with index set at the value -specified. - </description> - <name>begin</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <type>int</type> - </attribute> - <attribute> - <description> -If items specified: -Iteration ends at the item located at the -specified index (inclusive). -If items not specified: -Iteration ends when index reaches the value -specified. - </description> - <name>end</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <type>int</type> - </attribute> - <attribute> - <description> -Iteration will only process every step items of -the collection, starting with the first one. - </description> - <name>step</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <type>int</type> - </attribute> - <attribute> - <description> -Name of the exported scoped variable for the -current item of the iteration. This scoped -variable has nested visibility. Its type depends -on the object of the underlying collection. - </description> - <name>var</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - <attribute> - <description> -Name of the exported scoped variable for the -status of the iteration. Object exported is of type -javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested -visibility. - </description> - <name>varStatus</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - </tag> - - <tag> - <description> - Iterates over tokens, separated by the supplied delimeters - </description> - <name>forTokens</name> - <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> - <body-content>JSP</body-content> - <attribute> - <description> -String of tokens to iterate over. - </description> - <name>items</name> - <required>true</required> - <rtexprvalue>true</rtexprvalue> - <type>java.lang.String</type> - </attribute> - <attribute> - <description> -The set of delimiters (the characters that -separate the tokens in the string). - </description> - <name>delims</name> - <required>true</required> - <rtexprvalue>true</rtexprvalue> - <type>java.lang.String</type> - </attribute> - <attribute> - <description> -Iteration begins at the token located at the -specified index. First token has index 0. - </description> - <name>begin</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <type>int</type> - </attribute> - <attribute> - <description> -Iteration ends at the token located at the -specified index (inclusive). - </description> - <name>end</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <type>int</type> - </attribute> - <attribute> - <description> -Iteration will only process every step tokens -of the string, starting with the first one. - </description> - <name>step</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <type>int</type> - </attribute> - <attribute> - <description> -Name of the exported scoped variable for the -current item of the iteration. This scoped -variable has nested visibility. - </description> - <name>var</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - <attribute> - <description> -Name of the exported scoped variable for the -status of the iteration. Object exported is of -type -javax.servlet.jsp.jstl.core.LoopTag -Status. This scoped variable has nested -visibility. - </description> - <name>varStatus</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - </tag> - - <tag> - <description> - Like <%= ... >, but for expressions. - </description> - <name>out</name> - <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class> - <body-content>JSP</body-content> - <attribute> - <description> -Expression to be evaluated. - </description> - <name>value</name> - <required>true</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - <attribute> - <description> -Default value if the resulting value is null. - </description> - <name>default</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - <attribute> - <description> -Determines whether characters <,>,&,'," in the -resulting string should be converted to their -corresponding character entity codes. Default value is -true. - </description> - <name>escapeXml</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - </tag> - - - <tag> - <description> - Subtag of <choose> that follows <when> tags - and runs only if all of the prior conditions evaluated to - 'false' - </description> - <name>otherwise</name> - <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> - <body-content>JSP</body-content> - </tag> - - <tag> - <description> - Adds a parameter to a containing 'import' tag's URL. - </description> - <name>param</name> - <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> - <body-content>JSP</body-content> - <attribute> - <description> -Name of the query string parameter. - </description> - <name>name</name> - <required>true</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - <attribute> - <description> -Value of the parameter. - </description> - <name>value</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - </tag> - - <tag> - <description> - Redirects to a new URL. - </description> - <name>redirect</name> - <tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class> - <body-content>JSP</body-content> - <attribute> - <description> -The URL of the resource to redirect to. - </description> - <name>url</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - <attribute> - <description> -Name of the context when redirecting to a relative URL -resource that belongs to a foreign context. - </description> - <name>context</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - </tag> - - <tag> - <description> - Removes a scoped variable (from a particular scope, if specified). - </description> - <name>remove</name> - <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> - <body-content>empty</body-content> - <attribute> - <description> -Name of the scoped variable to be removed. - </description> - <name>var</name> - <required>true</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - <attribute> - <description> -Scope for var. - </description> - <name>scope</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - </tag> - - <tag> - <description> - Sets the result of an expression evaluation in a 'scope' - </description> - <name>set</name> - <tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class> - <body-content>JSP</body-content> - <attribute> - <description> -Name of the exported scoped variable to hold the value -specified in the action. The type of the scoped variable is -whatever type the value expression evaluates to. - </description> - <name>var</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - <attribute> - <description> -Expression to be evaluated. - </description> - <name>value</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - <attribute> - <description> -Target object whose property will be set. Must evaluate to -a JavaBeans object with setter property property, or to a -java.util.Map object. - </description> - <name>target</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - <attribute> - <description> -Name of the property to be set in the target object. - </description> - <name>property</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - <attribute> - <description> -Scope for var. - </description> - <name>scope</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - </tag> - - <tag> - <description> - Creates a URL with optional query parameters. - </description> - <name>url</name> - <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> - <body-content>JSP</body-content> - <attribute> - <description> -Name of the exported scoped variable for the -processed url. The type of the scoped variable is -String. - </description> - <name>var</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - <attribute> - <description> -Scope for var. - </description> - <name>scope</name> - <required>false</required> - <rtexprvalue>false</rtexprvalue> - </attribute> - <attribute> - <description> -URL to be processed. - </description> - <name>value</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - <attribute> - <description> -Name of the context when specifying a relative URL -resource that belongs to a foreign context. - </description> - <name>context</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - </attribute> - </tag> - - <tag> - <description> - Subtag of <choose> that includes its body if its - condition evalutes to 'true' - </description> - <name>when</name> - <tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class> - <body-content>JSP</body-content> - <attribute> - <description> -The test condition that determines whether or not the -body content should be processed. - </description> - <name>test</name> - <required>true</required> - <rtexprvalue>true</rtexprvalue> - <type>boolean</type> - </attribute> - </tag> - -</taglib> Modified: trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml =================================================================== --- trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml 2010-02-24 22:30:54 UTC (rev 2059) +++ trunk/openutils-elfunctions/src/test/resources/WEB-INF/web.xml 2010-02-24 22:43:09 UTC (rev 2060) @@ -5,16 +5,4 @@ <extension>jsp</extension> <mime-type>text/html</mime-type> </mime-mapping> - <taglib> - <taglib-uri>http://openutils.sf.net/openutils-stringutils</taglib-uri> - <taglib-location>/../classes/META-INF/stringutils.tld</taglib-location> - </taglib> - <taglib> - <taglib-uri>dateutils</taglib-uri> - <taglib-location>/../classes/META-INF/dateutils.tld</taglib-location> - </taglib> - <taglib> - <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri> - <taglib-location>c.tld</taglib-location> - </taglib> </web-app> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |