fun `test_getIterator$Ljava_text_AttributedCharacterIterator$AttributeII`() { val test = "Test string" try { val hm: MutableMap<AttributedCharacterIterator.Attribute?, String> = HashMap<AttributedCharacterIterator.Attribute?, String>() val aci: Array<AttributedCharacterIterator.Attribute?> = arrayOfNulls<AttributedCharacterIterator.Attribute>(3) aci[0] = TestAttributedCharacterIteratorAttribute("att1") aci[1] = TestAttributedCharacterIteratorAttribute("att2") aci[2] = TestAttributedCharacterIteratorAttribute("att3") hm[aci[0]] = "value1" hm[aci[1]] = "value2" val attrString = AttributedString(test) attrString.addAttributes(hm, 2, 4) val it: AttributedCharacterIterator = attrString.getIterator(aci, 1, 5) assertTrue("Incorrect iteration on AttributedString", it.getAttribute(aci[0]) == null) assertTrue("Incorrect iteration on AttributedString", it.getAttribute(aci[1]) == null) assertTrue("Incorrect iteration on AttributedString", it.getAttribute(aci[2]) == null) it.next() assertTrue( "Incorrect iteration on AttributedString", it.getAttribute(aci[0]).equals("value1") ) assertTrue( "Incorrect iteration on AttributedString", it.getAttribute(aci[1]).equals("value2") ) assertTrue("Incorrect iteration on AttributedString", it.getAttribute(aci[2]) == null) try { attrString.getIterator(aci, -1, 5) fail("IllegalArgumentException is not thrown.") } catch (iae: IllegalArgumentException) { } }try { attrString.getIterator(aci, 6, 5) fail("IllegalArgumentException is not thrown.") } catch (iae: IllegalArgumentException) { } try { attrString.getIterator(aci, 3, 2) fail("IllegalArgumentException is not thrown.") } catch (iae: IllegalArgumentException) { } } catch (e: Exception) { fail("Unexpected exceptiption $e") } }
java.text.AttributedString # getIterator ( AttributedCharacterIterator.Attribute [ ] , int , int ) Test of method java.text.AttributedString # getIterator ( AttributedCharacterIterator.Attribute [ ] , int , int ) .