Java Code Examples for org.altbeacon.beacon.BeaconManager#setsManifestCheckingDisabled()

The following examples show how to use org.altbeacon.beacon.BeaconManager#setsManifestCheckingDisabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScanStateTest.java    From android-beacon-library with Apache License 2.0 5 votes vote down vote up
@Before
public void before() {
    org.robolectric.shadows.ShadowLog.stream = System.err;
    LogManager.setLogger(Loggers.verboseLogger());
    LogManager.setVerboseLoggingEnabled(true);
    BeaconManager.setsManifestCheckingDisabled(true);
}
 
Example 2
Source File: RangingDataTest.java    From android-beacon-library with Apache License 2.0 5 votes vote down vote up
@Before
public void before() {
    org.robolectric.shadows.ShadowLog.stream = System.err;
    LogManager.setLogger(Loggers.verboseLogger());
    LogManager.setVerboseLoggingEnabled(true);
    BeaconManager.setsManifestCheckingDisabled(true);
}
 
Example 3
Source File: BeaconServiceTest.java    From android-beacon-library with Apache License 2.0 5 votes vote down vote up
@Before
public void before() {
    org.robolectric.shadows.ShadowLog.stream = System.err;
    LogManager.setLogger(Loggers.verboseLogger());
    LogManager.setVerboseLoggingEnabled(true);
    BeaconManager.setsManifestCheckingDisabled(true);
}
 
Example 4
Source File: ScanFilterUtilsTest.java    From android-beacon-library with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetAltBeaconScanFilter() throws Exception {
    org.robolectric.shadows.ShadowLog.stream = System.err;
    BeaconParser parser = new AltBeaconParser();
    BeaconManager.setsManifestCheckingDisabled(true); // no manifest available in robolectric
    List<ScanFilterUtils.ScanFilterData> scanFilterDatas = new ScanFilterUtils().createScanFilterDataForBeaconParser(parser);
    assertEquals("scanFilters should be of correct size", 1, scanFilterDatas.size());
    ScanFilterUtils.ScanFilterData sfd = scanFilterDatas.get(0);
    assertEquals("manufacturer should be right", 0x0118, sfd.manufacturer);
    assertEquals("mask length should be right", 2, sfd.mask.length);
    assertArrayEquals("mask should be right", new byte[] {(byte)0xff, (byte)0xff}, sfd.mask);
    assertArrayEquals("filter should be right", new byte[] {(byte)0xbe, (byte)0xac}, sfd.filter);
}
 
Example 5
Source File: ScanFilterUtilsTest.java    From android-beacon-library with Apache License 2.0 5 votes vote down vote up
@Test
public void testGenericScanFilter() throws Exception {
    org.robolectric.shadows.ShadowLog.stream = System.err;
    BeaconParser parser = new BeaconParser();
    parser.setBeaconLayout("m:2-3=1111,i:4-6,p:24-24");
    BeaconManager.setsManifestCheckingDisabled(true); // no manifest available in robolectric
    List<ScanFilterUtils.ScanFilterData> scanFilterDatas = new ScanFilterUtils().createScanFilterDataForBeaconParser(parser);
    assertEquals("scanFilters should be of correct size", 1, scanFilterDatas.size());
    ScanFilterUtils.ScanFilterData sfd = scanFilterDatas.get(0);
    assertEquals("manufacturer should be right", 0x004c, sfd.manufacturer);
    assertEquals("mask length should be right", 2, sfd.mask.length);
    assertArrayEquals("mask should be right", new byte[]{(byte) 0xff, (byte) 0xff}, sfd.mask);
    assertArrayEquals("filter should be right", new byte[] {(byte)0x11, (byte) 0x11}, sfd.filter);
    assertNull("serviceUuid should be null", sfd.serviceUuid);
}
 
Example 6
Source File: ScanFilterUtilsTest.java    From android-beacon-library with Apache License 2.0 5 votes vote down vote up
@Test
public void testEddystoneScanFilterData() throws Exception {
    org.robolectric.shadows.ShadowLog.stream = System.err;
    BeaconParser parser = new BeaconParser();
    parser.setBeaconLayout(BeaconParser.EDDYSTONE_UID_LAYOUT);
    BeaconManager.setsManifestCheckingDisabled(true); // no manifest available in robolectric
    List<ScanFilterUtils.ScanFilterData> scanFilterDatas = new ScanFilterUtils().createScanFilterDataForBeaconParser(parser);
    assertEquals("scanFilters should be of correct size", 1, scanFilterDatas.size());
    ScanFilterUtils.ScanFilterData sfd = scanFilterDatas.get(0);
    assertEquals("serviceUuid should be right", new Long(0xfeaa), sfd.serviceUuid);
}
 
Example 7
Source File: ScanFilterUtilsTest.java    From android-beacon-library with Apache License 2.0 5 votes vote down vote up
@Test
public void testZeroOffsetScanFilter() throws Exception {
    org.robolectric.shadows.ShadowLog.stream = System.err;
    BeaconParser parser = new BeaconParser();
    parser.setBeaconLayout("m:0-3=11223344,i:4-6,p:24-24");
    BeaconManager.setsManifestCheckingDisabled(true); // no manifest available in robolectric
    List<ScanFilterUtils.ScanFilterData> scanFilterDatas = new ScanFilterUtils().createScanFilterDataForBeaconParser(parser);
    assertEquals("scanFilters should be of correct size", 1, scanFilterDatas.size());
    ScanFilterUtils.ScanFilterData sfd = scanFilterDatas.get(0);
    assertEquals("manufacturer should be right", 0x004c, sfd.manufacturer);
    assertEquals("mask length should be right", 2, sfd.mask.length);
    assertArrayEquals("mask should be right", new byte[] {(byte)0xff, (byte)0xff}, sfd.mask);
    assertArrayEquals("filter should be right", new byte[] {(byte)0x33, (byte)0x44}, sfd.filter);
}