Browse Source

jsp testcases; not yet with matching junit tests

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269888 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 23 years ago
parent
commit
26c2dac518
5 changed files with 92 additions and 0 deletions
  1. +4
    -0
      src/etc/testcases/taskdefs/optional/jsp/WEB-INF/web.xml
  2. +16
    -0
      src/etc/testcases/taskdefs/optional/jsp/missing_tld.jsp
  3. +9
    -0
      src/etc/testcases/taskdefs/optional/jsp/simple.jsp
  4. +9
    -0
      src/etc/testcases/taskdefs/optional/jsp/uriroot.jsp
  5. +54
    -0
      src/etc/testcases/taskdefs/optional/jspc.xml

+ 4
- 0
src/etc/testcases/taskdefs/optional/jsp/WEB-INF/web.xml View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app/>

+ 16
- 0
src/etc/testcases/taskdefs/optional/jsp/missing_tld.jsp View File

@@ -0,0 +1,16 @@
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-template.tld" prefix="template" %>
<html:html locale="true">
<head>
<title>shouldnt compile</title>
<html:base/>
</head>
<body>

This page should not compile because refers to TLDs that arent around.

</body>

</html:html>

+ 9
- 0
src/etc/testcases/taskdefs/optional/jsp/simple.jsp View File

@@ -0,0 +1,9 @@
<%@ page language="java" %>
<html>
<head/>
<body>

It is now <%= System.currentTimeMillis() %>

</body>
</html>

+ 9
- 0
src/etc/testcases/taskdefs/optional/jsp/uriroot.jsp View File

@@ -0,0 +1,9 @@
<%@ page language="java" %>
<html>
<head/>
<body>

It is now <%= System.currentTimeMillis() %>

</body>
</html>

+ 54
- 0
src/etc/testcases/taskdefs/optional/jspc.xml View File

@@ -0,0 +1,54 @@
<?xml version="1.0"?>

<project name="jspc-test" default="main" basedir=".">

<target name="main" depends="simple,missing_tld">

</target>

<target name="init">
<property name="jsp.dir" location="jsp"/>
<property name="jsp.output.dir" location="${jsp.dir}/java"/>
<property name="jsp.verbosity" value="3"/>
<mkdir dir="${jsp.output.dir}"/>
</target>
<target name="cleanup">
<delete dir="${jsp.output.dir}"/>
</target>
<!-- this should fail -->
<target name="missing_tld" depends="init">
<jspc
destdir="${jsp.output.dir}"
srcdir="${jsp.dir}"
verbose="${jsp.verbosity}">
<include
name="missing_tld.jsp"/>
</jspc>
</target>

<!-- this should compile to simple.java -->
<target name="simple" depends="init">
<jspc
destdir="${jsp.output.dir}"
srcdir="${jsp.dir}"
verbose="${jsp.verbosity}">
<include
name="simple.jsp"/>
</jspc>
</target>

<!-- this should also compile to simple.java -->
<target name="uriroot" depends="init">
<jspc
destdir="${jsp.output.dir}"
uriroot="${jsp.dir}"
srcdir="${jsp.dir}"
verbose="${jsp.verbosity}">
<include
name="uriroot.jsp"/>
</jspc>
</target>
</project>

Loading…
Cancel
Save