JUnit's @Parameterized runner provides support for parameterized tests.
Questions tagged [parameterized]
525 questions
7
votes
1 answer
Parameterized method runs twice
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 results in duplicate elements and fails the test I'm…

yusif
- 193
- 9
7
votes
5 answers
Parameterized SQL statements vs. very simple method
When I started to write the first SQL-Statements in my programs I felt quite comfortable with protecting myself against SQL-Injection with a very simple method that a colleague showed me. It replaced all single quotes with two single quotes.
So for…

Philipp Grathwohl
- 2,726
- 3
- 27
- 38
7
votes
2 answers
Passing arrays to Parameterized JUnit
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 generates run-time error:
testGeneral[0] caused an ERROR:…

Hai Vu
- 37,849
- 11
- 66
- 93
7
votes
1 answer
Fortran: parameterized derived types in a 'select type' clause
I am trying to use parameterized derived types in a subroutine using an unlimited polymorphic pointer.
Is is possible to use a 'select type' clause for parameterized types?
I've tried something along the following lines but am getting a compilation…

AlRi
- 121
- 1
- 6
7
votes
2 answers
Parameterized suites in Junit 4?
With @RunWith( Suite.class ) I can group test classes into a test suite and run them all together. With @RunWith( Parameterized.class ) I can run the same test for different parameters. What I want is to run a test suite for different parameters. Is…

Frank HJ Cuypers
- 71
- 2
7
votes
4 answers
Not all tests are run in parameterised NUnit TestFixture containing arrays
I have a test class as follows:
[TestFixture("someurl1", new[] { "param1", "param2" }, 15)]
[TestFixture("someurl2", new[] { "param3" }, 15)]
public class my_test
{
public my_test(string url, string[] fields, int someVal)
{
// test…

Chris Wignall
- 145
- 7
6
votes
2 answers
Parameterised Modules in Erlang
I was going through mochiweb source code and got to see something i never used before. The module declaration especially in mochiweb_request and mochiweb_response modules found in the mochiweb http library. Here is how the module…

Muzaaya Joshua
- 7,736
- 3
- 47
- 86
6
votes
1 answer
Inheritance (or an alternative) in Parameterized jUnit tests
I'd like to do something like this in jUnit:
@Runwith(Parameterized.class)
public abstract class BaseTest {
protected abstract List

slim
- 40,215
- 13
- 94
- 127
6
votes
4 answers
SQL Server Performance of Parameterized Queries with leading wildcards
I have a SQL 2008 R2 Database with about 2 million rows in one of the tables and am struggling with the performance of a specific query when using parameterized SQL.
In the table, there's a field containing a name in it:
[PatientsName] nvarchar…

Steve Wranovsky
- 5,503
- 4
- 34
- 52
6
votes
4 answers
[zend][db] fetchAll with multiple variables
I'm trying to use fetchAll on a query that has 2 variables. I can't figure out the syntax.
I can manage with only 1 variable:
$sql = "SELECT * FROM mytable WHERE field1 = ?";
$this->_db->fetchAll($sql,$value1); # that works
However I'm having some…

Max
- 12,794
- 30
- 90
- 142
6
votes
1 answer
Best Practice for multiple Parameterized JUnit Tests
Often, a Java class has more than one public method that we want to test with JUnit. What happens when both public methods are something we can use Parameterized techniques?
Should we keep a JUnit Test class for each public method we want to test…

Oh Chin Boon
- 23,028
- 51
- 143
- 215
6
votes
4 answers
SQL Server query plan differences
I'm having trouble understanding the behavior of the estimated query plans for my statement in SQL Server when a change from a parameterized query to a non-parameterized query.
I have the following query:
DECLARE @p0 UniqueIdentifier =…

soren.enemaerke
- 4,770
- 5
- 53
- 80
6
votes
1 answer
Incremental build in Jenkins
I am using Jenkins 1.462 and maven version is 3.0.4.
At Jenkins I enabled check-box "Incremental build - only build changed modules"
I want to figure out 2 questions:
Whether incremental build is sufficient?
Here How do I trigger a Jenkins build…

alexsmail
- 5,661
- 7
- 37
- 57
5
votes
1 answer
Porting a java interface to a scala trait with generics
I am a Scala newbie and I need to port part of a java application to scala.
I have the following java interface definition which is as follows:
public interface AccountDAO extends CrudRepository {
...
}
I am not sure…

balteo
- 23,602
- 63
- 219
- 412
5
votes
4 answers
SQL Parameter Slows Down Query
I have a query which I'm using with SQL Server 2008R2 via ADO.NET. When I use a LIKE clause inline, it works in less than a second, with 5 rows returned from 2 million. If I declare the paramater as I do in .NET at the start of the query in SSMS, it…

Echilon
- 10,064
- 33
- 131
- 217