Krishna Sarma
Krishna Sarma

Reputation: 1860

Type mismatch: cannot convert from Class<Parameterized> to Class<? extends Runner>

I am trying to execute the JUNIT tests with parameters.

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.beust.jcommander.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class QtyByParam extends TestBase_Post {

I have included the jars junit-4.11.jar, junit-dep-4.11.jar

Is there anything missing? I am getting Type mismatch: cannot convert from Class<Parameterized> to Class<? extends Runner> error at @RunWith section.

Upvotes: 2

Views: 4769

Answers (2)

Jens
Jens

Reputation: 69470

You have the wrong class imported:

import com.beust.jcommander.Parameterized;

this is the correct import:

import org.junit.runners.Parameterized;

Upvotes: 4

Andr&#233; Stannek
Andr&#233; Stannek

Reputation: 7863

Seems your import is wrong. Change

import com.beust.jcommander.Parameterized;

to

import org.junit.runners.Parameterized;

Upvotes: 2

Related Questions