use of org.altbeacon.beacon.Beacon in project android-beacon-library by AltBeacon.
the class ExtraDataBeaconTrackerTest method gattBeaconExtraDataGetUpdated.
@Test
public void gattBeaconExtraDataGetUpdated() {
Beacon beacon = getGattBeacon();
Beacon extraDataBeacon = getGattBeaconExtraData();
Beacon extraDataBeacon2 = getGattBeaconExtraData2();
ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker();
tracker.track(beacon);
tracker.track(extraDataBeacon);
tracker.track(extraDataBeacon2);
Beacon trackedBeacon = tracker.track(beacon);
assertEquals("extra data is updated", extraDataBeacon2.getDataFields(), trackedBeacon.getExtraDataFields());
}
use of org.altbeacon.beacon.Beacon in project android-beacon-library by AltBeacon.
the class ExtraDataBeaconTrackerTest method gattBeaconExtraDataAreNotOverwritten.
@Test
public void gattBeaconExtraDataAreNotOverwritten() {
Beacon beacon = getGattBeacon();
Beacon extraDataBeacon = getGattBeaconExtraData();
ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker();
tracker.track(beacon);
tracker.track(extraDataBeacon);
Beacon trackedBeacon = tracker.track(beacon);
assertEquals("extra data should not be overwritten", extraDataBeacon.getDataFields(), trackedBeacon.getExtraDataFields());
}
use of org.altbeacon.beacon.Beacon in project android-beacon-library by AltBeacon.
the class ExtraDataBeaconTrackerTest method gattBeaconFieldsGetUpdated.
@Test
public void gattBeaconFieldsGetUpdated() {
Beacon beacon = getGattBeacon();
Beacon beaconUpdate = getGattBeaconUpdate();
Beacon extraDataBeacon = getGattBeaconExtraData();
ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker();
tracker.track(beacon);
Beacon trackedBeacon = tracker.track(beaconUpdate);
assertEquals("rssi should be updated", beaconUpdate.getRssi(), trackedBeacon.getRssi());
assertEquals("data fields should be updated", beaconUpdate.getDataFields(), trackedBeacon.getDataFields());
}
use of org.altbeacon.beacon.Beacon in project android-beacon-library by AltBeacon.
the class ExtraDataBeaconTrackerTest method trackingManufacturerBeaconReturnsSelf.
@Test
public void trackingManufacturerBeaconReturnsSelf() {
Beacon beacon = getManufacturerBeacon();
ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker();
Beacon trackedBeacon = tracker.track(beacon);
assertEquals("Returns itself", trackedBeacon, beacon);
}
use of org.altbeacon.beacon.Beacon in project android-beacon-library by AltBeacon.
the class ExtraDataBeaconTrackerTest method multiFrameBeaconProgramaticParserAssociationDifferentServiceUUIDFieldsGetUpdated.
@Test
public void multiFrameBeaconProgramaticParserAssociationDifferentServiceUUIDFieldsGetUpdated() {
Beacon beacon = getMultiFrameBeacon();
Beacon beaconUpdate = getMultiFrameBeaconUpdateDifferentServiceUUID();
ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker(false);
tracker.track(beacon);
tracker.track(beaconUpdate);
Beacon trackedBeacon = tracker.track(beacon);
assertEquals("rssi should be updated", beaconUpdate.getRssi(), trackedBeacon.getRssi());
assertEquals("data fields should be updated", beaconUpdate.getDataFields(), trackedBeacon.getExtraDataFields());
}
Aggregations