Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JUNIT Stub or Mock in JUnit
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


neelam
Stub or Mock in JUnit
1 Answer(s)      3 years and 11 months ago
Posted in : JUNIT


What is stub and Mock in JUnit? Please give one real time example so that i can understand easily.


Advertisement
View Answers

December 6, 2010 at 5:33 PM


Consider a situation, where you have a class Calculator, that needs a dao (Data Access Object) object to load the data it needs from a database. Setting up the connection and inserting the data in the database can be a lot of work.

Instead you can provide the Calculator instance with a fake dao class which just returns the data you need for the test. The fake dao class will not actually read the data from the database. The fake dao class is a mock object or stub object.



Related Tutorials/Questions & Answers:
Stub or Mock in JUnit
Stub or Mock in JUnit  What is stub and Mock in JUnit? Please give one real time example so that i can understand easily.   Consider... the database. The fake dao class is a mock object or stub object
Functionality of the stub
Functionality of the stub  hii,, What is the functionality of the stub?   hii Stub: Stub is a client side representative. The functionality of stub is Marshalling and Unmarshalling in RMI(Remote method invocation
Advertisements
Using Spring mock objects
Using Mock objects Mock Object is object that mimic/copy some real object... object. It originally became popular by the junit team and the expert programmers/developers. The mock object simulate the behavior of real, complex
junit
junit  why we are going to junit?   Hi, Junit is unit... developers to write Unit test to test their code. Junit test is used to test the applications. Read JUnit Tutorial. Thanks
Junit
Junit  How to capture junit error reports in to a file
junit
junit  i want to learn junit for user guidence for easy format to understnad to study. please provide that one
junit - JUNIT
JUnit  What is Junit
junit
junit  Explain about junit?   Junit is new framework designed for Java to perform unit testing. It is an Open source framework. Junit... ). It helps the developers in designing and writing test cases. Junit also have
Junit
Junit  hii.... how to create junit of methods having parameters passed in it..... for example : plz dont refer any link. Just help me by junit of this code. public boolean validateUser(final Display display) { int
Junit
Junit  Hi sir My question to you is - What is JUnit?   Hi Friend, Junit is a Unit testing framework for java programming language. It is part of the Unit testing framework family collectively know
Junit
) { UniversalData.connectionDetails = connectionDetails; }** if i want to make a test case using Junit...; regards Ankit Chauhan   Have a look at the following link: Junit Testing
junit - JUNIT
junit  can u give me a sample application of using junit?  Hi Friend, Please visit the following link: http://www.roseindia.net/junit/ Hope that it will be helpful for you. Thanks
JUnit - JUNIT
JUnit test cases in java  How to write a test case for JUnit in Java...;public class SimpleTest extends TestCase{ JunitExample junit = new JunitExample... information,http://www.roseindia.net/junit
JUNIT - JUNIT
JUNIT  Hi, all please help me ..... how to Generate Cactus Report for JUNIT Testcase... These Test cases are written for JSFPages..it's very Urgent in our Project. Thanks in Advance
The skeleton and stub in Java - Java Beginners
The skeleton and stub in Java  Hi, I want to know more about skeleton and stub in Java programming language. What is skeleton and stub? What is the purpose of skeleton and stub? Thanks   Hi Friend, Stub
junit testing - JUNIT
junit testing  How to perform a testing in JUnit?  Hi,Could you please explain me in detail "junit testing on stack". What is stack and how do you want to test?Please let's know, I will try to provide
install junit - JUNIT
install junit  How to install Junit?  Download it from here http://www.roseindia.net/junit/downloadingandinstallingjunit4.3.1.shtml
Junit
JUnit Junit is new framework designed for Java to perform unit testing. It is an Open source framework. Junit is an instance of xUnit architecture... and writing test cases. Junit also have a Graphical User Interface which allows
How to create Mock/Skeleton SAML responder in java
How to create Mock/Skeleton SAML responder in java  My requirement is, i need to create a SAML request based on the artifact received from 3rd party... to authenticate against the Mock SAML responder. However I have tried Shibboleth IDP but i
What is JUnit?
What is JUnit?  What is the use of JUnit? How to write program to test a Java application? Thanks   Hi, JUnit is unit testing tool in Java. You can use the JUnit to test your Java code. Read more at JUnit 4.3.1
java - JUNIT
java  junit tool which purpose is used   Hi Friend, junit is used for testing java programs. For more information, visit the following link: http://www.roseindia.net/junit/ Thanks
Junit 4
Junit 4  Hello, I need someone to help me with the generic implementation of the toString method testing using Junit 4
JUnit Uninstallation
JUnit Uninstallation  Hi Sir, How can we uninstall JUnit completely from our system ?   Hi Friend Follow these steps to uninstall JUnit : 1 Delete the directory structure where you unzipped the JUnit distribution. 2
Need of JUnit
Need of JUnit  Hi sir, What makes JUnit better than other... features which make JUnit better for Unit testing : 1.JUnit tests allow you to write code faster while increasing quality. 2 JUnit is elegantly simple. It is less
Running JUnit
Running JUnit  Hi sir How can we run JUnit or Run test case Using JUnit using command prompt or CMD? Is there any alternate way of running test cases?   ou can run JUnit test case by running following command on CMD
Running JUnit
Running JUnit  Hi sir How can we run JUnit or Run test case Using JUnit using command prompt or CMD? Is there any alternate way of running test cases?   Hi friend You can run JUnit test case by running following
java - JUNIT
java  i am doing junit testing for a website,i required to check the value of text(ex:refund=0)inside a // refund 0 // tag from a web page...://www.roseindia.net/junit/ Hope that it will be helpful for you. Thanks
generating mock data class of times (start and end time and value)
generating mock data class of times (start and end time and value)   Using the timertask function want to generate a set of mock data of times using the random DATE class and values for plotting on a graph using java. How
Junit download & installation.
Junit download & installation.  Hello sir I want to know from which site i can download JUnit & How can i install JUnit? If there is any class... the latest version of JUnit, referred as junit4.x.x.zip from given below link : http
Junit @Test annotation
Junit @Test annotation  What is the Application of @Test Annotation in JUnit ?   The Test annotation tells JUnit that the public void method to which it is attached can be run as a test case : public class Example
Regarding junit testcases
Regarding junit testcases  Can Any one help me ..How to write junit testcase for Email (plz dont give links ...i want code
Advertisements
 

 

 

DMCA.com