Package de.nordakademie.nxtsimulation.sensor

Examples of de.nordakademie.nxtsimulation.sensor.NativeSensorPortStub


    assertEquals(205, brightness);
  }

  @Test
  public void testCercaContext() {
    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, lightSensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    LightSensor lightSensor = new LightSensor(SensorPort.S1);

    lightSensorStub.setImage(new Image(Display.getDefault(),
View Full Code Here


  final ISensorPort sensorPortMockA = context.mock(ISensorPort.class, "PortA");
  final ISensorPort sensorPortMockB = context.mock(ISensorPort.class, "PortB");

  @Before
  public void setUp() {
    nativeSensorPortStub = new NativeSensorPortStub();
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
  }
View Full Code Here

  public void testCercaContext() {
    int anzahlMessungen = 100;
    System.out.println("CercaContext SoundSensor-Test mit "
        + anzahlMessungen + " Messungen. Bitte ins Mikrofon br�llen!");

    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, soundSensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    SoundSensor soundSensor = new SoundSensor(SensorPort.S1);
   
    int sensorValue;
View Full Code Here

    nativeBattery.setBehaviour(batteryStub);   
    NativeButtonStub btnStub = new NativeButtonStub();
    nativeButton.setBehaviour(btnStub);     
    NativeLcdStub lcdStub = new NativeLcdStub();
    nativeLcd.setBehaviour(lcdStub);   
    NativeSensorPortStub sensorPortStub = new NativeSensorPortStub();
    nativeSensor.setBehaviour(sensorPortStub);
   
    // Initialsetzung der angeschlossenen Elemente des SimPilots   
    simPilot.setTrackWidth(11.6f);
    simPilot.setWheelDiameter(5.6f);
View Full Code Here

    nativeBattery.setBehaviour(batteryStub);
    btnStub = new NativeButtonStub();
    nativeButton.setBehaviour(btnStub);
    lcdStub = new NativeLcdStub();
    nativeLcd.setBehaviour(lcdStub);
    sensorPortStub = new NativeSensorPortStub();
    nativeSensor.setBehaviour(sensorPortStub);

    // Controller
    lcdController = new LcdController(lcdStub, mainGui.getLcdGui());
    btnController = new ButtonController(btnStub, mainGui
View Full Code Here

    assertEquals((byte) 9, buffer[0]);
  }

  @Test
  public void testCercaContextNoObstacle() {
    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, sensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    UltrasonicSensor sensor = new UltrasonicSensor(SensorPort.S1);
    sensorStub.setPosX(0);
    sensorStub.setPosY(0);
View Full Code Here

    assertEquals(255, sensor.getDistance());
  }
 
  @Test
  public void testCercaContextConfig() {
    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, sensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    UltrasonicSensor sensor = new UltrasonicSensor(SensorPort.S1);
    sensorStub.setPosX(0);
    sensorStub.setPosY(0);
View Full Code Here

    assertEquals((byte) 1, sensor.getMode());
  }

  @Test
  public void testCercaContextWithObstacles() {
    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, sensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    UltrasonicSensor sensor = new UltrasonicSensor(SensorPort.S1);
    sensorStub.setPosX(0);
    sensorStub.setPosY(0);
View Full Code Here

TOP

Related Classes of de.nordakademie.nxtsimulation.sensor.NativeSensorPortStub

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.