public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/JUnitParams] epel10: Initial RPM
@ 2026-07-16 21:36 Jerry James
0 siblings, 0 replies; only message in thread
From: Jerry James @ 2026-07-16 21:36 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/JUnitParams
Branch : epel10
Commit : e05de917f775d6d7355d3adff7d04648b2f4d83f
Author : Jerry James <loganjerry@gmail.com>
Date : 2023-12-04T09:18:31-07:00
Stats : +684/-0 in 11 file(s)
URL : https://src.fedoraproject.org/rpms/JUnitParams/c/e05de917f775d6d7355d3adff7d04648b2f4d83f?branch=epel10
Log:
Initial RPM
---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0a63916
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/JUnitParams-*.tar.gz
diff --git a/280ee05.patch b/280ee05.patch
new file mode 100644
index 0000000..c0f064d
--- /dev/null
+++ b/280ee05.patch
@@ -0,0 +1,31 @@
+From 280ee05666f151ebd1af4f390fd0ff659cce67e9 Mon Sep 17 00:00:00 2001
+From: Quang Nguyen <quangctkm9207@gmail.com>
+Date: Wed, 20 Dec 2017 16:27:41 +0900
+Subject: [PATCH] Add language identifier for syntax highlighting.
+
+---
+ README.md | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/README.md b/README.md
+index 4e793b0..bc7d713 100644
+--- a/README.md
++++ b/README.md
+@@ -44,7 +44,7 @@ Main differences to standard JUnit Parametrised runner:
+ ## Quickstart
+
+ JUnitParams is available as Maven artifact:
+-```
++```xml
+ <dependency>
+ <groupId>pl.pragmatists</groupId>
+ <artifactId>JUnitParams</artifactId>
+@@ -54,7 +54,7 @@ JUnitParams is available as Maven artifact:
+ ```
+ To use JUnitParams in a Gradle build add this to your dependencies:
+
+-```
++```groovy
+ testCompile 'pl.pragmatists:JUnitParams:1.1.1'
+ ```
+
diff --git a/6bab69a.patch b/6bab69a.patch
new file mode 100644
index 0000000..b7fe5f5
--- /dev/null
+++ b/6bab69a.patch
@@ -0,0 +1,130 @@
+From 6bab69a62f17a32fa81e1ed1ab3617263cac103f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marcin=20K=C5=82opotek?= <marcin.klopotek@jcommerce.pl>
+Date: Fri, 5 Jan 2018 15:01:07 +0100
+Subject: [PATCH] Fixes #44: Show original exception throw from test class
+ constructor
+
+---
+ .../java/junitparams/JUnitParamsRunner.java | 24 +++++++++-
+ .../internal/JUnitParamsRunnerTest.java | 47 +++++++++++++++++++
+ 2 files changed, 69 insertions(+), 2 deletions(-)
+ create mode 100644 src/test/java/junitparams/internal/JUnitParamsRunnerTest.java
+
+diff --git a/src/main/java/junitparams/JUnitParamsRunner.java b/src/main/java/junitparams/JUnitParamsRunner.java
+index d31930a..313eb24 100644
+--- a/src/main/java/junitparams/JUnitParamsRunner.java
++++ b/src/main/java/junitparams/JUnitParamsRunner.java
+@@ -7,9 +7,11 @@
+ import org.junit.AfterClass;
+ import org.junit.Before;
+ import org.junit.BeforeClass;
++import org.junit.internal.runners.statements.Fail;
+ import org.junit.runner.Description;
+ import org.junit.runner.manipulation.Filter;
+ import org.junit.runner.manipulation.NoTestsRemainException;
++import org.junit.runner.notification.Failure;
+ import org.junit.runner.notification.RunNotifier;
+ import org.junit.runners.BlockJUnit4ClassRunner;
+ import org.junit.runners.model.FrameworkMethod;
+@@ -18,6 +20,7 @@
+ import org.junit.validator.PublicClassValidator;
+
+ import static org.junit.internal.runners.rules.RuleMemberValidator.*;
++import static org.junit.runner.Description.createSuiteDescription;
+
+ import junitparams.internal.ParameterisedTestClassRunner;
+ import junitparams.internal.ParametrizedTestMethodsFilter;
+@@ -443,13 +446,30 @@ protected void runChild(FrameworkMethod method, RunNotifier notifier) {
+
+ TestMethod testMethod = parameterisedRunner.testMethodFor(method);
+ if (parameterisedRunner.shouldRun(testMethod)) {
+- parameterisedRunner.runParameterisedTest(testMethod, methodBlock(method), notifier);
++ Statement statement = methodBlock(method);
++ if (initializedProperly(statement, notifier)) {
++ parameterisedRunner.runParameterisedTest(testMethod, statement, notifier);
++ }
+ } else {
+ verifyMethodCanBeRunByStandardRunner(testMethod);
+ super.runChild(method, notifier);
+ }
+ }
+
++ private boolean initializedProperly(Statement statement, RunNotifier notifier) {
++ boolean initializedProperly = true;
++ if (statement instanceof Fail) {
++ try {
++ statement.evaluate();
++ } catch (Throwable throwable) {
++ initializedProperly = false;
++ Failure instantiationFailure = new Failure(createSuiteDescription("Instantiation failure"), throwable);
++ notifier.fireTestFailure(instantiationFailure);
++ }
++ }
++ return initializedProperly;
++ }
++
+ @Override
+ protected Description describeChild(FrameworkMethod method) {
+ Description description = parameterisedRunner.getDescriptionFor(method);
+@@ -489,7 +509,7 @@ protected Statement methodInvoker(FrameworkMethod method, Object test) {
+ @Override
+ public Description getDescription() {
+ if (description == null) {
+- description = Description.createSuiteDescription(getName(), getTestClass().getAnnotations());
++ description = createSuiteDescription(getName(), getTestClass().getAnnotations());
+ List<FrameworkMethod> resultMethods = getListOfMethods();
+
+ for (FrameworkMethod method : resultMethods)
+diff --git a/src/test/java/junitparams/internal/JUnitParamsRunnerTest.java b/src/test/java/junitparams/internal/JUnitParamsRunnerTest.java
+new file mode 100644
+index 0000000..f08579a
+--- /dev/null
++++ b/src/test/java/junitparams/internal/JUnitParamsRunnerTest.java
+@@ -0,0 +1,47 @@
++package junitparams.internal;
++
++import junitparams.JUnitParamsRunner;
++import org.assertj.core.api.iterable.Extractor;
++import org.junit.Test;
++import org.junit.runner.JUnitCore;
++import org.junit.runner.Result;
++import org.junit.runner.RunWith;
++import org.junit.runner.notification.Failure;
++
++import static org.assertj.core.api.Assertions.assertThat;
++import static org.junit.Assert.fail;
++
++public class JUnitParamsRunnerTest {
++
++ private static final RuntimeException TEST_EXCEPTION = new RuntimeException("Test Exception");
++
++ @Test
++ public void shouldGetOriginalExceptionThrownBySampleTestConstructor() {
++ final Result testResult = JUnitCore.runClasses(ExceptionInSampleTestConstructorTest.class);
++ final Extractor<Failure, Throwable> throwableProperty = new Extractor<Failure, Throwable>() {
++ @Override
++ public Throwable extract(Failure failure) {
++ return failure.getException();
++ }
++ };
++ assertThat(testResult.getFailures())
++ .extracting(throwableProperty)
++ .contains(TEST_EXCEPTION);
++ }
++
++ @RunWith(JUnitParamsRunner.class)
++ public static class ExceptionInSampleTestConstructorTest {
++
++ @SuppressWarnings("WeakerAccess")
++ public ExceptionInSampleTestConstructorTest() {
++ throw TEST_EXCEPTION;
++ }
++
++ @Test
++ @SuppressWarnings({"unused", "WeakerAccess"})
++ public void testCase() {
++ fail("Should not be invoked");
++ }
++
++ }
++}
diff --git a/90d47a5.patch b/90d47a5.patch
new file mode 100644
index 0000000..d6adb36
--- /dev/null
+++ b/90d47a5.patch
@@ -0,0 +1,60 @@
+From 90d47a5c89fb2ccce89bb931776d432b8d10c441 Mon Sep 17 00:00:00 2001
+From: mlip <kiwaczki@gmail.com>
+Date: Fri, 11 May 2018 13:44:32 +0200
+Subject: [PATCH] Fix for #155 Better exception message for missing parameters
+
+---
+ .../junitparams/internal/InvokeParameterisedMethod.java | 6 +++---
+ .../junitparams/missingparams/MissingParametersTest.java | 9 +++------
+ 2 files changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/src/main/java/junitparams/internal/InvokeParameterisedMethod.java b/src/main/java/junitparams/internal/InvokeParameterisedMethod.java
+index 6cbd051..0489ae1 100644
+--- a/src/main/java/junitparams/internal/InvokeParameterisedMethod.java
++++ b/src/main/java/junitparams/internal/InvokeParameterisedMethod.java
+@@ -237,9 +237,9 @@ private void verifyNumberOfParameters(FrameworkMethod testMethod, Object[] provi
+
+ if (numberOftestParameters != NumberOfProvidedParameters)
+ throw new IllegalArgumentException(
+- "Number of parameters in data provider method doesn't match the number of test method parameters.\nThere are "
+- + NumberOfProvidedParameters + " parameters in provider method, while there's " + numberOftestParameters + " parameters in the "
+- + testMethod.getName() + " method.");
++ "Number of parameters in data provider method doesn't match the number of test method parameters.\n" +
++ "Number of parameters in provider method is " + NumberOfProvidedParameters +
++ ", while the number of parameters in the " + testMethod.getName() + " test is " + numberOftestParameters);
+ }
+
+ private boolean isForSingleParameter(FrameworkMethod testMethod) {
+diff --git a/src/test/java/junitparams/missingparams/MissingParametersTest.java b/src/test/java/junitparams/missingparams/MissingParametersTest.java
+index c09fcc6..0a4f4e1 100644
+--- a/src/test/java/junitparams/missingparams/MissingParametersTest.java
++++ b/src/test/java/junitparams/missingparams/MissingParametersTest.java
+@@ -39,16 +39,13 @@ public void missingParametersInMethodThrowsIllegalArgumentException() {
+ assertEquals(1, testResult.getFailureCount());
+ assertEquals(IllegalArgumentException.class, testFailure.getException().getClass());
+ assertEquals("Number of parameters in data provider method doesn't match the number of test method parameters.\n" +
+- "There are 1 parameters in provider method, while there's 2 parameters in the missingParameters method."
++ "Number of parameters in provider method is 1, while the number of parameters in the missingParameters test is 2"
+ , testFailure.getException().getMessage());
+ }
+
+ @RunWith(JUnitParamsRunner.class)
+ public static class MissingNullParametersInMethodProvider {
+
+- public MissingNullParametersInMethodProvider() {
+- }
+-
+ @Test
+ @Parameters(method = "withWrongNumberOfNullParams")
+ public void testWithValueAndMethodProviders(String param1, String param2, String param3) {
+@@ -71,8 +68,8 @@ public void missingNullParametersInMethodThrowsIllegalArgumentException() {
+ assertEquals(1, testResult.getFailureCount());
+ assertEquals(IllegalArgumentException.class, testFailure.getException().getClass());
+ assertEquals("Number of parameters in data provider method doesn't match the number of test method parameters.\n" +
+- "There are 2 parameters in provider method, while there's 3 parameters in the testWithValueAndMethodProviders method.",
+- testFailure.getException().getMessage());
++ "Number of parameters in provider method is 2, while the number of parameters in the testWithValueAndMethodProviders test is 3"
++ , testFailure.getException().getMessage());
+ }
+
+
diff --git a/JUnitParams-has-message-containing.patch b/JUnitParams-has-message-containing.patch
new file mode 100644
index 0000000..167a3e6
--- /dev/null
+++ b/JUnitParams-has-message-containing.patch
@@ -0,0 +1,22 @@
+--- JUnitParams-JUnitParams-1.1.1/src/test/java/junitparams/BeforeAfterClassTest.java.orig 2017-11-03 02:05:01.000000000 -0600
++++ JUnitParams-JUnitParams-1.1.1/src/test/java/junitparams/BeforeAfterClassTest.java 2023-11-03 16:43:15.216295932 -0600
+@@ -41,7 +41,7 @@ public class BeforeAfterClassTest {
+
+ assertThat(result.getFailureCount()).isEqualTo(1);
+ assertThat(result.getFailures().get(0).getException())
+- .hasMessage("Method fail() should be static");
++ .hasMessageContaining("Method fail() should be static");
+ }
+
+
+--- JUnitParams-JUnitParams-1.1.1/src/test/java/junitparams/RulesTest.java.orig 2017-11-03 02:05:01.000000000 -0600
++++ JUnitParams-JUnitParams-1.1.1/src/test/java/junitparams/RulesTest.java 2023-11-03 16:43:55.392655339 -0600
+@@ -45,7 +45,7 @@ public class RulesTest {
+
+ assertThat(result.getFailureCount()).isEqualTo(1);
+ assertThat(result.getFailures().get(0).getException())
+- .hasMessage("The @Rule 'testRule' must be public.");
++ .hasMessageContaining("The @Rule 'testRule' must be public.");
+ }
+
+ public class ProtectedRuleTest {
diff --git a/JUnitParams-parse-bigdecimal.patch b/JUnitParams-parse-bigdecimal.patch
new file mode 100644
index 0000000..02e5c07
--- /dev/null
+++ b/JUnitParams-parse-bigdecimal.patch
@@ -0,0 +1,29 @@
+--- JUnitParams-JUnitParams-1.1.1/src/main/java/junitparams/internal/InvokeParameterisedMethod.java.orig 2023-11-03 14:36:37.224929445 -0600
++++ JUnitParams-JUnitParams-1.1.1/src/main/java/junitparams/internal/InvokeParameterisedMethod.java 2023-11-03 14:52:02.457809490 -0600
+@@ -14,6 +14,8 @@ import java.beans.PropertyEditorManager;
+ import java.lang.annotation.Annotation;
+ import java.lang.reflect.Array;
+ import java.math.BigDecimal;
++import java.text.DecimalFormat;
++import java.text.ParseException;
+
+ /**
+ * JUnit invoker for parameterised test methods
+@@ -209,8 +211,15 @@ class InvokeParameterisedMethod extends
+ return object.toString().charAt(0);
+ if (clazz.isAssignableFrom(Byte.TYPE) || clazz.isAssignableFrom(Byte.class))
+ return Byte.parseByte((String) object);
+- if (clazz.isAssignableFrom(BigDecimal.class))
+- return new BigDecimal((String) object);
++ if (clazz.isAssignableFrom(BigDecimal.class)) {
++ DecimalFormat decimalFormat = new DecimalFormat();
++ decimalFormat.setParseBigDecimal(true);
++ try {
++ return decimalFormat.parse((String) object);
++ } catch (ParseException e) {
++ throw new IllegalArgumentException("Illegal BigDecimal value (" + object + ")", e);
++ }
++ }
+ PropertyEditor editor = PropertyEditorManager.findEditor(clazz);
+ if (editor != null) {
+ editor.setAsText((String) object);
diff --git a/JUnitParams-single-method-filter.patch b/JUnitParams-single-method-filter.patch
new file mode 100644
index 0000000..37681c5
--- /dev/null
+++ b/JUnitParams-single-method-filter.patch
@@ -0,0 +1,86 @@
+--- JUnitParams-JUnitParams-1.1.1/src/test/java/junitparams/FilterableTest.java.orig 2017-11-03 02:05:01.000000000 -0600
++++ JUnitParams-JUnitParams-1.1.1/src/test/java/junitparams/FilterableTest.java 2023-11-03 16:38:12.533336631 -0600
+@@ -5,6 +5,7 @@ import org.junit.runner.Description;
+ import org.junit.runner.JUnitCore;
+ import org.junit.runner.Request;
+ import org.junit.runner.Result;
++import org.junit.runner.Runner;
+ import org.junit.runner.manipulation.Filter;
+
+ import static org.assertj.core.api.Assertions.*;
+@@ -22,7 +23,7 @@ public class FilterableTest {
+
+ @Test
+ public void shouldRunSingleTestWithoutParameters() throws Exception {
+- Request request = requestSingleMethodRun(SampleTestCase.class, "firstTestMethod");
++ Request request = Request.method(SampleTestCase.class, "firstTestMethod");
+
+ Result result = new JUnitCore().run(request);
+
+@@ -31,7 +32,7 @@ public class FilterableTest {
+
+ @Test
+ public void shouldRunParametrisedTest() throws Exception {
+- Request request = requestSingleMethodRun(SampleTestCase.class, "secondTestMethod");
++ Request request = Request.method(SampleTestCase.class, "secondTestMethod");
+
+ Result result = new JUnitCore().run(request);
+
+@@ -40,43 +41,27 @@ public class FilterableTest {
+
+ @Test
+ public void shouldReturnOneDescriptionForSimpleTestCase() throws Exception {
+- Request request = requestSingleMethodRun(SampleTestCase.class, "firstTestMethod");
++ Request request = Request.method(SampleTestCase.class, "firstTestMethod");
+
+- Description description = request.getRunner().getDescription();
++ Runner runner = request.getRunner();
++ Description description = runner.getDescription();
+
+- assertThat(description.getChildren()).hasSize(1);
+- assertThat(description.getChildren().get(0).getChildren()).hasSize(0);
++ assertThat(runner.testCount() == 1);
++ for (Description desc: description.getChildren())
++ if (desc.getDisplayName() == "firstTestMethod")
++ assertThat(desc.getChildren()).hasSize(0);
+ }
+
+ @Test
+ public void shouldReturnParametrizedDescriptionsForParametrizedTestCase() throws Exception {
+- Request request = requestSingleMethodRun(SampleTestCase.class, "secondTestMethod");
+-
+- Description description = request.getRunner().getDescription();
+-
+- assertThat(description.getChildren()).hasSize(1);
+- assertThat(description.getChildren().get(0).getChildren()).hasSize(2);
+- }
+-
+- private Request requestSingleMethodRun(Class<SampleTestCase> clazz, String methodName) {
+- return Request.aClass(clazz).filterWith(new SingleMethodFilter(methodName));
+- }
+-
+- private static class SingleMethodFilter extends Filter {
+- private final String methodName;
+-
+- public SingleMethodFilter(String methodName) {
+- this.methodName = methodName;
+- }
++ Request request = Request.method(SampleTestCase.class, "secondTestMethod");
+
+- @Override
+- public boolean shouldRun(Description description) {
+- return description.getDisplayName().contains(methodName);
+- }
++ Runner runner = request.getRunner();
++ Description description = runner.getDescription();
+
+- @Override
+- public String describe() {
+- return methodName;
+- }
++ assertThat(runner.testCount() == 1);
++ for (Description desc: description.getChildren())
++ if (desc.getDisplayName() == "secondTestMethod")
++ assertThat(desc.getChildren()).hasSize(2);
+ }
+ }
diff --git a/JUnitParams.spec b/JUnitParams.spec
new file mode 100644
index 0000000..66a6a55
--- /dev/null
+++ b/JUnitParams.spec
@@ -0,0 +1,86 @@
+Name: JUnitParams
+Version: 1.1.1
+Release: %autorelease
+Summary: Parameterized Java tests
+
+License: Apache-2.0
+URL: https://pragmatists.github.io/JUnitParams/
+Source0: https://github.com/Pragmatists/JUnitParams/archive/%{name}-%{version}.tar.gz
+## Post-release bug fixes
+# Release notes and Readme updated
+Patch0: https://github.com/Pragmatists/JUnitParams/commit/c060976.patch
+# Add language identifiers to README.md for syntax highlighting
+Patch1: https://github.com/Pragmatists/JUnitParams/commit/280ee05.patch
+# Show original exception thrown from test class constructor
+Patch2: https://github.com/Pragmatists/JUnitParams/commit/6bab69a.patch
+# Better exception for missing parameters
+Patch3: https://github.com/Pragmatists/JUnitParams/commit/f0772e7.patch
+# Better exception message for missing parameters
+Patch4: https://github.com/Pragmatists/JUnitParams/commit/90d47a5.patch
+
+## Patches to fix testing with junit 4.13. See:
+## - https://github.com/Pragmatists/JUnitParams/issues/172
+## - https://github.com/Pragmatists/JUnitParams/pull/182
+# Fix parsing of strings into BigDecimal values
+Patch5: %{name}-parse-bigdecimal.patch
+# Fix single method test filters
+Patch6: %{name}-single-method-filter.patch
+# Use hasMessageContaining instead of hasMessage
+Patch7: %{name}-has-message-containing.patch
+
+BuildRequires: maven-local
+BuildRequires: mvn(junit:junit)
+BuildRequires: mvn(org.apache.maven.plugins:maven-compiler-plugin)
+BuildRequires: mvn(org.apache.maven.plugins:maven-jar-plugin)
+BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin)
+BuildRequires: mvn(org.apache.maven.plugins:maven-surefire-plugin)
+BuildRequires: mvn(org.assertj:assertj-core)
+
+BuildArch: noarch
+ExclusiveArch: %{java_arches} noarch
+
+%description
+The JUnitParams project adds a new runner to JUnit and provides much
+easier and more readable parameterized tests for JUnit >= 4.12.
+
+The main differences with the standard JUnit Parameterized runner are:
+- more explicit - params are in test method params, not class fields
+- less code - you don't need a constructor to set up parameters
+- you can mix parameterized with non-parameterized methods in one class
+- params can be passed as a CSV string or from a parameters provider
+ class
+- parameters provider class can have as many parameters providing
+ methods as you want, so that you can group different cases
+- you can have a test method that provides parameters (no external
+ classes or statics anymore)
+- you can see actual parameter values in your IDE (in JUnit's
+ Parameterized, it's only consecutive numbers of parameters)
+
+%prep
+%autosetup -n %{name}-%{name}-%{version} -p1
+
+# sonatype-oss-parent is deprecated in Fedora
+%pom_remove_parent
+
+# Unnecessary plugins for an RPM build
+%pom_remove_plugin org.apache.maven.plugins:maven-javadoc-plugin
+%pom_remove_plugin org.apache.maven.plugins:maven-release-plugin
+%pom_remove_plugin org.codehaus.mojo:animal-sniffer-maven-plugin
+%pom_remove_plugin org.sonatype.plugins:nexus-staging-maven-plugin
+
+# Build for Java 1.8 at a minimum
+%pom_xpath_set '//pom:source' 1.8
+%pom_xpath_set '//pom:target' 1.8
+
+%build
+%mvn_build -j
+
+%install
+%mvn_install
+
+%files -f .mfiles
+%doc README.md RELEASES.md
+%license LICENSE.txt
+
+%changelog
+%autochangelog
diff --git a/c060976.patch b/c060976.patch
new file mode 100644
index 0000000..6d932a1
--- /dev/null
+++ b/c060976.patch
@@ -0,0 +1,56 @@
+From c06097656225bf3e348dab590de619590cc9245a Mon Sep 17 00:00:00 2001
+From: Marcin Armatys <marcin.armatys@pragmatists.pl>
+Date: Fri, 3 Nov 2017 16:38:52 +0100
+Subject: [PATCH] Release notes and Readme updated
+
+---
+ README.md | 6 +++---
+ RELEASES.md | 8 ++++++++
+ 2 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/README.md b/README.md
+index 7f790b1..360adc3 100644
+--- a/README.md
++++ b/README.md
+@@ -24,7 +24,7 @@ See more [examples](https://github.com/Pragmatists/JUnitParams/blob/master/src/t
+
+ ## Latest News
+
+-* 2017-04-17 JUnitParams 1.1.0 released. Check [release info](RELEASES.md).
++* 2017-11-03 JUnitParams 1.1.1 released. Check [release info](RELEASES.md).
+
+ [more news here](https://github.com/Pragmatists/JUnitParams/wiki)
+
+@@ -48,14 +48,14 @@ JUnitParams is available as Maven artifact:
+ <dependency>
+ <groupId>pl.pragmatists</groupId>
+ <artifactId>JUnitParams</artifactId>
+- <version>1.1.0</version>
++ <version>1.1.1</version>
+ <scope>test</scope>
+ </dependency>
+ ```
+ To use JUnitParams in a Gradle build add this to your dependencies:
+
+ ```
+-testCompile 'pl.pragmatists:JUnitParams:1.1.0'
++testCompile 'pl.pragmatists:JUnitParams:1.1.1'
+ ```
+
+
+diff --git a/RELEASES.md b/RELEASES.md
+index fc25551..0fe04e4 100644
+--- a/RELEASES.md
++++ b/RELEASES.md
+@@ -1,3 +1,11 @@
++## JUnitParams 1.1.1 release. Release date : 2017-11-03
++
++### Regexp bugfix
++
++New version works well for Instrumented Unit Test for Android 19 and below.
++
++Thanks [mattmook](https://github.com/mattmook) and [aaalaniz](https://github.com/aaalaniz) for contribution.
++
+ ## JUnitParams 1.1.0 release. Release date : 2017-04-17
+
+ ### [Breaking change] Enhance ParametersProvider with FrameworkMethod
diff --git a/f0772e7.patch b/f0772e7.patch
new file mode 100644
index 0000000..72cf860
--- /dev/null
+++ b/f0772e7.patch
@@ -0,0 +1,182 @@
+From f0772e7bfde036d2cd66464866cb552a969ca33a Mon Sep 17 00:00:00 2001
+From: mlip <kiwaczki@gmail.com>
+Date: Fri, 11 May 2018 13:31:26 +0200
+Subject: [PATCH] Fix for #155 Better exception for missing parameters
+
+---
+ .../internal/InvokeParameterisedMethod.java | 42 ++++++++--
+ .../missingparams/MissingParametersTest.java | 82 +++++++++++++++++++
+ 2 files changed, 118 insertions(+), 6 deletions(-)
+ create mode 100644 src/test/java/junitparams/missingparams/MissingParametersTest.java
+
+diff --git a/src/main/java/junitparams/internal/InvokeParameterisedMethod.java b/src/main/java/junitparams/internal/InvokeParameterisedMethod.java
+index 599416a..6cbd051 100644
+--- a/src/main/java/junitparams/internal/InvokeParameterisedMethod.java
++++ b/src/main/java/junitparams/internal/InvokeParameterisedMethod.java
+@@ -1,5 +1,6 @@
+ package junitparams.internal;
+
++import junitparams.FileParameters;
+ import junitparams.converters.ConversionFailedException;
+ import junitparams.converters.ConvertParam;
+ import junitparams.converters.ParamAnnotation;
+@@ -62,13 +63,15 @@ private Object[] castParamsFromObjects(Object params) throws ConversionFailedExc
+ } catch (ConversionFailedException e) {
+ throw e;
+ } catch (Exception e) {
+- Class<?>[] typesOfParameters = createArrayOfTypesOf(paramset);
+- Object resultParam = createObjectOfExpectedTypeBasedOnParams(paramset, typesOfParameters);
+- return new Object[]{resultParam};
++ return createObjectOfExpectedTypeBasedOnParams(paramset);
+ }
+ }
+
+- private Object createObjectOfExpectedTypeBasedOnParams(Object[] paramset, Class<?>[] typesOfParameters) {
++ private Object[] createObjectOfExpectedTypeBasedOnParams(Object[] paramset) {
++
++ verifyNumberOfParameters(testMethod, paramset);
++
++ Class<?>[] typesOfParameters = createArrayOfTypesOf(paramset);
+ Object resultParam;
+
+ try {
+@@ -84,7 +87,7 @@ private Object createObjectOfExpectedTypeBasedOnParams(Object[] paramset, Class<
+ throw new IllegalStateException("While trying to create object of class " + testMethod.getMethod().getParameterTypes()[0]
+ + " could not find constructor with arguments matching (type-wise) the ones given in parameters.", e);
+ }
+- return resultParam;
++ return new Object[]{resultParam};
+ }
+
+ private Class<?>[] createArrayOfTypesOf(Object[] paramset) {
+@@ -217,7 +220,7 @@ private Object castParameterDirectly(Object object, Class clazz) {
+ " Only primitive types, BigDecimals and Strings can be used.");
+ }
+
+- private void verifySameSizeOfArrays(Object[] columns, Class<?>[] parameterTypes) {
++ private void verifySameSizeOfArrays(Object[] columns, Object[] parameterTypes) {
+ if (parameterTypes.length != columns.length)
+ throw new IllegalArgumentException(
+ "Number of parameters inside @Parameters annotation doesn't match the number of test method parameters.\nThere are "
+@@ -225,6 +228,33 @@ private void verifySameSizeOfArrays(Object[] columns, Class<?>[] parameterTypes)
+ + testMethod.getName() + " method.");
+ }
+
++ private void verifyNumberOfParameters(FrameworkMethod testMethod, Object[] providedParameters) {
++ if (isForFileParameters(testMethod) || isForSingleParameter(testMethod)) {
++ return;
++ }
++ int numberOftestParameters = testMethod.getMethod().getParameterTypes().length;
++ int NumberOfProvidedParameters = providedParameters.length;
++
++ if (numberOftestParameters != NumberOfProvidedParameters)
++ throw new IllegalArgumentException(
++ "Number of parameters in data provider method doesn't match the number of test method parameters.\nThere are "
++ + NumberOfProvidedParameters + " parameters in provider method, while there's " + numberOftestParameters + " parameters in the "
++ + testMethod.getName() + " method.");
++ }
++
++ private boolean isForSingleParameter(FrameworkMethod testMethod) {
++ return testMethod.getMethod().getParameterTypes().length==1;
++ }
++
++ private boolean isForFileParameters(FrameworkMethod testMethod) {
++ for (int i = 0; i < testMethod.getAnnotations().length; i++) {
++ if (testMethod.getAnnotations()[i].annotationType().isAssignableFrom(FileParameters.class)) {
++ return true;
++ }
++ }
++ return false;
++ }
++
+ boolean matchesDescription(Description description) {
+ return description.hashCode() == uniqueMethodId.hashCode();
+ }
+diff --git a/src/test/java/junitparams/missingparams/MissingParametersTest.java b/src/test/java/junitparams/missingparams/MissingParametersTest.java
+new file mode 100644
+index 0000000..c09fcc6
+--- /dev/null
++++ b/src/test/java/junitparams/missingparams/MissingParametersTest.java
+@@ -0,0 +1,82 @@
++package junitparams.missingparams;
++
++import junitparams.JUnitParamsRunner;
++import junitparams.Parameters;
++import org.junit.Test;
++import org.junit.runner.JUnitCore;
++import org.junit.runner.Result;
++import org.junit.runner.RunWith;
++import org.junit.runner.notification.Failure;
++
++import static org.junit.Assert.assertEquals;
++
++public class MissingParametersTest {
++
++
++ @RunWith(JUnitParamsRunner.class)
++ public static class MissingParametersInMethodProvider {
++
++
++ @Test
++ @Parameters(method = "parametersProvider")
++ public void missingParameters(String param1, String param2) {
++ assertEquals(param1, param2);
++ }
++
++ public Object[][] parametersProvider() {
++ return new Object[][]{
++ new Object[]{"pass", "pass"},
++ new Object[]{"fail"}
++ };
++ }
++ }
++
++ @Test
++ public void missingParametersInMethodThrowsIllegalArgumentException() {
++ Result testResult = JUnitCore.runClasses(MissingParametersInMethodProvider.class);
++ Failure testFailure = testResult.getFailures().iterator().next();
++
++ assertEquals(1, testResult.getFailureCount());
++ assertEquals(IllegalArgumentException.class, testFailure.getException().getClass());
++ assertEquals("Number of parameters in data provider method doesn't match the number of test method parameters.\n" +
++ "There are 1 parameters in provider method, while there's 2 parameters in the missingParameters method."
++ , testFailure.getException().getMessage());
++ }
++
++ @RunWith(JUnitParamsRunner.class)
++ public static class MissingNullParametersInMethodProvider {
++
++ public MissingNullParametersInMethodProvider() {
++ }
++
++ @Test
++ @Parameters(method = "withWrongNumberOfNullParams")
++ public void testWithValueAndMethodProviders(String param1, String param2, String param3) {
++ assertEquals(param1, param2, param3);
++ }
++
++ public Object[][] withWrongNumberOfNullParams() {
++ return new Object[][]{
++ new Object[]{null, null}
++ };
++ }
++
++ }
++
++ @Test
++ public void missingNullParametersInMethodThrowsIllegalArgumentException() {
++ Result testResult = JUnitCore.runClasses(MissingNullParametersInMethodProvider.class);
++ Failure testFailure = testResult.getFailures().iterator().next();
++
++ assertEquals(1, testResult.getFailureCount());
++ assertEquals(IllegalArgumentException.class, testFailure.getException().getClass());
++ assertEquals("Number of parameters in data provider method doesn't match the number of test method parameters.\n" +
++ "There are 2 parameters in provider method, while there's 3 parameters in the testWithValueAndMethodProviders method.",
++ testFailure.getException().getMessage());
++ }
++
++
++}
++
++
++
diff --git a/sources b/sources
new file mode 100644
index 0000000..48e7ac1
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (JUnitParams-1.1.1.tar.gz) = 77e25bff2f821e8be4f3747c58e550b728aace1dac4ac98f0cd8f99235d6a2b0129e61d7f90063d5f85dd3dd4b0e5d0614e3591633bdcf5dfa452c62a114acae
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-16 21:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-16 21:36 [rpms/JUnitParams] epel10: Initial RPM Jerry James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox