JUnit's @Parameterized runner provides support for parameterized tests.
Questions tagged [parameterized]
525 questions
5
votes
2 answers
Embedded SQL vs Dynamic SQL
I am currently doing a *cough*Oracle*cough* database subject. The lecturer is introducing embedded SQL as the way you get other languages (e.g. C, C++) to interact with the (Oracle) database.
I have done some database work myself (on mysql) where I…

Portablejim
- 824
- 1
- 12
- 21
5
votes
4 answers
JUnit 5 and Arguments.of() with functions
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 method of(Object...) in the type Arguments is not…

B. Stackhouse
- 477
- 5
- 15
5
votes
2 answers
What happens if you don't call the base constructor from the derived constructor?
Is it always necessary to call base class constructor from derived class constructor? What happens when you don't call it?

nafiz amin
- 97
- 2
- 6
5
votes
1 answer
running a single scenario of a parametrized junit test in intellij
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:
Here's the collection of scenarios, the parameter and the…

Amnon
- 2,212
- 1
- 19
- 35
5
votes
3 answers
Parameterized junit testing with more than one test
Parameterized testing is good to have different data to feed into your test. However, I created a sample calculator that I want to create parameterized tests for. However, I have found that you can only create 1 set of parameterized data for a…

ant2009
- 27,094
- 154
- 411
- 609
5
votes
3 answers
What is not valid in this assignment: `Map mObj = new HashMap();`?
in java, what is wrong with this assignment:
Map mObj = new HashMap();
I get:
error: incompatible types: HashMap cannot be converted to Map
Since String[] is an Object, that should…

ncenerar
- 1,517
- 12
- 25
5
votes
2 answers
Hudson: how do i use a parameterized build to do svn checkout and svn tag?
I'm setting up a parameterized build in hudson v1.362. the parameter i'm creting is used to determine which branch to checkout in subversion.
I can set my svn repository url like this: https://my.svn.server/branches/${branch} and it does the…

Derick Bailey
- 72,004
- 22
- 206
- 219
5
votes
3 answers
Parameterized types in OCaml
I try to use parameterized types in OCaml but it doesnt't work :(
In a first file "tree.ml" I define the type :
type 'a tree =
| Node of ('a tree)*('a tree)
| Leaf of 'a
In another file "intTree.ml", I use this type to define a type t :…

permanganate
- 709
- 1
- 6
- 19
5
votes
1 answer
Strange behaviour with parameterized method on abstract class
Can someone tell my why this gives a compile error? I don't see why the cast to A in the second for-loop causes strings() to return a general List of Objects.
import java.util.ArrayList;
import java.util.List;
public class E {
public static…

Kristian
- 61
- 4
5
votes
2 answers
Junit 4.11 parameterized and categorized methods
i have parameterized junit tests which i would like to group the test functions so as to run one group in one test suite and the other group in another.
What i have tried is this:
TestClass:
@RunWith(Parameterized.class)
public class TestClass {
…

pDiller
- 73
- 6
5
votes
1 answer
Automatic SystemVerilog variable size using interface width and $size?
I am trying to make a module (a DSP in my case) with a standardized memory interface in SystemVerilog, and would like the variables in the module to size automatically based on the bus widths in the attached interface. My rationale: this makes the…

Martin
- 518
- 7
- 11
5
votes
6 answers
parameterized sql query - asp.net / c#
So I recently learned that I should absolutely be using parametrized query's to avoid security issues such as SQL injection. That's all fine and all, I got it working.
This code shows some of the code how I do it:
param1 = new…

Mana
- 1,925
- 6
- 39
- 55
5
votes
2 answers
Parameterized methods in generic class type
I have a rather simple question. I can't find an answer by searching though.
Is there a difference in these two code-fragments? And what is the difference?
Fragment1:
public class BinaryTree> {
...
public

Bridy
- 53
- 3
5
votes
2 answers
Parameterized queries WITHOUT stored procedures?
Every sample I've seen uses stored procedures. I've adopted an old application written in Classic ASP that uses inline SQL. This is an obvious issue, so I need to convert it to safer code. The client does not wish that I use stored procedures in…

Chris
- 21,549
- 25
- 71
- 99
4
votes
4 answers
Is there a SQL Injection risk with this query? If so, how can I avoid it?
I usually create parameterized queries in order to avoid SQL Injection attacks. However, I have this particular situation where I haven't been totally able to do it:
public DataSet getLiveAccountingDSByParameterAndValue(string parameter, string…

aleafonso
- 2,244
- 8
- 38
- 58