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
0
votes
1 answer

Adding @Test to each method after upgarding from Junit 3.x to Junit4.x

We upgraded Junit framework from 3.x to 4.x. and In 4.x, each test method will be recognized by adding @Test annotation at top of the method. There exists a test class with multiple test methods like test***() (around 250 methods). Do we need add…
Kiran Nunna
  • 158
  • 3
  • 8
  • 20
0
votes
2 answers

JUnit 4 with ActivityInstrumentationTestCase2

Is possible I use JUnit 4 with my class extend ActivityInstrumentationTestCase2? I am getting the following warn: @Test inside class extending JUnit3 TestCase My class public class MainActivityTest extends…
Douglas Mesquita
  • 860
  • 1
  • 13
  • 30
0
votes
0 answers

HTML report using Junit and Ant with pass column

How to show count of pass test cases in HTML report of J unit
Pandey Praveen
  • 95
  • 1
  • 2
  • 12
0
votes
1 answer

Error: "Test class not found in selected project"

I am testing a simple application. When i start JUnit testing, although i get test run finished, I am not getting any result. Pop up menu showing "Test Class not found". Could anyone fix this? Stack trace : junit.framework.AssertionFailedError:…
Nikesh Devaki
  • 2,091
  • 2
  • 16
  • 24
0
votes
1 answer

codePro junit generates in junit-4 always

I am using codePro tool to generate junit. Since I am using JDK1.4, I opted junit3 in codePro settings. Despite me setting junit-3, the test cases are generated in junit-4 (with annotations) The first screen shot shows that my setting shows my…
Arun
  • 3,440
  • 11
  • 60
  • 108
0
votes
1 answer

Sharing Android tests between two projects

I'm writing automated unit tests for an Android application, and I have come across a very odd situation. The application is carefully constructed to target API8 - API 19 without needing multiple releases. One part of the tests, however, requires…
Scutterman
  • 357
  • 2
  • 14
0
votes
2 answers

Test Case failing when expected is equal to output

Before I get into detail, YES this is a HOMEWORK ASSIGNMENT. NO I DON'T WANT ANSWERS, JUST TIPS and/or Suggestions to try this or that. The problem introduces with this: Create a class, ExactNumber, that uses two long properties named left and…
JC626
  • 37
  • 6
0
votes
2 answers

Robotuim - selecting text fields by index solo.enterText

We are trying to write a test for an Native Android App and this has been driving me nuts. solo.enterText(6, "100"); solo.enterText(7, "200"); solo.enterText(8, "300"); solo.enterText(9, "400"); all work fine, but once the index…
Bob
  • 73
  • 1
  • 6
0
votes
0 answers

Android junit - access custom shared preferences in ServiceTestCase

I want to get shared preferences in ServiceTestCase: SharedPreferences preferences = context.getSharedPreferences("preferences_name", Context.MODE_PRIVATE); and do something like that: int value = preferences.getInt("key",…
0
votes
1 answer

JUnit Code generation - compatible to java 1.4

My project is developed in java 1.4 .I need to generate junit codes. While I google-ed a bit on this, I can see all the code-generators are junit 4 compliant (annotation based mostly) and junit 4 is compiled in java 1.5 The best thing would be to…
Arun
  • 3,440
  • 11
  • 60
  • 108
0
votes
1 answer

How to write in junit3?

I have written this code in junit4. @Test (expected = AssertionError.class) public void testMinFail() { double min = emApp.minSalary(emApp.getEmployees()); assertEquals(40000.0, min, 0); } enter code here I was just wondering how to…
0
votes
2 answers

How to write tests in junit for methods that return void and implement runnable?

I need to write junit tests for a method that implements the runnable and the whole logic of the code is within run() method. for example: public class BookmarkController{ public void addBookmark(final String url, final String title) { …
0
votes
1 answer

Order of evaluation of multiple @Test annotation inside a class in Junit

Can anyone tell me what is the order of evaluation of @Test annotation in Junit when you have multiple @Test Annotation? I was trying with the following example but didnot find any specific order.You may consider the following example to explain…
0
votes
1 answer

Junit 3: How to run only one testcase from a test class

I am using JUnit 3 and I have a test class which had 4 test methods. CLass A: test1() test2() test3() test4() Now I have written another test class B, which has the following methods: test10() test11() test12() Now, test10() requires test1() (of…
Sunny
  • 7,444
  • 22
  • 63
  • 104
0
votes
1 answer

JUnit3 with a common setUp() for multiple tests

How can I group a few tests that have a common dependency, so that setUp()/tearDown() is executed for the whole group? I want to test SQL queries execution times but not including the time to load the database at each test setUp()! TestSuite doesn't…
WindRider
  • 11,958
  • 6
  • 50
  • 57