This commit is contained in:
2024-11-30 19:03:49 +08:00
commit 1e6763c160
3806 changed files with 737676 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
================================================================================
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.
================================================================================
Best practice, fit in with the style that is already there. However, things have
evolved over time so there are some variations across the project; use your
judgement.
There is a validate build target that performs checks using tools like checkstyle.
This is off by default but can be enabled by setting "execute.validate=true" in
your build.properties file.
This directory contains support files for various IDEs that can help configure
your development environment.
Some guidelines:
* Do not rely on Java's autoboxing - perform conversions explicitly

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<classpath>
<classpathentry kind="src" path="java"/>
<classpathentry excluding="deployment/|tld/|webapp*/|webresources/" kind="src" path="test"/>
<classpathentry kind="src" path="webapps/examples/WEB-INF/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
<classpathentry kind="var" path="TOMCAT_LIBS_BASE/jaxrpc-1.1-rc4/geronimo-spec-jaxrpc-1.1-rc4.jar"/>
<classpathentry kind="var" path="TOMCAT_LIBS_BASE/wsdl4j-1.6.3/wsdl4j-1.6.3.jar"/>
<classpathentry kind="var" path="TOMCAT_LIBS_BASE/ecj-4.6.3/ecj-4.6.3.jar"/>
<classpathentry kind="var" path="TOMCAT_LIBS_BASE/easymock-3.2/easymock-3.2.jar"/>
<classpathentry kind="var" path="TOMCAT_LIBS_BASE/hamcrest-1.3/hamcrest-core-1.3.jar"/>
<classpathentry kind="var" path="TOMCAT_LIBS_BASE/cglib-2.2.2/cglib-nodep-2.2.2.jar"/>
<classpathentry kind="var" path="TOMCAT_LIBS_BASE/objenesis-1.2/objenesis-1.2.jar"/>
<classpathentry kind="output" path=".settings/output"/>
</classpath>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<projectDescription>
<name>tomcat-8.5.x</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,130 @@
================================================================================
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.
================================================================================
# Java -> Compiler -> Errors/Warnings
=======================================
The following settings are for Oxygen (Eclipse 4.13)
W = Warning
I = Ignore
E = Error
Code style
- Non-static access to static member - W
- Indirect access to static member - I
- Unqualified access to instance field - I
- Access to a non-accessible member... - I
- Parameter assignment - I
- Non-externalized strings - I
- Undocumented empty block - I
- Resource not managed via try-with-resource (1.7 or higher) - I
- Method with a constructor name - W
- Method can be static - I
- Method can potentially be static - I
Potential programming problems
- All - W
except the following:
- Incomplete 'switch' cases on enum - W
[ ] Signal even if 'default' case exists
- 'switch' is missing 'default' case - I
- Potential resource leak - I
Name shadowing and conflicts
- Field declaration hides another... - I
- Local variable declaration hides.. - I
- Type parameter hides another type - W
- Method does not override... - W
- Interface method conflicts... - W
Deprecated and restricted API
- Deprecated API - W
([ ] on all additional check boxes)
- Deprecated API marked for removal - W
- Forbidden references - E
- Discouraged reference - W
Modules
- All - W
Unnecessary code
- All - W
([x] on all additional check boxes)
except the following:
- Value of exception parameter is... - I
- Unnecessary else - I
Generic types
- All - W
[ ] Ignore unavoidable generic type problems
Annotations
- All - W
([x] on all additional check boxes)
Null analysis
- Null pointer access - W
- Potential null pointer access - W
- Redundant null check - W
[ ] Include 'assert' in null analysis
[ ] Enable annotation-based null analysis
Note: The list of codes supported in @SuppressWarnings annotation in
Eclipse IDE is documented here:
3.6: http://help.eclipse.org/helios/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm
3.7: http://help.eclipse.org/indigo/topic/org.eclipse.jdt.doc.user/tasks/task-suppress_warnings.htm
4.2: http://help.eclipse.org/juno/topic/org.eclipse.jdt.doc.user/tasks/task-suppress_warnings.htm
# Java -> Compiler -> Javadoc
=============================
Enable 'Process Javadoc comments'
- Malformed Javadoc comments - W
- Only consider members visible as - Public
[X] Validate tag arguments
[ ] Report non-visible references
[X] Report deprecated references
- Missing tag descriptions - Validate all standard tags
- Missing Javadoc tags - W
- Only consider members visible as - Public
[X] - Ignore in overriding and implementing methods
[ ] - Ignore method type parameters
- Missing Javadoc comments - I
# Java -> Code Style -> Organize Imports
==========================================
The following configuration of "Organize Imports" setting can be
recommended for a quick setup. The order is enforced by checkstyle, so for
the authoritative definition look at <module name="ImportOrder"> in
res/checkstyle/checkstyle.xml
- java
- javax
- async
- jsp2
- [static] org.junit
- org.junit
- [static] org
- org
- com
- util

View File

@@ -0,0 +1,20 @@
# -----------------------------------------------------------------------------
# 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.
# -----------------------------------------------------------------------------
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.source=1.8

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
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.
-->
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/tomcat-8.5.x/java/org/apache/catalina/startup/Bootstrap.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="start"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tomcat-8.5.x"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=${project_loc:/tomcat-8.5.x/java/org/apache/catalina/startup/Bootstrap.java}/output/build"/>
</launchConfiguration>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
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.
-->
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/tomcat-8.5.x/java/org/apache/catalina/startup/Bootstrap.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="stop"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tomcat-8.5.x"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=${project_loc:/tomcat-8.5.x/java/org/apache/catalina/startup/Bootstrap.java}/output/build"/>
</launchConfiguration>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/.idea/output" />
</component>
</project>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/tomcat.iml" filepath="$PROJECT_DIR$/.idea/tomcat.iml" />
</modules>
</component>
</project>

View File

@@ -0,0 +1,143 @@
================================================================================
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.
================================================================================
Building and Debugging Apache Tomcat under NetBeans
Unlike other IDE's, NetBeans is a pure java swing application. It uses
Apache Ant to build its projects, and works directly with the class files
and jars created by the standard Apache Ant build.xml files. This strength
is also its weakness when working with complex projects such as Tomcat that
already have their own build.xml files, but which do not use the NetBeans
templates.
Any of complex Ant project can still be managed under NetBeans by
defining it to be something called a Free-Form Project. However, because
the build.xml does not conform to all the NetBeans naming and structural
conventions, a certain amount of manual customisation is required to
achieve a useful level of integration.
1. NetBeans can open a Tomcat source tree as a Free-Form Project, which
will allow you to edit, build, and debug Tomcat and its unit tests
within the workbench. Even with NetBeans 7.1, integration of a project
as complex as Tomcat requires significant configuration. The
configuration involves dealing with several quirky aspects of the way
NetBeans manages this kind of project. Before you try to open Tomcat
as a NetBeans project, you are strongly recommended to successfully
build and run the tests using Apache Ant from a command prompt!
(see BUILDING.txt in the Tomcat source root directory).
2. Once Tomcat has been built, you can install the default NetBeans
project configuration by running the following build target:
ant ide-netbeans
This uses the Tomcat build.xml to create a new directory called
nbproject (this name is reserved by NetBeans). The nbproject directory
will then be primed with a self-consistent set of default definitions
sufficient to open Tomcat as a Free-Form Project under NetBeans.
Note: if you ever open the Project Properties from the NetBeans context
menu, even without making any changes, there is a significant risk
that NetBeans will modify one or more of these files. You can
restore the Tomcat default files at any time by running this target:
ant ide-netbeans-replace
Only the default files will be overwritten, so any other content
such as your own local files, and the NetBeans private directory,
will not be affected.
3. NetBeans needs to know where to find the directory where you keep the
Tomcat dependencies jars. If you have successfully built Tomcat from
a command prompt, you will probably have assigned the base.path
property in your build.properties file.
Warning: The support for Tomcat in NetBeans will detect and use this
property. However, if you have left it to default, you MUST
still define this path in the nb-tomcat-project.properties file!
Note: The current support for Tomcat in NetBeans does not include the
components in the modules directory (e.g. tomcat-lite).
4. Start NetBeans... once it has initialised and scanned your other open
projects, just open an existing project and select the location of
Tomcat. NetBeans will recognise it as a Free-Form project, then read and
validate the nbproject/project.xml file. This file defines how to relate
targets in build.xml to NetBeans project-related actions. It also tells
NetBeans what classpaths to use for validation and code completion of
the various source directories.
Warning: do not be tempted to casually click the properties menu item
for the Tomcat project. NetBeans might change the contents
of these files. (The NetBeans New Project wizard also
automatically creates a Free-Form project.xml which carries
this same warning).
Note: the Tomcat project should open successfully and, after the source
packages have been scanned, they should not be flagged with any
syntax errors (except in some of the jsp bug unit tests).
5. Verify your work by running the NetBeans project Clean action. It
should complete successfully. Next, run the Build action (which calls
the Tomcat deploy build target) and confirm that it successfully
compiles the Tomcat source files and creates the jars.
6. Next, navigate down to one of the test files and select the compile
action. This will compile only your chosen file, although the compiler
will find there is nothing to do unless you have deliberately changed it.
Note: if you have changed any of the Tomcat source files, they will be
recompiled first. However, any changes to test files will not be compiled
unless you select those file and explicitly compile them. If you have any
doubts about dependencies between unit test classes, you can use the
compileAllTests project action and any files that have been changed
will be detected and compiled.
7. You can run an individual unit test class by selecting it and choosing
the "run selected file" NetBeans action. As the test runs, NetBeans
should open a unit test results pane that shows you the progress and
final outcome of the test (Note: this feature does not currently work).
8. Next, open the source of the unit test that ran successfully in step 7.
Set a breakpoint in one of the test cases, then request NetBeans to
debug that class. The class will start running, and then will stop as
it hits your breakpoint. You should be able to display variables, then
navigate the call stack to open the source files of each method. You
should also be able to step through the code. Use the continue icon
to resume execution. When the test completes, you should see the same
jUnit test result panel as in step 7 (Note: this feature does not
currently work).
9. You can also use your Tomcat NetBeans Free-Form project to debug an
external Tomcat instance that is executing on the same, or a different
machine. (Obviously, the external instance must be running the same
version of the source code!)
The external Tomcat instance must be started with its jvm enabled for
debugging by adding extra arguments to JAVA_OPTS, e.g.
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
To debug the external Tomcat instance under NetBeans, select the
"attach debugger" choice from the debug menu. Accept the default
JPDA debugger with the SocketAttach connector and the dt_socket
transport. Specify the hostname and port where the Tomcat jvm is
listening. Your NetBeans workbench should then connect to the external
Tomcat and display the running threads. You can now set breakpoints and
begin debugging.

View File

@@ -0,0 +1,50 @@
#================================================================================
# 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.
#================================================================================
# NetBeans will automatically set the project basedir "." correctly to
# the parent directory of the nbproject subdirectory
#
# the Tomcat build.properties file defines the confusingly-named "base.path"
# property, which is where the Tomcat dependencies are downloaded
# the following properties will be generated by build.xml, but are also needed
# by the NetBeans targets which do not have access to those properties
# as-yet not created by the main Ant build.
tomcat.output=./output
tomcat.classes=${tomcat.output}/classes
tomcat.build=${tomcat.output}/build
test.classes=${tomcat.output}/testclasses
test.temp=${tomcat.output}/test-tmp
nb-test.io-method=org.apache.coyote.http11.Http11NioProtocol
# it is not possible to retrieve the classpaths from the build to
# use in the NetBeans targets, so they must be explicitly declared
nb-test.classpath=${test.classes}:${tomcat.build}/webapps/examples/WEB-INF/classes:${base.path}/junit-4.11/junit-4.11.jar:${base.path}/easymock-3.2/easymock-3.2.jar:${base.path}/hamcrest-1.3/hamcrest-core-1.3.jar:${base.path}/ecj-4.6.3/ecj-4.6.3.jar:${tomcat.classes}
# Extra properties used by the Tomcat project additional NetBeans targets.
# configure JUnit test results so that NetBeans can intercept and display them
#
nb-junit.formatter=-Dorg.apache.juli.formatter=java.util.logging.SimpleFormatter
nb-junit.formatter.type=plain
nb-junit.formatter.usefile=true
nb-junit.formatter.extension=.txt

View File

@@ -0,0 +1,33 @@
#================================================================================
# 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.
#================================================================================
# NetBeans will automatically set the project basedir "." correctly to
# the parent directory of the nbproject subdirectory
#
# The Tomcat build.properties file defines the confusingly-named "base.path"
# property, which is where the Tomcat dependencies are downloaded.
# If you have followed the Tomcat recommendation and explicitly coded
# a path, it will be used by NetBeans. However, if you have left it to
# default you MUST explicitly code it here, e.g.
#base.path=/home/yourname/sandboxApache/tomcat8-dependencies
# NetBeans syntax checking and code completion of the main source files
# needs all the Ant libraries to be on the classpath. This is achieved
# by the standard build.xml, but needs to be duplicated for NetBeans.
#
ant.includes=${ant.home}/lib/ant.jar:${ant.home}/lib/ant-apache-bcel.jar:${ant.home}/lib/ant-launcher.jar:${ant.home}/lib/ant-apache-oro.jar:${ant.home}/lib/ant-apache-regexp.jar:${ant.home}/lib/ant-jmf.jar:${ant.home}/lib/ant-jsch.jar:${ant.home}/lib/ant-apache-bsf.jar:${ant.home}/lib/ant-apache-log4j.jar:${ant.home}/lib/ant-apache-resolver.jar:${ant.home}/lib/ant-apache-xalan2.jar:${ant.home}/lib/ant-commons-net.jar:${ant.home}/lib/ant-javamail.jar:${ant.home}/lib/ant-junit.jar:${ant.home}/lib/ant-swing.jar:${ant.home}/lib/ant-testutil.jar:${ant.home}/lib/junit.jar:${ant.home}/lib/ant-commons-logging.jar

View File

@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!--
Supplementary build targets for the Tomcat project under NetBeans.
Use the project root as basedir to be consistent with standard build.
-->
<project basedir=".." name="Tomcat_8.0">
<!--
load the standard and user Tomcat build properties now,
so they can be used in the NetBeans-specific targets below.
Note: inheritall==false will still pass all of these user
properties to the Ant build targets of Tomcat.
-->
<property file="./build.properties"/>
<property file="./build.properties.default"/>
<!-- load the extra NetBeans build properties for Tomcat, which can -->
<!-- use the standard properties symbolic variables. -->
<!-- Note: inheritall==false will still pass all of these user -->
<!-- properties to the Ant build targets of Tomcat -->
<property file="./nbproject/nb-tomcat-build.properties"/>
<target name="deploy">
<ant target="deploy" inheritall="false"/>
</target>
<target name="clean">
<ant target="clean" inheritall="false"/>
</target>
<target name="javadoc" depends="-package-project">
<ant target="javadoc" inheritall="false"/>
</target>
<target name="test" depends="-package-project">
<ant target="test" inheritall="false"/>
</target>
<target name="-package-project"
description="ensure Tomcat is ready to use">
<ant target="deploy" inheritall="false"/>
</target>
<target name="-compile-all-tests"
description="needed to prepare some dependencies">
<ant target="test-compile" inheritall="false"/>
</target>
<target name="compile-selected-files-in-test"
depends="-package-project"
description="compile one or more selected test (not main) classes">
<fail unless="netbeans.home">This target can only run under NetBeans.</fail>
<fail unless="files">Property 'files' must be set in project.xml.</fail>
<echo level="verbose" message="compiling tests: ${files}"/>
<echo level="verbose" message="compiling tests into: ${test.classes}"/>
<mkdir dir="${test.classes}"/>
<javac srcdir="test"
destdir="${test.classes}"
includes="${files}"
debug="true"
deprecation="${compile.deprecation}"
source="${compile.source}"
encoding="ISO-8859-1"
includeantruntime="false">
<classpath path="${nb-test.classpath}"/>
</javac>
</target>
<target name="test-selected-file"
description="execute a single unit test class (-Dtest.entry=nnn)">
<fail unless="test.entry"
message="Property 'test.entry' must be set in project.xml."/>
<!--
the runtests macro runs a single test if test.entry is a class name
Note: we must ONLY run one of the test targets, otherwise test-apr
will run last and wipe out the test results!
Note: the test targets all depend on deploy
-->
<ant target="test-nio" inheritall="false">
<property name="junit.formatter.type" value="brief" />
<property name="junit.formatter.usefile" value="false" />
</ant>
</target>
<target name="debug-selected-file-in-test"
depends="-package-project"
description="debug the single selected unit test class">
<echo message="debugging test: ${test.entry}"/>
<fail unless="netbeans.home">This target can only run under NetBeans.</fail>
<fail unless="test.entry"
message="Property 'test.entry' must be set in project.xml."/>
<nbjpdastart name="${test.entry}"
addressproperty="jpda.address"
transport="dt_socket" >
<classpath path="${nb-test.classpath}"/>
<sourcepath>
<path path="test"/>
</sourcepath>
</nbjpdastart>
<junit printsummary="yes" fork="yes" dir="." showoutput="yes"
errorproperty="test.result.error"
failureproperty="test.result.failure"
haltonfailure="${test.haltonfailure}" >
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
<jvmarg value="-Djava.compiler=none"/>
<jvmarg value="${test.jvmarg.egd}"/>
<jvmarg value="-Djava.library.path=${test.apr.loc}"/>
<jvmarg value="${nb-junit.formatter}"/>
<classpath path="${nb-test.classpath}" />
<sysproperty key="tomcat.test.temp" value="${test.temp}" />
<sysproperty key="tomcat.test.tomcatbuild" value="${tomcat.build}" />
<sysproperty key="tomcat.test.protocol" value="${nb-test.io-method}"/>
<sysproperty key="tomcat.test.accesslog" value="${test.accesslog}" />
<!-- define a non-file JUnit formatter for NetBeans to capture and display -->
<formatter usefile="false" type="brief" />
<!-- and also a file formatter for checking later -->
<formatter type="${nb-junit.formatter.type}"
usefile="${nb-junit.formatter.usefile}"
extension="@NB-DBG${nb-junit.formatter.extension}"/>
<!-- run the chosen JUnit test class under the debugger -->
<test todir="${tomcat.build}/logs" name="${test.entry}"/>
</junit>
</target>
</project>

View File

@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!--
Free-Form project definition for Tomcat under NetBeans.
Paths are all relative to the project root.
Warning: Do NOT use the NetBeans GUI Project Properties customizer
for this project, otherwise you might trigger unwanted
changes to this critical file, which must be maintained
by the Tomcat developers!
Note: As specified in the BUILDING.txt file of Tomcat, the code completion
classpaths below depend on the ANT_HOME environment
variable being properly defined.
-->
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.ant.freeform</type>
<configuration>
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
<!-- Do not use Project Properties customizer when editing this file manually. -->
<name>Tomcat 8.0</name>
<properties>
<!-- load the local Tomcat build.properties, especially base.path. -->
<property-file>./build.properties</property-file>
<!-- prime some NetBeans build properties for Tomcat, which will -->
<!-- also be defined in the standard properties. -->
<property-file>./nbproject/nb-tomcat-project.properties</property-file>
</properties>
<folders>
<source-folder>
<label>java</label>
<type>java</type>
<location>java</location>
</source-folder>
<source-folder>
<label>webapps/docs/appdev/sample/src</label>
<type>java</type>
<location>webapps/docs/appdev/sample/src</location>
</source-folder>
<source-folder>
<label>modules/tomcat-lite/test</label>
<type>java</type>
<location>modules/tomcat-lite/test</location>
</source-folder>
<source-folder>
<label>test</label>
<type>java</type>
<location>test</location>
</source-folder>
</folders>
<ide-actions>
<!--
Note: all NetBeans actions are delegated to an external
script, so that Properties can be used consistently
with the standard Tomcat build.
-->
<action name="build">
<script>nbproject/nb-tomcat.xml</script>
<target>deploy</target>
</action>
<action name="clean">
<script>nbproject/nb-tomcat.xml</script>
<target>clean</target>
</action>
<action name="javadoc">
<script>nbproject/nb-tomcat.xml</script>
<target>javadoc</target>
</action>
<action name="test">
<script>nbproject/nb-tomcat.xml</script>
<target>test</target>
</action>
<action name="rebuild">
<script>nbproject/nb-tomcat.xml</script>
<target>clean</target>
<target>deploy</target>
</action>
<action name="compileAllTests">
<script>nbproject/nb-tomcat.xml</script>
<target>-compile-all-tests</target>
</action>
<action name="compile.single">
<script>nbproject/nb-tomcat.xml</script>
<target>compile-selected-files-in-test</target>
<context>
<property>files</property>
<folder>test</folder>
<pattern>\.java$</pattern>
<format>relative-path</format>
<arity>
<separated-files>,</separated-files>
</arity>
</context>
</action>
<action name="run.single">
<script>nbproject/nb-tomcat.xml</script>
<target>test-selected-file</target>
<context>
<property>test.entry</property>
<folder>test</folder>
<pattern>\.java$</pattern>
<format>java-name</format>
<arity>
<one-file-only/>
</arity>
</context>
</action>
<action name="debug.single">
<script>nbproject/nb-tomcat.xml</script>
<target>debug-selected-file-in-test</target>
<context>
<property>test.entry</property>
<folder>test</folder>
<pattern>\.java$</pattern>
<format>java-name</format>
<arity>
<one-file-only/>
</arity>
</context>
</action>
</ide-actions>
<view>
<items>
<source-folder style="packages">
<label>java</label>
<location>java</location>
</source-folder>
<source-folder style="packages">
<label>webapps/docs/appdev/sample/src</label>
<location>webapps/docs/appdev/sample/src</location>
</source-folder>
<source-folder style="packages">
<label>test</label>
<location>test</location>
</source-folder>
<source-file>
<location>build.xml</location>
</source-file>
</items>
<context-menu>
<ide-action name="build"/>
<ide-action name="rebuild"/>
<ide-action name="clean"/>
<ide-action name="javadoc"/>
<ide-action name="test"/>
</context-menu>
</view>
<subprojects/>
</general-data>
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3">
<!--
Warning: the classpath elements used below CANNOT include any
Properties because NetBeans will not expand them! Sadly,
this means (with nb 7.2.1, at least) every path MUST be
coded explicitly - with the potential for errors. These
errors will be flagged in the project navigation and
editors windows, although they will not affect the build
or any special NetBeans targets, e.g. debugging.
Note: the classpath elements used below CAN include environment
variables as Properties, e.g. ANT_HOME becomes ${ant.home}!
-->
<compilation-unit>
<package-root>java</package-root>
<classpath mode="compile">${base.path}/jaxrpc-1.1-rc4/geronimo-spec-jaxrpc-1.1-rc4.jar:${base.path}/wsdl4j-1.6.3/wsdl4j-1.6.3.jar:${base.path}/ecj-4.6.3/ecj-4.6.3.jar:${ant.includes}/</classpath>
<source-level>1.7</source-level>
</compilation-unit>
<compilation-unit>
<package-root>webapps/docs/appdev/sample/src</package-root>
<classpath mode="compile">${base.path}/servletapi-2.3/servletapi-2.3.jar</classpath>
<source-level>1.7</source-level>
</compilation-unit>
<compilation-unit>
<package-root>test</package-root>
<unit-tests/>
<classpath mode="compile">output/classes:output/testclasses:${base.path}/junit-4.12/junit-4.12.jar:${base.path}/easymock-3.2/easymock-3.2.jar:${base.path}/hamcrest-1.3/hamcrest-core-1.3.jar</classpath>
<source-level>1.7</source-level>
</compilation-unit>
</java-data>
</configuration>
</project>