Jmock Présentation Et Tutorial

  • Uploaded by: MohammedBoukoutaya
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Jmock Présentation Et Tutorial as PDF for free.

More details

  • Words: 296
  • Pages: 11
Icare Design 2009 2009 Icare Design

Jmock, outils et astuces

Mohammed Boukoutaya

Alcatel-Lucent Services for Enterprise

All Rights Reserved © Alcatel-Lucent 2007

Plan

1. Les prérequis 2. La philosophie 3. L’utilisation de Jmock

All Rights Reserved © Alcatel-Lucent 2007

Icare Design 2009

Les prérequis

Alcatel-Lucent Services for Enterprise

All Rights Reserved © Alcatel-Lucent 2007

 IDE : eclipse.  JDK 1.6 ou autre  La JavaDoc de Jmock  La bibliothèque Jmock 2.5.1

All Rights Reserved © Alcatel-Lucent 2007

La philosophie

5 | Presentation Title | Month 2007

All Rights Reserved © Alcatel-Lucent 2007

La philosphie

B A

C

All Rights Reserved © Alcatel-Lucent 2007

La philosphie

 Les généralité d’utilisation

 Accès complexe,  DataBase,  Utilisation de bibliothèques tierces

All Rights Reserved © Alcatel-Lucent 2007

L’utilisation

8 | Presentation Title | Month 2007

All Rights Reserved © Alcatel-Lucent 2007

Utilisation

The invocation is expected once and once only.

one exactly(n).of

The invocation is expected exactly n times. Note: one is a convenient shorthand for exactly(1).

atLeast(n).of

The invocation is expected at least n times.

atMost(n).of

The invocation is expected at most n times.

between(min, max).o The invocation is expected at least min times and at most max times. f allowing

The invocation is allowed any number of times but does not have to happen.

ignoring

The same as allowing. Allowing or ignoring should be chosen to make the test code clearly express intent.

never

The invocation is not expected at all. This is used to mak

All Rights Reserved © Alcatel-Lucent 2007

Utilisation

context = new Mockery() { { setImposteriser(ClassImposteriser.INSTANCE); } }; final SearchUdaService searchUdaMock = context.mock(SearchUdaService.class); context.checking(new Expectations() { { one(mockStub).searchByFullName(with(any(SearchByFullNameRequest.class))); will(returnValue(searchByFullNameResponse)); });

All Rights Reserved © Alcatel-Lucent 2007

www.alcatel-lucent.com

11 | Presentation Title | Month 2007

All Rights Reserved © Alcatel-Lucent 2007

Related Documents


More Documents from "Dr_M_Soliman"

June 2020 8
June 2020 8
Banana Scrum
July 2020 13