parameterized Questions

9

Solved

Currently I have to create a parameterized test class for every method that I want to test with several different inputs. Is there a way to add this together in one file? Right now there's Calcula...
Willumsen asked 29/12, 2012 at 13:10

5

I am working with JUnit 5 and I want to create parameterized tests in a nested class. For example: class CardTest { @Nested class Cost { Stream<Arguments> cards() { return Stream.of( Arg...
Womanish asked 21/12, 2017 at 22:50

6

Solved

I Just came across a situation where I need to put the data in the JSONObject, while doing that I received a warning from the compiler regarding. Type safety: The method put(Object, Object) belon...
Klipspringer asked 17/2, 2016 at 9:48

3

Solved

My parameters determine the name of my parameterized pytest. I will be using a some randomized params for these tests. In order for my reporting names in junit to not get messed up, I'd like to cre...
Acetone asked 1/6, 2016 at 17:56

12

Solved

I just ran into a strange thing...there is some code on our site that is taking a giant SQL statement, modifying it in code by doing some search and replace based on some user values, and then pass...
Quite asked 7/8, 2009 at 20:9

4

Writing a JUnit 5 parameterized test and need to pass functions to the test using Arguments.of(), but there are 2 compile errors that I don't know how to fix. Any help would be appreciated. The m...
Acquittal asked 15/6, 2020 at 19:18

15

Solved

Is there a way to set my own custom test case names when using parameterized tests in JUnit4? I'd like to change the default — [Test class].runTest[n] — to something meaningful.
Mulciber asked 16/3, 2009 at 15:25

6

Solved

I'm not sure what I want to do is possible, but if it is, I want to find out how. Basically, I want to create a Map where the key is a class (java.lang.Class), and value for that entry is an instan...
Courtland asked 17/4, 2012 at 16:5

1

I am running this code, and realized that getAllParameters() method runs twice for some reason. Because the static field enumMap is initialized outside that method, it gets populated twice, which r...
Anal asked 29/8, 2017 at 16:38

7

Solved

I try to launch curl -X POST -u "user:pass" -H Jenkins-Crumb:thecrumbnumber http://myjenkinsserver/jenkins/job/testjob/buildWithParameters?=PARAMETER=somenumber which works by triggering a param...
Pedi asked 22/3, 2017 at 9:0

2

Solved

In Eclipse, while using the Parameterized runner in a junit test class, each run is noted by a number (0, 1, etc.) Is there a way to replace this number with a proper label? PS: I am using a JUNI...
Drusilladrusus asked 23/1, 2014 at 12:4

3

Solved

I have a BaseTest class which consists of several tests. Each test shall be executed for EVERY profile I list. I thought about using Parameterized values such as: @RunWith(Parameterized.class) @S...
Headgear asked 19/7, 2017 at 20:9

8

Solved

In a C# application, I'm building a query by creating a query string with parameters, then to the command adding the parameters and their values. For example: string query = "UPDATE USERS u SET u....
Trademark asked 14/10, 2011 at 19:47

3

Is there a Jenkins plugin that can do a group-artifact-version (GAV) search of my Nexus repo and list the results? I would like the results to be available on a parameterized build as a choice (a d...
Squib asked 13/6, 2015 at 20:52

2

Solved

I want to write a test for a small database-like application. This application uses queries and a query should return the correct result. This is easily implemented in JUnit 5, something like @Bef...
Pigheaded asked 3/8, 2018 at 18:55

7

Solved

In JUnit4 you can write parameterized unit tests by providing parameters collection in one method, which will be passed to the constructor of the test and testing in another method. If I have a par...
Sorci asked 11/11, 2010 at 8:29

2

Solved

is it possible to use the maven release plugin with a multi-module project, where some of the inter-module dependencies are specified using a parameter from the parent pom? When I try to call rele...
Malonis asked 19/1, 2012 at 13:14

4

Solved

I've been trying to figure out how to run parameterized tests in Junit4 together with PowerMock. The problem is that to use PowerMock you need to decorate your test class with @RunWith(PowerMockR...
Proudfoot asked 16/3, 2010 at 13:3

9

Is there any annotation in JUnit to exclude a non param test in parameterized test class?
Porett asked 29/7, 2010 at 9:55

4

I am creating a Java application based on JRE 6. I use JUnit 4 to generate parameterized tests. I am receiving this error: The annotation @Parameterized.Parameters must define the attribute value ...
Spectrograph asked 4/3, 2013 at 23:24

2

Solved

I would like to write a unit test which is executed for every Spring bean of a given type. JUnit5's parameterized tests offer a lot of possibilities, but I don't know how to inject beans into a met...
Polecat asked 26/6, 2019 at 6:58

1

Solved

I want to do a ParameterizedTest with @ValueSource , i have readed many tutorials including Guide to JUnit 5 Parameterized Tests: /** * The {@link Class} values to use as sources of argumen...
Adlai asked 24/6, 2019 at 12:42

2

Solved

I am new to parameterized feature of JUnit 4.x and having a problem. My parameterized test consists of 3 integer arrays and I am having difficulty of how to declare them. What I have below generate...
Pancake asked 11/6, 2014 at 17:15

1

Solved

Both JUnit and N/XUnit enable us to parameterize tests which differ only by input values and expected results. In other words, we can statically define sets of test data (inputs + expected results)...
Revengeful asked 19/10, 2018 at 1:29

1

I have a Parameterized junit test with several scenarios & need to be able to run just one of the scenarios. I would like to do it in IntelliJ. Does anyone know how to? Here's a code example:...
Skinny asked 21/4, 2016 at 12:49

© 2022 - 2024 — McMap. All rights reserved.