Questions tagged [junit3]

JUnit 3 is version 3 of the popular JUnit testing framework for Java

JUnit 3 is version 3 of the popular JUnit testing framework for Java.

Use this tag only for question related to features provided by version 3. Use for general questions.

152 questions
1
vote
0 answers

Datepicker android junit

I am new to Android Junit, i have been trying to write test case to a sample application that displays a datepicker on click of button and display it in the textview. I am able to write unit test case to check if the button is getting clicked and…
Magic
  • 505
  • 2
  • 6
  • 19
1
vote
2 answers

Do we have a @beforeTests method which can run once, before all the tests starts

In Junit, I know there is a @beforeclass , @before annotation, do we have a annotation or design, allow us to write a method to run ONLY once before the whole testing process? we have a script, which setup some database data (config, static,…
Junchen Liu
  • 5,435
  • 10
  • 51
  • 62
1
vote
1 answer

Is there a performance difference between JUnit3 and JUnit4?

I would like to know if there is a difference in running a JUnit3-Test or a JUnit4-Test. Even if it is just 5-10% improvment on the total runtime, in a big project with nightly builds this could matter. Subquestins are: Does the TestRunner improved…
Simulant
  • 19,190
  • 8
  • 63
  • 98
1
vote
1 answer

Robotium Activity Leak Causing Wrong Activity for other Tests

I am having some issues with my Robotium tests. I have 3 test classes that each have about 2 to 3 methods. They all test different activities in the Android Life Cycle. The problem I am finding is that when test A presses a button in A the intent is…
Elliott
  • 539
  • 4
  • 14
0
votes
1 answer

How to write data driven tests using JUnit 3

I want to create test cases at runtime. The testcases will be created from some excel file and depending upon the values in excel. I know we have @Parametrized in JUnit4 but I cannot use JUnit4. Please suggest. Thanks
kunal
  • 11
  • 3
0
votes
1 answer

Junit 3, start testing from a java method

I'm need to use JUnit 3, I know in JUnit 4 there is a method in the API to start the JUnit tests from a normal method in Java (Result r = org.junit.runner.JUnitCore.runClasses(MyTestClass.class)). But how can I do this in JUnit 3 and getting the…
Danny Gloudemans
  • 2,597
  • 7
  • 39
  • 57
0
votes
1 answer

Specify test method name prefix for test suite in junit 3

Is it possible to tell JUnit 3 to use additional method name prefix when looking up test method names? The goal is to have additional tests running locally that should not be run on continuous integration server. CI server doesn't use test suites,…
Marko
  • 30,263
  • 18
  • 74
  • 108
0
votes
1 answer

A query on Junit test methods

public void testNullsInName() { fail("sample failure"); Person p = new Person(null, "lastName"); assertEquals("lastName", p.getFullName()); p = new Person("Tanner", null); assertEquals("Tanner ?", p.getFullName()); } I have…
Pawan
  • 31,545
  • 102
  • 256
  • 434
0
votes
0 answers

jUnit-Testing from another class

I simplified the problem. I have 3 classes: My operating class, which has just one static method (add) in it, which should add to ints: public class T{ public static int add(int a, int b){ return a+b; } } I am…
Michèle S.
  • 304
  • 1
  • 3
  • 7
0
votes
0 answers

How to fix UnnecessaryStubbingException error nothing I tried worked?

package com.services.report.service.controller; import com.services.report.service.model.SmsInfo; import com.services.report.service.repository.SmsInfoRepository; import com.services.report.service.request.screen.SmsInfoQueryRequest; import…
0
votes
1 answer

Junit Tests returning as Unrooted Tests

I've similar questions asked on this site, but this is a bit of a different scenario than what I have seen. We have a PC client execute JUnit 4 tests. However, we have a custom test runner that ships the JUnit 4 tests as JUnit 3 tests (using…
codewario
  • 19,553
  • 20
  • 90
  • 159
0
votes
0 answers

How to write unit tests when a private variable is used in all public functions?

I have a function named LoginInteractor.java like this: public class LoginInteractor { private LoginSessionManager loginSessionManager; private static LoginInteractor instance; public static LoginInteractor getInstance() { if…
Light Yagami
  • 961
  • 1
  • 9
  • 29
0
votes
1 answer

Play Framework 1.x Functional Test with @AllowFeature Controller Method

I do want to write some functional tests for our project. Techstack: Play Framework 1.5, Java 16, Junit 3. I found following documentation: test - 1.5.x security - 1.5.x So the Controller looks something like…
0
votes
0 answers

How to write junit test cases for if and else statements in Java?

Here assuming this to be my simple method I want to write unit test cases covering if and else statement both .. public String getdata() { String existsQuery = "select ID from DEF where " + " NAME = ? " ; if (data) { …
devbranch
  • 23
  • 1
  • 7
0
votes
1 answer

testing java ee 6 with junit 3

I have a short question: Can I test java ee 6 with junit 3, or do I have to use JUnit 4?
Null
  • 31
  • 1
  • 3