First commit. WIP. Don't expect the build to work yet. Project: http://git-wip-us.apache.org/repos/asf/commons-testing/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-testing/commit/59d9d61f Tree: http://git-wip-us.apache.org/repos/asf/commons-testing/tree/59d9d61f Diff: http://git-wip-us.apache.org/repos/asf/commons-testing/diff/59d9d61f
Branch: refs/heads/master Commit: 59d9d61f84238568d7fdefac26c8e995ba4cf258 Parents: Author: Gary Gregory <ggreg...@apache.org> Authored: Sun Nov 5 23:01:10 2017 -0700 Committer: Gary Gregory <ggreg...@apache.org> Committed: Sun Nov 5 23:01:10 2017 -0700 ---------------------------------------------------------------------- .gitignore | 3 + .travis.yml | 27 ++ LICENSE.txt | 202 ++++++++++ NOTICE.txt | 5 + checkstyle-suppressions.xml | 25 ++ checkstyle.xml | 59 +++ commons-testing-generic/.gitignore | 4 + commons-testing-generic/pom.xml | 76 ++++ commons-testing-junit4/.gitignore | 4 + commons-testing-junit4/pom.xml | 88 +++++ .../junit4/AbstractAvailableLocalesTest.java | 95 +++++ .../junit4/ObjectToStringComparator.java | 40 ++ .../junit4/SetDefaultLocaleTestRule.java | 58 +++ findbugs-exclude-filter.xml | 26 ++ pom.xml | 376 +++++++++++++++++++ src/assembly/bin.xml | 46 +++ src/assembly/src.xml | 44 +++ src/changes/changes.xml | 53 +++ src/changes/release-notes.vm | 135 +++++++ src/media/logo.xcf | Bin 0 -> 122924 bytes src/site/resources/download_lang.cgi | 4 + src/site/resources/images/logo.png | Bin 0 -> 32813 bytes src/site/resources/profile.clirr | 0 src/site/resources/profile.cobertura | 0 src/site/site.xml | 44 +++ src/site/xdoc/building.xml | 49 +++ src/site/xdoc/developerguide.xml | 60 +++ src/site/xdoc/index.xml | 99 +++++ src/site/xdoc/issue-tracking.xml | 102 +++++ src/site/xdoc/mail-lists.xml | 202 ++++++++++ src/site/xdoc/proposal.xml | 97 +++++ target/antrun/build-main.xml | 11 + target/apidocs/META-INF/LICENSE.txt | 202 ++++++++++ target/apidocs/META-INF/NOTICE.txt | 5 + ...mmons-testing-parent-1.0.0-SNAPSHOT-site.xml | 44 +++ target/maven-archiver/pom.properties | 5 + 36 files changed, 2290 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fbdf7eb --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.classpath +/.project +/.settings/ http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..af604cc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +# 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. + +language: java +sudo: false + +jdk: + - oraclejdk8 + - oraclejdk9 + +script: + - mvn + +after_success: + - mvn clean cobertura:cobertura coveralls:report -Ptravis-cobertura http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/LICENSE.txt ---------------------------------------------------------------------- diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE.txt @@ -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. http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/NOTICE.txt ---------------------------------------------------------------------- diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 0000000..db8bc2e --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,5 @@ +Apache Commons Testing +Copyright 2017-2017 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/checkstyle-suppressions.xml ---------------------------------------------------------------------- diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml new file mode 100644 index 0000000..e4746a5 --- /dev/null +++ b/checkstyle-suppressions.xml @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<!-- +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. +--> +<!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN" "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd"> +<suppressions> + <suppress checks="JavadocMethod" files=".*[/\\]test[/\\].*"/> + <suppress checks="JavadocPackage" files=".*[/\\]test[/\\].*"/> + <!-- exclude generated JMH classes from all checks --> + <suppress checks="[a-zA-Z0-9]*" files=".*[/\\]generated-test-sources[/\\].*"/> + <suppress checks="RedundantModifier" files="ConstructorUtilsTest" lines="0-99999"/> +</suppressions> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/checkstyle.xml ---------------------------------------------------------------------- diff --git a/checkstyle.xml b/checkstyle.xml new file mode 100644 index 0000000..9ba1bcc --- /dev/null +++ b/checkstyle.xml @@ -0,0 +1,59 @@ +<?xml version="1.0"?> +<!-- +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. +--> + +<!DOCTYPE module PUBLIC + "-//Puppy Crawl//DTD Check Configuration 1.1//EN" + "http://www.puppycrawl.com/dtds/configuration_1_1.dtd"> + +<!-- commons lang customization of default Checkstyle behavior --> +<module name="Checker"> + <property name="localeLanguage" value="en"/> + <module name="JavadocPackage"/> + <module name="NewlineAtEndOfFile"> + <property name="lineSeparator" value="lf" /> + </module> + <module name="FileTabCharacter"> + <property name="fileExtensions" value="java,xml"/> + </module> + <module name="RegexpSingleline"> + <!-- \s matches whitespace character, $ matches end of line. --> + <property name="format" value="\s+$"/> + <property name="message" value="Line has trailing spaces."/> + </module> + <module name="SuppressionFilter"> + <property name="file" value="checkstyle-suppressions.xml"/> + </module> + <module name="TreeWalker"> + <property name="cacheFile" value="target/cachefile"/> + <module name="AvoidStarImport"/> + <module name="IllegalImport"/> + <module name="RedundantImport"/> + <module name="UnusedImports"/> + <module name="NeedBraces"/> + <module name="JavadocMethod"> + <property name="allowUndeclaredRTE" value="true"/> + <property name="scope" value="public" /> + </module> + <module name="ModifierOrder"/> + <module name="RedundantModifier"/> + <module name="UpperEll" /> + <module name="LeftCurly"/> + <module name="NeedBraces"/> + <module name="RightCurly"/> + </module> +</module> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/commons-testing-generic/.gitignore ---------------------------------------------------------------------- diff --git a/commons-testing-generic/.gitignore b/commons-testing-generic/.gitignore new file mode 100644 index 0000000..9fac551 --- /dev/null +++ b/commons-testing-generic/.gitignore @@ -0,0 +1,4 @@ +/.settings/ +/.classpath +/.project +/target/ http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/commons-testing-generic/pom.xml ---------------------------------------------------------------------- diff --git a/commons-testing-generic/pom.xml b/commons-testing-generic/pom.xml new file mode 100644 index 0000000..2e25fcd --- /dev/null +++ b/commons-testing-generic/pom.xml @@ -0,0 +1,76 @@ +<?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 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/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.commons</groupId> + <artifactId>commons-testing-parent</artifactId> + <version>1.0.0-SNAPSHOT</version> + </parent> + + <artifactId>commons-testing-generic</artifactId> + <packaging>jar</packaging> + + <name>Apache Commons Testing for Generic test code</name> + <description>Apache Commons Testing for Generic test code</description> + + <properties> + <commons.osgi.symbolicName>org.apache.commons.testing.generic</commons.osgi.symbolicName> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <id>test-jar</id> + <!-- Also expose abstract test classes --> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <configuration> + <instructions> + <Bundle-SymbolicName>org.apache.commons.testing.generic</Bundle-SymbolicName> + <Automatic-Module-Name>org.apache.commons.testing.generic</Automatic-Module-Name> + </instructions> + </configuration> + </plugin> + </plugins> + </build> + + <distributionManagement> + <site> + <id>commonstesting-generic-site</id> + <url>scm:svn:${commons.scmPubUrl}/generic/</url> + </site> + </distributionManagement> + +</project> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/commons-testing-junit4/.gitignore ---------------------------------------------------------------------- diff --git a/commons-testing-junit4/.gitignore b/commons-testing-junit4/.gitignore new file mode 100644 index 0000000..10d81e8 --- /dev/null +++ b/commons-testing-junit4/.gitignore @@ -0,0 +1,4 @@ +/.classpath +/.project +/.settings/ +/target/ http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/commons-testing-junit4/pom.xml ---------------------------------------------------------------------- diff --git a/commons-testing-junit4/pom.xml b/commons-testing-junit4/pom.xml new file mode 100644 index 0000000..948e73c --- /dev/null +++ b/commons-testing-junit4/pom.xml @@ -0,0 +1,88 @@ +<?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 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/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.commons</groupId> + <artifactId>commons-testing-parent</artifactId> + <version>1.0.0-SNAPSHOT</version> + </parent> + + <artifactId>commons-testing-junit4</artifactId> + <packaging>jar</packaging> + + <name>Apache Commons Testing for JUnit4</name> + <description>Apache Commons Testing for JUnit4</description> + + <properties> + <commons.osgi.symbolicName>org.apache.commons.testing.junit4</commons.osgi.symbolicName> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <id>test-jar</id> + <!-- Also expose abstract test classes --> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <configuration> + <instructions> + <Bundle-SymbolicName>org.apache.commons.testing.junit4</Bundle-SymbolicName> + <Automatic-Module-Name>org.apache.commons.testing.junit4</Automatic-Module-Name> + </instructions> + </configuration> + </plugin> + </plugins> + </build> + + <distributionManagement> + <site> + <id>commonstesting-junit4-site</id> + <url>scm:svn:${commons.scmPubUrl}/junit4/</url> + </site> + </distributionManagement> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + </dependency> + </dependencies> + +</project> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/AbstractAvailableLocalesTest.java ---------------------------------------------------------------------- diff --git a/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/AbstractAvailableLocalesTest.java b/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/AbstractAvailableLocalesTest.java new file mode 100644 index 0000000..23459a3 --- /dev/null +++ b/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/AbstractAvailableLocalesTest.java @@ -0,0 +1,95 @@ +/* + * 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.commons.testing.junit4; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Locale; + +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.Rule; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public abstract class AbstractAvailableLocalesTest { + +// public static List<Object[]> combine(final Object[] objects, final List<Locale> locales) { +// final List<Object[]> result = new ArrayList<>(objects.length * locales.size()); +// Arrays.stream(objects).forEachOrdered(object -> locales.stream().forEachOrdered(locale -> result.add(new Object[] { object, locale }))); +// return result; +// } +// +// public static List<Object[]> combine(final Object[] objects, final Locale[] locales) { +// final List<Object[]> result = new ArrayList<>(objects.length * locales.length); +// Arrays.stream(objects).forEachOrdered(object -> Arrays.stream(locales).forEachOrdered(locale -> result.add(new Object[] { object, locale }))); +// return result; +// } + +// public static List<Object[]> combineAvailableLocales(final Object[] objects) { +// return combine(objects, getSortedAvailableLocales()); +// } +// +// public static List<Object[]> combineDeclaredLocales(final Object[] objects) { +// return combine(objects, getSortedDeclaredLocales()); +// } + + @Parameters(name = "{0}") + public static Locale[] getSortedAvailableLocales() { + final Locale[] availableLocales = Locale.getAvailableLocales(); + Arrays.sort(availableLocales, new ObjectToStringComparator()); + return availableLocales; + } + + public static List<Locale> getSortedDeclaredLocales() { + final Field[] allFields = FieldUtils.getAllFields(Locale.class); + final List<Locale> availableLocales = new ArrayList<>(allFields.length); + for (final Field field : allFields) { + final int modifiers = field.getModifiers(); + if (field.getType() == Locale.class && Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers)) { + try { + availableLocales.add((Locale) field.get(Locale.class)); + } catch (IllegalArgumentException | IllegalAccessException e) { + throw new IllegalStateException("Field " + field, e); + } + } + } + Collections.sort(availableLocales, new ObjectToStringComparator()); + return availableLocales; + } + + private final Locale locale; + + @Rule + public final SetDefaultLocaleTestRule rule; + + public AbstractAvailableLocalesTest(final Locale locale) { + super(); + this.locale = locale; + this.rule = new SetDefaultLocaleTestRule(locale); + } + + public Locale getLocale() { + return locale; + } +} http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/ObjectToStringComparator.java ---------------------------------------------------------------------- diff --git a/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/ObjectToStringComparator.java b/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/ObjectToStringComparator.java new file mode 100644 index 0000000..c04bacf --- /dev/null +++ b/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/ObjectToStringComparator.java @@ -0,0 +1,40 @@ +/* + * 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.commons.testing.junit4; + +import java.io.Serializable; +import java.util.Comparator; + +public final class ObjectToStringComparator implements Comparator<Object>, Serializable { + + private static final long serialVersionUID = 1L; + + @Override + public int compare(final Object o1, final Object o2) { + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return 1; + } + if (o2 == null) { + return -1; + } + return o1.toString().compareTo(o2.toString()); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SetDefaultLocaleTestRule.java ---------------------------------------------------------------------- diff --git a/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SetDefaultLocaleTestRule.java b/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SetDefaultLocaleTestRule.java new file mode 100644 index 0000000..4b7dbd9 --- /dev/null +++ b/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SetDefaultLocaleTestRule.java @@ -0,0 +1,58 @@ +/* + * 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.commons.testing.junit4; + +import java.util.Locale; + +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +/** + * Sets the default {@code Locale} to the given locale for the duration of the test. + */ +public class SetDefaultLocaleTestRule implements TestRule { + + private final Locale locale; + + public SetDefaultLocaleTestRule(final Locale locale) { + super(); + this.locale = locale; + } + + @Override + public Statement apply(final Statement base, final Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + final Locale savedLocale = Locale.getDefault(); + Locale.setDefault(getLocale()); + try { + base.evaluate(); + } finally { + Locale.setDefault(savedLocale); + } + } + }; + } + + public Locale getLocale() { + return locale; + } + +} http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/findbugs-exclude-filter.xml ---------------------------------------------------------------------- diff --git a/findbugs-exclude-filter.xml b/findbugs-exclude-filter.xml new file mode 100644 index 0000000..c4d319f --- /dev/null +++ b/findbugs-exclude-filter.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!-- + 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. +--> + +<!-- + This file contains some false positive bugs detected by findbugs. Their + false positive nature has been analyzed individually and they have been + put here to instruct findbugs it must ignore them. +--> +<FindBugsFilter> + +</FindBugsFilter> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..f7cb360 --- /dev/null +++ b/pom.xml @@ -0,0 +1,376 @@ +<?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 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>org.apache.commons</groupId> + <artifactId>commons-parent</artifactId> + <version>42</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>commons-testing-parent</artifactId> + <version>1.0.0-SNAPSHOT</version> + <packaging>pom</packaging> + <name>Apache Commons Testing</name> + + <inceptionYear>2017</inceptionYear> + <description> + Apache Commons Testing, a package of Java utility classes for testing. + </description> + + <url>http://commons.apache.org/proper/commons-testing/</url> + + <issueManagement> + <system>jira</system> + <!-- WIP --> + <url>http://issues.apache.org/jira/browse/TEST</url> + </issueManagement> + + <scm> + <connection>scm:git:http://git-wip-us.apache.org/repos/asf/commons-testing.git</connection> + <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/commons-testing.git</developerConnection> + <url>https://git-wip-us.apache.org/repos/asf?p=commons-testing.git</url> + <tag>TESTING-1.0.0</tag> + </scm> + + <developers> + <developer> + <name>Gary D. Gregory</name> + <id>ggregory</id> + <email>ggreg...@apache.org</email> + <timezone>-5</timezone> + <roles> + <role>Java Developer</role> + </roles> + </developer> + </developers> + + <contributors> + </contributors> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.6</version> + </dependency> + </dependencies> + </dependencyManagement> + + <distributionManagement> + <site> + <id>apache.website</id> + <name>Apache Commons Testing Site</name> + <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-testing/</url> + </site> + </distributionManagement> + + <properties> + <argLine>-Xmx512m</argLine> + <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + <!-- + This is also used to generate download_xxx file name. + To override this when generating the download page: + + mvn commons:download-page -Dcommons.componentid=testing + + The above seems to change the download page name but not any other + properties that depend on the componentid. + --> + <commons.componentid>testing</commons.componentid> + <commons.module.name>org.apache.commons.testing</commons.module.name> + <!-- Current 1.x release series --> + <commons.release.version>1.0.0</commons.release.version> + <commons.release.desc>(Java 8)</commons.release.desc> + <commons.jira.id>TESTING</commons.jira.id> + <commons.jira.pid>????</commons.jira.pid> + + <commons.site.path>testing</commons.site.path> + <commons.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-testing</commons.scmPubUrl> + <commons.scmPubCheckoutDirectory>site-content</commons.scmPubCheckoutDirectory> + <commons.encoding>utf-8</commons.encoding> + + <!-- Override clirr version to be able to build the site on Java 8 --> + <commons.clirr.version>2.8</commons.clirr.version> + <checkstyle.plugin.version>2.17</checkstyle.plugin.version> + + </properties> + + + <build> + <defaultGoal>clean verify apache-rat:check clirr:check checkstyle:check findbugs:check javadoc:javadoc</defaultGoal> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <configuration> + <excludes> + <exclude>site-content/**</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <executions> + <execution> + <id>plain</id> + <configuration> + <includes> + <include>**/*Test.java</include> + </includes> + <runOrder>random</runOrder> + </configuration> + </execution> + <!-- <execution> <id>security-manager-test</id> <phase>integration-test</phase> <goals> <goal>test</goal> </goals> + <configuration> + <includes> <include>**/*Test.java</include> </includes> <argLine>-Djava.security.manager -Djava.security.policy=${basedir}/src/test/resources/java.policy</argLine> + </configuration> </execution> --> + </executions> + </plugin> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptors> + <descriptor>src/assembly/bin.xml</descriptor> + <descriptor>src/assembly/src.xml</descriptor> + </descriptors> + <tarLongFileMode>gnu</tarLongFileMode> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + <!-- Temporary fix for LANG-1338, remove this after this has implemented in parent pom --> + <configuration> + <archive combine.children="append"> + <manifestEntries> + <Automatic-Module-Name>org.apache.commons.testing</Automatic-Module-Name> + </manifestEntries> + </archive> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-scm-publish-plugin</artifactId> + <configuration> + <ignorePathsToDelete> + <ignorePathToDelete>javadocs</ignorePathToDelete> + </ignorePathsToDelete> + </configuration> + </plugin> + <plugin> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>${checkstyle.plugin.version}</version> + <configuration> + <configLocation>${basedir}/checkstyle.xml</configLocation> + <includeTestSourceDirectory>true</includeTestSourceDirectory> + <enableRulesSummary>false</enableRulesSummary> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <!-- Use version from parent pom as that is adjusted according to the Java version used to run Maven --> + <version>${commons.findbugs.version}</version> + <configuration> + <excludeFilterFile>${basedir}/findbugs-exclude-filter.xml</excludeFilterFile> + </configuration> + </plugin> + </plugins> + </pluginManagement> + <plugins> + </plugins> + + </build> + + <reporting> + <plugins> + <plugin> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>${checkstyle.plugin.version}</version> + <configuration> + <configLocation>${basedir}/checkstyle.xml</configLocation> + <includeTestSourceDirectory>true</includeTestSourceDirectory> + <enableRulesSummary>false</enableRulesSummary> + </configuration> + <reportSets> + <reportSet> + <reports> + <report>checkstyle</report> + </reports> + </reportSet> + </reportSets> + </plugin> + <!-- Requires setting 'export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m" ' --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <!-- Use version from parent pom as that is adjusted according to the Java version used to run Maven --> + <version>${commons.findbugs.version}</version> + <configuration> + <excludeFilterFile>${basedir}/findbugs-exclude-filter.xml</excludeFilterFile> + </configuration> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <version>3.8</version> + <configuration> + <targetJdk>${maven.compiler.target}</targetJdk> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>taglist-maven-plugin</artifactId> + <version>2.4</version> + <configuration> + <tagListOptions> + <tagClasses> + <tagClass> + <displayName>Needs Work</displayName> + <tags> + <tag> + <matchString>TODO</matchString> + <matchType>exact</matchType> + </tag> + <tag> + <matchString>FIXME</matchString> + <matchType>exact</matchType> + </tag> + <tag> + <matchString>XXX</matchString> + <matchType>exact</matchType> + </tag> + </tags> + </tagClass> + <tagClass> + <displayName>Noteable Markers</displayName> + <tags> + <tag> + <matchString>NOTE</matchString> + <matchType>exact</matchType> + </tag> + <tag> + <matchString>NOPMD</matchString> + <matchType>exact</matchType> + </tag> + <tag> + <matchString>NOSONAR</matchString> + <matchType>exact</matchType> + </tag> + </tags> + </tagClass> + </tagClasses> + </tagListOptions> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>javancss-maven-plugin</artifactId> + <version>2.1</version> + </plugin> + </plugins> + </reporting> + + <modules> + <module>commons-testing-generic</module> + <module>commons-testing-junit4</module> + <!--<module>commons-testing-junit5</module> --> + </modules> + + <profiles> + <profile> + <id>setup-checkout</id> + <activation> + <file> + <missing>site-content</missing> + </file> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>prepare-checkout</id> + <phase>pre-site</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks> + <exec executable="svn"> + <arg line="checkout --depth immediates ${commons.scmPubUrl} ${commons.scmPubCheckoutDirectory}" /> + </exec> + + <exec executable="svn"> + <arg line="update --set-depth exclude ${commons.scmPubCheckoutDirectory}/javadocs" /> + </exec> + + <pathconvert pathsep=" " property="dirs"> + <dirset dir="${commons.scmPubCheckoutDirectory}" includes="*" /> + </pathconvert> + <exec executable="svn"> + <arg line="update --set-depth infinity ${dirs}" /> + </exec> + </tasks> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + + <profile> + <id>java9</id> + <activation> + <jdk>9</jdk> + </activation> + <properties> + <!-- LANG-1265: allow tests to access private fields/methods of java.base classes via reflection --> + <argLine>-Xmx512m --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens + java.base/java.lang=ALL-UNNAMED</argLine> + <!-- versions below 3.0.0 do not work with java 9 --> + <commons.javadoc.version>3.0.0-M1</commons.javadoc.version> + <!-- coverall version 4.3.0 does not work with java 9, see https://github.com/trautonen/coveralls-maven-plugin/issues/112 --> + <coveralls.skip>true</coveralls.skip> + </properties> + </profile> + + </profiles> + +</project> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/assembly/bin.xml ---------------------------------------------------------------------- diff --git a/src/assembly/bin.xml b/src/assembly/bin.xml new file mode 100644 index 0000000..fb1e07c --- /dev/null +++ b/src/assembly/bin.xml @@ -0,0 +1,46 @@ +<!-- + 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. +--> +<assembly> + <id>bin</id> + <formats> + <format>tar.gz</format> + <format>zip</format> + </formats> + <includeSiteDirectory>false</includeSiteDirectory> + <fileSets> + <fileSet> + <includes> + <include>LICENSE.txt</include> + <include>NOTICE.txt</include> + <include>RELEASE-NOTES.txt</include> + <include>README.md</include> + <include>CONTRIBUTING.md</include> + </includes> + </fileSet> + <fileSet> + <directory>target</directory> + <outputDirectory></outputDirectory> + <includes> + <include>*.jar</include> + </includes> + </fileSet> + <fileSet> + <directory>target/site/apidocs</directory> + <outputDirectory>apidocs</outputDirectory> + </fileSet> + </fileSets> +</assembly> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/assembly/src.xml ---------------------------------------------------------------------- diff --git a/src/assembly/src.xml b/src/assembly/src.xml new file mode 100644 index 0000000..dc91e0e --- /dev/null +++ b/src/assembly/src.xml @@ -0,0 +1,44 @@ +<!-- + 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. +--> +<assembly> + <id>src</id> + <formats> + <format>tar.gz</format> + <format>zip</format> + </formats> + <baseDirectory>${project.artifactId}-${commons.release.version}-src</baseDirectory> + <fileSets> + <fileSet> + <includes> + <include>.travis.yml</include> + <include>checkstyle.xml</include> + <include>checkstyle-suppressions.xml</include> + <include>findbugs-exclude-filter.xml</include> + <include>LICENSE.txt</include> + <include>NOTICE.txt</include> + <include>pom.xml</include> + <include>PROPOSAL.html</include> + <include>RELEASE-NOTES.txt</include> + <include>README.md</include> + <include>CONTRIBUTING.md</include> + </includes> + </fileSet> + <fileSet> + <directory>src</directory> + </fileSet> + </fileSets> +</assembly> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/changes/changes.xml ---------------------------------------------------------------------- diff --git a/src/changes/changes.xml b/src/changes/changes.xml new file mode 100644 index 0000000..3150dc4 --- /dev/null +++ b/src/changes/changes.xml @@ -0,0 +1,53 @@ +<?xml version="1.0"?> +<!-- + 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. + --> + +<!-- +This file is also used by the maven-changes-plugin to generate the release notes. +Useful ways of finding items to add to this file are: + +1. Add items when you fix a bug or add a feature (this makes the +release process easy :-). + +2. Do a JIRA search for tickets closed since the previous release. + +3. Use the report generated by the maven-changelog-plugin to see all +SVN commits. TBA how to use this with SVN. + +To generate the release notes from this file: + +mvn changes:announcement-generate -Prelease-notes [-Dchanges.version=nnn] + +then tweak the formatting if necessary +and commit + +The <action> type attribute can be add,update,fix,remove. +--> + + +<document> + <properties> + <title>Apache Commons Testing Changes</title> + </properties> + <body> + + <release version="1.0.0" date="2017-MM-DD" description="First release (Java 8)"> + + </release> + + </body> +</document> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/changes/release-notes.vm ---------------------------------------------------------------------- diff --git a/src/changes/release-notes.vm b/src/changes/release-notes.vm new file mode 100644 index 0000000..faee66c --- /dev/null +++ b/src/changes/release-notes.vm @@ -0,0 +1,135 @@ +## 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. +## + +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.name} + Version ${version} + Release Notes + + +INTRODUCTION: + +This document contains the release notes for the ${version} version of Apache Commons Testing. +Commons Testing is a set of utility functions and reusable components that should be of use in any +Java environment. + +Commons Testing 1.0.0 targets Java 8. + +$introduction.replaceAll("(?<!\015)\012", " +").replaceAll("(?m)^ +","") + +## N.B. the available variables are described here: +## http://maven.apache.org/plugins/maven-changes-plugin/examples/using-a-custom-announcement-template.html +## +## Hack to improve layout: replace all pairs of spaces with a single new-line +$release.description.replaceAll(" ", " +") + +## set up indent sizes. Only change indent1 +#set($props=${project.properties}) +#set($jiralen=$props.get("commons.jira.id").length()) +## indent1 = POOL-nnnn: +#set($blanklen=$jiralen+6)## +6 for "-nnnn:" +## must be at least as long as the longest JIRA id +#set($blanks=" ") +#set($indent1=$blanks.substring(0,$blanklen)) +## indent2 allows for issue wrapper +#set($indent2="$indent1 ") +## +#macro ( processaction ) +## Use replaceAll to fix up LF-only line ends on Windows. +#set($action=$actionItem.getAction().replaceAll("\n"," +")) +## Fix up indentation for multi-line action descriptions +#set($action=$action.replaceAll("(?m)^ +",$indent2)) +#if ($actionItem.getIssue()) +#set($issue="$actionItem.getIssue():") +## Pad shorter issue numbers +#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end +#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end +#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end +#else +#set($issue=$indent1) +#end +#if ($actionItem.getDueTo()) +#set($dueto=" Thanks to $actionItem.getDueTo().") +#else +#set($dueto="") +#end +o $issue ${action}$dueto +#set($action="") +#set($issue="") +#set($dueto="") +#end +## +#if ($release.getActions().size() == 0) +No changes defined in this version. +#else +Changes in this version include: + +#if ($release.getActions('add').size() !=0) +New features: +#foreach($actionItem in $release.getActions('add')) +#processaction() +#end +#end + +#if ($release.getActions('fix').size() !=0) +Fixed Bugs: +#foreach($actionItem in $release.getActions('fix')) +#processaction() +#end +#end + +#if ($release.getActions('update').size() !=0) +Changes: +#foreach($actionItem in $release.getActions('update')) +#processaction() +#end +#end + +#if ($release.getActions('remove').size() !=0) +Removed: +#foreach($actionItem in $release.getActions('remove')) +#processaction() +#end +#end +## End of main loop +#end + +Historical list of changes: ${project.url}changes-report.html + +For complete information on ${project.name}, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache ${project.name} website: + +${project.url} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/media/logo.xcf ---------------------------------------------------------------------- diff --git a/src/media/logo.xcf b/src/media/logo.xcf new file mode 100644 index 0000000..ad6b97b Binary files /dev/null and b/src/media/logo.xcf differ http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/site/resources/download_lang.cgi ---------------------------------------------------------------------- diff --git a/src/site/resources/download_lang.cgi b/src/site/resources/download_lang.cgi new file mode 100644 index 0000000..495cde1 --- /dev/null +++ b/src/site/resources/download_lang.cgi @@ -0,0 +1,4 @@ +#!/bin/sh +# Just call the standard mirrors.cgi script. It will use download.html +# as the input template. +exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $* \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/site/resources/images/logo.png ---------------------------------------------------------------------- diff --git a/src/site/resources/images/logo.png b/src/site/resources/images/logo.png new file mode 100644 index 0000000..797c9ab Binary files /dev/null and b/src/site/resources/images/logo.png differ http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/site/resources/profile.clirr ---------------------------------------------------------------------- diff --git a/src/site/resources/profile.clirr b/src/site/resources/profile.clirr new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/site/resources/profile.cobertura ---------------------------------------------------------------------- diff --git a/src/site/resources/profile.cobertura b/src/site/resources/profile.cobertura new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/site/site.xml ---------------------------------------------------------------------- diff --git a/src/site/site.xml b/src/site/site.xml new file mode 100644 index 0000000..69574cb --- /dev/null +++ b/src/site/site.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + 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 name="Lang"> + <bannerRight> + <name>Commons Testing</name> + <src>/images/logo.png</src> + <href>/index.html</href> + </bannerRight> + + <body> + <menu name="Lang"> + <item name="Overview" href="/index.html"/> + <item name="Download" href="/download_lang.cgi"/> + <item name="Javadoc (1.0.0)" href="javadocs/api-1.0.0/index.html"/> + <item name="Javadoc (Latest)" href="javadocs/api-release/index.html"/> + </menu> + + <menu name="Development"> + <item name="Building" href="/building.html"/> + <item name="Mailing Lists" href="/mail-lists.html"/> + <item name="Issue Tracking" href="/issue-tracking.html"/> + <item name="Developer Guide" href="/developerguide.html"/> + <item name="Source Repository" href="/source-repository.html"/> + <item name="Javadoc (GIT latest)" href="apidocs/index.html"/> + </menu> + + </body> + +</project> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/site/xdoc/building.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/building.xml b/src/site/xdoc/building.xml new file mode 100644 index 0000000..3d10b1e --- /dev/null +++ b/src/site/xdoc/building.xml @@ -0,0 +1,49 @@ +<?xml version="1.0"?> +<!-- +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. +--> +<document> + <properties> + <title>Building</title> + <author email="d...@commons.apache.org">Commons Documentation Team</author> + </properties> +<body> +<!-- ================================================== --> +<section name="Overview"> +<p> + Apache Commons Testing uses <a href="http://maven.apache.org">Maven</a>. +</p> +</section> +<!-- ================================================== --> +<section name="Maven Goals"> + <p> + To build a jar file, change into the root directory of Commons Testing and run "mvn clean package". + The result will be in the "target" subdirectory. + </p> + <p> + To build the full website, run "mvn clean site". + The result will be in "target/site". + You must be online to successfully complete this target. + </p> + <p> + Further details can be found in the + <a href="http://commons.apache.org/building.html">commons build instructions</a>. + </p> +</section> +<!-- ================================================== --> +<!-- ================================================== --> +</body> +</document> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/site/xdoc/developerguide.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/developerguide.xml b/src/site/xdoc/developerguide.xml new file mode 100644 index 0000000..232c001 --- /dev/null +++ b/src/site/xdoc/developerguide.xml @@ -0,0 +1,60 @@ +<!-- + 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. +--> +<document> + <properties> + <title>Developer guide for Apache Commons Testing</title> + </properties> + <body> + + <section name='Developer guide for Apache Commons Testing'> + + <h1> + The Apache Commons + <em>Testing</em> + Component + </h1> + <h2>Developers Guide</h2> + <br /> + <a href="#Introduction">[Introduction]</a> + <a href="#PackageStructure">[Package Structure]</a> + <a href="#UtilityClasses">[Utility Classes]</a> + <a href="#Javadoc">[Javadoc]</a> + <a href="#Building">[Building]</a> + <br /> + <br /> + + <a name="Introduction"></a> + <h3>1. INTRODUCTION</h3> + + <a name="PackageStructure"></a> + <h3>2. PACKAGE STRUCTURE</h3> + + <a name="UtilityClasses"></a> + <h3>3. UTILITY CLASSES</h3> + + <a name="Javadoc"></a> + <h3>4. JAVADOC</h3> + + <a name="Building"></a> + <h3>5.BUILDING</h3> + <h4>Building a Release</h4> + <p> + Commons Testing targets Java 8. + </p> + </section> + </body> +</document> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/site/xdoc/index.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml new file mode 100644 index 0000000..2085a02 --- /dev/null +++ b/src/site/xdoc/index.xml @@ -0,0 +1,99 @@ +<?xml version="1.0"?> +<!-- +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. +--> +<document> + <properties> + <title>Home</title> + <author email="d...@commons.apache.org">Commons Documentation Team</author> + </properties> +<body> +<!-- ================================================== --> +<section name="Apache Commons Testing"> + +<p> +TODO +</p> + +</section> +<!-- ================================================== --> +<section name="Documentation"> +<p> +The package descriptions in the <a href="javadocs/api-release/index.html">JavaDoc</a> give an overview of the available features +and various <a href="project-reports.html">project reports</a> are provided. +</p> +<p> +The JavaDoc API documents are available online: +</p> +<ul> +<li>The <a href="javadocs/api-1.0.0/index.html">current stable release 1.0.0</a> [Java 8]</li> +</ul> +<p> +The <a href="source-repository.html">git repository</a> can be +<a href="https://git-wip-us.apache.org/repos/asf?p=commons-testing.git">browsed</a>, or you can browse/contribute via <a href="https://github.com/apache/commons-testing">GitHub</a>. +</p> +</section> +<!-- ================================================== --> +<section name="Release Information"> +<p>The latest stable release of Lang is 1.0.0. You may: </p> +<ul> +<li>Download <a href="http://commons.apache.org/lang/download_lang.cgi">1.0.0</a></li> +<li>Read the <a href="RELEASE-NOTES.txt">1.0.0 release notes</a></li> +</ul> +<p> +Alternatively you can pull it from the central Maven repositories: +<pre> +<dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-testing</artifactId> + <version>1.0.0</version> +</dependency> +</pre> +</p> + +<p> +For information on previous releases see the <a href="release-history.html">Release History</a>, and to download previous releases see the <a href="http://archive.apache.org/dist/commons/testing/">Commons Testing Archive</a>. +</p> +</section> +<!-- ================================================== --> +<section name="Getting Involved"> +<p> +The <a href="mail-lists.html">commons developer mailing list</a> is the main channel of communication for contributors. Please remember that the lists are shared between all commons components, so prefix your email by [testing]. </p> +<p>You can also visit the #apache-commons IRC channel on irc.freenode.net or peruse <a href="issue-tracking.html">JIRA</a>. Specific links of interest for JIRA are:</p> +<ul> +<li>Ideas looking for code: <a href="https://issues.apache.org/jira/issues/?jql=project%20%3D%20TEST%20AND%20resolution%20%3D%20Unresolved%20AND%20fixVersion%20%3D%20%22Patch%20Needed%22%20ORDER%20BY%20priority%20DESC">Patch Needed</a></li> +<li>Issues with patches, looking for reviews: <a href="https://issues.apache.org/jira/issues/?jql=fixVersion%20%3D%20%22Review%20Patch%22%20AND%20project%20%3D%20TEST%20AND%20resolution%20%3D%20Unresolved%20ORDER%20BY%20priority%20DESC">Review Patch</a></li> +</ul> +<p>Alternatively you can go through the <em>Needs Work</em> tags in the <a href="taglist.html">TagList report</a>.</p> +<p>If you'd like to offer up pull requests via GitHub rather than applying patches to JIRA, we have a <a href="https://github.com/apache/commons-testing/">GitHub mirror</a>. </p> +</section> +<!-- ================================================== --> +<section name="Support"> +<p> +The <a href="mail-lists.html">commons mailing lists</a> act as the main support forum. +The user list is suitable for most library usage queries. +The dev list is intended for the development discussion. +Please remember that the lists are shared between all commons components, +so prefix your email by [lang]. +</p> +<p> +Bug reports and enhancements are also welcomed via the <a href="issue-tracking.html">JIRA</a> issue tracker. +Please read the instructions carefully. +</p> +</section> +<!-- ================================================== --> +</body> +</document> http://git-wip-us.apache.org/repos/asf/commons-testing/blob/59d9d61f/src/site/xdoc/issue-tracking.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/issue-tracking.xml b/src/site/xdoc/issue-tracking.xml new file mode 100644 index 0000000..65c199f --- /dev/null +++ b/src/site/xdoc/issue-tracking.xml @@ -0,0 +1,102 @@ +<?xml version="1.0"?> +<!-- +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. +--> +<!-- + +======================================================================+ + |**** ****| + |**** THIS FILE IS GENERATED BY THE COMMONS BUILD PLUGIN ****| + |**** DO NOT EDIT DIRECTLY ****| + |**** ****| + +======================================================================+ + | TEMPLATE FILE: issue-tracking-template.xml | + | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates | + +======================================================================+ + | | + | 1) Re-generate using: mvn commons:jira-page | + | | + | 2) Set the following properties in the component's pom: | + | - commons.jira.id (required, alphabetic, upper case) | + | - commons.jira.pid (required, numeric) | + | | + | 3) Example Properties | + | | + | <properties> | + | <commons.jira.id>MATH</commons.jira.id> | + | <commons.jira.pid>12310485</commons.jira.pid> | + | </properties> | + | | + +======================================================================+ +--> +<document> + <properties> + <title>Commons Lang Issue tracking</title> + <author email="d...@commons.apache.org">Commons Documentation Team</author> + </properties> + <body> + + <section name="Commons Lang Issue tracking"> + <p> + Commons Lang uses <a href="http://issues.apache.org/jira/">ASF JIRA</a> for tracking issues. + See the <a href="http://issues.apache.org/jira/browse/LANG">Commons Lang JIRA project page</a>. + </p> + + <p> + To use JIRA you may need to <a href="http://issues.apache.org/jira/secure/Signup!default.jspa">create an account</a> + (if you have previously created/updated Commons issues using Bugzilla an account will have been automatically + created and you can use the <a href="http://issues.apache.org/jira/secure/ForgotPassword!default.jspa">Forgot Password</a> + page to get a new password). + </p> + + <p> + If you would like to report a bug, or raise an enhancement request with + Commons Lang please do the following: + <ol> + <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310481&sorter/field=issuekey&sorter/order=DESC&status=1&status=3&status=4">Search existing open bugs</a>. + If you find your issue listed then please add a comment with your details.</li> + <li><a href="mail-lists.html">Search the mailing list archive(s)</a>. + You may find your issue or idea has already been discussed.</li> + <li>Decide if your issue is a bug or an enhancement.</li> + <li>Submit either a <a href="http://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12310481&issuetype=1&priority=4&assignee=-1">bug report</a> + or <a href="http://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12310481&issuetype=4&priority=4&assignee=-1">enhancement request</a>.</li> + </ol> + </p> + + <p> + Please also remember these points: + <ul> + <li>the more information you provide, the better we can help you</li> + <li>test cases are vital, particularly for any proposed enhancements</li> + <li>the developers of Commons Lang are all unpaid volunteers</li> + </ul> + </p> + + <p> + For more information on subversion and creating patches see the + <a href="http://www.apache.org/dev/contributors.html">Apache Contributors Guide</a>. + </p> + + <p> + You may also find these links useful: + <ul> + <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310481&sorter/field=issuekey&sorter/order=DESC&status=1&status=3&status=4">All Open Commons Lang bugs</a></li> + <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310481&sorter/field=issuekey&sorter/order=DESC&status=5&status=6">All Resolved Commons Lang bugs</a></li> + <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310481&sorter/field=issuekey&sorter/order=DESC">All Commons Lang bugs</a></li> + </ul> + </p> + </section> + </body> +</document>