Example usage for android.util ArrayMap isEmpty

List of usage examples for android.util ArrayMap isEmpty

Introduction

In this page you can find the example usage for android.util ArrayMap isEmpty.

Prototype

@Override
public boolean isEmpty() 

Source Link

Document

Return true if the array map contains no items.

Usage

From source file:com.android.tests.lib.UnitTest.java

@Test
public void exceptions() {
    try {//from w  w w .  j av  a 2  s .  c o  m
        ArrayMap map = new ArrayMap();
        map.isEmpty();
        fail();
    } catch (RuntimeException e) {
        assertEquals(RuntimeException.class, e.getClass());
        assertTrue(e.getMessage().contains("isEmpty"));
        assertTrue(e.getMessage().contains("not mocked"));
        assertTrue(e.getMessage().contains("androidstudio/not-mocked"));
    }

    try {
        Debug.getThreadAllocCount();
        fail();
    } catch (RuntimeException e) {
        assertEquals(RuntimeException.class, e.getClass());
        assertTrue(e.getMessage().contains("getThreadAllocCount"));
        assertTrue(e.getMessage().contains("not mocked"));
        assertTrue(e.getMessage().contains("androidstudio/not-mocked"));
    }

}

From source file:com.android.tests.lib.LibUnitTest.java

@Test
public void exceptions() {
    try {// www  . ja  va2s . c o  m
        ArrayMap map = new ArrayMap();
        map.isEmpty();
        fail();
    } catch (RuntimeException e) {
        assertEquals(RuntimeException.class, e.getClass());
        assertTrue(e.getMessage().contains("isEmpty"));
        assertTrue(e.getMessage().contains("not mocked"));
    }

    try {
        Debug.getThreadAllocCount();
        fail();
    } catch (RuntimeException e) {
        assertEquals(RuntimeException.class, e.getClass());
        assertTrue(e.getMessage().contains("getThreadAllocCount"));
        assertTrue(e.getMessage().contains("not mocked"));
    }

}