简体   繁体   中英

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> Type mismatch: cannot convert from Class<Parameterized> to Class<? extends Runner> error at @RunWith section.

You have the wrong class imported:

import com.beust.jcommander.Parameterized;

this is the correct import:

import org.junit.runners.Parameterized;

Seems your import is wrong. Change

import com.beust.jcommander.Parameterized;

to

import org.junit.runners.Parameterized;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM