urbanairship-core/src/test/java/com/urbanairship/location/LocationRequestOptionsTest.java
@Test
    public void testParcelable() throws JsonException {
        LocationRequestOptions original = new LocationRequestOptions.Builder()
                .setPriority(LocationRequestOptions.PRIORITY_LOW_POWER)
                .setMinDistance(44.4f)
                .setMinTime(1111, TimeUnit.MILLISECONDS)
                .create();

        // Write the options to the parcel
        Parcel parcel = Parcel.obtain();
        original.writeToParcel(parcel, 0);

        // Reset the parcel so we can read it
        parcel.setDataPosition(0);

        // Create the options from the parcel
        LocationRequestOptions fromParcel = LocationRequestOptions.CREATOR.createFromParcel(parcel);

        // Validate the data
        assertEquals(original, fromParcel);
    }
/**
     * Test saving and reading LocationRequestOptions from a parcel.
     */
Test saving and reading LocationRequestOptions from a parcel.
Test saving and reading LocationRequestOptions from a parcel .
@Test
    public void testParcelable() throws JsonException {
        LocationRequestOptions original = new LocationRequestOptions.Builder()
                .setPriority(LocationRequestOptions.PRIORITY_LOW_POWER)
                .setMinDistance(44.4f)
                .setMinTime(1111, TimeUnit.MILLISECONDS)
                .create();
        Parcel parcel = Parcel.obtain();
        original.writeToParcel(parcel, 0);
        parcel.setDataPosition(0);
        LocationRequestOptions fromParcel = LocationRequestOptions.CREATOR.createFromParcel(parcel);
        assertEquals(original, fromParcel);
    }
@ Test public void testParcelable ( ) throws JsonException { LocationRequestOptions original = new LocationRequestOptions . Builder ( ) . setPriority ( LocationRequestOptions . PRIORITY_LOW_POWER ) . setMinDistance ( 44.4f ) . setMinTime ( 1111 , TimeUnit . MILLISECONDS ) . create ( ) ; Parcel parcel = Parcel . obtain ( ) ; original . writeToParcel ( parcel , 0 ) ; parcel . setDataPosition ( 0 ) ; LocationRequestOptions fromParcel = LocationRequestOptions . CREATOR . createFromParcel ( parcel ) ; assertEquals ( original , fromParcel ) ; }
Test saving and reading LocationRequestOptions from a parcel.
Test saving and reading LocationRequestOptions from a parcel .
// Write the options to the parcel // Reset the parcel so we can read it // Create the options from the parcel // Validate the data