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
2
votes
2 answers

Android JUnit tests not detecting in Robotium

I am trying to run following Android JUnit3 test with robotium: import android.test.ActivityInstrumentationTestCase2; import com.package.sample.MyActivityClass; import com.jayway.android.robotium.solo.Solo; public class TestSample extends…
user1511140
2
votes
1 answer

Android Unit Test Package Path Errors

I've been plugging along with Android Unit Testing and ran into what appears to be a pathing problem. First I run this command from my within my project directory android create test-project -m ../ -p tests -n RoamPayTests This creates a test…
Frank Sposaro
  • 8,511
  • 4
  • 43
  • 64
2
votes
1 answer

The type junit.framework.TestCase cannot be resolved. It is indirectly referenced from required .class files

I'm following the example here: jMock - getting started I'm getting this error: The type junit.framework.TestCase cannot be resolved. It is indirectly referenced from required .class files I've imported these 4 jars: jmock-2.5.1.jar…
Eric Francis
  • 23,039
  • 31
  • 88
  • 122
1
vote
1 answer

Junit 3, get data from tests

I want to show some data in my GUI from my tests. I'm using JUnit 3 because other applications that I use are using that one. So if I use JUnit 4 it will collapse. I know that the possibilities in JUnit 4 are much bigger en better. But I can't use…
Danny Gloudemans
  • 2,597
  • 7
  • 39
  • 57
1
vote
2 answers

How can I write a JUnit test of a private function which is returning a Boolean?

I have written a JUnit test for a private function which is returning String. And it is working fine. public void test2() throws Exception { MyHandler handler = new MyHandler(); Method privateStringMethod =…
vikiiii
  • 9,246
  • 9
  • 49
  • 68
1
vote
0 answers

Running JUnit 3 tests with JUnit Vintage engine

In our project we have quite a few JUnit 3 tests looking like: @RunWith(AllTests.class) public class JUnit3Test extends TestCase { public static TestSuite suite() { var suite = new TestSuite("JUnit 3 style test suite"); …
1
vote
0 answers

how to get the next sequence number . in the confirmation message in Junit with selenium

i m using the verification for the text as verifyEquals("Successful Submit:Sequence Number: 911537\n ); but the sequence number keeps on updating on each run. Can anybody suggest as how to verify the text for each multiple run or how to generate…
user808548
1
vote
1 answer

Does the Spring testing framework support JUnit 3?

Does the Spring testing framework support JUnit 3? There is no information on what version of Spring testing framework supports JUnit version 3. And from what version is only JUnit 4 supported?
voipp
  • 1,243
  • 3
  • 18
  • 31
1
vote
2 answers

How to run a simple JUnit test in eclipse

So here's my code: package tests; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; class StatementTester extends TestCase { public StatementTester (String name) { super(name); } …
mstaniloiu
  • 11
  • 1
  • 2
1
vote
0 answers

Junit for spring boot restcontroller which uses mongodb

I have restcontroller which is uses internally uses mongodb to persisit data , now I want to write junit test-cases which should not use the actual DB or collection of my backend mongoDB. I want to use similar to H2 test database. I have written…
indra
  • 832
  • 4
  • 17
  • 33
1
vote
2 answers

Could not start Selenium session: in Junit 3.8.2 test and selenium 3.4 on linux

My environment: linux ubuntu selenium-html-runner-3.4.0.jar selenium-java-3.4.0 selenium-server-standalone-3.4.0.jar to build I do: javac -cp "/usr/share/java/junit.jar:/home/me/ushare/hobo/selenium/selenium-html-runner-3.4.0.jar:."…
gene
  • 156
  • 3
  • 12
1
vote
1 answer

jUnit testing Database operations

I'm developing an Android application with database storage. I want to test some classes that I use to access database. I've found ActivityInstrumentationTestCase2 to test Activities but I haven't found anything to test classes. How can I do that? I…
VansFannel
  • 45,055
  • 107
  • 359
  • 626
1
vote
2 answers

Junit 3 to JUnit 4 conversion

I had the following version of a test in JUnit 3, and I tried converting it into JUnit 4, with no success. The idea is to have a base test case, that does the actual test of an interface, say Service interface. I want to test the ServiceImpl class,…
walters
  • 1,427
  • 3
  • 17
  • 28
1
vote
2 answers

How to cover a method calling a static method using JUnit mocking?

Consider two classes A and B. class A { static int a(){} } class B { void something(){ int value=A.a(); .......}} Now I have to cover class B using Junit Test case and hence I create a new class (class TestB) to cover the class B. class TestB { …
Akshit Bhatia
  • 11
  • 1
  • 1
  • 5
1
vote
0 answers

Using test rules for JUnit3 TestCase

First of all let me explain the test setup, I work for this very large project which has many smaller modules. And to test, we use JUnit in two ways, JUnit 4: With @Test annotation and we use a custom test runner that derives from…
Subhransu
  • 449
  • 1
  • 4
  • 12