Package de.nordakademie.cerca.motorport

Examples of de.nordakademie.cerca.motorport.NativeMotorPort


   * resets variables hasExpectedParams and isCalled prior to every
   * test.
   */
  @Before
  public void setUp() {
    NativeMotorPort motorPort = NativeMotorPort.getInstance();
    motorPort.setBehaviour(this);
    this.hasExpectedParameters = false;
    this.isCalled = false;
  }
View Full Code Here


  public void testCercaContext() throws InterruptedException {
   
   
    NxtMotorStub motorA = new NxtMotorStub(0);
    NxtMotorStub motorB = new NxtMotorStub(1);
    NativeMotorPort np = NativeMotorPort.getInstance();
    np.setBehaviour(new NativeMotorPortStub(motorA, motorB, null));   
    NativeBattery nb = NativeBattery.getInstance();
    nb.setBehaviour(new NativeBatteryStub());
   
    Motor.A.stop();
    Motor.B.stop()
View Full Code Here

        oneOf(A).controlMotor(0, 1); // Stop
        oneOf(A).controlMotor(-100, 1); // Maximum Backward
        allowing(A);
      }
    });
    NativeMotorPort mp = NativeMotorPort.getInstance();
    mp.setBehaviour(motorPort);
    Motor.A.forward();
    Thread.sleep(50);
    assertTrue(Motor.A.isMoving());
    Motor.A.reverseDirection();
    Thread.sleep(50);
View Full Code Here

   * im SimPilot auf 0 gesetzt werden, da dies nur f�r die Anzeige
   * relevant ist   
   */
  public void testWithZPilot() throws InterruptedException{
   
    NativeMotorPort nativeMotorPort = NativeMotorPort.getInstance();
    NativeBattery nativeBattery = NativeBattery.getInstance();
    NativeButton nativeButton = NativeButton.getInstance();
    NativeLCD nativeLcd = NativeLCD.getInstance();
    NativeSensorPort nativeSensor = NativeSensorPort.getInstance();
   
    //Verhalten f�r die Cerca Instanzen setzen
    NativeMotorPortStub motorportStub = new NativeMotorPortStub();
    nativeMotorPort.setBehaviour(motorportStub);   
    NativeBatteryStub batteryStub = new NativeBatteryStub();
    nativeBattery.setBehaviour(batteryStub);   
    NativeButtonStub btnStub = new NativeButtonStub();
    nativeButton.setBehaviour(btnStub);     
    NativeLcdStub lcdStub = new NativeLcdStub();
View Full Code Here

TOP

Related Classes of de.nordakademie.cerca.motorport.NativeMotorPort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.