How do I use JUnit to test a class that has internal private methods? It seems bad to change the access modifier for a method just to be able to run a test.
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Friday, May 25, 2012
What"s the proper way to test a class with private methods using JUnit?
Friday, April 27, 2012
IntelliJ IDEA with Junit 4.7 "!!! JUnit version 3.8 or later expected:”
When I attempt to run the following test in IntelliJ IDEA I get the message:
Wednesday, April 25, 2012
How to run all tests belonging to a certain Category in JUnit 4
JUnit 4.8 contains a nice new feature called "Categories" that allows you to group certain kinds of tests together. This is very useful, e.g. to have separate test runs for slow and fast tests. I know the stuff mentioned in JUnit 4.8 release notes , but would like to know how I can actually run all the tests annotated with certain category.
Tuesday, April 17, 2012
Can I test status bar notifications using Android"s testing framework?
I have a class that sends a status bar notification in Android. I can't find a way to test whether the notification was sent or not, which makes it very hard to write any kind of useful unit test.
Wednesday, March 7, 2012
differences between 2 JUnit Assert classes
I've noticed that the JUnit framework contains 2 Assert classes (in different packages, obviously) and the methods on each appear to be very similar. Can anybody explain why this is?
Wednesday, February 29, 2012
Robotium side scroll not working for me
I want to scroll left/right on an android application using a Robotium/Junit test.
Monday, February 20, 2012
How should I be creating classes when doing TDD
I have started doing TDD and I am unsure if I am doing it correctly. I have made a Question class and a QuestionTest. The Question class has an addAnswer method that takes an instance of the Answer class. Now, should I be creating only the class Answer and use the default constructor. Or should I be making the Answer class and also provide the constructor with parameters?