Questions tagged [junit-runner]

The JUnit runner checks, makes and launches the unit tests.

The default runner implementation guarantees that the instances of the test case class will be constructed immediately before running the test and that the runner will retain no reference to the test case instances, generally making them available for garbage collection

124 questions
0
votes
1 answer

Android: While running test cases: Could not determine the dependencies of task ':app:compileDebugAndroidTestJavaWithJavac'

I recently stated writing test cases. I am using JUnit and Barista for the same. My app is compiling successfully and running but when I run test cases it is showing me following error: Could not determine the dependencies of task…
Sunny
  • 68
  • 8
0
votes
0 answers

How to run Cucumber Junit runner class in BDD Framework using NetBeans

I am trying to run my simple login scenario in NetBeans (UI Test) using selenium and Java. Used BDD Framework and trying to run Junit (Runner) class, but not able to see even run as Junit option in NetBeans. Excellent if you can help with…
0
votes
0 answers

Custom runner for a test method, not at class level - Is it possible?

Is it possible to specify a custom runner per test method within a test class? That is: Class SomeTests { public void test1() { } public void test2() { } // For this test only, is it possible // to specify a different runner, for // example :…
CuriousMind
  • 8,301
  • 22
  • 65
  • 134
0
votes
1 answer

In feature file with Background , @Before and @After hooks, @Before is executed even before the scenario started

In my project I have 3 feature files named as Login.feature,Home.feature and TransferFund.feature. Each have Background: mentioned in them, in Login.feature's step definition file , I have mentioned @Before and @ After hooks. My understanding of…
Rajaji
  • 133
  • 2
  • 14
0
votes
1 answer

How to avoid autoconfigurable classes loading while Running Springboot Testcases

I am Currently facing the problem while running spring boot test.I have a spring boot project with vaadin and micro services configuration,When I run the test cases then behind the hood automatically some auto configurable classes are being loaded…
kushal Baldev
  • 729
  • 1
  • 14
  • 37
0
votes
1 answer

how to pass parameters to a test case while running it using Junit Suite

I want to run multitple Junit tests i have created in a package. Every test needs region and server paramter to load the correct data files. I am using System.getProperty to fetch region and serverdetails for all junit tests. I am not sure how to…
garima
  • 111
  • 1
  • 15
0
votes
1 answer

Missing steps - Junit - Cucumber

I'm using cucumber and Junit in my automation code, I create a Runner class with the follow code: @RunWith(Cucumber.class) @CucumberOptions(features = "src/main/java/CompraVtex/CompraVtex/VtexCompra.feature", glue = { "Steps" }, plugin = { …
Cleicy Guião
  • 111
  • 1
  • 20
0
votes
1 answer

Unable to read the test data from CSV via ThucydidesParameterizedRunner

I am trying to print the value which I am feeding as input inside the CSV file. When run the below set of code through Junit and getting error. Could some one please help me to come out of this error and print the values successfully…
Deepak Prabhu
  • 219
  • 1
  • 4
  • 15
0
votes
1 answer

Can we pass multiple browser names to execute parallelly through command line in Selenium Cucumber Maven framework

Iam using Selenium Cucumber Maven framework with Junit. I need to run the feature file in different browsers in parallel(at the same time). Does this work if we pass browsernames like this ? mvn test "-Dbrowser=chrome" , "-Dbrowser=firefox"…
Milu
  • 135
  • 1
  • 3
  • 13
0
votes
0 answers

How to get currently running jUnit test suite runner instances within test class instances?

I have a jUnit 4/5-project and I run my test classes via test suites. I use the com.github.peterwippermann.junit4.parameterizedsuite.ParameterizedSuite.class runner for the annotation "RunWith()" at the test suites but my test classes are use…
SlitEye
  • 43
  • 6
0
votes
1 answer

Junit test where some parameters differ and other remains same

I have a following input parameters for a junit Test. Basically I need to test an algorithm which takes inputFile and few other parameters as input and produces some data. This data need to be compared with the referenceData (referenceData file is…
Ragini
  • 1,509
  • 7
  • 28
  • 42
0
votes
3 answers

Custom Junit runner, Before and After running

In unit custom runner I want to perform action before and after running the test action, so I came around with this solution. how solid is doing it that way, is there a more clean way to achieve that? public class SomeCustomRunner extends…
Shay_t
  • 163
  • 1
  • 16
0
votes
1 answer

TypeNotPresentException with JUnitParamsRunner

My Java-Code looks like this: Person.java public class Person { private int age; public Person(int age) { this.age = age; } public boolean isAdult() { return age >= 18; } @Override public String toString() { return "Person of age: " +…
uberroot4
  • 53
  • 2
  • 12
0
votes
1 answer

Junit with Exception

I have a piece of code with try-catch block: public static void writeExcelToFile(String outFileName, HSSFWorkbook workBook) throws IOException{ File file = null; FileOutputStream fileOutputStream = null; try { file =…
Divya Jose
  • 389
  • 1
  • 4
  • 21
0
votes
1 answer

Junit Toolbox WildcardPatternSuite with different Suffix?

I'm using Junit toolbox to run my unit and integration tests. It's working fine. Now, I have created another layer of tests that I would also like to run with junit toolbox but with a different suffix, not *IT or…
user840930
  • 5,214
  • 21
  • 65
  • 94
1 2 3
8 9