## Ex 3 Hardware Interfaces

xAx
Endlosschleifenbastler
Beiträge: 157
Registriert: 6. Mär 2008 17:20

### Ex 3 Hardware Interfaces

Hi,

are we allowed to change all the hardware related interfaces as we wish? E.g. LaneController only declares the functions

Code: Alles auswählen

    public Object getFallenPins();

public void clearLane();

I am missing functions to reflect requirements à la "rebuild all pins" or "Remove the fallen pins and rebuild all pins left over from the last throw".

Nichts ist wie es scheint!
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Zuletzt geändert von xAx am 14. Mär 2009 16:17, insgesamt 99-mal geändert.

sproksch
Computerversteher
Beiträge: 346
Registriert: 15. Apr 2004 17:56

### Re: Ex 3 Hardware Interfaces

Yeah, absolutely. These interface were provided to give you an impression what is asked for... You are free to change/extend/remove any of the code contained in the project.

C0RNi666
BASIC-Programmierer
Beiträge: 114
Registriert: 8. Jan 2008 12:51

### Re: Ex 3 Hardware Interfaces

From a testing point of perspective, are we required to implement the interfaces as well?
Win32: Reboot!
Unix: Be root!

sproksch
Computerversteher
Beiträge: 346
Registriert: 15. Apr 2004 17:56

### Re: Ex 3 Hardware Interfaces

Mockito can create mocks of interfaces, so you do not necessarily need to implement the interfaces. Nevertheless it might be necessary to implement some stubs or spies to cover all possible indirect in-/outputs that are created/consumed by those objects...

sproksch
Computerversteher
Beiträge: 346
Registriert: 15. Apr 2004 17:56

### Re: Ex 3 Hardware Interfaces

I have a small addition to give you an easier start on this: I think you might want to have a look at the Mockito.when(<call on mock>).thenReturn(<some object>) method. An example of this was provided in the tests of ex01 and ex02.

C0RNi666
BASIC-Programmierer
Beiträge: 114
Registriert: 8. Jan 2008 12:51

### Re: Ex 3 Hardware Interfaces

Thanks, of course.. That helps!
Win32: Reboot!
Unix: Be root!