コード例 #1
0
  @Test(expected = IllegalStateException.class)
  public void testParseError() {
    when(synchronizer.readPropertyValue(GeolocationSynchronizer.PROP_LATITUDE)).thenReturn("101.1");
    String date = "2012-12-30-20-15-43";
    when(synchronizer.readPropertyValue(GeolocationSynchronizer.PROP_TIMESTAMP)).thenReturn(date);

    synchronizer.readData(object);
  }
コード例 #2
0
  @Test
  public void testReadDataWithError() {
    when(synchronizer.readPropertyValue(GeolocationSynchronizer.PROP_ERROR_CODE))
        .thenReturn("UNKNOWN");

    synchronizer.readData(object);

    verify(adapter).setError(any(PositionError.class));
  }
コード例 #3
0
  @Test
  public void testReadData() {
    when(synchronizer.readPropertyValue(GeolocationSynchronizer.PROP_LATITUDE)).thenReturn("101.1");
    String date = "2012-Dec-30-20-15-43";
    when(synchronizer.readPropertyValue(GeolocationSynchronizer.PROP_TIMESTAMP)).thenReturn(date);

    synchronizer.readData(object);

    verify(adapter).setPosition(any(Position.class));
  }