Package js.lang.builtin

Examples of js.lang.builtin.Storage


@Ignore
public class EmulateStorageTest {

    @Test
    public void storage() throws Exception {
        Storage storage = Global.localStorage;
        assert storage.length() == 0;
        assert storage.getItem("1") == null;

        storage.setItem("1", "one");
        assert storage.length() == 1;
        assert storage.getItem("1").equals("one");

        storage.removeItem("1");
        assert storage.length() == 0;
        assert storage.getItem("1") == null;
    }
View Full Code Here


    public void model() throws Exception {
        Person person = new Person();
        person.setAge(16);
        person.setName("Yuigahama Yui");

        Storage storage = Global.localStorage;
        storage.set(person);

        Person other = storage.get(Person.class);
        assert other.getAge() == 16;
        assert other.getName().equals("Yuigahama Yui");
    }
View Full Code Here

TOP

Related Classes of js.lang.builtin.Storage

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.