From: <fg...@us...> - 2010-01-31 16:26:32
|
Revision: 1726 http://openutils.svn.sourceforge.net/openutils/?rev=1726&view=rev Author: fgiust Date: 2010-01-31 16:26:25 +0000 (Sun, 31 Jan 2010) Log Message: ----------- update parent to version 1.2 Modified Paths: -------------- trunk/magnolia-test-webapp/pom.xml trunk/openutils-bshd5/pom.xml trunk/openutils-dbmigration/pom.xml trunk/openutils-deployment/pom.xml trunk/openutils-elfunctions/pom.xml trunk/openutils-log4j/pom.xml trunk/openutils-mgnlbootstrapsync/pom.xml trunk/openutils-mgnlcas/pom.xml trunk/openutils-mgnlcontrols/pom.xml trunk/openutils-mgnlcriteria/pom.xml trunk/openutils-mgnlext/pom.xml trunk/openutils-mgnlgroovy/pom.xml trunk/openutils-mgnlmedia/pom.xml trunk/openutils-mgnlmessages/pom.xml trunk/openutils-mgnlrepoutils/pom.xml trunk/openutils-mgnlspring/pom.xml trunk/openutils-mgnlstripes/pom.xml trunk/openutils-mgnlstruts11/pom.xml trunk/openutils-mgnltasks/pom.xml trunk/openutils-mgnlutils/pom.xml trunk/openutils-spring/pom.xml trunk/openutils-testing/pom.xml trunk/openutils-testing-junit/pom.xml trunk/openutils-testing-testng/pom.xml trunk/openutils-testing4dwr/pom.xml trunk/openutils-testing4dwr-junit/pom.xml trunk/openutils-testing4dwr-testng/pom.xml trunk/openutils-testing4web/pom.xml trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/BaseJspEmbeddedTest.java Added Paths: ----------- trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/TestServletOptions.java trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/TestTldLocationsCache.java Modified: trunk/magnolia-test-webapp/pom.xml =================================================================== --- trunk/magnolia-test-webapp/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/magnolia-test-webapp/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>war</packaging> Modified: trunk/openutils-bshd5/pom.xml =================================================================== --- trunk/openutils-bshd5/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-bshd5/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <artifactId>openutils-bshd5</artifactId> <name>openutils base Spring-Hibernate DAO for java 5.0</name> Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-dbmigration/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <artifactId>openutils-dbmigration</artifactId> <name>openutils db migration</name> Modified: trunk/openutils-deployment/pom.xml =================================================================== --- trunk/openutils-deployment/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-deployment/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <artifactId>openutils-deployment</artifactId> <name>openutils deployment tools</name> Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-elfunctions/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -2,7 +2,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-log4j/pom.xml =================================================================== --- trunk/openutils-log4j/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-log4j/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <artifactId>openutils-log4j</artifactId> <packaging>jar</packaging> Modified: trunk/openutils-mgnlbootstrapsync/pom.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlbootstrapsync/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-mgnlcas/pom.xml =================================================================== --- trunk/openutils-mgnlcas/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlcas/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.0</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-mgnlcontrols/pom.xml =================================================================== --- trunk/openutils-mgnlcontrols/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlcontrols/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -2,7 +2,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlcriteria/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <artifactId>openutils-mgnlcriteria</artifactId> <name>Magnolia Criteria API</name> Modified: trunk/openutils-mgnlext/pom.xml =================================================================== --- trunk/openutils-mgnlext/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlext/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-mgnlgroovy/pom.xml =================================================================== --- trunk/openutils-mgnlgroovy/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlgroovy/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -2,7 +2,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-mgnlmedia/pom.xml =================================================================== --- trunk/openutils-mgnlmedia/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlmedia/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> @@ -89,7 +89,7 @@ <plugin> <groupId>net.sourceforge.maven-taglib</groupId> <artifactId>maven-taglib-plugin</artifactId> - <version>2.4-SNAPSHOT</version> + <version>2.4</version> <configuration> <parseHtml>true</parseHtml> <dontRecurseIntoSubdirs>true</dontRecurseIntoSubdirs> @@ -97,15 +97,11 @@ </plugin> <plugin> <artifactId>maven-changes-plugin</artifactId> - <version>2.0-beta-3</version> - <configuration> - <xmlPath>${basedir}/src/site/changes/changes.xml</xmlPath> - </configuration> + <version>2.3</version> <reportSets> <reportSet> <reports> <report>jira-report</report> - <report>announcement-generate</report> </reports> </reportSet> </reportSets> @@ -116,7 +112,7 @@ <reportSets> <reportSet> <reports> - <!-- <report>changes-report</report>--> + <report>changes-report</report> </reports> </reportSet> </reportSets> Modified: trunk/openutils-mgnlmessages/pom.xml =================================================================== --- trunk/openutils-mgnlmessages/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlmessages/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-mgnlrepoutils/pom.xml =================================================================== --- trunk/openutils-mgnlrepoutils/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlrepoutils/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -2,7 +2,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.0</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-mgnlspring/pom.xml =================================================================== --- trunk/openutils-mgnlspring/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlspring/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.0</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlstripes/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-mgnlstruts11/pom.xml =================================================================== --- trunk/openutils-mgnlstruts11/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlstruts11/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <artifactId>openutils-mgnlstruts11</artifactId> <packaging>jar</packaging> Modified: trunk/openutils-mgnltasks/pom.xml =================================================================== --- trunk/openutils-mgnltasks/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnltasks/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-mgnlutils/pom.xml =================================================================== --- trunk/openutils-mgnlutils/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-mgnlutils/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> Modified: trunk/openutils-spring/pom.xml =================================================================== --- trunk/openutils-spring/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-spring/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.0</version> + <version>1.2</version> </parent> <artifactId>openutils-spring</artifactId> <name>openutils spring tools</name> Modified: trunk/openutils-testing/pom.xml =================================================================== --- trunk/openutils-testing/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-testing/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <artifactId>openutils-testing</artifactId> <name>Openutils testing library</name> Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-testing-junit/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <artifactId>openutils-testing-junit</artifactId> <name>Openutils testing library (JUnit)</name> Modified: trunk/openutils-testing-testng/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-testing-testng/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <artifactId>openutils-testing-testng</artifactId> <name>Openutils testing library (TestNG)</name> Modified: trunk/openutils-testing4dwr/pom.xml =================================================================== --- trunk/openutils-testing4dwr/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-testing4dwr/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.0</version> + <version>1.2</version> </parent> <artifactId>openutils-testing4dwr</artifactId> <name>openutils dwr test utils</name> Modified: trunk/openutils-testing4dwr-junit/pom.xml =================================================================== --- trunk/openutils-testing4dwr-junit/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-testing4dwr-junit/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.0</version> + <version>1.2</version> </parent> <artifactId>openutils-testing4dwr-junit</artifactId> <name>openutils testing4dwr (junit)</name> Modified: trunk/openutils-testing4dwr-testng/pom.xml =================================================================== --- trunk/openutils-testing4dwr-testng/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-testing4dwr-testng/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.0</version> + <version>1.2</version> </parent> <artifactId>openutils-testing4dwr-testng</artifactId> <name>openutils testing4dwr (testng)</name> Modified: trunk/openutils-testing4web/pom.xml =================================================================== --- trunk/openutils-testing4web/pom.xml 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-testing4web/pom.xml 2010-01-31 16:26:25 UTC (rev 1726) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> - <version>1.1</version> + <version>1.2</version> </parent> <artifactId>openutils-testing4web</artifactId> <name>Openutils web test utils</name> Modified: trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/BaseJspEmbeddedTest.java =================================================================== --- trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/BaseJspEmbeddedTest.java 2010-01-31 16:13:49 UTC (rev 1725) +++ trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/BaseJspEmbeddedTest.java 2010-01-31 16:26:25 UTC (rev 1726) @@ -82,6 +82,11 @@ Hashtable<String, String> params = new Hashtable<String, String>(); params.put("javaEncoding", "utf-8"); + params.put("development", "true"); + params.put("keepgenerated", "false"); + params.put("modificationTestInterval", Integer.toString(Integer.MAX_VALUE / 1000)); + params.put("engineOptionsClass", TestServletOptions.class.getName()); + runner.registerServlet("*.jsp", "org.apache.jasper.servlet.JspServlet", params); log.debug("ServletRunner setup OK"); Added: trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/TestServletOptions.java =================================================================== --- trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/TestServletOptions.java (rev 0) +++ trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/TestServletOptions.java 2010-01-31 16:26:25 UTC (rev 1726) @@ -0,0 +1,344 @@ +package net.sourceforge.openutils.testing4web; + +import java.io.File; +import java.util.Map; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletContext; + +import org.apache.jasper.EmbeddedServletOptions; +import org.apache.jasper.Options; +import org.apache.jasper.compiler.JspConfig; +import org.apache.jasper.compiler.TagPluginManager; +import org.apache.jasper.compiler.TldLocationsCache; + + +/** + * @author fgiust + * @version $Id$ + */ +public class TestServletOptions implements Options +{ + + private EmbeddedServletOptions options; + + /** + * @param config + * @param context + */ + public TestServletOptions(ServletConfig config, ServletContext context) + { + options = new EmbeddedServletOptions(config, context); + options.setTldLocationsCache(new TestTldLocationsCache(context)); + } + + /** + * @return + * @see java.lang.Object#hashCode() + */ + public int hashCode() + { + return options.hashCode(); + } + + /** + * @param obj + * @return + * @see java.lang.Object#equals(java.lang.Object) + */ + public boolean equals(Object obj) + { + return options.equals(obj); + } + + /** + * @param name + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getProperty(java.lang.String) + */ + public String getProperty(String name) + { + return options.getProperty(name); + } + + /** + * @param name + * @param value + * @see org.apache.jasper.EmbeddedServletOptions#setProperty(java.lang.String, java.lang.String) + */ + public void setProperty(String name, String value) + { + options.setProperty(name, value); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getKeepGenerated() + */ + public boolean getKeepGenerated() + { + return options.getKeepGenerated(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getTrimSpaces() + */ + public boolean getTrimSpaces() + { + return options.getTrimSpaces(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#isPoolingEnabled() + */ + public boolean isPoolingEnabled() + { + return options.isPoolingEnabled(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getMappedFile() + */ + public boolean getMappedFile() + { + return options.getMappedFile(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getSendErrorToClient() + */ + public boolean getSendErrorToClient() + { + return options.getSendErrorToClient(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getClassDebugInfo() + */ + public boolean getClassDebugInfo() + { + return options.getClassDebugInfo(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getCheckInterval() + */ + public int getCheckInterval() + { + return options.getCheckInterval(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getModificationTestInterval() + */ + public int getModificationTestInterval() + { + return options.getModificationTestInterval(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getDevelopment() + */ + public boolean getDevelopment() + { + return options.getDevelopment(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#isSmapSuppressed() + */ + public boolean isSmapSuppressed() + { + return options.isSmapSuppressed(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#isSmapDumped() + */ + public boolean isSmapDumped() + { + return options.isSmapDumped(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#genStringAsCharArray() + */ + public boolean genStringAsCharArray() + { + return options.genStringAsCharArray(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getIeClassId() + */ + public String getIeClassId() + { + return options.getIeClassId(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getScratchDir() + */ + public File getScratchDir() + { + return options.getScratchDir(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getClassPath() + */ + public String getClassPath() + { + return options.getClassPath(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#isXpoweredBy() + */ + public boolean isXpoweredBy() + { + return options.isXpoweredBy(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getCompiler() + */ + public String getCompiler() + { + return options.getCompiler(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getCompilerTargetVM() + */ + public String getCompilerTargetVM() + { + return options.getCompilerTargetVM(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getCompilerSourceVM() + */ + public String getCompilerSourceVM() + { + return options.getCompilerSourceVM(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getErrorOnUseBeanInvalidClassAttribute() + */ + public boolean getErrorOnUseBeanInvalidClassAttribute() + { + return options.getErrorOnUseBeanInvalidClassAttribute(); + } + + /** + * @param b + * @see org.apache.jasper.EmbeddedServletOptions#setErrorOnUseBeanInvalidClassAttribute(boolean) + */ + public void setErrorOnUseBeanInvalidClassAttribute(boolean b) + { + options.setErrorOnUseBeanInvalidClassAttribute(b); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getTldLocationsCache() + */ + public TldLocationsCache getTldLocationsCache() + { + return options.getTldLocationsCache(); + } + + /** + * @param tldC + * @see org.apache.jasper.EmbeddedServletOptions#setTldLocationsCache(org.apache.jasper.compiler.TldLocationsCache) + */ + public void setTldLocationsCache(TldLocationsCache tldC) + { + options.setTldLocationsCache(tldC); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getJavaEncoding() + */ + public String getJavaEncoding() + { + return options.getJavaEncoding(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getFork() + */ + public boolean getFork() + { + return options.getFork(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getJspConfig() + */ + public JspConfig getJspConfig() + { + return options.getJspConfig(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getTagPluginManager() + */ + public TagPluginManager getTagPluginManager() + { + return options.getTagPluginManager(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#isCaching() + */ + public boolean isCaching() + { + return options.isCaching(); + } + + /** + * @return + * @see org.apache.jasper.EmbeddedServletOptions#getCache() + */ + public Map getCache() + { + return options.getCache(); + } + + /** + * @return + * @see java.lang.Object#toString() + */ + public String toString() + { + return options.toString(); + } + +} Property changes on: trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/TestServletOptions.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/TestTldLocationsCache.java =================================================================== --- trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/TestTldLocationsCache.java (rev 0) +++ trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/TestTldLocationsCache.java 2010-01-31 16:26:25 UTC (rev 1726) @@ -0,0 +1,269 @@ +package net.sourceforge.openutils.testing4web; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletContext; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.jasper.JasperException; +import org.apache.jasper.compiler.TldLocationsCache; +import org.apache.jasper.xmlparser.ParserUtils; +import org.apache.jasper.xmlparser.TreeNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * @author fgiust + * @version $Id$ + */ +public class TestTldLocationsCache extends TldLocationsCache +{ + + private boolean initialized; + + private Map<String, String[]> filemappings; + + /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(TestTldLocationsCache.class); + + private final ServletContext ctxt2; + + /** + * @param ctxt + */ + public TestTldLocationsCache(ServletContext ctxt) + { + super(ctxt); + ctxt2 = ctxt; + } + + /** + * @param ctxt + * @param redeployMode + */ + public TestTldLocationsCache(ServletContext ctxt, boolean redeployMode) + { + super(ctxt, redeployMode); + ctxt2 = ctxt; + } + + public String[] getLocation(String uri) throws JasperException + { + if (!initialized) + { + initFilesInClasspath(); + } + + String[] location = super.getLocation(uri); + + if (location != null) + { + return location; + } + + return filemappings.get(uri); + } + + /** + * + */ + private void initFilesInClasspath() + { + filemappings = new HashMap<String, String[]>(); + + ClassLoader webappLoader = Thread.currentThread().getContextClassLoader(); + ClassLoader loader = webappLoader; + + while (loader != null) + { + if (loader instanceof URLClassLoader) + { + URL[] urls = ((URLClassLoader) loader).getURLs(); + for (int i = 0; i < urls.length; i++) + { + URL url = urls[i]; + if (!StringUtils.endsWithIgnoreCase(url.getFile(), ".jar")) + { + File file = new File(url.getFile()); + if (file.isDirectory()) + { + log.debug("Processing {}", url.getFile()); + findTld(file); + } + } + } + } + + loader = loader.getParent(); + } + + } + + private void findTld(File f) + { + File[] list = f.listFiles(); + for (File file : list) + { + if (file.isDirectory()) + { + findTld(file); + } + else if (StringUtils.endsWithIgnoreCase(file.getName(), ".tld")) + { + + String uri = getUriFromTld(file); + if (uri != null && filemappings.get(uri) == null) + { + String base = ctxt2.getRealPath("/"); + + String filepath = getRelativePath(new File(base), file); + + log.debug("Adding {} to cache with url {}", uri, filepath); + filemappings.put(uri, new String[]{filepath, null }); + } + } + } + } + + private String getUriFromTld(File file) + { + String resourcePath = file.getAbsolutePath(); + InputStream in; + try + { + in = new BufferedInputStream(new FileInputStream(file)); + } + catch (FileNotFoundException e) + { + log.warn("File {} not found", file.getAbsolutePath()); + return null; + } + try + { + TreeNode tld = new ParserUtils().parseXMLDocument(resourcePath, in); + TreeNode uri = tld.findChild("uri"); + if (uri != null) + { + String body = uri.getBody(); + if (body != null) + { + return body; + } + } + } + catch (JasperException e) + { + log.error("Error processing " + file.getAbsolutePath(), e); + return null; + } + finally + { + IOUtils.closeQuietly(in); + } + + return null; + } + + /** + * break a path down into individual elements and add to a list. example : if a path is /a/b/c/d.txt, the breakdown + * will be [d.txt,c,b,a] + * @param f input file + * @return a List collection with the individual elements of the path in reverse order + */ + private static List getPathList(File f) + { + List l = new ArrayList(); + File r; + try + { + r = f.getCanonicalFile(); + while (r != null) + { + l.add(r.getName()); + r = r.getParentFile(); + } + } + catch (IOException e) + { + l = null; + } + return l; + } + + /** + * figure out a string representing the relative path of 'f' with respect to 'r' + * @param r home path + * @param f path of file + */ + private static String matchPathLists(List r, List f) + { + int i; + int j; + String s; + // start at the beginning of the lists + // iterate while both lists are equal + s = ""; + i = r.size() - 1; + j = f.size() - 1; + + // first eliminate common root + while ((i >= 0) && (j >= 0) && (r.get(i).equals(f.get(j)))) + { + i--; + j--; + } + + // for each remaining level in the home path, add a .. + for (; i >= 0; i--) + { + s += ".." + File.separator; + } + + // for each level in the file path, add the path + for (; j >= 1; j--) + { + s += f.get(j) + File.separator; + } + + // file name + s += f.get(j); + return s; + } + + /** + * get relative path of File 'f' with respect to 'home' directory example : home = /a/b/c f = /a/d/e/x.txt s = + * getRelativePath(home,f) = ../../d/e/x.txt + * @param home base path, should be a directory, not a file, or it doesn't make sense + * @param f file to generate path for + * @return path from home to f as a string + */ + public static String getRelativePath(File home, File f) + { + File r; + List homelist; + List filelist; + String s; + + homelist = getPathList(home); + filelist = getPathList(f); + s = matchPathLists(homelist, filelist); + + return s; + } + +} Property changes on: trunk/openutils-testing4web/src/main/java/net/sourceforge/openutils/testing4web/TestTldLocationsCache.java ___________________________________________________________________ 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. |