JUnit Mock objects

Posted on 2011-05-06
Last Modified: 2012-05-11
I was reading folowing lines of code in junit test cases code. and I did not understand clearly.
junit mockery
Mock objects etc.
What are they. what do they do. how we use them to mock objcetc. Any resources,sample code,links, highly appreciated. thanks in advance.
Question by:gudii9
    LVL 20

    Accepted Solution

    >>>>>>>Mock objects

    >>>>>>>junit mockery
    reporting error as junit test failer
    LVL 17

    Assisted Solution

    by:Dejan Pažin

    In short: mock objects are simulated objects that mimic the behavior of real objects in controlled ways

    More here:

    Get started with jMock (which I guess is what you are using):

    Other frameworks and libraries:

    Tutorials and longer explanations of technical details and various approaches to mock objects:


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    zeroMAx challenge 20 66
    Receive file in Servlet 1 26
    array6 challenfge 6 48
    json format text only 4 48
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now