Java Code Examples for org.apache.commons.lang3.ArrayUtils.toMap()

The following are Jave code examples for showing how to use toMap() of the org.apache.commons.lang3.ArrayUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: springboot-shiro-cas-mybatis   File: EhcacheBackedMapTests.java   Source Code and License Vote up 5 votes
@Test
public void verifyPutClear() {
    final String[][] arrayItems = {{"key0", "Item0"}, {"key1", "Item1"}, {"key2", "Item2"}};
    final Map mapItems = ArrayUtils.toMap(arrayItems);

    this.map.putAll(mapItems);
    assertEquals(map.size(), 3);

    this.map.clear();
    assertTrue(map.isEmpty());
}
 
Example 2
Project: springboot-shiro-cas-mybatis   File: EhcacheBackedMapTests.java   Source Code and License Vote up 5 votes
@Test
public void verifyKeysValues() {
    final String[][] arrayItems = {{"key0", "Item0"}, {"key1", "Item1"}, {"key2", "Item2"}};
    final Map mapItems = ArrayUtils.toMap(arrayItems);

    this.map.putAll(mapItems);
    assertEquals(map.keySet().size(), 3);
    assertEquals(map.values().size(), 3);
}
 
Example 3
Project: springboot-shiro-cas-mybatis   File: EhcacheBackedMapTests.java   Source Code and License Vote up 5 votes
@Test
public void verifyContains() {
    final String[][] arrayItems = {{"key0", "Item0"}, {"key1", "Item1"}, {"key2", "Item2"}};
    final Map mapItems = ArrayUtils.toMap(arrayItems);

    this.map.putAll(mapItems);
    assertTrue(map.containsKey("key2"));
    assertTrue(map.containsValue("Item1"));
}
 
Example 4
Project: springboot-shiro-cas-mybatis   File: EhcacheBackedMapTests.java   Source Code and License Vote up 5 votes
@Test
public void verifyPutClear() {
    final String[][] arrayItems = {{"key0", "Item0"}, {"key1", "Item1"}, {"key2", "Item2"}};
    final Map mapItems = ArrayUtils.toMap(arrayItems);

    this.map.putAll(mapItems);
    assertEquals(map.size(), 3);

    this.map.clear();
    assertTrue(map.isEmpty());
}
 
Example 5
Project: springboot-shiro-cas-mybatis   File: EhcacheBackedMapTests.java   Source Code and License Vote up 5 votes
@Test
public void verifyKeysValues() {
    final String[][] arrayItems = {{"key0", "Item0"}, {"key1", "Item1"}, {"key2", "Item2"}};
    final Map mapItems = ArrayUtils.toMap(arrayItems);

    this.map.putAll(mapItems);
    assertEquals(map.keySet().size(), 3);
    assertEquals(map.values().size(), 3);
}
 
Example 6
Project: springboot-shiro-cas-mybatis   File: EhcacheBackedMapTests.java   Source Code and License Vote up 5 votes
@Test
public void verifyContains() {
    final String[][] arrayItems = {{"key0", "Item0"}, {"key1", "Item1"}, {"key2", "Item2"}};
    final Map mapItems = ArrayUtils.toMap(arrayItems);

    this.map.putAll(mapItems);
    assertTrue(map.containsKey("key2"));
    assertTrue(map.containsValue("Item1"));
}
 
Example 7
Project: cas-server-4.2.1   File: EhcacheBackedMapTests.java   Source Code and License Vote up 5 votes
@Test
public void verifyPutClear() {
    final String[][] arrayItems = {{"key0", "Item0"}, {"key1", "Item1"}, {"key2", "Item2"}};
    final Map mapItems = ArrayUtils.toMap(arrayItems);

    this.map.putAll(mapItems);
    assertEquals(map.size(), 3);

    this.map.clear();
    assertTrue(map.isEmpty());
}
 
Example 8
Project: cas-server-4.2.1   File: EhcacheBackedMapTests.java   Source Code and License Vote up 5 votes
@Test
public void verifyKeysValues() {
    final String[][] arrayItems = {{"key0", "Item0"}, {"key1", "Item1"}, {"key2", "Item2"}};
    final Map mapItems = ArrayUtils.toMap(arrayItems);

    this.map.putAll(mapItems);
    assertEquals(map.keySet().size(), 3);
    assertEquals(map.values().size(), 3);
}
 
Example 9
Project: cas-server-4.2.1   File: EhcacheBackedMapTests.java   Source Code and License Vote up 5 votes
@Test
public void verifyContains() {
    final String[][] arrayItems = {{"key0", "Item0"}, {"key1", "Item1"}, {"key2", "Item2"}};
    final Map mapItems = ArrayUtils.toMap(arrayItems);

    this.map.putAll(mapItems);
    assertTrue(map.containsKey("key2"));
    assertTrue(map.containsValue("Item1"));
}