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

Running function after JUnit test runner

Is there a way to trigger some function to run after the junit or cucumber testrunner is done? I want to run a function that picks up the test report produced and push it to a specific place. I dont have any other way to do this since builds are…
user3139545
  • 6,882
  • 13
  • 44
  • 87
0
votes
1 answer

How to write TestNG to pass values from an excel sheet

What am I doing wrong??? I have no idea why the parameters aren't passed!!! Am trying to pass the values from an external excel sheet... Please help!! And guys please don't mark this as duplicate!! Thanks in advance P.S I am trying not to use…
0
votes
1 answer

Unable to use Burst with other test runner in JUnit

I found this interesting JUnit project: https://github.com/square/burst It's documentation only specify how to use it with class runner. However, Since JUnit only allows 1 Runner per JUnit, using Burst means user will have difficulty run it in…
janetsmith
  • 8,562
  • 11
  • 58
  • 76
0
votes
0 answers

Using reflections in getting annotations from a class

I am trying to use the reflection example from this blog:https://github.com/ronmamo/reflections to get a list of classes annotated with the @unitTests in my junit code. Below is what I have done: //imports…
Don Who
  • 21
  • 5
0
votes
1 answer

How to run categorized tests with JUnitCore?

I need to run certain tests depending using JUnitCore and Categories but I can't find a way to make it work, can you please take a look and let me know if this is valid? I have the following TestSuite…
user1336321
  • 144
  • 1
  • 1
  • 10
0
votes
1 answer

inheritance for @Categories Junit 4.11

I'd like to know if there is any way to gather a set of test classes together and to run one category of tests that is common for for those tests. I'll try to explain on an example: I have those 2 Categories: public interface Slowtests{} public…
Mickey Hovel
  • 982
  • 1
  • 15
  • 31
0
votes
1 answer

How do i generate a junit report with fail

I have junit testscript that creates different and unique ID. So when it finds an existing ID or a wrong Id I want the test script report via ANT to show that it is failed for following record but passed for the rest of the records that are…
Monika
  • 1
  • 1
0
votes
1 answer

How to execute JUnitTests in Runtime-Workspace (JUnit-Plugin-Test)?

I'm facing a problem with JUnit tests. I have written an JUnitRunner which is used to execute the WrapperTest. The WrapperTest generates a plain JUnit-Test and a needed file. If I want to execute the methods of the generated test, my Runner searchs…
SWYM
  • 43
  • 1
  • 8
0
votes
0 answers

Passing additional information about tests from JUnit Runner to RunListener

I'm implementing a custom JUnit Runner and would like to add additional reporting capabilities to it. I'd also like to reuse as much existing JUnit infrastructure as possible, so implementing a RunListener sounded like a good idea. Methods of…
Jörn Horstmann
  • 33,639
  • 11
  • 75
  • 118
0
votes
3 answers

JUnit - must return a Collection of arrays error

public class EmployeeDetails { private String name; private double monthlySalary; private int age; /** * @return the name */ public String getName() { return name; } /** * @param…
Rajagopal
  • 931
  • 1
  • 8
  • 23
0
votes
1 answer

Extending from Suite Runner vs BlockJUnit4Runner while defining some TestRules

I have a requirement to write many tests. I have extended Suite Runner of JUnit in order to be able to add new annotations where I can mention several Prerequisite classes which will be executed before any of the tests or setups get executed. My…
Buddha
  • 4,339
  • 2
  • 27
  • 51
0
votes
0 answers

Adding Tests with a JUnit Theory

Is there any way to use a rule to add additional tests? For example, I would like to convert the Theories runner to a rule, but I haven't been able to find a way to make Rules add additional tests.
Cobra1117
  • 1,150
  • 3
  • 11
  • 26
0
votes
1 answer

How to get JUnit test results from test runner?

I have implemented my own test runner with an overridden runChild() method: public class MyTestRunner extends BlockJUnit4ClassRunner { // ... @Override protected void runChild(FrameworkMethod method, RunNotifier notifier) { if…
user1613270
  • 523
  • 10
  • 20
0
votes
1 answer

is it necessary to have the tearDown method after robotium test in robotium 4.1?

my test closes the app and any activities associated with it no matter if this is called or not. What is the point of it and is it safe to remove it from all of my test classes?
user2387855
  • 314
  • 4
  • 9
0
votes
2 answers

Run a list of jUnit runners

I have some test suites that in essence looks like @Test public void test1_2() { test(1,2); } @Test public void test1_3() { test(1,3); } @Test public void test4_5() { test(4,5); } @Test public void test4_9() { test(4,9); } // and so…
Theodor
  • 5,536
  • 15
  • 41
  • 55
1 2 3
8
9