Index: trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/AttributedStringTest.java =================================================================== --- trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/AttributedStringTest.java (revision 438744) +++ trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/AttributedStringTest.java (working copy) @@ -17,6 +17,8 @@ import java.text.AttributedCharacterIterator; import java.text.AttributedString; import java.text.CharacterIterator; +import java.util.Map; +import java.util.Set; public class AttributedStringTest extends junit.framework.TestCase { @@ -35,6 +37,81 @@ assertTrue("Wrong string: " + buf, buf.toString().equals(test)); } + /** + * @tests java.text.AttributedString#AttributedString(AttributedCharacterIterator) + */ + public void test_ConstructorLAttributedCharacterIterator() { + //Regression for HARMONY-1354 + assertNotNull(new AttributedString(new testAttributedCharacterIterator())); + } + /** + * @tests java.text.AttributedString#AttributedString(AttributedCharacterIterator, int, int) + */ + public void test_ConstructorLAttributedCharacterIteratorII() { + //Regression for HARMONY-1355 + assertNotNull(new AttributedString(new testAttributedCharacterIterator(), 0, 0)); + } + + private class testAttributedCharacterIterator implements AttributedCharacterIterator { + public Set getAllAttributeKeys() { + return null; + } + public Object getAttribute(AttributedCharacterIterator.Attribute p) { + return null; + } + public Map getAttributes() { + return null; + } + public int getRunLimit(Set p) { + return 0; + } + public int getRunLimit(AttributedCharacterIterator.Attribute p) { + return 0; + } + public int getRunLimit() { + return 0; + } + public int getRunStart(Set p) { + return 0; + } + public int getRunStart(AttributedCharacterIterator.Attribute p) { + return 0; + } + public int getRunStart() { + return 0; + } + public Object clone() { + return null; + } + public int getIndex() { + return 0; + } + public int getEndIndex() { + return 0; + } + public int getBeginIndex() { + return 0; + } + public char setIndex(int p) { + return 'a'; + } + public char previous() { + return 'a'; + } + public char next() { + return 'a'; + } + public char current() { + return 'a'; + } + public char last() { + return 'a'; + } + public char first() { + return 'a'; + } + } + public void test_addAttributeLjava_text_AttributedCharacterIterator$AttributeLjava_lang_ObjectII() { AttributedString as = new AttributedString("test"); as.addAttribute(AttributedCharacterIterator.Attribute.LANGUAGE, "a", 2,