Name:                randomizedtesting
Version:             2.8.1
Release:             1
Summary:             Java Testing Framework
License:             ASL 2.0
URL:                 http://labs.carrotsearch.com/randomizedtesting.html
Source0:             https://github.com/randomizedtesting/randomizedtesting/archive/refs/tags/release/%{version}.tar.gz

Patch0:              Bump-asm-to-8.0.1.patch
Patch1:              change-sample-xml-safe-to-sample-xml.patch

BuildRequires:       maven-local mvn(com.google.guava:guava) mvn(de.thetaphi:forbiddenapis)
BuildRequires:       mvn(dom4j:dom4j) mvn(junit:junit) mvn(org.apache.ant:ant)
BuildRequires:       mvn(org.apache.ant:ant-junit) mvn(org.apache.maven:maven-artifact)
BuildRequires:       mvn(org.apache.maven:maven-compat) mvn(org.apache.maven:maven-core)
BuildRequires:       mvn(org.apache.maven:maven-plugin-api)
BuildRequires:       mvn(org.apache.maven.plugins:maven-antrun-plugin)
BuildRequires:       mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires:       mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires:       mvn(org.apache.maven.shared:maven-common-artifact-filters)
BuildRequires:       mvn(org.assertj:assertj-core) mvn(org.hamcrest:hamcrest-core)
BuildRequires:       mvn(org.ow2.asm:asm) mvn(org.simpleframework:simple-xml)
BuildArch:           noarch

%description
Foundation classes and rules for applying the
principles of Randomized Testing.

%package junit4-ant
Summary:             RandomizedTesting JUnit4 ANT Task
Requires:            %{name} = %{version}-%{release}

%description junit4-ant
RandomizedTesting JUnit4 ANT Task.

%package junit4-maven-plugin
Summary:             RandomizedTesting JUnit4 Maven Plugin
Requires:            %{name} = %{version}-%{release}

%description junit4-maven-plugin
RandomizedTesting JUnit4 Maven Plugin.

%package runner
Summary:             RandomizedTesting Randomized Runner
Requires:            %{name} = %{version}-%{release}

%description runner
RandomizedRunner is a JUnit runner, so it is capable of
running @Test-annotated test cases.

%package javadoc
Summary:             Javadoc for %{name}

%description javadoc
This package contains javadoc for %{name}.

%prep
%autosetup -n %{name}-release-%{version} -p1
find . -name "*.class" -delete
find . -name "*.jar" -delete
find . -name "*.dll" -delete
find . -name "*.dylib" -delete
find . -name "*.so" -delete
find . -name "*.js" -print -delete
sed -i '/jquery/d' \
 junit4-ant/src/main/resources/com/carrotsearch/ant/tasks/junit4/templates/json/index.html \
 junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/json/JsonReport.java
sed -i '/script.js/d' \
 junit4-ant/src/main/resources/com/carrotsearch/ant/tasks/junit4/templates/json/index.html \
 junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/json/JsonReport.java
%pom_disable_module examples/ant
%pom_disable_module examples/maven
%pom_disable_module examples/security-manager
%pom_disable_module junit4-maven-plugin-tests
%pom_remove_plugin com.pyx4me:proguard-maven-plugin junit4-ant
%pom_remove_plugin :maven-dependency-plugin junit4-ant
%pom_xpath_remove "pom:scope[text()='provided']" junit4-ant
for file in CHANGES.txt CONTRIBUTING.txt README.txt; do
 sed -i.orig 's|\r||g' $file
 touch -r $file.orig $file
 rm $file.orig
done
%pom_add_dep org.hamcrest:hamcrest-core randomized-runner
rm -r randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestClassMethodFiltering.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestContextRandom.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestCustomMethodProvider.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestExpected.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestFailurePropagationCompatibility.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestHooksWithEmptyTestSet.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestIgnoredRunCount.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestJ9SysThreads.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestListenersAnnotation.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestMacSysThreads.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestNightlyMode.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestOutOfScopeRandomUse.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestOverridingDefaultExceptionHandler.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestParameterized.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestParameterizedShufflesOrder.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestRepeatTestWithComplexDescription.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestResourceDisposal.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestRules.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestSeedDecorator.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestSeedFixingWithProperties.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestSeedParameterOptional.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestSeedRepeatable.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestStackAugmentation.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestTargetMethod.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestTestFiltering.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestTestCaseInstanceProviders.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestTestCaseOrdering.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestTestGroups.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestUncaughtExceptionsDuplicated.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/TestValidation.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/contracts \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/rules \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test001TimeoutSuite.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test002TimeoutMethod.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test003ThreadLeaksMethod.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test004ThreadLeaksSuite.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test005ThreadLeaksSystemThreads.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test006TimeoutAndThreadLeak.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test007UncaughtExceptions.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test008SeedsAnnotation.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test009TimeoutOrNotIdenticalSequence.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test010Zombies.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test013ThreadLeaksScopeNone.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test014Timeout.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test015TimeoutOverride.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test016ThreadLeaksCustomFilters.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test017ThreadLeaksCustomFiltersException.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test018TimeoutStacks.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test019ThreadLeakGroup.java \
 randomized-runner/src/test/java/com/carrotsearch/randomizedtesting/timeouts/Test020SuiteTimeoutStopsTests.java
%pom_xpath_remove "pom:executions/pom:execution[pom:id = 'surefire-it']" junit4-ant
%pom_remove_plugin :maven-site-plugin


%build
%mvn_build -s

%install
%mvn_install

%files -f .mfiles-%{name}-parent
%doc CHANGES.txt CONTRIBUTING.txt README.txt
%license LICENSE.txt

%files junit4-ant -f .mfiles-junit4-ant

%files junit4-maven-plugin -f .mfiles-junit4-maven-plugin

%files runner -f .mfiles-%{name}-runner

%files javadoc -f .mfiles-javadoc
%license LICENSE.txt

%changelog
* Wed Feb 21 2024 liweigang <izmirvii@gmail.com> - 2.8.1-1
- update to version 2.8.1

* Wed Aug 23 2023 xu_ping <707078654@qq.com> - 2.8.0-1
- Update to 2.8.0

* Tue May 31 2022 yaoxin <yaoxin30@h-partners.com> - 2.7.4-1
- Update to 2.7.4

* Thu Jul 30 2020 leiju <leiju4@huawei.com> - 2.5.3-1
- Package init
