unit testing - Running multiple test data on same set of test cases -


I am new to eclipse I am using Genuine 4. And I have written a set up method in my class which spreads the testcases where something starts up. I have a set of testcases in the same class. I have test data in the live form and connected to the work place. I am currently able to run all test cases for a test data. Somehow I want to set the control back () to take second test data and run all test cases. Is this possible? If yes, can anyone send some code snippets?

Thanks in advance

Thanks for the reply, but where should I put such code, even if it should be kept in the set up method and how to set up test data Will you?

You must use a runner with parameters This allows you to run the same test with multiple test data gives. As the following indicates that the test will run four times, the parameter "number" will be changed into the value in the array every time.

  @RunWith (value = Parameterized.class) Public class StackTest {Stack & lt; Integer & gt; Pile; Private int numbers; Public Stack (int number) {this.number = number; } @ Paramatars Public Static Collection Data () {Object [] [] Data = New Object [] [] {{}, {2}, {3}, {4}}; Return arrays.asList (data); } ...  

edit

Not sure if that is not clear, but I will try to clarify.

@RunWith (value = Parameterized.class) annotation is required. You should have a method, annotated with @ parameter, which gives the collection object, each of which should be an array of different parameters used for the test. You must have a public constructor who will accept these parameters.

Additional information, and can be found in another example.

Anything else.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -